# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1261032857 -7200 # Node ID 79c6a41cd166f6231b93972a13ddcddc842ff6f8 Revision: 200949 Kit: 200951 diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/data/bs_config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/data/bs_config.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 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: Build information file for project +* +*/ + +// MW_LAYER_PLATFORM_EXPORT_PATH macro definitions +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_MMPFILES +bsengine.mmp + +PRJ_EXPORTS +../rom/backsteppingservice.iby CORE_MW_LAYER_IBY_EXPORT_PATH(backsteppingservice.iby) + +../data/bs_config.xml /epoc32/data/Z/private/2000F83E/bs_config.xml +../data/bs_config.xml /epoc32/release/winscw/udeb/Z/private/2000F83E/bs_config.xml +../data/bs_config.xml /epoc32/release/winscw/urel/Z/private/2000F83E/bs_config.xml + +../inc/bsclient.h |../../inc/bsclient.h +../inc/bsengineglobals.h |../../inc/bsengineglobals.h +../inc/bsserviceconstants.h |../../inc/bsserviceconstants.h + +// End of file diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/group/bsengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/group/bsengine.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 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: Project definition file for project +* +*/ + +#include + +TARGET bsengine.exe +TARGETTYPE exe +CAPABILITY CAP_SERVER +VENDORID VID_DEFAULT + +UID 0x1000008d 0x2000F83E + +LANG SC + +SOURCEPATH ../src +SOURCE bsserver.cpp +SOURCE bsengine.cpp +SOURCE bsserversession.cpp +SOURCE bsconfiguration.cpp +SOURCE bsapplicationinfo.cpp + +USERINCLUDE ../inc + +// APP layer system include is needed here because xcfw_api has +// dependency to app layer +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib + +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib +LIBRARY bafl.lib + +LIBRARY xcfw.lib + +DEBUGLIBRARY flogger.lib + +//end of file diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsapplicationinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsapplicationinfo.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,118 @@ +/* +* 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: Class stores basic information about application + * +*/ + + +#ifndef BSAPPLICATIONINFO_H +#define BSAPPLICATIONINFO_H + +/** + * Simple helper class used for keeping basic information in back stepping stack + * + * @since S60 3.2 + */ +class CBSApplicationInfo : public CBase + { +public: + + static CBSApplicationInfo* NewL(); + static CBSApplicationInfo* NewLC(); + + /** + * Destructor. + */ + ~CBSApplicationInfo(); + + /** + * Set application UID + * + * @since S60 3.2 + * @param aApp application UID + */ + void SetAppUid( const TUid& aApp ); + + /** + * Get application UID + * + * @since S60 3.2 + * @return application UID + */ + TUid AppUid(); + + /** + * Set previous application UID + * It is application that started application in question + * + * @since S60 3.2 + * @param aApp previous application UID + */ + void SetPrevAppUid( const TUid& aApp ); + + /** + * Get previous application UID + * + * @since S60 3.2 + * @return previous application UID + */ + TUid PrevAppUid(); + + /** + * Set item state of application. + * It is a state that was activated when application gained focus + * Item state is encoded in simple descriptor + * + * @since S60 3.2 + * @param aState application item state + */ + void SetItemStateL( const TDesC8& aState ); + + /** + * Get item state of application. + * It is a state that was activated when application gained focus + * Item state is encoded in simple descriptor + * + * @since S60 3.2 + * @return application item state + */ + const TDesC8& ItemState(); + +private: + + CBSApplicationInfo(); + + void ConstructL(); + +private: + // data + /** + * Applicatin UID + */ + TUid iAppUid; + + /** + * Previous applicatin UID + */ + TUid iPrevAppUid; + + /** + * Item State of application + * Own. + */ + HBufC8* iItemState; + + }; + +#endif // BSAPPLICATIONINFO_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Client session for BS engine + * +*/ + + +#ifndef C_CBSCLIENT_H +#define C_CBSCLIENT_H + +#include + +/** + * Client-side interface to BS Engine + * + * This class provides the client-side interface to the BS server session, + * it just passes requests to the server. + * + * @since S60 v3.2 + */ +class RBSClient : public RSessionBase + { +public: + + /** + * Constructor. + * @since S60 v3.2 + */ + RBSClient(); + + /** + * Connects to the server and create a session. + * When the server is not running, the function starts the server. + * + * @since S60 v3.2 + * @return error code + */ + TInt Connect(); + + /** + * Initialize session with given application UID. + * + * @since S60 v3.2 + * @return error code + */ + TInt Initialize( TUid aApp ); + + /** + * Forwards activation event. + * + * @since S60 v3.2 + * @param aState state of application like view ids + * @param aIsItem indicate if it is item/exit activation + * @return error code + */ + TInt ForwardActivationEvent( const TDesC8& aState, TBool aIsItem ); + + /** + * Handle back command. + * + * @since S60 v3.2 + * @param aState state of application + * @param aCheckOnly indicates if only checking should be done (no actual action) + * @return error code + */ + TInt HandleBackCommand( const TDesC8& aState, TBool aCheckOnly ); + + /** + * Returns the version number. + * + * @return the version + */ + TVersion Version() const; + }; + +#endif // C_CBSCLIENT_H +// End of File diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsconfiguration.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,170 @@ +/* +* 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: Class keeps BS configuration + * +*/ + + +#ifndef BSCONFIGURATION_H +#define BSCONFIGURATION_H + +#include + +class CXCFWTree; +class MXCFWNode; +class CGECODefaultObject; + +/** + * Class keeps configuration of BS. + * Configuration is stored in XML in private folder of Back Stepping engine. + * This class is responsible for reading the XML + * @since S60 3.2 + */ +class CBSConfiguration : public CBase, public MXCFWEngineObserver + { +public: + + static CBSConfiguration* NewL(); + static CBSConfiguration* NewLC(); + + /** + * Destructor. + */ + ~CBSConfiguration(); + + // from base class MXCFWEngineObserver + + /** + * From MXCFWEngineObserver. + * Called when Engine parsing / saving state changes + * User can do desired actions on corresponding events. + * + * @param aEvent Engine event. + */ + virtual void HandleEngineEventL( TXCFWEngineEvent aEvent ); + + /** + * From MXCFWEngineObserver. + * Called when there's an error during parsing / saving + * + * @param aErrorCode Error code from engine + */ + virtual void HandleEngineErrorL( TInt aErrorCode ); + + /** + * Check if application with given UID is in reset list. + * Application from that the list should reset BS stack + * + * @since S60 3.2 + * @param aApp + * @return ETrue if application is in the list, otherwise EFalse + */ + TBool IsReset( TUid aApp ); + + /** + * Check if application with given UID is in ignored list. + * Application from that the list should be ignored in BS + * + * @since S60 3.2 + * @param aApp + * @return ETrue if application is in the list, otherwise EFalse + */ + TBool IsIgnored( TUid aApp ); + + /** + * Check if application with given UID is in additional ignored list. + * Application that is started from applicaton from the list + * should ignore BS stack + * + * @since S60 3.2 + * @param aApp + * @return ETrue if application is in the list, otherwise EFalse + */ + TBool IsIgnoredIfStartedFrom( TUid aApp ); + + /** + * Returns list of application that should reset BS stack, + * if any application was stated thru them (i.e. FastSwap) + * + * @since S60 3.2 + * @return list of UIDs + */ + RArray& ResetIfThruList(); + +private: + + CBSConfiguration(); + + void ConstructL(); + + /** + * Convert descriptor to integer. + * It detects if format is hexadecimal + * + * @since S60 3.2 + * @param aStr descriptor to convert + * @return converted intereger, + * if there will be problem wiht convertion return is KErrArgument + */ + TInt Str2Int( const TDesC& aStr ); + + /** + * Loads configuration from XML file + * Read file from private folder, parse the file and + * fill in internal structures. + * + * @since S60 3.2 + */ + void LoadConfigurationL(); + +private: + // data + + /** + * List of application that should reset BS stack + */ + RArray iResetApps; + + /** + * List of application that should be ignoresd from BS stack + */ + RArray iIgnoredApps; + + /** + * List of application that should deactive BS + * if application was started/activated from them + */ + RArray iIgnoredIfStartedFrom; + + /** + * List of application that should reset BS + * if any application was started/activated thu them + */ + RArray iResetIfThru; + + /** + * Content tree + * Own. + */ + CXCFWTree* iContentTree; + + /** + * Content parsing engine + * Own. + */ + CXCFWEngine* iContentEngine; + + }; + +#endif // BSCONFIGURATION_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsdebug.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,149 @@ +/* +* 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_BSDEBUG_H +#define C_BSDEBUG_H + +// INCLUDES +#include + +#ifdef _DEBUG +#include +#include "bsmydebug.h" + +// Take care that the correct adatmydebug.h will be included +// In adatmydebug.h in your module inc directory, +// define your application-specific configuration like this: +// ---------------------------------------------------------- +// Debug file - debug output is disabled if the parent dir does not exist +// _LIT(KDebugFileName, "C:\\logs\\bs\\bsengine.txt" ); + +// Replace the current debug file - if not defined appends to the file +#ifndef APPEND_TO_DEBUG_FILE +#define REPLACE_DEBUG_FILE +#endif + +// Maximum formatted size resulting from a single DEBUG* call +#ifndef MAX_DEBUG_STRING_LENGTH +#define MAX_DEBUG_STRING_LENGTH 4096 +#endif +// ---------------------------------------------------------- + + +// FORWARD DECLARATIONS +static void DoOutput( TDesC8& aData ); + +static void DebugStringNarrowL( const char* aFmt, ... ) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast(aFmt)); + HBufC8* buf = HBufC8::NewLC( MAX_DEBUG_STRING_LENGTH ); + buf->Des().FormatList( fmt, args ); + buf->Des().Append( '\n' ); + DoOutput( *buf ); + CleanupStack::PopAndDestroy( buf ); // buf + + VA_END(args); + } + +static void DebugStringWideL( const char* aFmt, ... ) + { + VA_LIST args; + VA_START(args, aFmt); + + TPtrC8 fmt(reinterpret_cast(aFmt)); + HBufC* fmt16 = HBufC::NewLC( fmt.Length( ) ); + fmt16->Des().Copy( fmt ); + HBufC* buf = HBufC::NewLC( MAX_DEBUG_STRING_LENGTH ); + buf->Des().FormatList( *fmt16, args ); + buf->Des().Append( '\n' ); + HBufC8* buf8 = HBufC8::NewLC( buf->Length( ) ); + buf8->Des().Copy( *buf ); + DoOutput( *buf8 ); + CleanupStack::PopAndDestroy( 3 ); // fmt16, buf, buf8 + + VA_END(args); + } + +static void DebugBufferL( const TDesC8& aBuf ) + { + DebugStringNarrowL( "\"%S\"", &aBuf ); + } + +static void DebugBufferL( const TDesC& aBuf ) + { + DebugStringWideL( "\"%S\"", &aBuf ); + } + +static void DebugTimeL( const TTime& aTime ) + { + TBuf<64> dateTimeString; + _LIT(KDateString, "%E%D%X%N%Y %1 %2 %3" ); + aTime.FormatL( dateTimeString, KDateString ); + DebugBufferL( dateTimeString ); + _LIT(KTimeString, "%-B%:0%J%:1%T%:2%S%.%*C4%:3%+B" ); + aTime.FormatL( dateTimeString, KTimeString ); + DebugBufferL( dateTimeString ); + } + +static void DoOutput( TDesC8& aData ) + { + RFileLogger::Write( KDebugDirName, KDebugFileName, + EFileLoggingModeAppend, aData ); + } +#endif + +// MACROS +// If you output one or more narrow descriptors by using '%S', +// use DEBUGSTRING8 +// else if you output one or more unicode descriptors by using '%S', +// use DEBUGSTRING16 +// else +// use DEBUGSTRING +// +// Narrow and unicode cannot be mixed in a single DEBUGSTRINGx call. + +#ifdef _DEBUG +#define DEBUGINIT() DebugInit() +#define DEBUGINITSUSPENDED() DebugInit(ETrue) +#define DEBUGENABLE() SetDebugEnabled(ETrue) +#define DEBUGDISABLE() SetDebugEnabled(EFalse) +#define DEBUGSUSPEND() SetDebugSuspended(ETrue) +#define DEBUGCONTINUE() SetDebugSuspended(EFalse) +#define DEBUG(x) DebugStringNarrowL x +#define DEBUG8(x) DebugStringNarrowL x +#define DEBUG16(x) DebugStringWideL x +#define DEBUGBUFFER(x) DebugBufferL x +#define DEBUGTIME(x) DebugTimeL x +#else +#define DEBUGINIT() +#define DEBUGINITSUSPENDED() +#define DEBUGENABLE() +#define DEBUGDISABLE() +#define DEBUGSUSPEND() +#define DEBUGCONTINUE() +#define DEBUG(x) +#define DEBUG8(x) +#define DEBUG16(x) +#define DEBUGBUFFER(x) +#define DEBUGTIME(x) +#endif + +#endif // C_BSDEBUG_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,154 @@ +/* +* 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: Engine for BS Engine + * +*/ + + +#ifndef C_CBSENGINE_H +#define C_CBSENGINE_H + +#include + +class CBSConfiguration; +class CBSApplicationInfo; +class CEikonEnv; + +/** + * Engine for BS solution + * It is the place when whole BS logic is implemented. + * + * @since S60 v3.2 + */ +class CBSEngine : public CBase + { +public: + + static CBSEngine* NewL(); + static CBSEngine* NewLC(); + + /** + * Destructor + */ + virtual ~CBSEngine(); + + /* + * This method is notified when new application gain focus + * + * @since S60 3.2 + * @param aApp application UID + */ + void HandleFocusChangeL( const TUid& aApp ); + + /** + * Invoked when activation event appeared + * appliction state changed or focus state changed + * + * @since S60 3.2 + * @param aApp application UID + * @param aState state of application (like view ids) + * @param aFocused indicate if it was item/exit state + * @return EBSEngineCommandWasConsumed if event was consumed, + * else EBSEngineCommandWasNotConsumed + */ + TInt HandleActivationEventL( const TUid& aApp, const TDesC8& aState, + TBool aFocused ); + + /** + * Invoked when back event appeared + * + * @since S60 3.2 + * @param aApp application UID + * @param aState state of application (like view ids) + * @param aCheckOnly indicates if only checking should be done (no actual action) + * @return EBSEngineCommandWasConsumed if event was consumed, + * else EBSEngineCommandWasNotConsumed + */ + TInt HandleBackEventL( const TUid& aApp, const TDesC8& aState, + TBool aCheckOnly ); + + /** + * Remove information about given application from BS stack + */ + void RemoveAppRecord( const TUid& aApp ); + + /** + * Marks that application was pressed + */ + void ApplicationKeyWasPressed(); + +private: + + CBSEngine(); + + void ConstructL(); + + /** + * Returns previous application in focus stack for given application. + * + * @since S60 3.2 + * @param aApp application UID + * @return UID of previous application, + * if information is missing returns TUid::Null + */ + TUid FindPreviousApp( const TUid& aApp ); + + /** + * Sends given appliction to background + * @since S60 3.2 + * @param aApp application UID + */ + void SendToBackground( const TUid& aApp ); + /** + * Resets BS history + */ + void ResetHistory(); + +private: + // data + + /** + * list of application in BS stact + */ + RPointerArray iAppsStack; + + /** + * focus stack + */ + RArray iFocusHistory; + + /** + * flag for handling fast swap events + */ + TBool swap; + + /** + * flag for application key state + */ + TBool wasPressed; + + /** + * Configuration of BS + * Own. + */ + CBSConfiguration* iConfiguration; + + /** + * Eikon environment + * Not own. + */ + CEikonEnv* iEnv; + }; + +#endif // C_CBSENGINE_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsengineglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsengineglobals.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +/* +* 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: Globals for BS engine + * +*/ + + +#ifndef C_BSENGINEGLOBALS_H +#define C_BSENGINEGLOBALS_H + +// CONSTANTS +const TUint KBSEngineMajorVersionNumber = 0; +const TUint KBSEngineMinorVersionNumber = 1; +const TUint KBSEngineBuildVersionNumber = 1; + +_LIT( KBSEngineThreadName, "bsengine" ); +_LIT( KBSEngineName, "bsengine" ); +_LIT( KBSEngineFilename, "bsengine" ); + +const TUid KServerUid3 = + { + 0x2000F83E + }; + +// ENUMERATIONS +// Opcodes used in message passing between client and server +enum TBSEngineRqst + { + EBSEngineInitialize = 100, + EBSEngineHandleActivationEvent = 101, + EBSEngineHandleBackCommand = 102 + }; + +enum TBSEngineRsp + { + EBSEngineCommandWasNotConsumed, + EBSEngineCommandWasConsumed + }; + +#endif // C_BSENGINEGLOBALS_H +// End of File diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsmydebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsmydebug.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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 definitions for BS Engine + * +*/ + + +#ifndef C_BSMYDEBUG_H +#define C_BSMYDEBUG_H + +// MACROS +#define APPEND_TO_DEBUG_FILE + +// CONSTANTS +_LIT( KDebugDirName, "bs" ); +_LIT( KDebugFileName, "bsengine.txt" ); + +#endif // C_BSMYDEBUG_H +// End of File diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bspanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bspanic.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* 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: Panic enumeration + * +*/ + + +#ifndef __BSPANIC_H__ +#define __BSPANIC_H__ + +/** Panic Category */ + +/** Active Data Server panic codes */ +enum TBSEnginePanic + { + EBSEngineBadRequest = 1, + EBSEngineBadDescriptor = 2, + EBSEngineSrvCreateServer = 3, + EBSEngineCreateTrapCleanup = 4, + EBSEngineEIkonEnv = 5 + }; + +#endif // __BSPANIC_H__ diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,179 @@ +/* +* 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: BS Server - implemenration of CServer2 + * +*/ + + +#ifndef C_CBSSERVER_H +#define C_CBSSERVER_H + +// INCLUDES +#include +#include + +#include "bspanic.h" + +class CBSEngine; + +/** + * Back Stepping server implementation + * + * @since Series 60 3.2 + */ + +class CBSServer : public CServer2 + { + /** + * EIkonEnv for the server process. + * + * @since Series 60 3.2 + */ + class CBSEikonEnv : public CEikonEnv + { + public: + void DestroyEnvironment(); + void ConstructL(); + }; + + /** + * EikAppUi for the server process. + * Inform engine if focused application was changed + * + * @since Series 60 3.2 + */ + class CBSAppUi : public CEikAppUi + { + public: + ~CBSAppUi(); + void ConstructL(); + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + void ForwardEventL( const TWsEvent& aEvent ); + CBSEngine* iEngine; + }; + +public: + + static CBSServer* NewLC(); + + /** + * Destructor. + */ + virtual ~CBSServer(); + + /** + * Return the reference to the engine. + * + * @since Series 60 3.2 + * @return engine reference + */ + CBSEngine& Engine(); + + /** + * Increment session count + * + * @since Series 60 3.2 + */ + void IncrementSessions(); + + /** + * Decrement session count + * Stops server if last session was closed + * @since Series 60 3.2 + */ + void DecrementSessions(); + + /** + * First stage startup for the server thread. + * + * @since Series 60 3.2 + * @return return KErrNone or panics thread + */ + static TInt ThreadFunction(); + + /** + * Panic client. + * + * @since Series 60 3.2 + * @param aMessage RMessage2 + * @param aPanic panic code + */ + static void PanicClient( const RMessage2& aMessage, + TBSEnginePanic aPanic ); + +protected: + + // from base class CActive + /** + * From CActive. + * Process any errors. + * + * @since Series 60 3.2 + * @param aError the leave code reported + * @return return KErrNone if leave is handled + */ + TInt RunError( TInt aError ); + +private: + + /** + * Constructs the server. + * + * @since Series 60 3.2 + * @param aPriority CServer2 input parameter + */ + CBSServer( TInt aPriority ); + + void ConstructL(); + + /** + * Panic the server. + * + * @since Series 60 3.2 + * @param aPanic the panic code + */ + static void PanicServer( TBSEnginePanic aPanic ); + + /** + * Second stage startup for the server thread. + * + * @since Series 60 3.2 + */ + static void ThreadFunctionL(); + + /** + * Create a server session, and return a pointer to the created object. + * @param aVersion the client version + * @param aMessage RMessage2 + * @return pointer to new session + */ + CSession2* NewSessionL( const TVersion& aVersion, + const RMessage2& aMessage ) const; + +private: + // data + /** + * Instance of engine + * Own. + */ + CBSEngine* iEngine; + + /* + * Session count + */ + TInt iSessionCount; + }; + +#endif // C_CBSSERVER_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsserversession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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: Server session for BS engine + * +*/ + + +#ifndef C_CBSSERVERSESSION_H +#define C_CBSSERVERSESSION_H + +class CBSServer; + +/** + * Server session. + * An instance of class CBSServerSession is created for each client + */ +class CBSServerSession : public CSession2 + { +public: + /** + * Create a CBSServerSession object using two phase construction, + * and return a pointer to the created object + * + * @since S60 3.2 + * @param aServer CBSServer + * @return pointer to new session + */ + static CBSServerSession* NewL( CBSServer* aServer ); + + /** + * Create a CBSServerSession object using two phase construction, + * and return a pointer to the created object + * + * @since S60 3.2 + * @param aServer CBSServer + * @return pointer to new session + */ + static CBSServerSession* NewLC( CBSServer* aServer ); + + /** + * Destructor. + */ + virtual ~CBSServerSession(); + + // from base class CSession + + /** + * From CSession. + * Called after a service request from client; from class CSession + * + * @since S60 3.2 + * @param aMessage message from client (containing requested operation and any data) + */ + void ServiceL( const RMessage2& aMessage ); + +private: + + CBSServerSession( CBSServer* aServer ); + + void ConstructL(); + + /** + * Read text from message from given slot + * + * @since S60 3.2 + * @param aMessage message + * @param aSlot slot number + * @return descriptor + */ + HBufC8* ReadTextLC( const RMessage2& aMessage, TInt aSlot ); + +private: + // data + + /** + * Pointer to server + * Not own. + */ + CBSServer* iBSServer; + /** + * UID of application assigned to the session + */ + TUid iAppUid; + }; + +#endif // C_CADATSERVERSESSION_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/inc/bsserviceconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/inc/bsserviceconstants.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* 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: Constants for Back Stepping Service Provider + * +*/ + + +#ifndef BS_SERVICE_CONSTANTS_H +#define BS_SERVICE_CONSTANTS_H + +// BS Service implementation UID +const TInt KBSServiceImplUid( 0x2000F840); + +// from LIW +_LIT8( KGenericParamServiceCmdIDStr, "cmd" ); + +// BSS Service and Interface ID +_LIT8( KBSServiceID, "Service.BackStepping" ); +_LIT8( KBSInterface, "IBackStepping" ); + +// BSS commands +_LIT8( KBSCmdInitialize, "Initialize" ); +_LIT8( KBSCmdForwardActivationEvent, "ForwardActivationEvent" ); +_LIT8( KBSCmdHandleBackCommand, "HandleBackCommand" ); + +// BSS in param names +_LIT8( KBSInParamAppUid, "AppUid" ); +_LIT8( KBSInParamState, "State" ); +_LIT8( KBSInParamEnter, "Enter" ); +_LIT8( KBSInParamCheckOnly, "CheckOnly" ); + +// BSS out param names +_LIT8( KBSOutParamStatusInfo, "StatusInfo" ); + +#endif // BS_SERVICE_CONSTANTS_H diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/rom/backsteppingservice.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/rom/backsteppingservice.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: +* +*/ + + +#ifndef BACKSTEPPINGSERVICE_IBY +#define BACKSTEPPINGSERVICE_IBY + +file=ABI_DIR\BUILD_DIR\bsengine.exe SHARED_LIB_DIR\bsengine.exe +data=\epoc32\data\Z\private\2000F83E\bs_config.xml private\2000F83E\bs_config.xml + +#endif // BACKSTEPPINGSERVICE_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/src/bsapplicationinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/src/bsapplicationinfo.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* 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: Class stores basic information about application + * +*/ + + +#include + +#include "bsapplicationinfo.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +CBSApplicationInfo::CBSApplicationInfo() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CBSApplicationInfo::~CBSApplicationInfo() + { + delete iItemState; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSApplicationInfo* CBSApplicationInfo::NewLC() + { + CBSApplicationInfo* self = new (ELeave)CBSApplicationInfo(); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSApplicationInfo* CBSApplicationInfo::NewL() + { + CBSApplicationInfo* self = CBSApplicationInfo::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBSApplicationInfo::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSApplicationInfo::SetAppUid( const TUid& aApp ) + { + iAppUid = aApp; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUid CBSApplicationInfo::AppUid() + { + return iAppUid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSApplicationInfo::SetPrevAppUid( const TUid& aApp ) + { + iPrevAppUid = aApp; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUid CBSApplicationInfo::PrevAppUid() + { + return iPrevAppUid; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSApplicationInfo::SetItemStateL( const TDesC8& aState ) + { + delete iItemState; + iItemState = NULL; + iItemState = aState.AllocL( ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CBSApplicationInfo::ItemState() + { + if ( iItemState ) + return *iItemState; + else + return KNullDesC8; + } diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/src/bsconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/src/bsconfiguration.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,279 @@ +/* +* 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: Class keeps BS configuration + * +*/ + + +#include //FileExists +#include +#include +#include +#include + +#include "bsdebug.h" +#include "bsconfiguration.h" + +_LIT(KConfigurationFile, "bs_config.xml" ); +_LIT(KCDrive, "C"); +_LIT(KZDrive, "Z"); + +_LIT(KDelimiter, ":"); +_LIT(KTrueValue, "1"); +_LIT(KHexStart,"0x"); + +_LIT(KAppNode, "app"); + +_LIT(KUidAttribute, "uid"); +_LIT(KResetAttribute, "reset"); +_LIT(KIgnoredAttribute, "ignored"); +_LIT(KIgnoredIfStartedFromAttribute, "ignoredIfStartedFrom"); +_LIT(KResetIfThruAttribute, "resetIfThru"); + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CBSConfiguration::CBSConfiguration() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CBSConfiguration::~CBSConfiguration() + { + delete iContentTree; + delete iContentEngine; + + iResetApps.Close( ); + iIgnoredApps.Close( ); + iIgnoredIfStartedFrom.Close( ); + iResetIfThru.Close( ); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSConfiguration* CBSConfiguration::NewLC() + { + CBSConfiguration* self = new (ELeave)CBSConfiguration(); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSConfiguration* CBSConfiguration::NewL() + { + CBSConfiguration* self = CBSConfiguration::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBSConfiguration::ConstructL() + { + iContentTree = CXCFWTree::NewL( ); + iContentEngine = CXCFWEngine::NewL( this ); + + RFs fileSession; + + User::LeaveIfError( fileSession.Connect( ) ); + CleanupClosePushL( fileSession ); + + TFileName configPath; + + User::LeaveIfError( fileSession.PrivatePath( configPath ) ); + configPath.Insert( 0, KDelimiter ); + configPath.Insert( 0, KCDrive ); + configPath.Append( KConfigurationFile ); + + // first check if file exists on c drive + if ( !BaflUtils::FileExists( fileSession, configPath ) ) + { + // read from z drive + configPath[0] = KZDrive()[0]; + } + + CleanupStack::PopAndDestroy( &fileSession ); + + iContentEngine->LoadL( *iContentTree, configPath ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CBSConfiguration::IsReset( TUid aApp ) + { + return iResetApps.Find( aApp.iUid ) != KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CBSConfiguration::IsIgnored( TUid aApp ) + { + return iIgnoredApps.Find( aApp.iUid ) != KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CBSConfiguration::IsIgnoredIfStartedFrom( TUid aApp ) + { + return iIgnoredIfStartedFrom.Find( aApp.iUid ) != KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RArray& CBSConfiguration::ResetIfThruList() + { + return iResetIfThru; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSConfiguration::LoadConfigurationL() + { + // get root node + MXCFWNode* root = iContentTree->Root( ); + + // list of fetched nodes + RNodeArray nodes; + CleanupClosePushL( nodes ); + + // handle entries + iContentTree->GetNodesOfTypeL( KAppNode, nodes, root, ETrue ); + + for ( TInt i = 0; i < nodes.Count( ); i++ ) + { + CGECODefaultObject* object = + static_cast(nodes[i]->Data( )); + TPtrC uidVal; + TPtrC resetVal; + TPtrC ignoredVal; + TPtrC ignoredIfStartedFromVal; + TPtrC resetIfThruVal; + object->GetAttribute( KUidAttribute, uidVal ); + object->GetAttribute( KResetAttribute, resetVal ); + object->GetAttribute( KIgnoredAttribute, ignoredVal ); + object->GetAttribute( KIgnoredIfStartedFromAttribute, + ignoredIfStartedFromVal ); + object->GetAttribute( KResetIfThruAttribute, resetIfThruVal ); + + TInt uid = Str2Int( uidVal ); + + if ( resetVal.Compare( KTrueValue ) == 0 ) + iResetApps.AppendL( uid ); + + if ( ignoredVal.Compare( KTrueValue ) == 0 ) + iIgnoredApps.AppendL( uid ); + + if ( ignoredIfStartedFromVal.Compare( KTrueValue ) == 0 ) + iIgnoredIfStartedFrom.AppendL( uid ); + + if ( resetIfThruVal.Compare( KTrueValue ) == 0 ) + iResetIfThru.AppendL( uid ); + } + +#ifdef _DEBUG + + for ( TInt i = 0; i< iResetApps.Count( ); i++ ) + DEBUG(("\tiResetApps[%d] = %X)", i, iResetApps[i])); + + for ( TInt i = 0; i< iIgnoredApps.Count( ); i++ ) + DEBUG(("\tiIgnoredApps[%d] = %X)", i, iIgnoredApps[i])); + + for ( TInt i = 0; i< iIgnoredIfStartedFrom.Count( ); i++ ) + DEBUG(("\tiIgnoredIfStartedFrom[%d] = %X)", i, iIgnoredIfStartedFrom[i])); + + for ( TInt i = 0; i< iResetIfThru.Count( ); i++ ) + DEBUG(("\tiResetIfThru[%d] = %X)", i, iResetIfThru[i])); + +#endif + + // clean up + CleanupStack::PopAndDestroy( &nodes ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CBSConfiguration::Str2Int( const TDesC& aStr ) + { + // if a string starts from '0x' then convert aStr from hex to int. + // else send aStr to the StrDec2Uint + + TInt position(aStr.Find( KHexStart ) ); + TInt ret(KErrArgument); + if ( position == 0 ) + { + // is hex + TPtrC string(aStr.Mid( KHexStart().Length( ) ) ); + + TLex lexer(string); + TUint val; + lexer.Val( val, EHex ); + ret = val; + } + else + { + TLex lexer(aStr); + lexer.Val( ret ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// From class MXCFWEngineObserver +// +// ----------------------------------------------------------------------------- +// +void CBSConfiguration::HandleEngineEventL( TXCFWEngineEvent aEvent ) + { + // handle completion + if ( aEvent == EEvtParsingComplete ) + { + LoadConfigurationL( ); + } + } + +// ----------------------------------------------------------------------------- +// From class MXCFWEngineObserver +// +// ----------------------------------------------------------------------------- +// +void CBSConfiguration::HandleEngineErrorL( TInt /*aErrorCode*/) + { + } diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/src/bsengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/src/bsengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,348 @@ +/* +* 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: Engine for BS Engine + * +*/ + + +#include +#include +#include +#include + +#include "bsengineglobals.h" +#include "bsdebug.h" +#include "bsengine.h" +#include "bsapplicationinfo.h" +#include "bsconfiguration.h" + +// CONSTANTS +const TInt KSecondTaskIndex( 1); + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CBSEngine::CBSEngine() + { + iEnv = CEikonEnv::Static( ); + swap = EFalse; + wasPressed = EFalse; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBSEngine::ConstructL() + { + DEBUG(("Create Engine")); + iConfiguration = CBSConfiguration::NewL( ); + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CBSEngine::~CBSEngine() + { + DEBUG(("~CBSEngine")); + iAppsStack.ResetAndDestroy( ); + iFocusHistory.Close( ); + + delete iConfiguration; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSEngine* CBSEngine::NewL() + { + CBSEngine* self = CBSEngine::NewLC( ); + CleanupStack::Pop( self ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSEngine* CBSEngine::NewLC() + { + CBSEngine* self = new ( ELeave ) CBSEngine(); + CleanupStack::PushL( self ); + self->ConstructL( ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSEngine::ApplicationKeyWasPressed() + { + wasPressed = ETrue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSEngine::HandleFocusChangeL( const TUid& aApp ) + { + DEBUG(("-> HandleFocusChangeL(0x%X)", aApp.iUid )); + // check if application is not in ignored list + if ( iConfiguration->IsIgnored( aApp ) ) + { + DEBUG(("\tIgnore the event - application in ignored list")); + return; + } + + TInt fsCount = iFocusHistory.Count( ); + if ( fsCount > 0 && iFocusHistory[fsCount - 1] == aApp.iUid ) + { + DEBUG(("\tIgnore the event - application already on top")); + swap = EFalse; + wasPressed = EFalse; + return; + } + + // check if we should not reset back stepping stack + if ( iConfiguration->IsReset( aApp ) ) + { + swap = EFalse; + wasPressed = EFalse; + ResetHistory( ); + } + + // check if we should reset if application was started tru + RArray& thuApps = iConfiguration->ResetIfThruList( ); + + for ( TInt i = 0; i < thuApps.Count( ); i++ ) + { + // position of application - i.e. fast swap + if ( aApp.iUid == thuApps[i] ) + { + //mark that there is a fast swap or dialog + swap = ETrue; + return; + } + else + { + if ( swap ) + { + swap = EFalse; + TInt currentApp = aApp.iUid; + TInt pos = iFocusHistory.Count( ) - 1; + if ( pos >= 0 ) + { + TInt prevApp = iFocusHistory[pos]; + if ( currentApp != prevApp && wasPressed ) + { + //we are here as the result of the fast swap + ResetHistory( ); + iFocusHistory.AppendL( thuApps[i] ); + wasPressed = EFalse; + } + } + } + } + } + // add application to focus history list, + iFocusHistory.AppendL( aApp.iUid ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CBSEngine::HandleActivationEventL( const TUid& aApp, + const TDesC8& aState, TBool aItem ) + { + DEBUG(("-> HandleActivationEventL(0x%X, %S, 0x%X)", + aApp.iUid, &aState, aItem)); + TInt result(EBSEngineCommandWasNotConsumed); + +#ifdef _DEBUG + // check from which application it was started + for ( TInt i = 0; i< iFocusHistory.Count( ); i++ ) + { + DEBUG(("\tiFocusHistory[%d] = %X)", i, iFocusHistory[i])); + } +#endif + + // is it the same application - i.e. internal state change - ignore + CBSApplicationInfo* last(NULL); + if ( iAppsStack.Count( ) ) + last = iAppsStack[iAppsStack.Count() - 1]; + + if ( last && last->AppUid( ) == aApp ) + { + DEBUG(("\tIgnore the event, application is already on stack")); + } + else if ( aItem ) // store only item events + { + CBSApplicationInfo* newApp = CBSApplicationInfo::NewLC(); + newApp->SetPrevAppUid( FindPreviousApp( aApp ) ); + newApp->SetAppUid( aApp ); + newApp->SetItemStateL( aState ); + + DEBUG(("\tAdd to BS stack app:0x%X, state:%S, prevapp:0x%X)", + newApp->AppUid().iUid, + &newApp->ItemState(), + newApp->PrevAppUid().iUid)); + iAppsStack.AppendL( newApp ); + CleanupStack::Pop( newApp ); + result = EBSEngineCommandWasConsumed; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CBSEngine::HandleBackEventL( const TUid& aApp, const TDesC8& aState, + TBool aCheckOnly ) + { + DEBUG(("-> HandleBackEventL(0x%X, %S, 0x%X )", + aApp.iUid, &aState, aCheckOnly )); + TInt result(EBSEngineCommandWasNotConsumed); + // get last application at stack + CBSApplicationInfo* info(NULL); + if ( iAppsStack.Count( ) ) + { + info = iAppsStack[iAppsStack.Count() - 1]; + + DEBUG(("\tcheck UIDs (0x%X-0x%X)", aApp.iUid, info->AppUid() )); + DEBUG(("\tcheck states (%S-%S)", &aState, &info->ItemState())); + if ( info && info->AppUid( ) == aApp && info->ItemState().Compare( aState ) == 0 ) + { + DEBUG(("\tcheck prev app, if BS to be ignored = %d)", + iConfiguration->IsIgnoredIfStartedFrom( info->PrevAppUid() ) )); + + // check what application activated the application in question + if ( !iConfiguration->IsIgnoredIfStartedFrom( info->PrevAppUid( ) ) ) + { + // find the task which is directly below the current one + // in window group Z-order hierarchy + TApaTaskList taskList(iEnv->WsSession( ) ); + // current task is in "0" position, next one is "1" + // NOTE: FindByPos doesn't return hidden tasks + TApaTask lowerTask = taskList.FindByPos( KSecondTaskIndex ); + CApaWindowGroupName* apaWGName = CApaWindowGroupName::NewLC( + iEnv->WsSession( ), lowerTask.WgId( ) ); + TUid lowerTaskUid = apaWGName->AppUid( ); + CleanupStack::PopAndDestroy( apaWGName ); + + DEBUG(("\tcheck task below (0x%X-0x%X)", + lowerTaskUid.iUid, info->PrevAppUid().iUid)); + // if the lower task is the one that activated the current one + // send the current one to background. + // the condition is false if i.e. the previous active task + // has been closed or sent to background (no explicit + // activation of the current task occured) + if ( lowerTaskUid == info->PrevAppUid( ) ) + { + if ( !aCheckOnly ) + { + SendToBackground( aApp ); + // remove history for the application + RemoveAppRecord( aApp ); + } + result = EBSEngineCommandWasConsumed; + } + } + } + } + return result; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSEngine::SendToBackground( const TUid& aApp ) + { + DEBUG(("-> SendToBackgroundL(0x%X)", aApp.iUid )); + + TApaTaskList taskList(iEnv->WsSession( )); + + TApaTask task = taskList.FindApp( aApp ); + if ( task.Exists( ) ) + { + // Request window server to send application to background + task.SendToBackground( ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUid CBSEngine::FindPreviousApp( const TUid& aApp ) + { + TUid result(TUid::Null( )); + + for ( TInt i = iFocusHistory.Count( ) - 1; i >= 0; i-- ) + { + if ( iFocusHistory[i] != aApp.iUid ) + { + result = TUid::Uid( iFocusHistory[i] ); + break; + } + } + + return result; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSEngine::RemoveAppRecord( const TUid& aApp ) + { + DEBUG(("-> RemoveRecord(0x%X)", aApp.iUid )); + + for ( TInt i = iAppsStack.Count( ) - 1; i >= 0; i-- ) + { + CBSApplicationInfo* info = iAppsStack[i]; + if ( info->AppUid( ) == aApp ) + { + DEBUG(("\tRemove item - [%d]", i)); + iAppsStack.Remove( i ); + delete info; + break; + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSEngine::ResetHistory() + { + DEBUG(("-> ResetHistory")); + iAppsStack.ResetAndDestroy( ); + iFocusHistory.Reset( ); + } + +// End of File + + diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/src/bsserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/src/bsserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,326 @@ +/* +* 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: BS Server - implemenration of CServer2 + * +*/ + + +#include +#include +#include +#include + +#include "bsengineglobals.h" +#include "bsengine.h" +#include "bsserversession.h" +#include "bsdebug.h" +#include "bsserver.h" + +const TInt idsArrayGranularity = 30; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CBSServer::CBSServer( TInt aPriority ) : + CServer2(aPriority) + { + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBSServer::ConstructL() + { + DEBUG(("Start BS Server" )); + iEngine = CBSEngine::NewL( ); + StartL( KBSEngineName ); + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// -------------------------------------- --------------------------------------- +// +CBSServer* CBSServer::NewLC() + { + CBSServer* self = new( ELeave ) CBSServer( EPriorityNormal ); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// -------------------------------------- --------------------------------------- +// +CBSServer::~CBSServer() + { + DEBUG(("Destroy BS Server" )); + delete iEngine; + } + +// ----------------------------------------------------------------------------- +// Create new session. +// ----------------------------------------------------------------------------- +// +CSession2* CBSServer::NewSessionL( const TVersion& aVersion, + const RMessage2& /*aMessage*/ ) const + { + // Check we're the right version + if ( !User::QueryVersionSupported( TVersion( KBSEngineMajorVersionNumber, + KBSEngineMinorVersionNumber, KBSEngineBuildVersionNumber ), aVersion ) ) + { + User::Leave( KErrNotSupported ); + } + + return CBSServerSession::NewL( ( CBSServer* ) this ); + } + +// ----------------------------------------------------------------------------- +// Increment sessions. +// ----------------------------------------------------------------------------- +// +void CBSServer::IncrementSessions() + { + iSessionCount++; + } + +// ----------------------------------------------------------------------------- +// Decrement sessions. +// ----------------------------------------------------------------------------- +// +void CBSServer::DecrementSessions() + { + iSessionCount--; + } +// ----------------------------------------------------------------------------- +// RunError is called when RunL leaves. +// ----------------------------------------------------------------------------- +// +TInt CBSServer::RunError( TInt aError ) + { + DEBUG(("CBSServer::RunError %d", aError )); + if ( aError == KErrBadDescriptor ) + { + PanicClient( Message( ), EBSEngineBadDescriptor ); + } + else + { + Message().Complete( aError ); + } + + // The leave will result in an early return from CServer::RunL(), skipping + // the call to request another message. So do that now in order to keep the + // server running. + ReStart( ); + // Handled the error fully + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Panic client. +// ----------------------------------------------------------------------------- +// +void CBSServer::PanicClient( const RMessage2& aMessage, TBSEnginePanic aPanic ) + { + aMessage.Panic( KBSEngineName, aPanic ); + } + +// ----------------------------------------------------------------------------- +// Panic server. +// ----------------------------------------------------------------------------- +// +void CBSServer::PanicServer( TBSEnginePanic aPanic ) + { + User::Panic( KBSEngineName, aPanic ); + } + +// ----------------------------------------------------------------------------- +// Create and start the server. +// ----------------------------------------------------------------------------- +// +void CBSServer::ThreadFunctionL() + { + CBSAppUi* ui = new (ELeave) CBSAppUi; + ui->ConstructL( ); + + // Construct our server + CBSServer* server = CBSServer::NewLC( ); + + // set engine to AppUI to get notification about focus changes + ui->iEngine = &(server->Engine( )); + + RProcess::Rendezvous( KErrNone ); + + // Start handling requests + CActiveScheduler::Start( ); + + CleanupStack::PopAndDestroy( server ); + + ui->PrepareToExit( ); + + } +// ----------------------------------------------------------------------------- +// Create and start the server. +// ----------------------------------------------------------------------------- +// +TInt CBSServer::ThreadFunction() + { + __UHEAP_MARK; + + User::RenameThread( KBSEngineThreadName ); + + CBSEikonEnv* env = new CBSEikonEnv; + __ASSERT_ALWAYS( env, PanicServer( EBSEngineEIkonEnv ) ); + + TRAPD(error, env->ConstructL();); + __ASSERT_ALWAYS( !error, PanicServer( EBSEngineEIkonEnv ) ); + + TRAPD( err, ThreadFunctionL() ); + if ( err != KErrNone ) + { + PanicServer( EBSEngineSrvCreateServer ); + } + + env->DestroyEnvironment( ); + + __UHEAP_MARKEND; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Getter of engine +// ----------------------------------------------------------------------------- +// +CBSEngine& CBSServer::Engine() + { + return *iEngine; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSServer::CBSEikonEnv::DestroyEnvironment() + { + CEikonEnv::DestroyEnvironment( ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSServer::CBSEikonEnv::ConstructL() + { + CEikonEnv::ConstructL( EFalse ); + SetAutoForwarding(ETrue); + User::SetPriorityControl(EFalse); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CBSServer::CBSAppUi::~CBSAppUi() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSServer::CBSAppUi::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* /*aDestination*/) + { + if ( aEvent.Type( ) == EEventFocusGroupChanged + || aEvent.Type( ) == EEventWindowGroupsChanged ) + { + + TInt windowsGroupID = iCoeEnv->WsSession().GetFocusWindowGroup( ); + CApaWindowGroupName* apaWGName = CApaWindowGroupName::NewLC( + iCoeEnv->WsSession( ), windowsGroupID ); + TUid uid = apaWGName->AppUid( ); + CleanupStack::PopAndDestroy( apaWGName ); + // if UID is 0, ignore event. + // Next event should bring correct information + if ( uid.iUid ) + { + iEngine->HandleFocusChangeL( uid ); + } + } + else if( aEvent.Type( ) == EEventKeyDown ) + { + iEngine->ApplicationKeyWasPressed( ); + ForwardEventL( aEvent ); + } + else if( aEvent.Type( ) == EEventKeyUp ) + { + ForwardEventL( aEvent ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSServer::CBSAppUi::ForwardEventL( const TWsEvent& aEvent ) + { + CArrayFixFlat* idArray = + new (ELeave) CArrayFixFlat( idsArrayGranularity ); + iCoeEnv->WsSession().WindowGroupList( idArray ); + + TInt ownId = iCoeEnv->RootWin().Identifier(); + for( TInt x(0); x < idArray->Count(); x++ ) + { + if( (*idArray)[x] != ownId ) + { + iCoeEnv->WsSession().SendEventToWindowGroup( + (*idArray)[x], aEvent ); + } + } + delete idArray; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CBSServer::CBSAppUi::ConstructL() + { + CEikAppUi::BaseConstructL( ENoAppResourceFile | ENoScreenFurniture ); + //get notifications about focus change events + iCoeEnv->RootWin().EnableFocusChangeEvents( ); + //get notifications about windows group change events + iCoeEnv->RootWin().EnableGroupChangeEvents( ); + //disable notifications about layout change + iCoeEnv->RootWin().DisableScreenChangeEvents(); + //get notifications about application key event + iCoeEnv->RootWin().CaptureKeyUpAndDowns( EStdKeyApplication0, 0, 0 ); + } + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// E32Main item point. +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + return CBSServer::ThreadFunction( ); + } + +// End of File + diff -r 000000000000 -r 79c6a41cd166 backsteppingsrv/src/bsserversession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backsteppingsrv/src/bsserversession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,152 @@ +/* +* 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: Server session for BS engine + * +*/ + + +// INCLUDE FILES +#include "bsserver.h" +#include "bsengine.h" +#include "bsengineglobals.h" + +#include "bsserversession.h" +#include "bspanic.h" +#include "bsdebug.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CBSServerSession::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSServerSession* CBSServerSession::NewL( CBSServer* aServer ) + { + CBSServerSession* self = CBSServerSession::NewLC( aServer ); + CleanupStack::Pop( self ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CBSServerSession* CBSServerSession::NewLC( CBSServer* aServer ) + { + CBSServerSession* self = new ( ELeave ) CBSServerSession(aServer); + CleanupStack::PushL( self ); + self->ConstructL( ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::~CBSServerSession +// Destructor. +// ----------------------------------------------------------------------------- +// +CBSServerSession::~CBSServerSession() + { + if ( iBSServer ) + { + iBSServer->Engine().RemoveAppRecord( iAppUid ); + iBSServer->DecrementSessions( ); + } + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::ReadTextL +// +// ----------------------------------------------------------------------------- +// +HBufC8* CBSServerSession::ReadTextLC( const RMessage2& aMessage, TInt aSlot ) + { + TInt length = aMessage.GetDesMaxLength( aSlot ); + HBufC8* result = HBufC8::NewLC( length ); + TPtr8 ptr(result->Des( )); + User::LeaveIfError( aMessage.Read( aSlot, ptr ) ); + + DEBUG(("ReadTextL slot (%d) - %S", aSlot, result)); + return result; + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::ServiceL +// Handle client requests. +// ----------------------------------------------------------------------------- +// +void CBSServerSession::ServiceL( const RMessage2& aMessage ) + { + DEBUG(("CBSServerSession::ServiceL")); + HBufC8* state(NULL); + TInt result(0); + switch ( aMessage.Function( ) ) + { + case EBSEngineInitialize: + iAppUid = TUid::Uid( aMessage.Int0( ) ); + DEBUG(("EBSEngineInitialize %x", iAppUid.iUid)); + aMessage.Complete( EBSEngineCommandWasConsumed ); + break; + case EBSEngineHandleActivationEvent: + state = ReadTextLC( aMessage, 0 ); + DEBUG(("EBSEngineHandleActivationEvent 0x%X, %S, 0x%X", + iAppUid.iUid, state, aMessage.Int1() )); + result = iBSServer->Engine(). + HandleActivationEventL( iAppUid, *state, aMessage.Int1( ) ); + CleanupStack::PopAndDestroy( state ); + aMessage.Complete( result ); + break; + case EBSEngineHandleBackCommand: + state = ReadTextLC( aMessage, 0 ); + + DEBUG(("EBSEngineHandleBackCommand 0x%X, %S", + iAppUid.iUid, state)); + result = iBSServer->Engine(). + HandleBackEventL( iAppUid, *state, aMessage.Int1( ) ); + CleanupStack::PopAndDestroy( state ); + aMessage.Complete( result ); + break; + default: + TBSEnginePanic tmp = EBSEngineBadRequest; + iBSServer->PanicClient( aMessage, tmp ); + break; + } + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::CBSServerSession +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CBSServerSession::CBSServerSession( CBSServer* aServer ) : + CSession2() + { + iBSServer = aServer; + iBSServer->IncrementSessions( ); + } + +// ----------------------------------------------------------------------------- +// CBSServerSession::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CBSServerSession::ConstructL() + { + DEBUG(("CBSServerSession::ConstructL")); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/bwins/ccclientsessionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/bwins/ccclientsessionu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,11 @@ +EXPORTS + ?WaitForApiReq@RCcClientSession@@IAEXAAV?$TPckgBuf@K@@00AAVTPtr8@@AAVTRequestStatus@@@Z @ 1 NONAME ; void RCcClientSession::WaitForApiReq(class TPckgBuf &, class TPckgBuf &, class TPckgBuf &, class TPtr8 &, class TRequestStatus &) + ?RegisterObserver@RCcClientSession@@IAEHAAV?$TPckgBuf@K@@0@Z @ 2 NONAME ; int RCcClientSession::RegisterObserver(class TPckgBuf &, class TPckgBuf &) + ?CancelReq@RCcClientSession@@IAEHAAV?$TPckgBuf@H@@@Z @ 3 NONAME ; int RCcClientSession::CancelReq(class TPckgBuf &) + ?Close@RCcClientSession@@IAEXXZ @ 4 NONAME ; void RCcClientSession::Close(void) + ?WaitForApiNtf@RCcClientSession@@IAEXAAV?$TPckgBuf@K@@00AAVTPtr8@@AAVTRequestStatus@@@Z @ 5 NONAME ; void RCcClientSession::WaitForApiNtf(class TPckgBuf &, class TPckgBuf &, class TPckgBuf &, class TPtr8 &, class TRequestStatus &) + ?Connect@RCcClientSession@@IAEHXZ @ 6 NONAME ; int RCcClientSession::Connect(void) + ?GetMsgData@RCcClientSession@@IAEHAAV?$TPckgBuf@K@@AAVTPtr8@@@Z @ 7 NONAME ; int RCcClientSession::GetMsgData(class TPckgBuf &, class TPtr8 &) + ?RegisterProvider@RCcClientSession@@IAEHAAV?$TPckgBuf@K@@0@Z @ 8 NONAME ; int RCcClientSession::RegisterProvider(class TPckgBuf &, class TPckgBuf &) + ?Send@RCcClientSession@@IAEHHAAV?$TPckgBuf@K@@00AAVTPtr8@@@Z @ 9 NONAME ; int RCcClientSession::Send(int, class TPckgBuf &, class TPckgBuf &, class TPckgBuf &, class TPtr8 &) + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/eabi/ccclientsessionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/eabi/ccclientsessionu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN16RCcClientSession10GetMsgDataER8TPckgBufImER5TPtr8 @ 1 NONAME + _ZN16RCcClientSession13WaitForApiNtfER8TPckgBufImES2_S2_R5TPtr8R14TRequestStatus @ 2 NONAME + _ZN16RCcClientSession13WaitForApiReqER8TPckgBufImES2_S2_R5TPtr8R14TRequestStatus @ 3 NONAME + _ZN16RCcClientSession16RegisterObserverER8TPckgBufImES2_ @ 4 NONAME + _ZN16RCcClientSession16RegisterProviderER8TPckgBufImES2_ @ 5 NONAME + _ZN16RCcClientSession4SendEiR8TPckgBufImES2_S2_R5TPtr8 @ 6 NONAME + _ZN16RCcClientSession5CloseEv @ 7 NONAME + _ZN16RCcClientSession7ConnectEv @ 8 NONAME + _ZN16RCcClientSession9CancelReqER8TPckgBufIiE @ 9 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +PRJ_PLATFORMS + +PRJ_EXPORTS +../inc/ccclientsession.h MW_LAYER_PLATFORM_EXPORT_PATH(ccclientsession.h) + +PRJ_MMPFILES +ccclientsession.mmp + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/group/ccclientsession.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/group/ccclientsession.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET ccclientsession.dll +TARGETTYPE dll + +UID 0x1000008d 0x20026f56 + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE ccclientsession.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ccsrvapi.lib diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/inc/ccclientsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/inc/ccclientsession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCCLIENTSESSION_H +#define CCCLIENTSESSION_H + +// System includes +#include + +// Forward declarations + +/** + * Content control server client side session + * + * + * @code + * + * @endcode + * + * @lib hsccsrv.lib + * @since S60 v5.0 + */ +class RCcClientSession : public RSessionBase + { +protected: + /** + * Connect. + * + * @since S60 5.0 + * @return Symbian error code. + */ + IMPORT_C TInt Connect(); + + /** + * Close. + * + * @since S60 5.0 + */ + IMPORT_C void Close(); + + /** + * Registers content control API provider + * @param aProvider Provider id + * @param aAddress Registered address of service provider + * @return KErrNone if registration succeeded + * Symbian error code if registration fails + * @since S60 5.0 + */ + IMPORT_C TInt RegisterProvider( + TPckgBuf& aProvider, + TPckgBuf& aAddress ); + + /** + * Registers content control API observer + * @param aProvider Provider id + * @param aAddress Registered address of observer + * @return KErrNone if registration succeeded + * Symbian error code if registration fails + * @since S60 5.0 + */ + IMPORT_C TInt RegisterObserver( + TPckgBuf& aProvider, + TPckgBuf& aAddress ); + + /** + * Cancels outstanding async request + * @param aFunction Canceled function + * @return KErrNone if registration succeeded + * Symbian error code if registration fails + * @since S60 5.0 + */ + IMPORT_C TInt CancelReq( + TPckgBuf& aFunction ); + + /** + * Starts receiving API requests + * @param aProvider Provider id + * @param aSender Sender of Api request + * @param aReceiver Service provider + * @param aBuf Message buffer for received API request header + * @param aStatus Completion status for IPC request + * @since S60 5.0 + */ + IMPORT_C void WaitForApiReq( + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf, + TRequestStatus& aStatus ); + + /** + * Starts receiving API notifications + * @param aProvider Provider id + * @param aSender Sender of Api request + * @param aReceiver Service provider + * @param aBuf Message buffer for received API notification header + * @param aStatus Completion status for IPC request + * @since S60 5.0 + */ + IMPORT_C void WaitForApiNtf( + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf, + TRequestStatus& aStatus ); + + /** + * Sends API request/response to Home screen content control server + * @param aFunction IPC function EHsCcApiReq/EHsCcApiResp + * @param aProvider Provider id + * @param aSender Sender of Api request + * @param aReceiver Service provider + * @param aBuf Message buffer: + * in: service request + * out: service response header + * @return KErrNone if sending succeeded + * Symbian error code if sending fails + * @since S60 5.0 + */ + IMPORT_C TInt Send( + TInt aFunction, + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf ); + + /** + * Reads message data + * @param aTrId Transaction id + * @param aBuf Data buffer + * @return KErrNone if reading succeeded + * Symbian error code if reading fails + * @since S60 5.0 + */ + IMPORT_C TInt GetMsgData( + TPckgBuf& aTrId, + TPtr8& aBuf ); + +public: + friend class CHsCcProviderClient; + friend class CHsCcApiClient; + + }; + + +#endif // CCCLIENTSESSION_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccclientsession/src/ccclientsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccclientsession/src/ccclientsession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,225 @@ +/* + * 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: + * + */ + +// System include files + +// User include files +#include "ccclientsession.h" +#include "ccresource.h" +#include "ccsrvapi.h" + + +// Local constants +// Home screen content control server definitions +const TUid KCcServerUid3 = {0x20026f53}; +_LIT( KCcSrvName,"ccserver" ); +const TUint KCcSrvMajorVersionNumber = 1; +const TUint KCcSrvMinorVersionNumber = 0; +const TUint KCcSrvBuildVersionNumber = 0; + + +// ----------------------------------------------------------------------------- +// StartServer() +// ----------------------------------------------------------------------------- +// +static TInt StartServer() + { + const TUidType serverUid( KNullUid,KNullUid,KCcServerUid3 ); + RProcess server; + TInt r = server.Create( KCcSrvName,KNullDesC ); + if ( r != KErrNone ) + { + return r; + } + TRequestStatus stat; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); // abort startup + } + else + { + server.Resume(); // logon OK - start the server + } + + User::WaitForRequest( stat ); // wait for start or death + + r=( server.ExitType() == EExitPanic ) ? KErrGeneral : stat.Int(); + server.Close(); + return r; + } + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// RCcClientSession::Connect +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::Connect() + { + TVersion ver = TVersion( + KCcSrvMajorVersionNumber, + KCcSrvMinorVersionNumber, + KCcSrvBuildVersionNumber); + TInt retry=2; + for (;;) + { + TInt r = CreateSession( KCcSrvName, ver ); + + if (r != KErrNotFound && r != KErrServerTerminated) + { + return r; + } + + if ( --retry==0 ) + { + return r; + } + + r = StartServer(); + if ( r!=KErrNone && r!=KErrAlreadyExists ) + { + return r; + } + } + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::Close() +// ----------------------------------------------------------------------------- +// +EXPORT_C void RCcClientSession::Close() + { + RSessionBase::Close(); + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::RegisterProvider() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::RegisterProvider( + TPckgBuf& aProvider, + TPckgBuf& aAddress ) + { + TInt err = SendReceive( + ECcReqisterProvider, + TIpcArgs( &aProvider,&aAddress,0,0 ) ); + return err; + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::RegisterObserver() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::RegisterObserver( + TPckgBuf& aProvider, + TPckgBuf& aAddress ) + { + TInt err = SendReceive( + ECcRegisterObserver, + TIpcArgs( &aProvider,&aAddress,0,0 ) ); + return err; + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::CancelReq() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::CancelReq( + TPckgBuf& aFunction ) + { + TInt err = SendReceive( + ECcCancel, + TIpcArgs( &aFunction,0,0,0 ) ); + return err; + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::WaitForApiReq() +// ----------------------------------------------------------------------------- +// +EXPORT_C void RCcClientSession::WaitForApiReq( + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf, + TRequestStatus& aStatus ) + { + SendReceive( + ECcWaitForApiReq, + TIpcArgs( &aProvider, + &aSender, + &aReceiver, + &aBuf ), + aStatus ); + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::WaitForApiNtf() +// ----------------------------------------------------------------------------- +// +EXPORT_C void RCcClientSession::WaitForApiNtf( + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf, + TRequestStatus& aStatus ) + { + SendReceive( + ECcWaitForApiNtf, + TIpcArgs( &aProvider, + &aSender, + &aReceiver, + &aBuf ), + aStatus ); + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::Send() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::Send( + TInt aFunction, + TPckgBuf& aProvider, + TPckgBuf& aSender, + TPckgBuf& aReceiver, + TPtr8& aBuf ) + { + TInt err = SendReceive( + aFunction, + TIpcArgs( &aProvider, + &aSender, + &aReceiver, + &aBuf ) ); + return err; + } + +// ----------------------------------------------------------------------------- +// RCcClientSession::GetMsgData() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RCcClientSession::GetMsgData( + TPckgBuf& aTrId, + TPtr8& aBuf ) + { + TInt err = SendReceive( + ECcGetMsgData, + TIpcArgs( &aTrId, &aBuf, 0, 0) ); + return err; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES +ccsrv.mmp + +//PRJ_TESTMMPFILES +// diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/group/ccsrv.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/group/ccsrv.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: Makefile of Content control server +* +*/ + + +#include + +TARGET ccserver.exe + +TARGETTYPE exe + +UID 0x1000008d 0x20026f53 +CAPABILITY ALL -TCB -DRM +VENDORID VID_DEFAULT +SECUREID 0x20026f53 + +SOURCEPATH ../src +SOURCE ccsrv.cpp +SOURCE ccsrvsession.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY ccsrvapi.lib + + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/inc/ccsrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/inc/ccsrv.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCSRV_H +#define CCSRV_H + +// System includes +#include + +// Forward declarations +class CCcSrvSession; +class CCcSrvMsg; + +/** + * Content control server + * + * + * @code + * + * @endcode + * + * @lib ccsrv.exe + * @since S60 v5.0 + */ +class CCcSrv : public CPolicyServer + { +public: // Constructor and destructor + + /** + * NewLC + * @since S60 3.1 + */ + static CServer2* NewLC(); + + +private: // Constructors and destructor + + /** + * Constructor + */ + CCcSrv(); + + /** + * Destructor + */ + ~CCcSrv(); + + /** + * Second phase constructor + */ + void ConstructL(); + +public: // New functions + /** + * Add session + * @param aSession Added session + */ + void AddSessionL( + CCcSrvSession* aSession ); + + /** + * Drop session + * @param aSession Dropped session + */ + void DropSession( + CCcSrvSession* aSession ); + + /** + * Registers provider session + * @param aProvider Registered provider + * @param aId Provider session id + */ + void RegisterProviderL( + TUint32 aProvider, + CCcSrvSession* aSession ); + + /** + * Registers observer session + * @param aProvider Registered provider + * @param aId Provider session id + */ + void RegisterObserverL( + TUint32 aProvider, + CCcSrvSession* aSession ); + + /** + * Resolves registered provider address + * @param aProvider Registered provider + * @param aAddress Resolved address + */ + void ResolveProviderAddressL( + TUint32 aProvider, + TUint32& aAddress ); + + /** + * Calculates next available transaction id + * @return next available transaction id + */ + TUint32 GetTrId(); + + /** + * Sends message to defined session + * @param aSender Sender session + * @param aReceiver Receiver session + * @param aMsgBuf Message buffer + */ + void SendMsgL( + TUint32 aSender, + TUint32 aReceiver, + CCcSrvMsg& aMessage ); + +private: + + /** + * NewSessionL + * @since S60 3.1 + */ + CSession2* NewSessionL( + const TVersion& aVersion, + const RMessage2& aMessage ) const; + + +private: // Data + /** + * Session list + */ + RPointerArray iSessions; + + /** + * Last session id + */ + TUint32 iLastSessionId; + + /** + * Last used transaction id + */ + TUint32 iLastTrId; + + /** + * Provider list + */ + struct TCcProvider + { + TUint32 iId; + CCcSrvSession* iSession; + }; + RArray iProviders; + + }; + + +#endif // CCSRV_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/inc/ccsrvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/inc/ccsrvsession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCSRVSESSION_H +#define CCSRVSESSION_H + +// System includes +#include + +// Forward declarations +#include "ccsrv.h" + +/** + * Home screen content control server session + * + * + * @code + * + * @endcode + * + * @lib ccsrv.exe + * @since S60 v5.0 + */ +class CCcSrvSession : public CSession2 + { +public: // Constructor and destructor + /** + * Constructor + */ + CCcSrvSession(); + + /** + * Destructor. + */ + ~CCcSrvSession(); + +public: // From CSession2 + /** + * + */ + void CreateL(); + + /** + * + */ + void ServiceL( + const RMessage2& aMessage ); + +public: // New functions + /** + * + */ + TUint32 Id(); + + /** + * + */ + void SetId( TUint32 aId ); + + /** + * + * + */ + void RegisterObserverSessionL( + TUint32 aObserver ); + + /** + * + * + */ + void UnregisterObserverSessionL( + TUint32 aObserver ); + + /** + * + * + */ + void ReceiveMsgL( + TUint32 aSender, + TUint32 aReceiver, + CCcSrvMsg& aMessage ); + +private: + /** + * + * + */ + inline CCcSrv& Server() + { + return *static_cast( const_cast( CSession2::Server() ) ); + }; + + /** + * + */ + void DoServiceL( + RMessage2& aMessage ); + + + /** + * + * + */ + void HandleRegisterProviderL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleRegisterObserverL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleCancelReqL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleWaitForApiReqL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleWaitForApiNtfL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleApiReqL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleApiRespL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleGetMsgDataL( + RMessage2& aMessage ); + + /** + * + * + */ + void HandleApiNtfL( + RMessage2& aMessage ); + + /** + * + * + */ + void SendObserverNtfL( + TUint32 aSender, + TUint32 aNtf ); + +private: // Data + /** + * Session id + */ + TUint32 iId; + + /** + * Last used transaction id + */ + TInt iLastTrId; + + /** + * Outstanding transactions + */ + RPointerArray iRequests; + + /** + * Observers + */ + RArray iObservers; + + }; + +#endif // CCSRVSESSION_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/src/ccsrv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/src/ccsrv.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,321 @@ +/* + * 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: + * + */ + +// System include files + +// User include files +#include "ccsrv.h" +#include "ccsrvsession.h" +#include "ccresource.h" +#include "ccsrvapi.h" + + +// Local constants + +// Home screen content control server name +_LIT( KCcSrvName,"ccserver" ); + +// Home screen content control server policy +//Total number of ranges +const TUint KCcRangeCount = 2; + +//Definition of the ranges of IPC numbers +const TInt KCcRanges[KCcRangeCount] = + { + ECcIPCFunctionBase, + ECcNotSupported + }; + +// Policy actions for each of the above ranges +const TUint8 KCcPolicyAction[KCcRangeCount] = + { + 0, + CPolicyServer::ENotSupported + }; + +// Requested capabilities +const CPolicyServer::TPolicyElement KCcCapability[] = + { + {_INIT_SECURITY_POLICY_C2( ECapabilityReadUserData, ECapabilityWriteUserData ), CPolicyServer::EFailClient} + }; + +const CPolicyServer::TPolicy KCcPolicy = + { + 0, + KCcRangeCount, + KCcRanges, + KCcPolicyAction, + KCcCapability + }; + +// ----------------------------------------------------------------------------- +// RunServerL() +// ----------------------------------------------------------------------------- +// +static void RunServerL() + { + User::LeaveIfError(User::RenameThread(KCcSrvName)); + CActiveScheduler* s=new(ELeave) CActiveScheduler; + CleanupStack::PushL(s); + CActiveScheduler::Install(s); + CCcSrv::NewLC(); + RProcess::Rendezvous(KErrNone); + CActiveScheduler::Start(); + CleanupStack::PopAndDestroy( 2, s ); + } + +// ----------------------------------------------------------------------------- +// E32Main +// Server process entry-point +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + __UHEAP_MARK; + CTrapCleanup* cleanup=CTrapCleanup::New(); + TInt r=KErrNoMemory; + if (cleanup) + { + TRAP(r,RunServerL()); + delete cleanup; + } + __UHEAP_MARKEND; + return r; + } + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CCcSrv::NewLC +// ----------------------------------------------------------------------------- +// +CServer2* CCcSrv::NewLC() + { + CCcSrv* self=new ( ELeave ) CCcSrv; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------- +// CCcSrv::ConstructL() +// ----------------------------------------------------------------------- +// +void CCcSrv::ConstructL() + { + StartL( KCcSrvName ); + } + +// ----------------------------------------------------------------------- +// CCcSrv::CCcSrv() +// ----------------------------------------------------------------------- +// +CCcSrv::CCcSrv() + :CPolicyServer( 0,KCcPolicy,ESharableSessions ) + ,iLastSessionId( 0 ) + { + } + +// ----------------------------------------------------------------------- +// CCcSrv::~CCcSrv() +// ----------------------------------------------------------------------- +// +CCcSrv::~CCcSrv() + { + iSessions.Close(); + iProviders.Close(); + } + +// ----------------------------------------------------------------------------- +// CCcSrv::NewSessionL +// ----------------------------------------------------------------------------- +// +CSession2* CCcSrv::NewSessionL( + const TVersion&, + const RMessage2& /* aMessage */ ) const + { + return new ( ELeave ) CCcSrvSession(); + } + +// ----------------------------------------------------------------------------- +// CCcSrv::AddSessionL +// ----------------------------------------------------------------------------- +// +void CCcSrv::AddSessionL( CCcSrvSession* aSession ) + { + // Find next available session id + while( ETrue ) + { + iLastSessionId = iLastSessionId + 1; + TBool found( EFalse ); + for ( TUint32 i = 0; i < iSessions.Count() && !found; i++ ) + { + if ( iSessions[ i ]->Id() == iLastSessionId ) + { + found = ETrue; + } + } + if ( !found ) + { + break; + } + } + + aSession->SetId( iLastSessionId ); + iSessions.AppendL( aSession ); + } + +// ----------------------------------------------------------------------------- +// CCcSrv::DropSession +// ----------------------------------------------------------------------------- +// +void CCcSrv::DropSession( CCcSrvSession* aSession ) + { + for ( TUint32 i = 0; i < iSessions.Count(); i++ ) + { + if ( iSessions[ i ]->Id() == aSession->Id() ) + { + iSessions.Remove( i ); + break; + } + } + // Unregister possible observations + for ( TUint32 i = 0; i < iProviders.Count(); i++ ) + { + TRAP_IGNORE( iProviders[ i ].iSession-> + UnregisterObserverSessionL( aSession->Id() ) ); + } + + // Remove possible provider + for ( TUint32 i = 0; i < iProviders.Count(); i++ ) + { + if ( iProviders[ i ].iId == aSession->Id() ) + { + iProviders.Remove( i ); + break; + } + } + if ( iSessions.Count() == 0 ) + { + // Last session dropped -> stop server + CActiveScheduler::Stop(); + } + } + +// ----------------------------------------------------------------------------- +// CCcSrv::RegisterProviderSessionL +// ----------------------------------------------------------------------------- +// +void CCcSrv::RegisterProviderL( + TUint32 aProvider, + CCcSrvSession* aSession ) + { + for ( TUint32 i = 0; i < iProviders.Count(); i++ ) + { + if ( iProviders[ i ].iId == aProvider ) + { + User::Leave( KErrAlreadyExists ); + } + } + CCcSrv::TCcProvider provider; + provider.iId = aProvider; + provider.iSession = aSession; + iProviders.Append( provider ); + + } + +// ----------------------------------------------------------------------------- +// CCcSrv::RegisterObserverL +// ----------------------------------------------------------------------------- +// +void CCcSrv::RegisterObserverL( + TUint32 aProvider, + CCcSrvSession* aSession ) + { + TBool found( EFalse ); + for ( TUint32 i = 0; i < iProviders.Count() && !found; i++ ) + { + if ( iProviders[ i ].iId == aProvider ) + { + iProviders[ i ].iSession->RegisterObserverSessionL( aSession->Id() ); + found = ETrue; + } + } + if ( !found ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CCcSrv::ResolveProviderAddressL +// ----------------------------------------------------------------------------- +// +void CCcSrv::ResolveProviderAddressL( + TUint32 aProvider, + TUint32& aAddress ) + { + TBool found( EFalse ); + for ( TUint32 i = 0; i < iProviders.Count() && !found; i++ ) + { + if ( iProviders[ i ].iId == aProvider ) + { + aAddress = iProviders[ i ].iSession->Id(); + found = ETrue; + } + } + if ( !found ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CCcSrv::GetTrId +// ----------------------------------------------------------------------------- +// +TUint32 CCcSrv::GetTrId() + { + iLastTrId++; + return iLastTrId; + } + +// ----------------------------------------------------------------------------- +// CCcSrv::SendMsgL +// ----------------------------------------------------------------------------- +// +void CCcSrv::SendMsgL( + TUint32 aSender, + TUint32 aReceiver, + CCcSrvMsg& aMessage ) + { + TBool found( EFalse ); + for ( TUint32 i = 0; i < iSessions.Count() && !found; i++ ) + { + if ( iSessions[ i ]->Id() == aReceiver ) + { + iSessions[ i ]->ReceiveMsgL( aSender, aReceiver, aMessage ); + found = ETrue; + } + } + if ( !found ) + { + User::Leave( KErrNotFound ); + } + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrv/src/ccsrvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/src/ccsrvsession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,563 @@ +/* + * 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: + * + */ + +// System include files +#include +#include + +// User include files +#include "ccsrvsession.h" +#include "ccsrv.h" +#include "ccresource.h" +#include "ccsrvapi.h" + +// Local constants + + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------- +// CCcSrvSession::CCcSrvSession() +// ----------------------------------------------------------------------- +// +CCcSrvSession::CCcSrvSession(): + iLastTrId( 0 ) + { + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::~CCcSrvSession() +// ----------------------------------------------------------------------- +// +CCcSrvSession::~CCcSrvSession() + { + iRequests.ResetAndDestroy(); + iObservers.Close(); + Server().DropSession( this ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::CreateL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::CreateL() + { + Server().AddSessionL( this ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::Id() +// ----------------------------------------------------------------------- +// +TUint32 CCcSrvSession::Id() + { + return iId; + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::SetId() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::SetId( + TUint32 aId ) + { + iId = aId; + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::ServiceL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::ServiceL( + const RMessage2& aMessage ) + { + RMessage2 msg = aMessage; + TRAPD( err, DoServiceL( msg ) ); + if ( err ) + { + aMessage.Complete( err ); + } + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::DoServiceL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::DoServiceL( + RMessage2& aMessage ) + { + switch ( aMessage.Function() ) + { + case ECcReqisterProvider: + HandleRegisterProviderL( aMessage ); + break; + case ECcRegisterObserver: + HandleRegisterObserverL( aMessage ); + break; + case ECcWaitForApiReq: + HandleWaitForApiReqL( aMessage ); + break; + case ECcWaitForApiNtf: + HandleWaitForApiNtfL( aMessage ); + break; + case ECcCancel: + HandleCancelReqL( aMessage ); + break; + case ECcApiReq: + HandleApiReqL( aMessage ); + break; + case ECcApiResp: + HandleApiRespL( aMessage ); + break; + case ECcGetMsgData: + HandleGetMsgDataL( aMessage ); + break; + case ECcApiNtf: + HandleApiNtfL( aMessage ); + break; + default: + User::Leave( KErrNotSupported ); + break; + } + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleRegisterProviderL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleRegisterProviderL( + RMessage2& aMessage ) + { + TUint32 provider; + TPckgBuf packagedProvider; + aMessage.ReadL(0, packagedProvider); + provider = packagedProvider(); + + Server().RegisterProviderL( + provider, + this ); + + TPckgBuf packagedSessionId( iId ); + aMessage.WriteL( 1, packagedSessionId ); + aMessage.Complete( KErrNone ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleRegisterObserverL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleRegisterObserverL( + RMessage2& aMessage ) + { + TUint32 provider; + TPckgBuf packagedProvider; + aMessage.ReadL(0, packagedProvider); + provider = packagedProvider(); + + Server().RegisterObserverL( + provider, + this ); + + TPckgBuf packagedSessionId( iId ); + aMessage.WriteL( 1, packagedSessionId ); + aMessage.Complete( KErrNone ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::RegisterObserverSessionL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::RegisterObserverSessionL( + TUint32 aObserver ) + { + // Notify provider of registered observer + SendObserverNtfL( aObserver, ECcRegisterObserverNtf ); + iObservers.AppendL( aObserver ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::UnregisterObserverSessionL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::UnregisterObserverSessionL( + TUint32 aObserver ) + { + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + if ( iObservers[ i ] == aObserver ) + { + // Notify provider of unregistered observer + SendObserverNtfL( aObserver, ECcUnregisterObserverNtf ); + iObservers.Remove( i ); + break; + } + } + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleWaitForApiReqL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleWaitForApiReqL( + RMessage2& aMessage ) + { + CCcSrvMsg* tr = CCcSrvMsg::NewL(); + CleanupStack::PushL( tr ); + tr->SetMessage( aMessage ); + iRequests.AppendL( tr ); + CleanupStack::Pop( tr ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleWaitForApiNtfL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleWaitForApiNtfL( + RMessage2& aMessage ) + { + CCcSrvMsg* tr = CCcSrvMsg::NewL(); + CleanupStack::PushL( tr ); + tr->SetMessage( aMessage ); + iRequests.AppendL( tr ); + CleanupStack::Pop( tr ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleCancelReqL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleCancelReqL( + RMessage2& aMessage ) + { + TInt function; + TPckgBuf packagedFunction; + aMessage.ReadL( 0, packagedFunction ); + function = packagedFunction(); + + for ( TInt i = 0; i < iRequests.Count(); i++ ) + { + CCcSrvMsg* req = iRequests[ i ]; + if ( req->Message().Function() == function && + !req->Message().IsNull() ) + { + // Complete canceled request + req->Message().Complete( KErrCancel ); + iRequests.Remove( i ); + delete req; + } + } + aMessage.Complete( KErrNone ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleApiReqL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleApiReqL( + RMessage2& aMessage ) + { + TUint32 provider; + TPckgBuf packagedProvider; + aMessage.ReadL( 0, packagedProvider ); + provider = packagedProvider(); + TUint32 providerAddress; + Server().ResolveProviderAddressL( provider, providerAddress ); + + HBufC8* msgBuf = HBufC8::NewL( aMessage.GetDesLengthL( 3 ) ); + CleanupStack::PushL( msgBuf ); + TPtr8 msgBufPtr = msgBuf->Des(); + aMessage.ReadL( 3, msgBufPtr, 0 ); + + RDesReadStream stream( msgBufPtr ); + + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->InternalizeL( stream ); + message->SetTrId( Server().GetTrId() ); + message->SetMessage( aMessage ); + + Server().SendMsgL( iId, providerAddress, *message ); + + iRequests.AppendL( message ); + + CleanupStack::Pop( message ); + CleanupStack::PopAndDestroy( msgBuf ); + + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleApiReqL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleApiRespL( + RMessage2& aMessage ) + { + // Read sender and receiver of a response + TPckgBuf pckg; + aMessage.ReadL( 1, pckg ); + TUint32 sender = pckg(); + aMessage.ReadL( 2, pckg ); + TUint32 receiver = pckg(); + + // Read message data + HBufC8* msgBuf = HBufC8::NewL( aMessage.GetDesLengthL( 3 ) ); + CleanupStack::PushL( msgBuf ); + TPtr8 msgBufPtr = msgBuf->Des(); + aMessage.ReadL( 3, msgBufPtr, 0 ); + + // Internalize message + RDesReadStream stream( msgBufPtr ); + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->InternalizeL( stream ); + message->SetMessage( aMessage ); + + // Forward message to receiver + Server().SendMsgL( sender, receiver, *message ); + + CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( msgBuf ); + + aMessage.Complete( KErrNone ); + + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleGetMsgDataL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleGetMsgDataL( + RMessage2& aMessage ) + { + // Read sender and receiver of a response + TPckgBuf pckg; + aMessage.ReadL( 0, pckg ); + TUint32 trId = pckg(); + + CCcSrvMsg* req( NULL ); + TInt index( 0 ); + for( TInt i = 0; i < iRequests.Count() && !req; i++ ) + { + if ( iRequests[ i ]->TrId() == trId ) + { + req = iRequests[ i ]; + index = i; + } + } + + TInt err( KErrNone ); + if ( req ) + { + // Write message data + aMessage.WriteL( 1, req->Data(), 0); + // Remove request + iRequests.Remove( index ); + delete req; + } + else + { + err = KErrNotFound; + } + + aMessage.Complete( err ); + + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::HandleApiNtfL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::HandleApiNtfL( + RMessage2& aMessage ) + { + // Read notification data + HBufC8* msgBuf = HBufC8::NewL( aMessage.GetDesLengthL( 3 ) ); + CleanupStack::PushL( msgBuf ); + TPtr8 msgBufPtr = msgBuf->Des(); + aMessage.ReadL( 3, msgBufPtr, 0 ); + + // Internalize notification + RDesReadStream stream( msgBufPtr ); + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->InternalizeL( stream ); + message->SetMessage( aMessage ); + + // Forward notification to observers + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + Server().SendMsgL( iId, iObservers[ i ], *message ); + } + + message->Message().Complete( KErrNone ); + + CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( msgBuf ); + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::ReceiveMsgL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::ReceiveMsgL( + TUint32 aSender, + TUint32 aReceiver, + CCcSrvMsg& aMessage ) + { + TBool found( EFalse ); + CCcSrvMsg* req( NULL ); + TInt index( 0 ); + for ( TInt i = 0; i < iRequests.Count() && !found; i++ ) + { + req = iRequests[ i ]; + if ( aMessage.Message().Function() == ECcApiReq && + req->Message().Function() == ECcWaitForApiReq && + !req->Message().IsNull() ) + { + // Pending WaitForApiReq transaction found + index = i; + found = ETrue; + } + else if ( aMessage.Message().Function() == ECcApiResp && + req->TrId() == aMessage.TrId() ) + { + // Pending ApiReq transaction found + index = i; + found = ETrue; + } + else if ( aMessage.Message().Function() == ECcApiNtf && + req->Message().Function() == ECcWaitForApiNtf && + !req->Message().IsNull() ) + { + // Pending WaitForApiNtf transaction found + index = i; + found = ETrue; + } + } + + if ( found ) + { + // Write sender of message + TPckgBuf packagedSender( aSender ); + req->Message().WriteL( 1, packagedSender, 0 ); + + // Write receiver of message + TPckgBuf packagedReceiver( aReceiver ); + req->Message().WriteL( 2, packagedReceiver, 0 ); + + // Externalize message header + CBufFlat* buf = CBufFlat::NewL( KCcHeaderSize ); + CleanupStack::PushL( buf ); + RBufWriteStream stream( *buf ); + CleanupClosePushL( stream ); + aMessage.ExternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + + //Create a heap descriptor from the buffer + HBufC8* des = HBufC8::NewL( buf->Size() ); + CleanupStack::PushL( des ); + TPtr8 ptr( des->Des() ); + buf->Read( 0, ptr, buf->Size() ); + + // Write request header + req->Message().WriteL( 3, ptr, 0); + CleanupStack::PopAndDestroy( des ); + CleanupStack::PopAndDestroy( buf ); + + // Complete request + req->Message().Complete( KErrNone ); + if ( aMessage.DataSize() ) + { + // Store request data to be read later + // with GetMsgData() + req->SetTrId( aMessage.TrId() ); + req->SetData( aMessage.Data() ); + } + else + { + // Received request does not contain any data + // -> remove it from request array + iRequests.Remove( index ); + delete req; + } + } + else + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------- +// CCcSrvSession::SendObserverNtfL() +// ----------------------------------------------------------------------- +// +void CCcSrvSession::SendObserverNtfL( + TUint32 aSender, + TUint32 aNtf ) + { + // Notify provider of registered observer + TBool found( EFalse ); + CCcSrvMsg* req( NULL ); + TInt index( 0 ); + for ( TInt i = 0; i < iRequests.Count() && !found; i++ ) + { + req = iRequests[ i ]; + if ( req->Message().Function() == ECcWaitForApiReq && + !req->Message().IsNull() ) + { + // Pending WaitForApiReq transaction found + index = i; + found = ETrue; + } + } + if ( found ) + { + // Write sender of message + TPckgBuf packagedSender( aSender ); + req->Message().WriteL( 1, packagedSender, 0 ); + + // Write receiver of message + TPckgBuf packagedReceiver( iId ); + req->Message().WriteL( 2, packagedReceiver, 0 ); + + // Externalize notification + CCcSrvMsg* ntf = CCcSrvMsg::NewL(); + CleanupStack::PushL( ntf ); + ntf->SetMsgId( aNtf ); + HBufC8* ntfBuf = ntf->MarshalL(); + CleanupStack::PushL( ntfBuf ); + TPtr8 ntfPtr( NULL, 0); + ntfPtr.Set( ntfBuf->Des() ); + + // Write request header + req->Message().WriteL( 3, ntfPtr, 0); + CleanupStack::PopAndDestroy( ntfBuf ); + CleanupStack::PopAndDestroy( ntf ); + + // Complete request + req->Message().Complete( KErrNone ); + iRequests.Remove( index ); + delete req; + + } + else + { + User::Leave( KErrNotFound ); + } + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/bwins/ccsrvapiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/bwins/ccsrvapiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +EXPORTS + ?SetStatus@CCcSrvMsg@@QAEXH@Z @ 1 NONAME ; void CCcSrvMsg::SetStatus(int) + ?ExternalizeHeaderL@CCcSrvMsg@@QAEXAAVRWriteStream@@@Z @ 2 NONAME ; void CCcSrvMsg::ExternalizeHeaderL(class RWriteStream &) + ?DataSize@CCcSrvMsg@@QAEHXZ @ 3 NONAME ; int CCcSrvMsg::DataSize(void) + ?MsgId@CCcSrvMsg@@QAEKXZ @ 4 NONAME ; unsigned long CCcSrvMsg::MsgId(void) + ?SetMsgId@CCcSrvMsg@@QAEXK@Z @ 5 NONAME ; void CCcSrvMsg::SetMsgId(unsigned long) + ?Data@CCcSrvMsg@@QAE?AVTPtrC8@@XZ @ 6 NONAME ; class TPtrC8 CCcSrvMsg::Data(void) + ?MarshalL@CCcSrvMsg@@QAEPAVHBufC8@@XZ @ 7 NONAME ; class HBufC8 * CCcSrvMsg::MarshalL(void) + ?SetTrId@CCcSrvMsg@@QAEXK@Z @ 8 NONAME ; void CCcSrvMsg::SetTrId(unsigned long) + ?InternalizeHeaderL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 9 NONAME ; void CCcSrvMsg::InternalizeHeaderL(class RReadStream &) + ?NewL@CCcSrvMsg@@SAPAV1@XZ @ 10 NONAME ; class CCcSrvMsg * CCcSrvMsg::NewL(void) + ?InternalizeL@CCcSrvMsg@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void CCcSrvMsg::InternalizeL(class RReadStream &) + ?TrId@CCcSrvMsg@@QAEKXZ @ 12 NONAME ; unsigned long CCcSrvMsg::TrId(void) + ?Message@CCcSrvMsg@@QAE?AVRMessage2@@XZ @ 13 NONAME ; class RMessage2 CCcSrvMsg::Message(void) + ?SetData@CCcSrvMsg@@QAEXABVTDesC8@@@Z @ 14 NONAME ; void CCcSrvMsg::SetData(class TDesC8 const &) + ?ExternalizeL@CCcSrvMsg@@QAEXAAVRWriteStream@@@Z @ 15 NONAME ; void CCcSrvMsg::ExternalizeL(class RWriteStream &) + ?SetMessage@CCcSrvMsg@@QAEXAAVRMessage2@@@Z @ 16 NONAME ; void CCcSrvMsg::SetMessage(class RMessage2 &) + ?Status@CCcSrvMsg@@QAEHXZ @ 17 NONAME ; int CCcSrvMsg::Status(void) + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/eabi/ccsrvapiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/eabi/ccsrvapiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,21 @@ +EXPORTS + _ZN9CCcSrvMsg10SetMessageER9RMessage2 @ 1 NONAME + _ZN9CCcSrvMsg12ExternalizeLER12RWriteStream @ 2 NONAME + _ZN9CCcSrvMsg12InternalizeLER11RReadStream @ 3 NONAME + _ZN9CCcSrvMsg18ExternalizeHeaderLER12RWriteStream @ 4 NONAME + _ZN9CCcSrvMsg18InternalizeHeaderLER11RReadStream @ 5 NONAME + _ZN9CCcSrvMsg4DataEv @ 6 NONAME + _ZN9CCcSrvMsg4NewLEv @ 7 NONAME + _ZN9CCcSrvMsg4TrIdEv @ 8 NONAME + _ZN9CCcSrvMsg5MsgIdEv @ 9 NONAME + _ZN9CCcSrvMsg6StatusEv @ 10 NONAME + _ZN9CCcSrvMsg7MessageEv @ 11 NONAME + _ZN9CCcSrvMsg7SetDataERK6TDesC8 @ 12 NONAME + _ZN9CCcSrvMsg7SetTrIdEm @ 13 NONAME + _ZN9CCcSrvMsg8DataSizeEv @ 14 NONAME + _ZN9CCcSrvMsg8MarshalLEv @ 15 NONAME + _ZN9CCcSrvMsg8SetMsgIdEm @ 16 NONAME + _ZN9CCcSrvMsg9SetStatusEi @ 17 NONAME + _ZTI9CCcSrvMsg @ 18 NONAME + _ZTV9CCcSrvMsg @ 19 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +PRJ_PLATFORMS + +PRJ_EXPORTS +../inc/ccresource.h MW_LAYER_PLATFORM_EXPORT_PATH(ccresource.h) +../inc/ccsrvapi.h MW_LAYER_PLATFORM_EXPORT_PATH(ccsrvapi.h) + +PRJ_MMPFILES +ccsrvapi.mmp + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/group/ccsrvapi.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/group/ccsrvapi.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET ccsrvapi.dll +TARGETTYPE dll + +UID 0x1000008d 0x20026f58 + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE ccsrvmsg.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/inc/ccresource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/inc/ccresource.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Content control provider resource definitions +* +*/ + +#ifndef CCRESOURCE_H +#define CCRESOURCE_H + +// Provider resource id's +enum THsCcResource + { + ECcHomescreen = 1 // Home screen content control provider + }; + +#endif // CCRESOURCE_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/inc/ccsrvapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/inc/ccsrvapi.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,375 @@ +/* +* 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: Content control server API definitions +* +*/ + +#ifndef CCSRVAPI_H +#define CCSRVAPI_H + +// System includes +#include + +// Forward declarations +class RWriteStream; +class RReadStream; + +// Constants + +// ---------------------------------------------------------------------------- +// Content control server IPC functions +// ---------------------------------------------------------------------------- +enum TCcSrvIPCFunctions + { + ECcIPCFunctionBase = 0, +// ---------------------------------------------------------------------------- +// RegisterProvider +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to register content control service provider +// to content control server +// +// IPC parameters: +// - Function: ECcReqisterProvider +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Registered provider address (out), TUint32 +// - Arg[2]: Not used +// - Arg[2]: Not used + ECcReqisterProvider = ECcIPCFunctionBase, +// ---------------------------------------------------------------------------- +// RegisterObserver +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to register observer for content control service +// provider +// +// IPC parameters: +// - Function: ECcRegisterObserver +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Registered observer address (out), TUint32 +// - Arg[2]: Not used +// - Arg[2]: Not used + ECcRegisterObserver, +// ---------------------------------------------------------------------------- +// WaitForApiReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used by content control service provider to receive +// API requests +// +// IPC parameters: +// - Function: ECcWaitForApiReq +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Provider address (in), TUint32 +// - Arg[2]: API request sender address (out), TUint32 +// - Arg[2]: API request header buffer (out), TPtr8 pointing to +// HBufC8 descriptor + ECcWaitForApiReq, +// ---------------------------------------------------------------------------- +// WaitForApiNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used by observer of content control service provider to +// receive content change notifications +// +// IPC parameters: +// - Function: ECcWaitForApiNtf +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Observer address (out), TUint32 +// - Arg[2]: Provider address (out), TUint32 +// - Arg[2]: API notification header buffer (out), TPtr8 pointing to +// HBufC8 descriptor + ECcWaitForApiNtf, +// ---------------------------------------------------------------------------- +// ApiReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to send a API request to the content control service +// provider +// +// IPC parameters: +// - Function: ECcApiReq +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: API request sender address (out), TUint32 +// - Arg[2]: Provider sender address (out), TUint32 +// - Arg[2]: API request buffer (in)/API response header (out), +// TPtr8 pointing to HBufC8 descriptor + ECcApiReq, +// ---------------------------------------------------------------------------- +// ApiResp +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to send a API response to the API request sender +// +// IPC parameters: +// - Function: ECcApiResp +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Provider address (in), TUint32 +// - Arg[2]: API response receiver address (in), TUint32 +// - Arg[2]: API response buffer (in), TPtr8 pointing to HBufC8 descriptor + ECcApiResp, +// ---------------------------------------------------------------------------- +// ApiNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to send a API notification +// +// IPC parameters: +// - Function: ECcApiNtf +// - Arg[0]: Provider id (in), TInt +// - Arg[1]: Provider address (in), TUint32 +// - Arg[2]: API notification receiver address (in), TUint32 +// - Arg[2]: API notification buffer (in), +// TPtr8 pointing to HBufC8 descriptor + ECcApiNtf, +// ---------------------------------------------------------------------------- +// GetMsgData +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to read message data +// +// IPC parameters: +// - Function: ECcGetMsgData +// - Arg[0]: Transaction id of a message which data is requested (in), TUint32 +// - Arg[1]: Message data buffer (out), TPtr8 pointing to HBufC8 descriptor +// - Arg[2]: None +// - Arg[2]: None + ECcGetMsgData, +// ---------------------------------------------------------------------------- +// Cancel +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to cancel outstanding WaitForApiReq or +// WaitForNotification request +// +// IPC parameters: +// - Function: ECcCancel +// - Arg[0]: Canceled IPC function (WaitForApiReq||WaitForNotification) +// - Arg[1]: None +// - Arg[2]: None +// - Arg[2]: None + ECcCancel, + ECcNotSupported + }; + +// ---------------------------------------------------------------------------- +// Content control server message header +// ---------------------------------------------------------------------------- +// Items: +// - Message id, TInt +// - Transaction id, TInt +// - Status, TInt +// - Data size, TInt +// Externalized message header size: +const TInt KCcHeaderSize = 16; + +// ---------------------------------------------------------------------------- +// Content control server messages +// ---------------------------------------------------------------------------- +enum TCcSrvMessages + { + ECcMessageBase = 0, +// ---------------------------------------------------------------------------- +// RegisterObserverNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This notification is used to inform content provider of registerd observer +// +// Message parameters: +// - Message id: EHsCcRegisterObserverNtf +// - Transaction id: None +// - Message data: None + ECcRegisterObserverNtf = ECcMessageBase, +// ---------------------------------------------------------------------------- +// UnregisterObserverNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This notification is used to inform content provider of unregisterd observer +// +// Message parameters: +// - Message id: EHsCcUnregisterObserverNtf +// - Transaction id: None +// - Message data: None + ECcUnregisterObserverNtf, +// ---------------------------------------------------------------------------- +// ProviderMessageBase +// ---------------------------------------------------------------------------- +// Purpose: +// ProviderMessageBase is used to define the start of provider message ids +// + ECcProviderMessageBase + }; + +/** + * Content control server message + * + * + * @code + * + * @endcode + * + * @lib ccsrvapi.lib + * @since S60 v5.0 + */ +class CCcSrvMsg : public CBase + { +public: // Constructor and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CCcSrvMsg* NewL(); + + /** + * Destructor. + */ + ~CCcSrvMsg(); + +private: // Constructors + /** + * Constructor + */ + CCcSrvMsg(); + + /** Second phase constructor */ + void ConstructL(); + + +public: // New functions + /** + * Returns pending request + */ + IMPORT_C RMessage2 Message(); + + /** + * Stores pending request + * @param aMessage Pending request + */ + IMPORT_C void SetMessage( RMessage2& aMessage ); + + /** + * Returns message id + */ + IMPORT_C TUint32 MsgId(); + + /** + * Stores message id + * @param aMsgId Message id + */ + IMPORT_C void SetMsgId( TUint32 aMsgId ); + + /** + * Returns transaction id + */ + IMPORT_C TUint32 TrId(); + + /** + * Stores transaction id + * @param aTrId Transaction id + */ + IMPORT_C void SetTrId( TUint32 aTrId ); + + /** + * Returns message status + */ + IMPORT_C TInt Status(); + + /** + * Stores message status + * @param aStatus Transaction status + */ + IMPORT_C void SetStatus( TInt aStatus ); + + /** + * Returns pointer to message data + */ + IMPORT_C TPtrC8 Data(); + + /** + * Stores message data + * @param aData Message data + */ + IMPORT_C void SetData( const TDesC8& aData ); + + /** + * Returns message data size + */ + IMPORT_C TInt DataSize(); + + /** + * Externalizes message (header and data) + * @param aStream Write stream where message is externalized + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream ); + + /** + * Externalizes message header + * @param aStream Write stream where message header is externalized + */ + IMPORT_C void ExternalizeHeaderL( RWriteStream& aStream ); + + /** + * Internalizes message (header and data) + * @param aStream Read stream where message is internalized + */ + IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Internalizes message header + * @param aStream Read stream where message header is internalized + */ + IMPORT_C void InternalizeHeaderL( RReadStream& aStream ); + + /** + * Marshals message to a descrptor + * @return Pointer to created descriptor + */ + IMPORT_C HBufC8* MarshalL(); + +private: // Data + /** + * Pending request + */ + RMessage2 iMessage; + + /** + * Message id + */ + TUint32 iMsgId; + + /** + * Transaction id + */ + TUint32 iTrId; + + /** + * Operation status + */ + TInt iStatus; + + /** + * Data size + */ + TInt iDataSize; + + /** + * Data + */ + HBufC8* iData; + + }; + + +#endif // CCSRVAPI_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/ccsrvapi/src/ccsrvmsg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrvapi/src/ccsrvmsg.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,242 @@ +/* + * 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: + * + */ + +// System include files +#include +#include + +// User include files +#include "ccsrvapi.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C CCcSrvMsg* CCcSrvMsg::NewL() + { + CCcSrvMsg* self = new ( ELeave ) CCcSrvMsg(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------- +// CCcSrvMsg::ConstructL() +// ----------------------------------------------------------------------- +// +void CCcSrvMsg::ConstructL() + { + } + +// ----------------------------------------------------------------------- +// CCcSrvMsg::CCcSrvMsg() +// ----------------------------------------------------------------------- +// +CCcSrvMsg::CCcSrvMsg() + { + } + +// ----------------------------------------------------------------------- +// CCcSrvMsg::~CCcSrvMsg() +// ----------------------------------------------------------------------- +// +CCcSrvMsg::~CCcSrvMsg() + { + delete iData; + iData = NULL; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::MsgId() +// ----------------------------------------------------------------------------- +EXPORT_C RMessage2 CCcSrvMsg::Message() + { + return( iMessage ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetMsgId() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetMessage( RMessage2& aMessage ) + { + iMessage = aMessage; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::MsgId() +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCcSrvMsg::MsgId() + { + return( iMsgId ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetMsgId() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetMsgId( TUint32 aMsgId ) + { + iMsgId = aMsgId; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::TrId() +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 CCcSrvMsg::TrId() + { + return( iTrId ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetTrId() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetTrId( TUint32 aTrId ) + { + iTrId = aTrId; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::Status() +// ----------------------------------------------------------------------------- +EXPORT_C TInt CCcSrvMsg::Status() + { + return( iStatus ) ; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetStatus() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetStatus( TInt aStatus ) + { + iStatus = aStatus; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::Data() +// ----------------------------------------------------------------------------- +EXPORT_C TPtrC8 CCcSrvMsg::Data() + { + if ( iData ) + { + return iData->Des(); + } + else + { + return KNullDesC8(); + } + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::SetData() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::SetData( const TDesC8& aData ) + { + if ( iData ) + { + delete iData; + } + iData = aData.Alloc(); + iDataSize = iData->Des().Length(); + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::DataSize() +// ----------------------------------------------------------------------------- +EXPORT_C TInt CCcSrvMsg::DataSize() + { + return iDataSize; + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::ExternalizeL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::ExternalizeL( RWriteStream& aStream ) + { + ExternalizeHeaderL( aStream ); + if ( iData ) + { + aStream << *iData; + } + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::ExternalizeHeaderL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::ExternalizeHeaderL( RWriteStream& aStream ) + { + aStream.WriteUint32L( iMsgId ); + aStream.WriteUint32L( iTrId ); + aStream.WriteInt32L( iStatus ); + aStream.WriteInt32L( iDataSize ); + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::InternalizeL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::InternalizeL( RReadStream& aStream ) + { + InternalizeHeaderL( aStream ); + if ( iData ) + { + delete iData; + iData = NULL; + } + if ( iDataSize ) + { + iData = HBufC8::NewL( aStream, iDataSize ); + } + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::InternalizeHeaderL() +// ----------------------------------------------------------------------------- +EXPORT_C void CCcSrvMsg::InternalizeHeaderL( RReadStream& aStream ) + { + iMsgId = aStream.ReadUint32L(); + iTrId = aStream.ReadUint32L(); + iStatus = aStream.ReadInt32L(); + iDataSize = aStream.ReadInt32L(); + } + +// ----------------------------------------------------------------------------- +// CCcSrvMsg::MarshalL() +// ----------------------------------------------------------------------------- +EXPORT_C HBufC8* CCcSrvMsg::MarshalL() + { + // Externalize message + CBufFlat* reqBuf = CBufFlat::NewL( KCcHeaderSize + iDataSize ); + CleanupStack::PushL( reqBuf ); + RBufWriteStream reqStream( *reqBuf ); + CleanupClosePushL( reqStream ); + ExternalizeL( reqStream ); + CleanupStack::PopAndDestroy( &reqStream ); + + // Append externalized messgae to a descriptor + HBufC8* msgDesc = HBufC8::NewL( reqBuf->Size() ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgDesc->Des() ); + reqBuf->Read( 0, msgPtr, reqBuf->Size() ); + CleanupStack::PopAndDestroy( reqBuf ); + + return msgDesc; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: Build information file for homescreencontentcontrolsrv +* +*/ + +#include + +#include "../ccsrv/group/bld.inf" +#include "../ccsrvapi/group/bld.inf" +#include "../ccclientsession/group/bld.inf" +#include "../hsccclient/group/bld.inf" +#include "../hscontentinfo/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/ccsrv.iby CORE_MW_LAYER_IBY_EXPORT_PATH(ccsrv.iby) + +PRJ_MMPFILES + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +#include "../hsccproviderclient/group/bld.inf" +#include "../hsccapiclient/group/bld.inf" + +PRJ_PLATFORMS + +PRJ_EXPORTS +../inc/hsccapi.h MW_LAYER_PLATFORM_EXPORT_PATH(hsccapi.h) + +PRJ_MMPFILES + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/bwins/hsccapiclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/bwins/hsccapiclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CHsCcApiClient@@SAPAV1@PAVMHsContentControl@@@Z @ 1 NONAME ; class CHsCcApiClient * CHsCcApiClient::NewL(class MHsContentControl *) + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/eabi/hsccapiclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/eabi/hsccapiclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _ZN14CHsCcApiClient4NewLEP17MHsContentControl @ 1 NONAME + _ZTI14CHsCcApiClient @ 2 NONAME + _ZTV14CHsCcApiClient @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +PRJ_PLATFORMS + +PRJ_EXPORTS +../inc/hsccapiclient.h MW_LAYER_PLATFORM_EXPORT_PATH(hsccapiclient.h) + +PRJ_MMPFILES +hsccapiclient.mmp + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/group/hsccapiclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/group/hsccapiclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET hsccapiclient.dll +TARGETTYPE dll + +UID 0x1000008d 0x20026f55 + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hsccapiclient.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY hscontentinfo.lib +LIBRARY ccsrvapi.lib +LIBRARY ccclientsession.lib diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/inc/hsccapiclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/inc/hsccapiclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCCAPICLIENT_H +#define HSCCAPICLIENT_H + +// System includes +#include +#include + +// Forward declarations +#include "ccclientsession.h" +class MHsContentControl; + +/** + * Home screen content control server content control api client + * + * + * @code + * + * @endcode + * + * @lib hsccapiclient.lib + * @since S60 v5.0 + */ +class CHsCcApiClient : public CActive, public MHsContentController + { +public: // Constructor and destructor + + /** + * Two-phased constructor. + * @param aControlIf Content control observer interface + */ + IMPORT_C static CHsCcApiClient* NewL( + MHsContentControl* aControlIf ); + + /** + * Destructor + */ + ~CHsCcApiClient(); + +private: // Constructors and destructor + + /** + * Constructor + * @param aControlIf Content control observer interface + */ + CHsCcApiClient( + MHsContentControl* aControlIf ); + + /** + * Second phase constructor + */ + void ConstructL(); + +private: // From CActive + /** + * + */ + void RunL(); + + /** + * + */ + void DoCancel(); + +public: // From MHsContentController + /** + * + */ + TInt WidgetListL( CHsContentInfoArray& aArray ); + + /** + * + */ + TInt ViewListL( CHsContentInfoArray& aArray ); + + /** + * + */ + TInt AppListL( CHsContentInfoArray& aArray ); + + /** + * + */ + TInt AddWidgetL( CHsContentInfo& aInfo ); + + /** + * + */ + TInt RemoveWidgetL( CHsContentInfo& aInfo ); + + /** + * + */ + TInt AddViewL( CHsContentInfo& aInfo ); + + /** + * + */ + TInt RemoveViewL( CHsContentInfo& aInfo ); + + /** + * + */ + TInt ActivateViewL( CHsContentInfo& aInfo ); + + /** + * + */ + TInt ActivateAppL( CHsContentInfo& aInfo ); + +private: // Functions + /** + * + */ + void WaitForApiNtfL(); + +private: // Data + /** + * Session to Homescreen content control server + */ + RCcClientSession iSession; + + /** + * Home screen content control API observer + */ + MHsContentControl* iObserver; + + /** + * Registered address + */ + TUint32 iAddress; + + /** + * Sender of Api request + */ + TPckgBuf iPckgSender; + + /** + * receiver of Api request + */ + TPckgBuf iPckgReceiver; + + /** + * Received API request header buffer + */ + HBufC8* iApiHeader; + + /** + * Pointer to header buffer + */ + TPtr8 iApiHeaderPtr; + + /** + * Received API request data buffer + */ + HBufC8* iApiData; + + /** + * Pointer to data buffer + */ + TPtr8 iApiDataPtr; + + }; + + +#endif // HSCCAPICLIENT_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccapiclient/src/hsccapiclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccapiclient/src/hsccapiclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,739 @@ +/* + * 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: + * + */ + +// System include files +#include +#include +#include +#include +#include + +// User include files +#include "hsccapiclient.h" +#include "ccresource.h" +#include "ccsrvapi.h" +#include "hsccapi.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C CHsCcApiClient* CHsCcApiClient::NewL( + MHsContentControl* aControlIf ) + { + CHsCcApiClient* self = new ( ELeave ) CHsCcApiClient( aControlIf ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------- +// CHsCcApiClient::ConstructL() +// ----------------------------------------------------------------------- +// +void CHsCcApiClient::ConstructL() + { + User::LeaveIfError( iSession.Connect() ); + + if ( iObserver ) + { + TPckgBuf provider( ECcHomescreen ); + TPckgBuf address; + User::LeaveIfError( iSession.RegisterObserver( + provider, + address ) ); + iAddress = address(); + + WaitForApiNtfL(); + } + } + +// ----------------------------------------------------------------------- +// CHsCcApiClient::CHsCcApiClient() +// ----------------------------------------------------------------------- +// +CHsCcApiClient::CHsCcApiClient( + MHsContentControl* aControlIf ) + :CActive( EPriorityStandard ) + ,iObserver( aControlIf ) + ,iAddress( 0 ) + ,iApiHeader( NULL ) + ,iApiHeaderPtr( NULL, 0 ) + ,iApiData( NULL ) + ,iApiDataPtr( NULL, 0 ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------- +// CHsCcApiClient::~CHsCcApiClient() +// ----------------------------------------------------------------------- +// +CHsCcApiClient::~CHsCcApiClient() + { + Cancel(); + iSession.Close(); + delete iApiHeader; + delete iApiData; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::RunL() +// ----------------------------------------------------------------------------- +// +void CHsCcApiClient::RunL() + { + if ( !iStatus.Int() ) + { + // Get received message header + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + RDesReadStream stream( iApiHeaderPtr ); + CleanupClosePushL( stream ); + message->InternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + + switch ( message->MsgId() ) + { + case EHsCcWidgetListChangedNtf: + if ( iObserver ) + { + iObserver->NotifyWidgetListChanged(); + } + break; + case EHsCcViewListChangedNtf: + if ( iObserver ) + { + iObserver->NotifyViewListChanged(); + } + break; + case EHsCcAppListChangedNtf: + if ( iObserver ) + { + iObserver->NotifyAppListChanged(); + } + break; + default: + // No action required + break; + } + CleanupStack::PopAndDestroy( message ); + } + + // Receive next API notification + WaitForApiNtfL(); + + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::DoCancel() +// ----------------------------------------------------------------------------- +// +void CHsCcApiClient::DoCancel() + { + if ( IsActive() ) + { + TPckgBuf function( ECcWaitForApiNtf ); + iSession.CancelReq( function ); + } + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::WidgetListL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::WidgetListL( CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + // Create WidgetListReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcWidgetListReq ); + reqMsg->SetTrId( 0 ); + reqMsg->SetData( KNullDesC8() ); + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize WidgetListResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + if ( !err ) + { + if ( respMsg->DataSize() ) + { + // Get API response data + HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( respMsg->TrId() ); + err = iSession.GetMsgData( trId, dataPtr ); + if ( !err ) + { + // Internalize API response data + RDesReadStream dataStream( dataPtr ); + CleanupClosePushL( dataStream ); + aArray.InternalizeL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + } + CleanupStack::PopAndDestroy( dataBuf ); + } + } + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::ViewListL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::ViewListL( CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + // Create ViewListReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcViewListReq ); + reqMsg->SetTrId( 0 ); + reqMsg->SetData( KNullDesC8() ); + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize ViewListResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + if ( !err ) + { + if ( respMsg->DataSize() ) + { + // Get API response data + HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( respMsg->TrId() ); + err = iSession.GetMsgData( trId, dataPtr ); + if ( !err ) + { + // Internalize API response data + RDesReadStream dataStream( dataPtr ); + CleanupClosePushL( dataStream ); + aArray.InternalizeL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + } + CleanupStack::PopAndDestroy( dataBuf ); + } + } + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::AppListL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::AppListL( CHsContentInfoArray& aArray ) + { + TInt err( KErrNone ); + + // Create AppListReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcAppListReq ); + reqMsg->SetTrId( 0 ); + reqMsg->SetData( KNullDesC8() ); + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize AppListResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + if ( !err ) + { + if ( respMsg->DataSize() ) + { + // Get API response data + HBufC8* dataBuf = HBufC8::NewL( respMsg->DataSize() ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( respMsg->TrId() ); + err = iSession.GetMsgData( trId, dataPtr ); + if ( !err ) + { + // Internalize API response data + RDesReadStream dataStream( dataPtr ); + CleanupClosePushL( dataStream ); + aArray.InternalizeL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + } + CleanupStack::PopAndDestroy( dataBuf ); + } + } + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::AddWidgetL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::AddWidgetL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create AddWidgetReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcAddWidgetReq ); + reqMsg->SetTrId( 0 ); + + // Marshal AddWidgetReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize AddWidgetResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::RemoveWidgetL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::RemoveWidgetL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create RemoveWidgetReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcRemoveWidgetReq ); + reqMsg->SetTrId( 0 ); + + // Marshal RemoveWidgetReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize RemoveWidgetResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::AddViewL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::AddViewL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create AddViewReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcAddViewReq ); + reqMsg->SetTrId( 0 ); + + // Marshal AddViewReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize AddViewResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::RemoveViewL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::RemoveViewL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create RemoveViewReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcRemoveViewReq ); + reqMsg->SetTrId( 0 ); + + // Marshal RemoveViewReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize RemoveViewResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::ActivateViewL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::ActivateViewL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create ActivateViewReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcActivateViewReq ); + reqMsg->SetTrId( 0 ); + + // Marshal ActivateViewReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize ActivateViewResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::ActivateAppL +// ----------------------------------------------------------------------------- +// +TInt CHsCcApiClient::ActivateAppL( CHsContentInfo& aInfo ) + { + TInt err( KErrNone ); + + // Create ActivateAppReq API request + CCcSrvMsg* reqMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( reqMsg ); + reqMsg->SetMsgId( EHsCcActivateAppReq ); + reqMsg->SetTrId( 0 ); + + // Marshal ActivateAppReq data to a descriptor + HBufC8* dataBuf = aInfo.MarshalL(); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + reqMsg->SetData( dataPtr ); + + delete dataBuf; + dataBuf = NULL; + + // Marshal API request + HBufC8* msgBuf = reqMsg->MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + // Send API request + // Sender and receiver address not defined -> message is routed + // according to the provider id + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender; + TPckgBuf receiver; + err = iSession.Send( ECcApiReq, provider, sender, receiver, msgPtr ); + + if ( !err ) + { + // Internalize ActivateAppResp API response + CCcSrvMsg* respMsg = CCcSrvMsg::NewL(); + CleanupStack::PushL( respMsg ); + RDesReadStream respStream( msgPtr ); + CleanupClosePushL( respStream ); + respMsg->InternalizeHeaderL( respStream ); + CleanupStack::PopAndDestroy( &respStream ); + err = respMsg->Status(); + CleanupStack::PopAndDestroy( respMsg ); + } + + // Cleanup + CleanupStack::PopAndDestroy( msgBuf ); + CleanupStack::PopAndDestroy( reqMsg ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsCcApiClient::WaitForApiNtfL() +// ----------------------------------------------------------------------------- +// +void CHsCcApiClient::WaitForApiNtfL() + { + + if ( iApiHeader ) + { + delete iApiHeader; + iApiHeader = NULL; + } + iApiHeader = HBufC8::NewL( KCcHeaderSize ); + iApiHeaderPtr.Set( iApiHeader->Des() ); + + TPckgBuf provider( ECcHomescreen ); + iPckgSender = 0; + iPckgReceiver = 0; + + iSession.WaitForApiNtf( provider, iPckgSender, iPckgReceiver, iApiHeaderPtr, iStatus ); + SetActive(); + + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/bwins/hsccproviderclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/bwins/hsccproviderclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CHsCcProviderClient@@SAPAV1@AAVMHsContentController@@@Z @ 1 NONAME ; class CHsCcProviderClient * CHsCcProviderClient::NewL(class MHsContentController &) + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/eabi/hsccproviderclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/eabi/hsccproviderclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _ZN19CHsCcProviderClient4NewLER20MHsContentController @ 1 NONAME + _ZTI19CHsCcProviderClient @ 2 NONAME + _ZTV19CHsCcProviderClient @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +PRJ_PLATFORMS + +PRJ_EXPORTS +../inc/hsccproviderclient.h MW_LAYER_PLATFORM_EXPORT_PATH(hsccproviderclient.h) + +PRJ_MMPFILES +hsccproviderclient.mmp + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/group/hsccproviderclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/group/hsccproviderclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +TARGET hsccproviderclient.dll +TARGETTYPE dll + +UID 0x1000008d 0x20026f54 + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hsccproviderclient.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY ccsrvapi.lib +LIBRARY ccclientsession.lib +LIBRARY hscontentinfo.lib diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/inc/hsccproviderclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/inc/hsccproviderclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,245 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCCPROVIDERCLIENT_H +#define HSCCPROVIDERCLIENT_H + +// System includes +#include +#include + +// Forward declarations +#include "ccclientsession.h" +class MHsContentController; +class CCcSrvMsg; + +/** + * Home screen content control server content provider client + * + * + * @code + * + * @endcode + * + * @lib hsccsrv.lib + * @since S60 v5.0 + */ +class CHsCcProviderClient : public CActive, public MHsContentControl + { +public: // Constructor and destructor + + /** + * Two-phased constructor. + * @param aController Controller interface + */ + IMPORT_C static CHsCcProviderClient* NewL( + MHsContentController& aController ); + + /** + * Destructor + */ + ~CHsCcProviderClient(); + +private: // Constructors and destructor + + /** + * Constructor + */ + CHsCcProviderClient( + MHsContentController& aController ); + + + /** + * Second phase constructor + */ + void ConstructL(); + +private: // From CActive + /** + * + */ + void RunL(); + + /** + * + */ + void DoCancel(); + +public: // From MHsContentControl + + /** + * + */ + void NotifyWidgetListChanged(); + + /** + * + */ + void NotifyViewListChanged(); + + /** + * + */ + void NotifyAppListChanged(); + +private: // Functions + /** + * + */ + void WaitForApiReqL(); + + /** + * + */ + void HandleWidgetListReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleRegisterObserverNtfL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleUnregisterObserverNtfL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleAddWidgetReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleRemoveWidgetReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleViewListReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleAddViewReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleRemoveViewReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleActivateViewReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleAppListReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleActivateAppReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void HandleNotSupportedReqL( + CCcSrvMsg& aMessage ); + + /** + * + */ + void SendNtfL( + TUint32 aNtf ); + + /** + * + */ + void SendRespL( + CCcSrvMsg& aMessage ); + +private: // Data + /** + * Session to Homescreen content control server + */ + RCcClientSession iSession; + + /** + * Homescreen content controller interface + */ + MHsContentController& iController; + + /** + * Registered address + */ + TUint32 iAddress; + + /** + * Sender of Api request + */ + TPckgBuf iPckgSender; + + /** + * receiver of Api request + */ + TPckgBuf iPckgReceiver; + + /** + * Received API request header buffer + */ + HBufC8* iApiHeader; + + /** + * Pointer to header buffer + */ + TPtr8 iApiHeaderPtr; + + /** + * Received API request data buffer + */ + HBufC8* iApiData; + + /** + * Pointer to data buffer + */ + TPtr8 iApiDataPtr; + + /** + * Observers + */ + RArray iObservers; + + }; + + +#endif // HSCCPROVIDERCLIENT_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,696 @@ +/* + * 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: + * + */ + +// System include files +#include +#include +#include +#include +#include + +// User include files +#include "hsccproviderclient.h" +#include "ccresource.h" +#include "ccsrvapi.h" +#include "hsccapi.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C CHsCcProviderClient* CHsCcProviderClient::NewL( + MHsContentController& aController ) + { + CHsCcProviderClient* self = new ( ELeave ) CHsCcProviderClient( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------- +// CHsCcProviderClient::ConstructL() +// ----------------------------------------------------------------------- +// +void CHsCcProviderClient::ConstructL() + { + User::LeaveIfError( iSession.Connect() ); + + TPckgBuf provider( ECcHomescreen ); + TPckgBuf address; + User::LeaveIfError( iSession.RegisterProvider( + provider, + address ) ); + iAddress = address(); + + WaitForApiReqL(); + + } + +// ----------------------------------------------------------------------- +// CHsCcProviderClient::CHsCcProviderClient() +// ----------------------------------------------------------------------- +// +CHsCcProviderClient::CHsCcProviderClient( + MHsContentController& aController ) + :CActive( EPriorityStandard ) + ,iController( aController ) + ,iAddress( 0 ) + ,iApiHeader( NULL ) + ,iApiHeaderPtr( NULL, 0 ) + ,iApiData( NULL ) + ,iApiDataPtr( NULL, 0 ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------- +// CHsCcProviderClient::~CHsCcProviderClient() +// ----------------------------------------------------------------------- +// + CHsCcProviderClient::~CHsCcProviderClient() + { + Cancel(); + iSession.Close(); + delete iApiHeader; + delete iApiData; + iObservers.Close(); + } + +// ----------------------------------------------------------------------------- +// CHsCcClient::RunL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::RunL() + { + + if ( !iStatus.Int() ) + { + // Get received message header + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + RDesReadStream stream( iApiHeaderPtr ); + CleanupClosePushL( stream ); + message->InternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + if ( message->DataSize() ) + { + // Get message data + HBufC8* dataBuf = HBufC8::NewL( message->DataSize() ); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + TPckgBuf trId( message->TrId() ); + iSession.GetMsgData( trId, dataPtr ); + message->SetData( dataPtr ); + CleanupStack::PopAndDestroy( dataBuf ); + } + + switch ( message->MsgId() ) + { + case ECcRegisterObserverNtf: + HandleRegisterObserverNtfL( *message ); + break; + case ECcUnregisterObserverNtf: + HandleUnregisterObserverNtfL( *message ); + break; + case EHsCcWidgetListReq: + HandleWidgetListReqL( *message ); + break; + case EHsCcAddWidgetReq: + HandleAddWidgetReqL( *message ); + break; + case EHsCcRemoveWidgetReq: + HandleRemoveWidgetReqL( *message ); + break; + case EHsCcViewListReq: + HandleViewListReqL( *message ); + break; + case EHsCcAddViewReq: + HandleAddViewReqL( *message ); + break; + case EHsCcRemoveViewReq: + HandleRemoveViewReqL( *message ); + break; + case EHsCcActivateViewReq: + HandleActivateViewReqL( *message ); + break; + case EHsCcAppListReq: + HandleAppListReqL( *message ); + break; + case EHsCcActivateAppReq: + HandleActivateAppReqL( *message ); + break; + default: + HandleNotSupportedReqL( *message ); + break; + } + CleanupStack::PopAndDestroy( message ); + } + + // Receive next API request + WaitForApiReqL(); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::DoCancel() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::DoCancel() + { + if ( IsActive() ) + { + TPckgBuf function( ECcWaitForApiReq ); + iSession.CancelReq( function ); + } + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::NotifyWidgetListChanged() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::NotifyWidgetListChanged() + { + if ( iObservers.Count() ) + { + TRAP_IGNORE( SendNtfL( EHsCcWidgetListChangedNtf ) ); + } + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::NotifyViewListChanged() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::NotifyViewListChanged() + { + if ( iObservers.Count() ) + { + TRAP_IGNORE( SendNtfL( EHsCcViewListChangedNtf ) ); + } + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::NotifyAppListChanged() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::NotifyAppListChanged() + { + if ( iObservers.Count() ) + { + TRAP_IGNORE( SendNtfL( EHsCcAppListChangedNtf ) ); + } + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::WaitForApiReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::WaitForApiReqL() + { + + if ( iApiHeader ) + { + delete iApiHeader; + iApiHeader = NULL; + } + iApiHeader = HBufC8::NewL( KCcHeaderSize ); + iApiHeaderPtr.Set( iApiHeader->Des() ); + + TPckgBuf provider( ECcHomescreen ); + iPckgSender = 0; + iPckgReceiver = 0; + + iSession.WaitForApiReq( provider, iPckgSender, iPckgReceiver, iApiHeaderPtr, iStatus ); + SetActive(); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleRegisterObserverNtfL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleRegisterObserverNtfL( + CCcSrvMsg& /* aMessage */ ) + { + TUint32 observer = iPckgSender(); + iObservers.AppendL( observer ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleUnregisterObserverNtfL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleUnregisterObserverNtfL( + CCcSrvMsg& /* aMessage */ ) + { + TUint32 observer = iPckgSender(); + for ( TInt i = 0; i < iObservers.Count(); i++ ) + { + if ( iObservers[ i ] == observer ) + { + iObservers.Remove( i ); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleWidgetListReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleWidgetListReqL( + CCcSrvMsg& aMessage ) + { + // Get widget list + CHsContentInfoArray* widgets = CHsContentInfoArray::NewL(); + CleanupStack::PushL( widgets ); + TInt err = iController.WidgetListL( *widgets ); + + // Create and send WidgetListResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcWidgetListResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + + if ( !err ) + { + // Externalize widget list + HBufC8* dataBuf = widgets->MarshalL(); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + message->SetData( dataPtr ); + CleanupStack::PopAndDestroy( dataBuf ); + } + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( widgets ); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleAddWidgetReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleAddWidgetReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Add widget + err = iController.AddWidgetL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send AddWidgetResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcAddWidgetResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleRemoveWidgetReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleRemoveWidgetReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Remove widget + err = iController.RemoveWidgetL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send RemoveWidgetResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcRemoveWidgetResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleViewListReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleViewListReqL( + CCcSrvMsg& aMessage ) + { + // Get view list + CHsContentInfoArray* views = CHsContentInfoArray::NewL(); + CleanupStack::PushL( views ); + TInt err = iController.ViewListL( *views ); + + // Create and send ViewListResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcViewListResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + + if ( !err ) + { + // Externalize view list + HBufC8* dataBuf = views->MarshalL(); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + message->SetData( dataPtr ); + CleanupStack::PopAndDestroy( dataBuf ); + } + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( views ); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleAddViewReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleAddViewReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Add view + err = iController.AddViewL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send AddViewResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcAddViewResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleRemoveViewReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleRemoveViewReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Remove view + err = iController.RemoveViewL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send RemoveViewResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcRemoveViewResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleActivateViewReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleActivateViewReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Activate view + err = iController.ActivateViewL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send ActivateViewResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcActivateViewResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleAppListReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleAppListReqL( + CCcSrvMsg& aMessage ) + { + // Get app list + CHsContentInfoArray* apps = CHsContentInfoArray::NewL(); + CleanupStack::PushL( apps ); + TInt err = iController.AppListL( *apps ); + + // Create and send AppListResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcAppListResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + if ( !err ) + { + // Externalize app list + HBufC8* dataBuf = apps->MarshalL(); + CleanupStack::PushL( dataBuf ); + TPtr8 dataPtr( NULL, 0 ); + dataPtr.Set( dataBuf->Des() ); + message->SetData( dataPtr ); + CleanupStack::PopAndDestroy( dataBuf ); + } + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( apps ); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleActivateAppReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleActivateAppReqL( + CCcSrvMsg& aMessage ) + { + TInt err( KErrNone ); + if ( aMessage.DataSize() ) + { + // Internalize message data + RDesReadStream dataStream( aMessage.Data() ); + CleanupClosePushL( dataStream ); + CHsContentInfo* info = CHsContentInfo::NewL( dataStream ); + CleanupStack::PopAndDestroy( &dataStream ); + CleanupStack::PushL( info ); + + // Activate view + err = iController.ActivateAppL( *info ); + + CleanupStack::PopAndDestroy( info ); + } + else + { + // Mandatory message data missing + err = KErrArgument; + } + + // Create and send ActivateAppResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcActivateAppResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( err ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::HandleNotSupportedReqL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::HandleNotSupportedReqL( + CCcSrvMsg& aMessage ) + { + // Create and send NotSupportedResp + CCcSrvMsg* message = CCcSrvMsg::NewL(); + CleanupStack::PushL( message ); + message->SetMsgId( EHsCcNotSupportedResp ); + message->SetTrId( aMessage.TrId() ); + message->SetStatus( KErrNone ); + message->SetData( KNullDesC8() ); + + SendRespL( *message ); + + CleanupStack::PopAndDestroy( message ); + + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::SendNtfL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::SendNtfL( + TUint32 aNtf ) + { + // Notify registered observers + CCcSrvMsg* ntf = CCcSrvMsg::NewL(); + CleanupStack::PushL( ntf ); + ntf->SetMsgId( aNtf ); + HBufC8* ntfBuf = ntf->MarshalL(); + CleanupStack::PushL( ntfBuf ); + TPtr8 ntfPtr( NULL, 0 ); + ntfPtr.Set( ntfBuf->Des() ); + + TPckgBuf provider( ECcHomescreen ); + TPckgBuf sender( iAddress ); + TPckgBuf receiver( 0 ); + iSession.Send( ECcApiNtf, provider, sender, receiver, ntfPtr ); + + CleanupStack::PopAndDestroy( ntfBuf ); + CleanupStack::PopAndDestroy( ntf ); + } + +// ----------------------------------------------------------------------------- +// CHsCcProviderClient::SendRespL() +// ----------------------------------------------------------------------------- +// +void CHsCcProviderClient::SendRespL( + CCcSrvMsg& aMessage ) + { + HBufC8* msgBuf = aMessage.MarshalL(); + CleanupStack::PushL( msgBuf ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgBuf->Des() ); + + TPckgBuf provider( ECcHomescreen ); + iSession.Send( ECcApiResp, provider, iPckgReceiver, iPckgSender, msgPtr ); + + CleanupStack::PopAndDestroy( msgBuf ); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hsccclient/inc/hsccapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hsccclient/inc/hsccapi.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,297 @@ +/* +* 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: Homescreen content control server API definitions +* +*/ + +#ifndef HSCCAPI_H +#define HSCCAPI_H + +// System includes +#include +#include +// Forward declarations + +// Constants + +// ---------------------------------------------------------------------------- +// Home screen cotent control server messages +// ---------------------------------------------------------------------------- +enum THsCcSrvMessages + { +// ---------------------------------------------------------------------------- +// WidgetListChangedNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This notification is used to inform api observer of changed widget list +// +// Message parameters: +// - Message id: EHsCcWidgetListChangedNtf +// - Transaction id: None +// - Message data: None + EHsCcWidgetListChangedNtf = ECcProviderMessageBase, +// ---------------------------------------------------------------------------- +// ViewListChangedNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This notification is used to inform api observer of changed view list +// +// Message parameters: +// - Message id: EHsCcViewListChangedNtf +// - Transaction id: None +// - Message data: None + EHsCcViewListChangedNtf, +// ---------------------------------------------------------------------------- +// AppListChangedNtf +// ---------------------------------------------------------------------------- +// Purpose: +// This notification is used to inform api observer of changed application list +// +// Message parameters: +// - Message id: EHsCcAppListChangedNtf +// - Transaction id: None +// - Message data: None + EHsCcAppListChangedNtf, +// ---------------------------------------------------------------------------- +// WidgetListReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to get a list of installed Home screen widgets +// +// Message parameters: +// - Message id: EHsCcWidgetListReq +// - Transaction id: Unique transaction id +// - Message data: None + EHsCcWidgetListReq, +// ---------------------------------------------------------------------------- +// WidgetListResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the list of installed widgets +// +// Message parameters: +// - Message id: EHsCcWidgetListResp +// - Transaction id: Transaction id from corresponding WidgetListReq +// - Status: Operation status (Symbian error code) +// - Message data: Successful operation: CHsContentInfoArray instance +// containing installed widgets +// Failed operation: None + EHsCcWidgetListResp, +// ---------------------------------------------------------------------------- +// AddWidgetReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to add a widget to Home screen +// +// Message parameters: +// - Message id: EHsCcAddWidgetReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the added widget + EHsCcAddWidgetReq, +// ---------------------------------------------------------------------------- +// AddWidgetResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of adding widget +// +// Message parameters: +// - Message id: EHsCcAddWidgetResp +// - Transaction id: Transaction id from corresponding AddWidgetReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcAddWidgetResp, +// ---------------------------------------------------------------------------- +// RemoveWidgetReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to remove a widget from Home screen +// +// Message parameters: +// - Message id: EHsCcRemoveWidgetReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the removed widget + EHsCcRemoveWidgetReq, +// ---------------------------------------------------------------------------- +// RemoveWidgetResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of removing widget +// +// Message parameters: +// - Message id: EHsCcRemoveWidgetResp +// - Transaction id: Transaction id from corresponding RemoveWidgetReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcRemoveWidgetResp, +// ---------------------------------------------------------------------------- +// ViewListReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to get a list of installed Home screen views +// +// Message parameters: +// - Message id: EHsCcViewListReq +// - Transaction id: Unique transaction id +// - Message data: None + EHsCcViewListReq, +// ---------------------------------------------------------------------------- +// ViewListResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the list of installed views +// +// Message parameters: +// - Message id: EHsCcViewListResp +// - Transaction id: Transaction id from corresponding ViewListReq +// - Status: Operation status (Symbian error code) +// - Message data: Successful operation: CHsContentInfoArray instance +// containing installed views +// Failed operation: None + EHsCcViewListResp, +// ---------------------------------------------------------------------------- +// AddViewReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to add a view to Home screen +// +// Message parameters: +// - Message id: EHsCcAddViewReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the added view + EHsCcAddViewReq, +// ---------------------------------------------------------------------------- +// AddViewResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of adding view +// +// Message parameters: +// - Message id: EHsCcAddViewResp +// - Transaction id: Transaction id from corresponding AddViewReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcAddViewResp, +// ---------------------------------------------------------------------------- +// RemoveViewReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to remove a view from Home screen +// +// Message parameters: +// - Message id: EHsCcRemoveViewReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the removed view + EHsCcRemoveViewReq, +// ---------------------------------------------------------------------------- +// RemoveViewResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of removing view +// +// Message parameters: +// - Message id: EHsCcRemoveViewResp +// - Transaction id: Transaction id from corresponding RemoveViewReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcRemoveViewResp, +// ---------------------------------------------------------------------------- +// ActivateViewReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to activate a Home screen view +// +// Message parameters: +// - Message id: EHsCcActivateViewReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the activated view + EHsCcActivateViewReq, +// ---------------------------------------------------------------------------- +// ActivateViewResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of activating view +// +// Message parameters: +// - Message id: EHsCcActivateViewResp +// - Transaction id: Transaction id from corresponding ActivateViewReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcActivateViewResp, +// ---------------------------------------------------------------------------- +// AppListReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to get a list of installed Home screen application +// configurations +// +// Message parameters: +// - Message id: EHsCcAppListReq +// - Transaction id: Unique transaction id +// - Message data: None + EHsCcAppListReq, +// ---------------------------------------------------------------------------- +// AppListResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the list of installed application configurations +// +// Message parameters: +// - Message id: EHsCcAppListResp +// - Transaction id: Transaction id from corresponding AppListReq +// - Status: Operation status (Symbian error code) +// - Message data: Successful operation: CHsContentInfoArray instance +// containing installed application configurations +// Failed operation: None + EHsCcAppListResp, +// ---------------------------------------------------------------------------- +// ActivateAppReq +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to activate a Home screen application configuration +// +// Message parameters: +// - Message id: EHsCcActivateAppReq +// - Transaction id: Unique transaction id +// - Message data: CHsContentInfo instance defining the activated application +// configuration + EHsCcActivateAppReq, +// ---------------------------------------------------------------------------- +// ActivateAppResp +// ---------------------------------------------------------------------------- +// Purpose: +// This response contains the status of activating application configuration +// +// Message parameters: +// - Message id: EHsCcActivateAppResp +// - Transaction id: Transaction id from corresponding ActivateAppReq +// - Status: Operation status (Symbian error code) +// - Message data: None + EHsCcActivateAppResp, +// ---------------------------------------------------------------------------- +// NotSupportedResp +// ---------------------------------------------------------------------------- +// Purpose: +// This request is used to get a list of installed Home screen widgets +// +// Message parameters: +// - Message id: EHsCcNotSupportedResp +// - Transaction id: Transaction id from corresponding not supported request +// - Status: Operation status KErrNotSupported +// - Message data: None + EHsCcNotSupportedResp + }; + +#endif // HSCCAPI_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/bwins/hscontentinfo.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +EXPORTS + ?MarshalL@CHsContentInfo@@QAEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * CHsContentInfo::MarshalL(void) + ?CanBeAdded@CHsContentInfo@@QBEHXZ @ 2 NONAME ; int CHsContentInfo::CanBeAdded(void) const + ?SetDescriptionL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CHsContentInfo::SetDescriptionL(class TDesC16 const &) + ?IconPath@CHsContentInfo@@QBEABVTDesC16@@XZ @ 4 NONAME ; class TDesC16 const & CHsContentInfo::IconPath(void) const + ?SetPluginIdL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 5 NONAME ; void CHsContentInfo::SetPluginIdL(class TDesC8 const &) + ?SetTypeL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 6 NONAME ; void CHsContentInfo::SetTypeL(class TDesC8 const &) + ?SetMaxWidgets@CHsContentInfo@@QAEXH@Z @ 7 NONAME ; void CHsContentInfo::SetMaxWidgets(int) + ?Array@CHsContentInfoArray@@QAEAAV?$RPointerArray@VCHsContentInfo@@@@XZ @ 8 NONAME ; class RPointerArray & CHsContentInfoArray::Array(void) + ?ExternalizeL@CHsContentInfo@@QAEXAAVRWriteStream@@@Z @ 9 NONAME ; void CHsContentInfo::ExternalizeL(class RWriteStream &) + ?Size@CHsContentInfo@@QAEHXZ @ 10 NONAME ; int CHsContentInfo::Size(void) + ?SetNameL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 11 NONAME ; void CHsContentInfo::SetNameL(class TDesC16 const &) + ?InternalizeL@CHsContentInfoArray@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void CHsContentInfoArray::InternalizeL(class RReadStream &) + ?Size@CHsContentInfoArray@@QAEHXZ @ 13 NONAME ; int CHsContentInfoArray::Size(void) + ?PublisherId@CHsContentInfo@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CHsContentInfo::PublisherId(void) const + ?SetInstallationTime@CHsContentInfo@@QAEXAAVTTime@@@Z @ 15 NONAME ; void CHsContentInfo::SetInstallationTime(class TTime &) + ?SetPublisherUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 16 NONAME ; void CHsContentInfo::SetPublisherUidL(class TDesC8 const &) + ?NewL@CHsContentInfoArray@@SAPAV1@XZ @ 17 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(void) + ?Name@CHsContentInfo@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & CHsContentInfo::Name(void) const + ?SetNameL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 19 NONAME ; void CHsContentInfo::SetNameL(class TDesC8 const &) + ?Type@CHsContentInfo@@QBEABVTDesC8@@XZ @ 20 NONAME ; class TDesC8 const & CHsContentInfo::Type(void) const + ?NewLC@CHsContentInfo@@SAPAV1@XZ @ 21 NONAME ; class CHsContentInfo * CHsContentInfo::NewLC(void) + ?InstallationTime@CHsContentInfo@@QBE?AVTTime@@XZ @ 22 NONAME ; class TTime CHsContentInfo::InstallationTime(void) const + ?NewL@CHsContentInfo@@SAPAV1@AAVRReadStream@@@Z @ 23 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(class RReadStream &) + ?CloneL@CHsContentInfo@@QAEPAV1@XZ @ 24 NONAME ; class CHsContentInfo * CHsContentInfo::CloneL(void) + ?SetCanBeAdded@CHsContentInfo@@QAEXH@Z @ 25 NONAME ; void CHsContentInfo::SetCanBeAdded(int) + ?ExternalizeL@CHsContentInfoArray@@QAEXAAVRWriteStream@@@Z @ 26 NONAME ; void CHsContentInfoArray::ExternalizeL(class RWriteStream &) + ?SetUidL@CHsContentInfo@@QAEXABVTDesC8@@@Z @ 27 NONAME ; void CHsContentInfo::SetUidL(class TDesC8 const &) + ?MaxWidgets@CHsContentInfo@@QBEHXZ @ 28 NONAME ; int CHsContentInfo::MaxWidgets(void) const + ?Uid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 29 NONAME ; class TDesC8 const & CHsContentInfo::Uid(void) const + ?MarshalL@CHsContentInfoArray@@QAEPAVHBufC8@@XZ @ 30 NONAME ; class HBufC8 * CHsContentInfoArray::MarshalL(void) + ?SetPublisherIdL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 31 NONAME ; void CHsContentInfo::SetPublisherIdL(class TDesC16 const &) + ?InternalizeL@CHsContentInfo@@QAEXAAVRReadStream@@@Z @ 32 NONAME ; void CHsContentInfo::InternalizeL(class RReadStream &) + ?CanBeRemoved@CHsContentInfo@@QBEHXZ @ 33 NONAME ; int CHsContentInfo::CanBeRemoved(void) const + ?SetCanBeRemoved@CHsContentInfo@@QAEXH@Z @ 34 NONAME ; void CHsContentInfo::SetCanBeRemoved(int) + ?SetIconPathL@CHsContentInfo@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void CHsContentInfo::SetIconPathL(class TDesC16 const &) + ?Description@CHsContentInfo@@QBEABVTDesC16@@XZ @ 36 NONAME ; class TDesC16 const & CHsContentInfo::Description(void) const + ?NewL@CHsContentInfo@@SAPAV1@XZ @ 37 NONAME ; class CHsContentInfo * CHsContentInfo::NewL(void) + ?PublisherUid@CHsContentInfo@@QBEABVTDesC8@@XZ @ 38 NONAME ; class TDesC8 const & CHsContentInfo::PublisherUid(void) const + ?NameAs8BitLC@CHsContentInfo@@QBEPAVHBufC8@@XZ @ 39 NONAME ; class HBufC8 * CHsContentInfo::NameAs8BitLC(void) const + ?PluginId@CHsContentInfo@@QBEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & CHsContentInfo::PluginId(void) const + ?NewL@CHsContentInfoArray@@SAPAV1@AAVRReadStream@@@Z @ 41 NONAME ; class CHsContentInfoArray * CHsContentInfoArray::NewL(class RReadStream &) + ?IsWrt@CHsContentInfo@@QBEHXZ @ 42 NONAME ; int CHsContentInfo::IsWrt(void) const + ?SetIsWrt@CHsContentInfo@@QAEXH@Z @ 43 NONAME ; void CHsContentInfo::SetIsWrt(int) + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/eabi/hscontentinfo.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +EXPORTS + _ZN14CHsContentInfo12ExternalizeLER12RWriteStream @ 1 NONAME + _ZN14CHsContentInfo12InternalizeLER11RReadStream @ 2 NONAME + _ZN14CHsContentInfo12SetIconPathLERK7TDesC16 @ 3 NONAME + _ZN14CHsContentInfo12SetPluginIdLERK6TDesC8 @ 4 NONAME + _ZN14CHsContentInfo13SetCanBeAddedEi @ 5 NONAME + _ZN14CHsContentInfo13SetMaxWidgetsEi @ 6 NONAME + _ZN14CHsContentInfo15SetCanBeRemovedEi @ 7 NONAME + _ZN14CHsContentInfo15SetDescriptionLERK7TDesC16 @ 8 NONAME + _ZN14CHsContentInfo15SetPublisherIdLERK7TDesC16 @ 9 NONAME + _ZN14CHsContentInfo16SetPublisherUidLERK6TDesC8 @ 10 NONAME + _ZN14CHsContentInfo19SetInstallationTimeER5TTime @ 11 NONAME + _ZN14CHsContentInfo4NewLER11RReadStream @ 12 NONAME + _ZN14CHsContentInfo4NewLEv @ 13 NONAME + _ZN14CHsContentInfo4SizeEv @ 14 NONAME + _ZN14CHsContentInfo5NewLCEv @ 15 NONAME + _ZN14CHsContentInfo6CloneLEv @ 16 NONAME + _ZN14CHsContentInfo7SetUidLERK6TDesC8 @ 17 NONAME + _ZN14CHsContentInfo8MarshalLEv @ 18 NONAME + _ZN14CHsContentInfo8SetNameLERK6TDesC8 @ 19 NONAME + _ZN14CHsContentInfo8SetNameLERK7TDesC16 @ 20 NONAME + _ZN14CHsContentInfo8SetTypeLERK6TDesC8 @ 21 NONAME + _ZN19CHsContentInfoArray12ExternalizeLER12RWriteStream @ 22 NONAME + _ZN19CHsContentInfoArray12InternalizeLER11RReadStream @ 23 NONAME + _ZN19CHsContentInfoArray4NewLER11RReadStream @ 24 NONAME + _ZN19CHsContentInfoArray4NewLEv @ 25 NONAME + _ZN19CHsContentInfoArray4SizeEv @ 26 NONAME + _ZN19CHsContentInfoArray5ArrayEv @ 27 NONAME + _ZN19CHsContentInfoArray8MarshalLEv @ 28 NONAME + _ZNK14CHsContentInfo10CanBeAddedEv @ 29 NONAME + _ZNK14CHsContentInfo10MaxWidgetsEv @ 30 NONAME + _ZNK14CHsContentInfo11DescriptionEv @ 31 NONAME + _ZNK14CHsContentInfo11PublisherIdEv @ 32 NONAME + _ZNK14CHsContentInfo12CanBeRemovedEv @ 33 NONAME + _ZNK14CHsContentInfo12NameAs8BitLCEv @ 34 NONAME + _ZNK14CHsContentInfo12PublisherUidEv @ 35 NONAME + _ZNK14CHsContentInfo16InstallationTimeEv @ 36 NONAME + _ZNK14CHsContentInfo3UidEv @ 37 NONAME + _ZNK14CHsContentInfo4NameEv @ 38 NONAME + _ZNK14CHsContentInfo4TypeEv @ 39 NONAME + _ZNK14CHsContentInfo8IconPathEv @ 40 NONAME + _ZNK14CHsContentInfo8PluginIdEv @ 41 NONAME + _ZTI19CHsContentInfoArray @ 42 NONAME + _ZTV19CHsContentInfoArray @ 43 NONAME + _ZN14CHsContentInfo8SetIsWrtEi @ 44 NONAME + _ZNK14CHsContentInfo5IsWrtEv @ 45 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Item id, name and properties +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +hscontentinfo.mmp diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/group/hscontentinfo.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/group/hscontentinfo.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: project file +* +*/ + +#include + +TARGET hscontentinfo.dll +TARGETTYPE dll + +UID 0x1000008d 0x200286de + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE hscontentinfo.cpp +SOURCE hscontentinfoarray.cpp + +//By default, the build tools look for the WINSCW def file in a BWINS directory +//(at the same level as the directory containing the mmp file), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/hscontentcontrol.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/hscontentcontrol.def +//#else +// DEFFILE ../eabi/hscontentcontrol.def +//#endif + +nostrictdef + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY charconv.lib + + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/src/hscontentinfo.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,583 @@ +/* + * 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: + * + */ + +// System include files +#include + +// User include files +#include "hscontentinfo.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------- +// CHsContentInfo::NewL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfo* CHsContentInfo::NewL() + { + CHsContentInfo* self = CHsContentInfo::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::NewL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfo* CHsContentInfo::NewL( RReadStream& aStream ) + { + CHsContentInfo* self = new ( ELeave ) CHsContentInfo(); + CleanupStack::PushL( self ); + self->InternalizeL( aStream ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::NewLC() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfo* CHsContentInfo::NewLC() + { + CHsContentInfo* self = new ( ELeave ) CHsContentInfo(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::CloneL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfo* CHsContentInfo::CloneL() + { + CHsContentInfo* clone = new ( ELeave ) CHsContentInfo(); + CleanupStack::PushL( clone ); + + clone->iName = Name().AllocL(); + clone->iUid = Uid().AllocL(); + clone->iPluginId = PluginId().AllocL(); + clone->iType = Type().AllocL(); + clone->iPublisherId = PublisherId().AllocL(); + clone->iDescription = Description().AllocL(); + clone->iIconPath = IconPath().AllocL(); + clone->iMaxInstance = iMaxInstance; + clone->iCanBeAdded = iCanBeAdded; + clone->iCanBeRemoved = iCanBeRemoved; + clone->iInstallationTime = iInstallationTime; + clone->iPublisherUid = PublisherUid().AllocL(); + clone->iIsWrt = iIsWrt; + + CleanupStack::Pop(); + return clone; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::ConstructL() +// ----------------------------------------------------------------------- +// +void CHsContentInfo::ConstructL() + { + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::CHsContentInfo() +// ----------------------------------------------------------------------- +// +CHsContentInfo::CHsContentInfo() + { + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::~CHsContentInfo() +// ----------------------------------------------------------------------- +// +CHsContentInfo::~CHsContentInfo() + { + delete iName; + delete iUid; + delete iPluginId; + delete iType; + delete iPublisherId; + delete iDescription; + delete iIconPath; + delete iPublisherUid; + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetNameL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = 0; + iName = CnvUtfConverter::ConvertToUnicodeFromUtf8L( aName ); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetNameL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetNameL( const TDesC& aName ) + { + delete iName; + iName = 0; + iName = aName.AllocL(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetPublisherIdL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetPublisherIdL( + const TDesC& aPublisherId ) + { + delete iPublisherId; + iPublisherId = 0; + iPublisherId = aPublisherId.AllocL(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetUidL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetUidL( const TDesC8& aUid ) + { + delete iUid; + iUid = 0; + iUid = aUid.AllocL(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetPluginIdL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetPluginIdL( const TDesC8& aId ) + { + delete iPluginId; + iPluginId = 0; + iPluginId = aId.AllocL(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::SetTypeL +// --------------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetTypeL( const TDesC8& aType ) + { + delete iType; + iType = 0; + iType = aType.AllocL(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::Name +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHsContentInfo::Name()const + { + return ( iName ) ? *iName : KNullDesC(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::PublisherId +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHsContentInfo::PublisherId()const + { + return ( iPublisherId ) ? *iPublisherId : KNullDesC(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::Uid +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHsContentInfo::Uid()const + { + return ( iUid ) ? *iUid : KNullDesC8(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::NameAs8BitLC +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CHsContentInfo::NameAs8BitLC()const + { + HBufC8* ret( CnvUtfConverter::ConvertFromUnicodeToUtf8L( Name() ) ); + CleanupStack::PushL( ret ); + + return ret; + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::PluginId +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHsContentInfo::PluginId()const + { + return ( iPluginId ) ? *iPluginId : KNullDesC8(); + } + +// --------------------------------------------------------------------------- +// CHsContentInfo::Type +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHsContentInfo::Type()const + { + return ( iType ) ? *iType : KNullDesC8(); + } + +// ----------------------------------------------------------------------- +// CPublisherInfo::SetMaxWidgets() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetMaxWidgets( TInt aMaxWidget ) + { + iMaxInstance = aMaxWidget; + } + +// ----------------------------------------------------------------------- +// CPublisherInfo::MaxWidgets() +// ----------------------------------------------------------------------- +// +EXPORT_C TInt CHsContentInfo::MaxWidgets() const + { + return iMaxInstance; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::ExternalizeL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::ExternalizeL( RWriteStream& aStream ) + { + // Keep this externalize routine in-sync with header file's members + + // externalize iName + aStream.WriteInt16L( Name().Size() ); + aStream << Name(); + + // externalize iUid + aStream.WriteInt16L( Uid().Size() ); + aStream << Uid(); + + // externalize iPluginId; + aStream.WriteInt16L( PluginId().Size() ); + aStream << PluginId(); + + // externalize iType; + aStream.WriteInt16L( Type().Size() ); + aStream << Type(); + + // externalize iPublisherId; + aStream.WriteInt16L( PublisherId().Size() ); + aStream << PublisherId(); + + // externalize iDescription; + aStream.WriteInt16L( Description().Size() ); + aStream << Description(); + + // externalize iIconPath; + aStream.WriteInt16L( IconPath().Size() ); + aStream << IconPath(); + + // externalize iMaxInstance + aStream.WriteInt16L( iMaxInstance ); + // externalize iCanBeAdded + aStream.WriteInt16L( iCanBeAdded ); + // externalize iCanBeRemoved + aStream.WriteInt16L( iCanBeRemoved ); + + TInt64 time( iInstallationTime.Int64() ); + + TUint32 low( I64LOW( time ) ); + TUint32 high( I64HIGH( time ) ); + + // externalize iInstallationTime + aStream.WriteUint32L( low ); + aStream.WriteUint32L( high ); + + // externalize iPublisherUid + aStream.WriteInt16L( PublisherUid().Size() ); + aStream << PublisherUid(); + + // externalise iIsWrt + aStream.WriteInt16L( iIsWrt ); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetCanBeAdded() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetCanBeAdded( TBool aValue ) + { + iCanBeAdded = aValue; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::CanBeAdded() +// ----------------------------------------------------------------------- +// +EXPORT_C TBool CHsContentInfo::CanBeAdded() const + { + return iCanBeAdded; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetCanBeRemoved() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetCanBeRemoved( TBool aValue ) + { + iCanBeRemoved = aValue; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::CanBeRemoved() +// ----------------------------------------------------------------------- +// +EXPORT_C TBool CHsContentInfo::CanBeRemoved() const + { + return iCanBeRemoved; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetInstallationTime() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetInstallationTime( TTime& aTime ) + { + iInstallationTime = aTime; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::InstallationTime() +// ----------------------------------------------------------------------- +// +EXPORT_C TTime CHsContentInfo::InstallationTime() const + { + return iInstallationTime; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetDescriptionL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetDescriptionL( const TDesC& aDescription ) + { + delete iDescription; + iDescription = NULL; + + iDescription = aDescription.AllocL(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::Description() +// ----------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHsContentInfo::Description() const + { + return ( iDescription ) ? *iDescription : KNullDesC(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetIconPathL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetIconPathL( const TDesC& aIconPath ) + { + delete iIconPath; + iIconPath = NULL; + + iIconPath = aIconPath.AllocL(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::IconPath() +// ----------------------------------------------------------------------- +// +EXPORT_C const TDesC& CHsContentInfo::IconPath() const + { + return ( iIconPath ) ? *iIconPath : KNullDesC(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::InternalizeL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::InternalizeL( RReadStream& aStream ) + { + TInt length( 0 ); + + // internalize iName + length = aStream.ReadInt16L(); + delete iName; + iName = NULL; + iName = HBufC::NewL( aStream, length ); + + // internalize iUid + length = aStream.ReadInt16L(); + delete iUid; + iUid = NULL; + iUid = HBufC8::NewL( aStream, length ); + + // internalize iPluginId + length = aStream.ReadInt16L(); + delete iPluginId; + iPluginId = NULL; + iPluginId = HBufC8::NewL( aStream, length ); + + // internalize iType + length = aStream.ReadInt16L(); + delete iType; + iType = NULL; + iType = HBufC8::NewL( aStream, length ); + + // internalize iPlublisherId; + length = aStream.ReadInt16L(); + delete iPublisherId; + iPublisherId = NULL; + iPublisherId = HBufC16::NewL( aStream, length ); + + // internalize iDescription; + length = aStream.ReadInt16L(); + delete iDescription; + iDescription = NULL; + iDescription = HBufC16::NewL( aStream, length ); + + // internalize iIconPath; + length = aStream.ReadInt16L(); + delete iIconPath; + iIconPath = NULL; + iIconPath = HBufC16::NewL( aStream, length ); + + // internalize iMaxInstance + iMaxInstance = aStream.ReadInt16L(); + // internalize iCanBeAdded + iCanBeAdded = aStream.ReadInt16L(); + // internalize iCanBeRemoved + iCanBeRemoved = aStream.ReadInt16L(); + + TUint32 low( aStream.ReadUint32L() ); + TUint32 high( aStream.ReadUint32L() ); + + iInstallationTime = TTime( MAKE_TINT64( high, low ) ); + + // internalize iPublisherUid + length = aStream.ReadInt16L(); + delete iPublisherUid; + iPublisherUid = NULL; + iPublisherUid = HBufC8::NewL( aStream, length ); + + // internalize iIsWrt + iIsWrt = aStream.ReadInt16L(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::Size() +// ----------------------------------------------------------------------- +// +EXPORT_C TInt CHsContentInfo::Size( ) + { + TInt size( 0 ); + size = size + Name().Size(); // name + size = size + Uid().Size(); // uid + size = size + PluginId().Size(); // plugin id + size = size + Type().Size(); // type + size = size + PublisherId().Size(); // publisher id + size = size + Description().Size(); // description + size = size + IconPath().Size(); // icon path + size = size + sizeof( TInt16 ); // max instance + size = size + sizeof( TInt16 ); // can be added + size = size + sizeof( TInt16 ); // can be removed + size = size + sizeof( TUint32 ); // installation time low + size = size + sizeof( TUint32 ); // installation time high + size = size + PublisherUid().Size();// publisher uid + size = size + sizeof( TInt16 ); // is wrt + + return size; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetPublisherUidL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetPublisherUidL( + const TDesC8& aPublisherUid ) + { + delete iPublisherUid; + iPublisherUid = 0; + iPublisherUid = aPublisherUid.AllocL(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::PublisherUid() +// ----------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHsContentInfo::PublisherUid() const + { + return ( iPublisherUid ) ? *iPublisherUid : KNullDesC8(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::SetIsWrt() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfo::SetIsWrt( TBool aIsWrt ) + { + iIsWrt = aIsWrt; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::IsWrt() +// ----------------------------------------------------------------------- +// +EXPORT_C TBool CHsContentInfo::IsWrt() const + { + return iIsWrt; + } + +// ----------------------------------------------------------------------- +// CHsContentInfo::MarshalL() +// ----------------------------------------------------------------------- +// +EXPORT_C HBufC8* CHsContentInfo::MarshalL( ) + { + + // Externalize message + CBufFlat* reqBuf = CBufFlat::NewL( Size() ); + CleanupStack::PushL( reqBuf ); + RBufWriteStream reqStream( *reqBuf ); + CleanupClosePushL( reqStream ); + ExternalizeL( reqStream ); + CleanupStack::PopAndDestroy( &reqStream ); + + // Append externalized messgae to a descriptor + HBufC8* msgDesc = HBufC8::NewL( reqBuf->Size() ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgDesc->Des() ); + reqBuf->Read( 0, msgPtr, reqBuf->Size() ); + CleanupStack::PopAndDestroy( reqBuf ); + + return msgDesc; + + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/hscontentinfo/src/hscontentinfoarray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/hscontentinfo/src/hscontentinfoarray.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* + * 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: + * + */ + +// System include files +#include +#include + +// User include files +#include "hscontentinfoarray.h" + +// Local constants + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::NewL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfoArray* CHsContentInfoArray::NewL() + { + CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::NewL() +// ----------------------------------------------------------------------- +// +EXPORT_C CHsContentInfoArray* CHsContentInfoArray::NewL( RReadStream& aStream ) + { + CHsContentInfoArray* self = new ( ELeave ) CHsContentInfoArray(); + CleanupStack::PushL( self ); + self->InternalizeL( aStream ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::ConstructL() +// ----------------------------------------------------------------------- +// +void CHsContentInfoArray::ConstructL() + { + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::CHsContentInfoArray() +// ----------------------------------------------------------------------- +// +CHsContentInfoArray::CHsContentInfoArray() + { + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::~CHsContentInfoArray() +// ----------------------------------------------------------------------- +// +CHsContentInfoArray::~CHsContentInfoArray() + { + iArray.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::Array() +// ----------------------------------------------------------------------- +// +EXPORT_C RPointerArray< CHsContentInfo >& CHsContentInfoArray::Array() + { + return iArray; + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::ExternalizeL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfoArray::ExternalizeL( RWriteStream& aStream ) + { + aStream.WriteInt16L( iArray.Count() ); + + for( int i = 0; i < iArray.Count(); i++ ) + { + CHsContentInfo* info = iArray[i]; + info->ExternalizeL( aStream ); + } + } + + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::InternalizeL() +// ----------------------------------------------------------------------- +// +EXPORT_C void CHsContentInfoArray::InternalizeL( RReadStream& aStream ) + { + TInt count = aStream.ReadInt16L(); + + for( int i = 0; i < count; i++ ) + { + CHsContentInfo* info = CHsContentInfo::NewL( aStream ); + iArray.AppendL( info ); + } + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::Size() +// ----------------------------------------------------------------------- +// +EXPORT_C TInt CHsContentInfoArray::Size( ) + { + TInt size( 0 ); + for ( TInt i = 0; i < iArray.Count(); i++ ) + { + size = size + iArray[ i ]->Size(); + } + return size; + } + +// ----------------------------------------------------------------------- +// CHsContentInfoArray::MarshalL() +// ----------------------------------------------------------------------- +// +EXPORT_C HBufC8* CHsContentInfoArray::MarshalL( ) + { + + // Externalize message + CBufFlat* reqBuf = CBufFlat::NewL( Size() ); + CleanupStack::PushL( reqBuf ); + RBufWriteStream reqStream( *reqBuf ); + CleanupClosePushL( reqStream ); + ExternalizeL( reqStream ); + CleanupStack::PopAndDestroy( &reqStream ); + + // Append externalized messgae to a descriptor + HBufC8* msgDesc = HBufC8::NewL( reqBuf->Size() ); + TPtr8 msgPtr( NULL, 0 ); + msgPtr.Set( msgDesc->Des() ); + reqBuf->Read( 0, msgPtr, reqBuf->Size() ); + CleanupStack::PopAndDestroy( reqBuf ); + + return msgDesc; + + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentcontrolsrv/rom/ccsrv.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/rom/ccsrv.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* 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: IBY file for ROM image creation +* +*/ + + +#ifndef CCSRV_IBY +#define CCSRV_IBY + +#include + +file=ABI_DIR\BUILD_DIR\ccclientsession.dll SHARED_LIB_DIR\ccclientsession.dll +file=ABI_DIR\BUILD_DIR\ccsrvapi.dll SHARED_LIB_DIR\ccsrvapi.dll +file=ABI_DIR\BUILD_DIR\hsccapiclient.dll SHARED_LIB_DIR\hsccapiclient.dll +file=ABI_DIR\BUILD_DIR\hsccproviderclient.dll SHARED_LIB_DIR\hsccproviderclient.dll +file=ABI_DIR\BUILD_DIR\hscontentinfo.dll SHARED_LIB_DIR\hscontentinfo.dll + +file=ABI_DIR\BUILD_DIR\ccserver.exe PROGRAMS_DIR\ccserver.exe + + + +#endif // CCSRV_IBY + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/bwins/contentharvesterclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/bwins/contentharvesterclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,6 @@ +EXPORTS + ??0RContentHarvesterClient@@QAE@XZ @ 1 NONAME ; RContentHarvesterClient::RContentHarvesterClient(void) + ?Connect@RContentHarvesterClient@@QAEHXZ @ 2 NONAME ; int RContentHarvesterClient::Connect(void) + ?Stop@RContentHarvesterClient@@QAEHXZ @ 3 NONAME ; int RContentHarvesterClient::Stop(void) + ?Update@RContentHarvesterClient@@QAEHXZ @ 4 NONAME ; int RContentHarvesterClient::Update(void) + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/eabi/contentharvesterclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/eabi/contentharvesterclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,7 @@ +EXPORTS + _ZN23RContentHarvesterClient4StopEv @ 1 NONAME + _ZN23RContentHarvesterClient6UpdateEv @ 2 NONAME + _ZN23RContentHarvesterClient7ConnectEv @ 3 NONAME + _ZN23RContentHarvesterClientC1Ev @ 4 NONAME + _ZN23RContentHarvesterClientC2Ev @ 5 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Client +* +*/ + + + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS + + +PRJ_MMPFILES +contentharvesterclient.mmp + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/group/contentharvesterclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/group/contentharvesterclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 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: Interface to CP Active Data Server +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET contentharvesterclient.dll +TARGETTYPE dll + +UID 0x1000008D 0x10282E59 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LANG SC + +SOURCEPATH ../src +SOURCE contentharvesterclient.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../contentharvesterserver/inc + +// Default system include paths for application layer modules. +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +DEBUGLIBRARY flogger.lib + + +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/inc/contentharvesterclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/inc/contentharvesterclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,77 @@ +/* +* 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: + * +*/ + + +#ifndef C_CONTENTHARVESTERCLIENT_H +#define C_CONTENTHARVESTERCLIENT_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS + + +// CLASS DECLARATION + +/** + * @brief Client-side interface to CP Active Data Server + * + * This class provides the client-side interface to the active data server session, + * it just passes requests to the server. + * + * @lib contentharvesterclient.lib + * @since S60 v3.1 + */ +class RContentHarvesterClient : public RSessionBase + { +public: + + /** + * Construct the object. + */ + IMPORT_C RContentHarvesterClient(); + + /** + * Connects to the server and create a session. + * When the server is not running, the function starts the server. + * @return error code + */ + IMPORT_C TInt Connect(); + + /** + * Triggers updating process of Active Data Server, + * the function returns right after the server receives the request + * (it isn't information about the whole update process.) + * @return error code + */ + IMPORT_C TInt Update(); + + /** + * Triggers stop process on server + * @return error code + */ + IMPORT_C TInt Stop(); + + /** + * Returns the version number + * @return the version + */ + TVersion Version() const; + }; + +#endif // C_CONTENTHARVESTERCLIENT_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterclient/src/contentharvesterclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/src/contentharvesterclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: + * +*/ + +#include "contentharvesterclient.h" +#include "contentharvesterglobals.h" + +// Number of message slots to reserve for this client server session. +const TUint KDefaultMessageSlots( 5); + +// Function prototypes +static TInt StartServer(); +static TInt CreateServerProcess(); + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// RContentHarvesterClient::RContentHarvesterClient +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C RContentHarvesterClient::RContentHarvesterClient() +:RSessionBase() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// RContentHarvesterClient::Connect +// Connect to Content Harvester Server session. +// exist +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RContentHarvesterClient::Connect() + { + TInt error = ::StartServer(); + + if ( error == KErrNone ) + { + error = CreateSession( KContentHarvesterName, + Version(), + KDefaultMessageSlots ); + } + return error; + } + +// ----------------------------------------------------------------------------- +// RContentHarvesterClient::Update +// Client requests to trigger update process +// ----------------------------------------------------------------------------- + +EXPORT_C TInt RContentHarvesterClient::Update() + { + return SendReceive( EContentHarvesterUpdate ); + } + +// ----------------------------------------------------------------------------- +// RContentHarvesterClient::Stop +// Client requests to trigger stop process +// ----------------------------------------------------------------------------- + +EXPORT_C TInt RContentHarvesterClient::Stop() + { + return SendReceive( EContentHarvesterStop ); + } + +// ----------------------------------------------------------------------------- +// RContentHarvesterClient::Version +// Version information. +// ----------------------------------------------------------------------------- +// +TVersion RContentHarvesterClient::Version() const + { + return (TVersion( KContentHarvesterMajorVersionNumber, + KContentHarvesterMinorVersionNumber, + KContentHarvesterBuildVersionNumber ) ); + } + +// ----------------------------------------------------------------------------- +// StartServer +// Static method to start the server. +// ----------------------------------------------------------------------------- +// +static TInt StartServer() + { + TInt result; + + TFindServer findServer( KContentHarvesterName ); + TFullName name; + + result = findServer.Next( name ); + if ( result != KErrNone ) + { + // Server not running + result = CreateServerProcess( ); + } + return result; + } + +// ----------------------------------------------------------------------------- +// CreateServerProcess +// Static method to create the server process. +// ----------------------------------------------------------------------------- +// +static TInt CreateServerProcess() + { + const TUidType serverUid( KNullUid, KNullUid, KServerUid3); + RProcess server; + TInt result; + result = server.Create( KContentHarvesterFilename, KNullDesC, serverUid ); + if ( result == KErrNone ) + { + TRequestStatus stat = KRequestPending; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); // abort startup + } + else + { + server.Resume( ); // logon OK - start the server + } + + User::WaitForRequest( stat ); // wait for start or death + // we can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + result = (server.ExitType( ) == EExitPanic ) ? KErrGeneral + : stat.Int( ); + } + server.Close( ); + return result; + } diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Server +* +*/ + + + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS + +PRJ_MMPFILES +contentharvesterserver.mmp + + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/group/contentharvesterserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/group/contentharvesterserver.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 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: ?Description +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET contentharvester.exe +TARGETTYPE exe +CAPABILITY CAP_SERVER NetworkControl +VENDORID VID_DEFAULT + +UID 0x1000008d 0x10282E5A + +LANG SC + +SOURCEPATH ../src +SOURCE contentharvesterserver.cpp +SOURCE contentharvesterengine.cpp +SOURCE contentharvestersession.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../contentpublishingserver/cpserver/inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc +USERINCLUDE ../../../contentpublishingutils/pluginvalidator/inc + +// Default system include paths for application layer modules. +MW_LAYER_SYSTEMINCLUDE + + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib + +LIBRARY fbscli.lib // to operate with images +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY liwservicehandler.lib +LIBRARY pluginvalidator.lib + +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif + +DEBUGLIBRARY flogger.lib + +EPOCHEAPSIZE 0x1000 0x400000 +EPOCSTACKSIZE 0x5000 + +//end of file + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Engine for cp active data server + * +*/ + + +#ifndef C_CONTENTHARVESTERENGINE_H +#define C_CONTENTHARVESTERENGINE_H + +#include "contentharvesterplugin.h" + +// FORWARD DECLARATIONS +//class CContentHarvesterPlugin; +class MLiwInterface; +class CLiwServiceHandler; +class CPluginValidator; + +// CLASS DECLARATION + +/** + * The engine that discovers and manages all installed harvesting plugins. + * + * @lib contentharvesterserver.lib + * @since S60 v3.1 + */ +class CContentHarvesterEngine : public CBase + { + +public: + // New methods + + /** + * Create a CContentHarvesterEngine object using two phase construction, + * and return a pointer to the created object. + * @return pointer to new session + */ + static CContentHarvesterEngine* NewL(); + + /** + * Create a CContentHarvesterEngine object using two phase construction, + * and return a pointer to the created object. + * @return pointer to new session + */ + static CContentHarvesterEngine* NewLC(); + + /** + * Destroy the object and release all memory objects. + */ + virtual ~CContentHarvesterEngine(); + + /** + * Pass update request to all registered plugins. + */ + void Update(); + +private: + // New methods + + /** + * Perform the first phase of two phase construction. + */ + CContentHarvesterEngine(); + + /** + * Perform the second phase construction of a CContentHarvesterEngine object. + */ + void ConstructL(); + +private: + + /** + * handler to CPS + * Own + */ + CLiwServiceHandler* iServiceHandler; + + /** + * interface to CPS + * Own + */ + MLiwInterface * iCPSInterface; + + /** + * Plugins + * Own + */ + CPluginValidator* iPluginManager; + + }; + +#endif // C_CONTENTHARVESTERENGINE_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterglobals.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,51 @@ +/* +* 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: Globals for cp active data server + * +*/ + + +#ifndef C_CONTENTHARVESTERGLOBALS_H +#define C_CONTENTHARVESTERGLOBALS_H + +// CONSTANTS +const TUint KContentHarvesterMajorVersionNumber = 0; +const TUint KContentHarvesterMinorVersionNumber = 1; +const TUint KContentHarvesterBuildVersionNumber = 1; + +_LIT( KContentHarvesterThreadName, "contentharvester_MainThread" ); +_LIT( KContentHarvesterName, "contentharvester" ); +_LIT( KContentHarvesterFilename, "contentharvester" ); + +const TUid KServerUid3 = + { + 0x10282E5A + }; + +// ENUMERATIONS +// Opcodes used in message passing between client and server +enum KContentHarvesterRqst + { + EContentHarvesterUpdate = 100, + EContentHarvesterStop + }; + +enum KContentHarvesterRsp + { + EContentHarvesterUpdateComplete = 200, + EContentHarvesterStopComplete + }; + +#endif // C_CONTENTHARVESTERGLOBALS_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterpanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterpanic.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Panics for cp active data server + * +*/ + + +#ifndef __CONTENTHARVESTERPANIC_H_ +#define __CONTENTHARVESTERPANIC_H_ + +/** Panic Category */ + +/** Content Harvester panic codes */ +enum TContentHarvesterPanic + { + EContentHarvesterBadRequest = 1, + EContentHarvesterBadDescriptor = 2, + EContentHarvesterSrvCreateServer = 3, + EContentHarvesterMainSchedulerError = 4, + EContentHarvesterCreateTrapCleanup = 5, + EContentHarvesterSrvSessCreateTimer = 6, + EContentHarvesterReqAlreadyPending = 7, // A request is already pending + EContentHarvesterEIkonEnv = 8 + }; + +#endif // __CONTENTHARVESTERPANIC_H_ diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvesterserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,171 @@ +/* +* 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: Content Harvester Server - implemenration of CServer2 + * +*/ + + +#ifndef C_CONTENTHARVESTERSERVER_H +#define C_CONTENTHARVESTERSERVER_H + +#include +#include +#include "contentharvesterpanic.h" + +class CContentHarvesterEngine; + +// CONSTANTS + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** + * CP Active Data Server container. + * Provides interface for CP Active Data Server maintanace purposes. + * + * @lib ???.lib + * @since Series 60 3.1 + */ +class CContentHarvesterServer : public CServer2 + { + /** + * EIkonEnv for the server process. + * + * @lib ???.lib + * @since Series 60 3.1 + */ + class CContentHarvesterEikonEnv : public CEikonEnv + { +public: + void DestroyEnvironment(); + void ConstructL(); + }; + + /** + * EikAppUi for the server process. + * + * @lib ???.lib + * @since Series 60 3.1 + */ + class CContentHarvesterAppUi : public CEikAppUi + { +public: + ~CContentHarvesterAppUi(); + void ConstructL(); + TErrorHandlerResponse HandleError( TInt aError, + const SExtendedError &aExtErr, + TDes &aErrorText, + TDes &aContextText ); + }; + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CContentHarvesterServer* NewLC(); + + /** + * Destructor. + */ + virtual ~CContentHarvesterServer(); + +public: + // New functions + + /** + * Return the reference to the engine. + * @return engine reference + */ + CContentHarvesterEngine& Engine(); + + /** + * Stops server. + */ + void Stop(); + + /** + * First stage startup for the server thread. + * @return return KErrNone or panics thread + */ + static TInt ThreadFunction(); + + /** + * Panic client. + * @param aMessage RMessage2 + * @param aPanic panic code + */ + static void PanicClient( const RMessage2& aMessage, + TContentHarvesterPanic aPanic ); + +protected: + // From CActive + /** + * Process any errors. + * @param aError the leave code reported + * @return return KErrNone if leave is handled + */ + TInt RunError( TInt aError ); + +private: + // New methods + + /** + * Constructs the server. + * @param aPriority CServer2 input parameter + */ + CContentHarvesterServer( TInt aPriority ); + + /** + * Perform the second phase construction of a CContentHarvesterServer object. + */ + void ConstructL(); + + /** + * Panic the server. + * @param param aPanic the panic code + * @return a updateId of container + */ + static void PanicServer( TContentHarvesterPanic aPanic ); + + /** + * Second stage startup for the server thread. + */ + static void ThreadFunctionL(); + +private: + // From CServer2 + + /** + * Create a time server session, and return a pointer to the created object. + * @param aVersion the client version + * @param aMessage RMessage2 + * @return pointer to new session + */ + CSession2* NewSessionL( const TVersion& aVersion, + const RMessage2& aMessage ) const; + +private: + + /** + * instance of engine, where the whole logic is implemented + * Own. + */ + CContentHarvesterEngine* iEngine; + + }; + +#endif // C_CONTENTHARVESTERSERVER_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvestersession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/inc/contentharvestersession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* 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: Engine for content harvester server + * +*/ + + +#ifndef C_CONTENTHARVESTERSESSION_H +#define C_CONTENTHARVESTERSESSION_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CContentHarvesterServer; + +// CLASS DECLARATION + +/** + An instance of class CContentHarvesterSession is created for each client + */ +class CContentHarvesterSession : public CSession2 + { + +public: + // New methods + + /** + * Create a CContentHarvesterSession object using two phase construction, + * and return a pointer to the created object + * @param aServer CContentHarvesterServer + * @return pointer to new session + */ + static CContentHarvesterSession* NewL( CContentHarvesterServer* aServer ); + + /** + * Create a CContentHarvesterSession object using two phase construction, + * and return a pointer to the created object + * @param aServer CContentHarvesterServer + * @return pointer to new session + */ + static CContentHarvesterSession* NewLC( CContentHarvesterServer* aServer ); + + /** + * Destroy the object and release all memory objects + */ + virtual ~CContentHarvesterSession(); + +public: + // From CSession + /** + * Called after a service request from client; from class CSession + * @param aMessage message from client (containing requested operation and any data) + */ + void ServiceL( const RMessage2& aMessage ); + +private: + // New methods + + /** + * Perform the first phase of two phase construction + * @param aServer CContentHarvesterServer + */ + CContentHarvesterSession( CContentHarvesterServer* aServer ); + + /** + * Perform the second phase construction of a CContentHarvesterSession object + */ + void ConstructL(); + +private: + + /** + * CP Active Data Server container + * Own. + */ + CContentHarvesterServer* iContentHarvesterServer; + }; + +#endif // C_CONTENTHARVESTERSESSION_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,167 @@ +/* +* 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: Content Harvester Engine + * +*/ + + +// for CleanupResetAndDestroyPushL +#include +#include // harvesting plugin +#include +#include + +#include "charvesterpluginvalidator.h" +#include "contentharvesterpluginuids.hrh" +#include "cpglobals.h" +#include "cpdebug.h" +#include "contentharvesterengine.h" + +// LOCAL CONSTANTS +const TInt KADatFactorySettingsServerPluginUid( 0x102830EF); + + + +// ================= MEMBER FUNCTIONS ======================= +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::CContentHarvesterEngine +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CContentHarvesterEngine::CContentHarvesterEngine() + { + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterEngine::ConstructL() + { + CP_DEBUG(_L8("Create Engine" )); + + CP_DEBUG(_L8("Start delayed update" )); + // start updating process + + iServiceHandler = CLiwServiceHandler::NewL( ); + // for convinience keep pointers to Service Handler param lists + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL( ); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL( ); + + RCriteriaArray criteriaArray; + CleanupResetAndDestroyPushL( criteriaArray ); + + // create Liw criteria + CLiwCriteriaItem* criterion = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, + KCPInterface, KCPService ); + criterion->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + criteriaArray.AppendL( criterion ); + CleanupStack::Pop( criterion ); + + // attach Liw criteria + iServiceHandler->AttachL( criteriaArray ); + // get BS Service interface + iServiceHandler->ExecuteServiceCmdL( *criterion, *inParamList, + *outParamList ); + + CleanupStack::PopAndDestroy( &criteriaArray ); + + TInt pos( 0); + outParamList->FindFirst( pos, KCPInterface ); + if ( pos != KErrNotFound ) + { + iCPSInterface = (*outParamList)[pos].Value().AsInterface( ); + } + + iPluginManager = CHarvesterPluginValidator::NewL( + TUid::Uid( KContentHarvesterPluginUid ), + iCPSInterface ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::~CContentHarvesterEngine +// Destructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterEngine::~CContentHarvesterEngine() + { + if ( iCPSInterface ) + { + iCPSInterface->Close( ); + } + delete iServiceHandler; + delete iPluginManager; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterEngine* CContentHarvesterEngine::NewL() + { + CContentHarvesterEngine* self = CContentHarvesterEngine::NewLC( ); + CleanupStack::Pop( self ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterEngine* CContentHarvesterEngine::NewLC() + { + CContentHarvesterEngine* self = new ( ELeave ) CContentHarvesterEngine(); + CleanupStack::PushL( self ); + self->ConstructL( ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEngine::Update +// Pass request for update to all installed plugins +// ----------------------------------------------------------------------------- +// +void CContentHarvesterEngine::Update() + { + CP_DEBUG(_L8("CContentHarvesterEngine::Update" )); + CContentHarvesterPlugin* plugin( NULL ); + CContentHarvesterPlugin* fsplugin = + static_cast + ( iPluginManager->GetImplementation( + TUid::Uid( KADatFactorySettingsServerPluginUid) ) ); + + if (fsplugin) + { + TRAP_IGNORE( fsplugin->UpdateL() ); + } + + for ( TInt i = 0; i < iPluginManager->GetCount(); i++ ) + { + plugin = static_cast + ( iPluginManager->GetImplementation( i ) ); + if( plugin!= fsplugin ) + { + TRAP_IGNORE( plugin->UpdateL() ); + } + } + } + +// End of File + + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvesterserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,300 @@ +/* +* 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: Content Harvester Server + * +*/ + + +//#include +//#include + +#include + +#include "contentharvesterserver.h" +#include "contentharvestersession.h" +#include "contentharvesterglobals.h" +#include "contentharvesterengine.h" +#include "cpdebug.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::CContentHarvesterServer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CContentHarvesterServer::CContentHarvesterServer( TInt aPriority ) : + CServer2(aPriority) + { + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::ConstructL() + { + CP_DEBUG( _L8("Start Content Harvester Server" )); + StartL( KContentHarvesterName ); + iEngine = CContentHarvesterEngine::NewL( ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::NewL +// Two-phased constructor. +// -------------------------------------- --------------------------------------- +// +CContentHarvesterServer* CContentHarvesterServer::NewLC() + { + CContentHarvesterServer* self = new( ELeave ) + CContentHarvesterServer( EPriorityNormal ); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// Destructor +CContentHarvesterServer::~CContentHarvesterServer() + { + CP_DEBUG( _L8("Destroy Content Harvester Server" )); + delete iEngine; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::NewSessionL +// Create new session. +// ----------------------------------------------------------------------------- +// +CSession2* CContentHarvesterServer::NewSessionL( const TVersion& aVersion, + const RMessage2& /*aMessage*/ ) const + { + CP_DEBUG(_L8("CContentHarvesterServer::NewSessionL" )); + // Check we're the right version + if ( !User::QueryVersionSupported( TVersion( + KContentHarvesterMajorVersionNumber, + KContentHarvesterMinorVersionNumber, + KContentHarvesterBuildVersionNumber ), aVersion ) ) + { + User::Leave( KErrNotSupported ); + } + return CContentHarvesterSession::NewL( ( CContentHarvesterServer* ) this ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::RunError +// RunError is called when RunL leaves. +// ----------------------------------------------------------------------------- +// +TInt CContentHarvesterServer::RunError( TInt aError ) + { + CP_DEBUG( _L8("CContentHarvesterServer::RunError " )); + if ( aError == KErrBadDescriptor ) + { + PanicClient( Message( ), EContentHarvesterBadDescriptor ); + } + else + { + Message().Complete( aError ); + } + + // The leave will result in an early return from CServer::RunL(), skipping + // the call to request another message. So do that now in order to keep the + // server running. + ReStart( ); + // Handled the error fully + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::PanicClient +// Panic client. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::PanicClient( const RMessage2& aMessage, + TContentHarvesterPanic aPanic ) + { + aMessage.Panic( KContentHarvesterName, aPanic ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::PanicServer +// Panic server. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::PanicServer( TContentHarvesterPanic aPanic ) + { + User::Panic( KContentHarvesterName, aPanic ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::ThreadFunctionL +// Create and start the server. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::ThreadFunctionL() + { + RFbsSession::Connect( ); + // Construct our server + + CContentHarvesterServer* server = CContentHarvesterServer::NewLC( ); + CP_DEBUG(_L8("Send Rendezvous" )); + RProcess::Rendezvous( KErrNone ); + + CActiveScheduler::Start( ); + + CleanupStack::PopAndDestroy( server ); + + RFbsSession::Disconnect( ); + } +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::ThreadFunctionL +// Create and start the server. +// ----------------------------------------------------------------------------- +// +TInt CContentHarvesterServer::ThreadFunction() + { + __UHEAP_MARK; + + TFindServer findCountServer( KContentHarvesterName ); + TFullName name; + + // Need to check that the server exists. + if (findCountServer.Next(name) != KErrNone) + { + User::RenameThread( KContentHarvesterThreadName ); + + CTrapCleanup* cleanupStack = CTrapCleanup::New( ); + if ( !(cleanupStack ) ) + { + PanicServer( EContentHarvesterCreateTrapCleanup ); + } + + CContentHarvesterEikonEnv* env = new CContentHarvesterEikonEnv; + __ASSERT_ALWAYS( env, PanicServer( EContentHarvesterEIkonEnv ) ); + + CContentHarvesterAppUi* ui = new CContentHarvesterAppUi; + __ASSERT_ALWAYS( ui, PanicServer( EContentHarvesterEIkonEnv ) ); + + TRAPD(error, env->ConstructL(); ui->ConstructL()); + __ASSERT_ALWAYS( !error, PanicServer( EContentHarvesterEIkonEnv ) ); + + TRAPD( err, ThreadFunctionL() ); + if ( err != KErrNone ) + { + PanicServer( EContentHarvesterSrvCreateServer ); + } + ui->PrepareToExit( ); + env->DestroyEnvironment( ); + + delete cleanupStack; + cleanupStack = NULL; + } + + __UHEAP_MARKEND; + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::Engine +// Getter of engine +// ----------------------------------------------------------------------------- +// +CContentHarvesterEngine& CContentHarvesterServer::Engine() + { + return *iEngine; + } +// ----------------------------------------------------------------------------- +// CContentHarvesterServer::Engine +// Getter of engine +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::Stop() + { + CActiveScheduler::Stop( ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEikonEnv::DestroyEnvironment +// +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::CContentHarvesterEikonEnv::DestroyEnvironment() + { + CEikonEnv::DestroyEnvironment( ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEikonEnv::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::CContentHarvesterEikonEnv::ConstructL() + { + CEikonEnv::ConstructL( EFalse ); + SetAutoForwarding( ETrue ); + User::SetPriorityControl( EFalse ); + } +// ----------------------------------------------------------------------------- +// CContentHarvesterAppUi::~CContentHarvesterAppUi +// +// ----------------------------------------------------------------------------- +// +CContentHarvesterServer::CContentHarvesterAppUi::~CContentHarvesterAppUi() + { + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterAppUi::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CContentHarvesterServer::CContentHarvesterAppUi::ConstructL() + { + CEikAppUi::BaseConstructL( ENoAppResourceFile|ENoScreenFurniture ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TErrorHandlerResponse CContentHarvesterServer::CContentHarvesterAppUi::HandleError( TInt aError, + const SExtendedError& /*aExtErr*/, + TDes& /*aErrorText*/, + TDes& /*aContextText*/ ) + { + RDebug::Printf("CContentHarvesterAppUi::HandleError %d", aError); + if ( aError != KErrNoMemory ) + { + return ENoDisplay; // we dont want to handle this error + } + return EErrorNotHandled; + } + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// E32Main entry point. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + return CContentHarvesterServer::ThreadFunction( ); + } + +// End of File + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvestersession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/src/contentharvestersession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* 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: Content Harvester Server Session + * +*/ + + +// INCLUDE FILES +#include "contentharvestersession.h" +#include "contentharvesterengine.h" +#include "contentharvesterserver.h" +#include "contentharvesterglobals.h" +#include "cpdebug.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterSession* CContentHarvesterSession::NewL( + CContentHarvesterServer* aServer ) + { + CContentHarvesterSession* self = + CContentHarvesterSession::NewLC( aServer ); + CleanupStack::Pop( self ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterSession* CContentHarvesterSession::NewLC( + CContentHarvesterServer* aServer ) + { + CContentHarvesterSession* self = new ( ELeave ) + CContentHarvesterSession(aServer); + CleanupStack::PushL( self ); + self->ConstructL( ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::~CContentHarvesterSession +// Destructor. +// ----------------------------------------------------------------------------- +// +CContentHarvesterSession::~CContentHarvesterSession() + { + + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::ServiceL +// Handle client requests. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterSession::ServiceL( const RMessage2& aMessage ) + { + CP_DEBUG(_L8("CContentHarvesterSession::ServiceL")); + switch ( aMessage.Function( ) ) + { + case EContentHarvesterUpdate: + CP_DEBUG(_L8("Update command")); + aMessage.Complete( EContentHarvesterUpdateComplete ); + iContentHarvesterServer->Engine().Update( ); + break; + case EContentHarvesterStop: + CP_DEBUG(_L8("Stop command")); + aMessage.Complete( EContentHarvesterStopComplete ); + iContentHarvesterServer->Stop( ); + break; + default: + iContentHarvesterServer->PanicClient( aMessage, + EContentHarvesterBadRequest ); + break; + } + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::CContentHarvesterSession +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CContentHarvesterSession::CContentHarvesterSession( + CContentHarvesterServer* aServer ) : + CSession2() + { + iContentHarvesterServer = aServer; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterSession::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CContentHarvesterSession::ConstructL() + { + CP_DEBUG(_L8("CContentHarvesterSession::ConstructL")); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterswiplugin/data/chswiplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/data/chswiplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: + * +*/ + +#include +#include + + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// REGISTRY_INFO theInfo +// Declares info for the "all" implementation +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = KCHSwiPluginUidDll; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KContentHarvesterPluginUid; + implementations = + { + // Info for CCHSwiPlugin + IMPLEMENTATION_INFO + { + implementation_uid = KCHSwiPluginUidImpl; + version_no = 1; + display_name = "chswiplugin"; + default_data = "chswiplugin"; + opaque_data = "chswiplugin"; + } + }; + } + }; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: + * +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +chswiplugin.mmp + + +// End of File + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/chswiplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: + * +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET chswiplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20022E84 +CAPABILITY CAP_ECOM_PLUGIN + +LANG SC + +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE chswiplugin.cpp + +SOURCEPATH ../data +START RESOURCE chswiplugin.rss +HEADER +TARGET chswiplugin.rsc +TARGETPATH resource/plugins +END + +USERINCLUDE ../inc +USERINCLUDE ../../../contentpublishingserver/cpserver/inc + +MW_LAYER_SYSTEMINCLUDE + + +LIBRARY ecom.lib +LIBRARY euser.lib + +LIBRARY apgrfx.lib +LIBRARY apparc.lib + +LIBRARY liwservicehandler.lib //AIW Framework + +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: + * +*/ + +#ifndef C_CCHSWIPLUGIN_H +#define C_CCHSWIPLUGIN_H + +#include +#include + +class MLiwInterface; +class CLiwGenericParamList; + +/** + * Active Data plugin for SIS installation events. + * + * @since S60 S60 v3.1 + */ +class CCHSwiPlugin: public CContentHarvesterPlugin, + MApaAppListServObserver + { + +public: + /** + * Two-phased constructor. + * @param aInterface liw interface + */ + static CCHSwiPlugin* NewL( MLiwInterface* aInterface ); + + /** + * Destructor. + */ + virtual ~CCHSwiPlugin(); + + /** + * From CContentHarvesterPlugin. + * This function updates all data entries which could change when an applicaion is installed + * or when the MMC is removed/inserted. + */ + void UpdateL(); + +private: + // from MApaAppListServObserver + + void HandleAppListEvent( TInt aEvent ); + /** + * Performs the second phase construction of a CADatSwi object. + */ + void ConstructL(); + + /** + * Default Constructor. + * @param aActiveSpace An instance of the Active Space Client. + */ + CCHSwiPlugin( MLiwInterface* aInterface ); + + + /** + * This function removes publishers from database when + * an applicaion is uninstalled or when the MMC is removed. + */ + void UpdateWidgetsL(); + + + void RemoveWidgetsL( CLiwGenericParamList* aWidgets ); + + void RemoveWidgetL( const TDesC& aType, + const TDesC& aContentId ); + + +private: + + /** + * An interface to Content Publisher Service + */ + MLiwInterface* iCPSInterface; + + + /** + * AppArc session. + * Own. + */ + RApaLsSession iApaLsSession; + + CApaAppListNotifier* iNotifier; ///< Change notifier. Own. + + }; + +#endif // C_CCHSWIPLUGIN_H + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,214 @@ +/* +* 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: + * +*/ + +#include "chswiplugin.h" + +#include + +#include +#include +#include +#include "cpglobals.h" + +_LIT( KHsWidgetPublisher, "hswidgetpublisher"); +_LIT( KHsPublisher, "ai3templatedwidget" ); +_LIT8( KWidgetUid, "widget_uid"); + +// Map the interface UIDs to implementation factory functions +// ============================= LOCAL FUNCTIONS =============================== + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + {{KCHSwiPluginUidImpl}, (TProxyNewLPtr)CCHSwiPlugin::NewL}, + }; + +// ---------------------------------------------------------------------------- +// Exported proxy for instantiation method resolution +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::CCHSwiPlugin +// Constructor +// ---------------------------------------------------------------------------- +// +CCHSwiPlugin::CCHSwiPlugin( MLiwInterface* aInterface ) + { + iCPSInterface = aInterface; + } + +// ---------------------------------------------------------------------------- +// CADatSwi::ConstructL +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::ConstructL() + { + iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard ); + User::LeaveIfError( iApaLsSession.Connect() ); + } + +// ---------------------------------------------------------------------------- +// CADatSwi::NewL +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CCHSwiPlugin* CCHSwiPlugin::NewL( MLiwInterface* aInterface) + { + CCHSwiPlugin* self = new (ELeave) CCHSwiPlugin( aInterface ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::~CCHSwiPlugin +// Destructor. +// ---------------------------------------------------------------------------- +// +CCHSwiPlugin::~CCHSwiPlugin() + { + iApaLsSession.Close(); + delete iNotifier; + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::UpdateL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::UpdateL() + { + UpdateWidgetsL(); + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::HandleAppListEvent +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::HandleAppListEvent( TInt /*aEvent*/ ) + { + TRAP_IGNORE( UpdateWidgetsL() ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::UpdateWidgetsL +// MMC watcher callback. +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::UpdateWidgetsL() + { + CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); + CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); + inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( KPublisher ) ) ); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); + filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); + inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); + + iCPSInterface->ExecuteCmdL( KGetList, *inparam, *outparam ); + + RemoveWidgetsL( outparam ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( outparam ); + CleanupStack::PopAndDestroy( inparam ); + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::RemoveWidgetsL +// MMC watcher callback. +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::RemoveWidgetsL( CLiwGenericParamList* aWidgets ) + { + TInt pos ( 0 ); + aWidgets->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + { + TLiwVariant variant = (*aWidgets)[pos].Value(); + variant.PushL(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + if( iterable->NextL( variant ) ) + { + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + if ( map->FindL( KDataMap, variant) ) + { + CLiwDefaultMap *dataMap = CLiwDefaultMap::NewLC(); + variant.Get( *dataMap ); + if ( dataMap->FindL( KWidgetUid, variant ) ) + { + TApaAppInfo appInfo; + + if( KErrNotFound == iApaLsSession.GetAppInfo( + appInfo, TUid::Uid( variant.AsTInt32() ) ) ) + { + if( map->FindL( KContentId, variant ) ) + { + RemoveWidgetL( KPublisher, variant.AsDes() ); + RemoveWidgetL( KCpData, variant.AsDes() ); + } + } + } + CleanupStack::PopAndDestroy( dataMap ); + } + CleanupStack::PopAndDestroy( map ); + } + CleanupStack::PopAndDestroy(&variant); + } + } + +// ---------------------------------------------------------------------------- +// CCHSwiPlugin::RemoveWidgetL +// MMC watcher callback. +// ---------------------------------------------------------------------------- +// +void CCHSwiPlugin::RemoveWidgetL( const TDesC& aType, + const TDesC& aContentId ) + { + CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); + CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); + inparam->AppendL( TLiwGenericParam( KType, TLiwVariant( aType ) ) ); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + + filter->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); + filter->InsertL( KContentType, TLiwVariant( KHsPublisher )); + filter->InsertL( KContentId, TLiwVariant( aContentId )); + inparam->AppendL( TLiwGenericParam( KFilter, TLiwVariant( filter ) ) ); + + iCPSInterface->ExecuteCmdL( KDelete, *inparam, *outparam ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( outparam ); + CleanupStack::PopAndDestroy( inparam ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/data/chfactorysettingsplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/data/chfactorysettingsplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* 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: ECOM registration for Factory Settings EC harvesting plugin +* +*/ + + +// INCLUDES +#include +#include + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// REGISTRY_INFO theInfo +// Declares info for the "all" implementation +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x10282E6C; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KContentHarvesterPluginUid; + implementations = + { + // Info for CADatFactorySettings + IMPLEMENTATION_INFO + { + implementation_uid = 0x102830EF; + version_no = 1; + display_name = "factorysettings"; + default_data = "factorysettings"; + opaque_data = "factorysettings"; + } + }; + } + }; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2002-2004 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: Content Publisher Plugin +* +*/ + + +PRJ_EXPORTS + +//XMLs used by this DLL are in main rom dir and are exported by main bld.inf +PRJ_MMPFILES +chfactorysettingsplugin.mmp + + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/group/chfactorysettingsplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/group/chfactorysettingsplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2002-2004 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: Active Space Facory Settings +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET chfactorysettingsplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10282E6C +CAPABILITY CAP_ECOM_PLUGIN + +LANG SC + +VENDORID VID_DEFAULT +SOURCEPATH ../data +START RESOURCE chfactorysettingsplugin.rss +HEADER +TARGET chfactorysettingsplugin.rsc +TARGETPATH resource/plugins +END + +SOURCEPATH ../src +SOURCE chfactorysettingsplugin.cpp +SOURCE chfactorysettingsinstallnotifier.cpp +SOURCE chfactorysettingsparser.cpp +SOURCE chfactsetutils.cpp +SOURCE chdbstatehandler.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc +USERINCLUDE ../../../contentpublishingserver/cpserver/inc + +// APP layer system include is needed here because xcfw_api has +// dependency to app layer +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +LIBRARY xcfw.lib +LIBRARY bafl.lib +LIBRARY ecom.lib +//AIW Plugin +LIBRARY liwservicehandler.lib //AIW Framework +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif +LIBRARY centralrepository.lib + +DEBUGLIBRARY flogger.lib + +// End of file + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chdbstatehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chdbstatehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Central Repository about DB state change information observer + * +*/ + + +#ifndef C_CHDBSTATEHANDLER_H +#define C_CHDBSTATEHANDLER_H + +#include // For CActive, link against: euser.lib + +class CRepository; +class CCHFactorySettings; + +class CCHDbStateHandler : + public CActive + { +public: + /* + * Destructor. + */ + ~CCHDbStateHandler(); + + /** + * Two-phased constructor. + */ + static CCHDbStateHandler* NewL( CCHFactorySettings* aCallback ); + +private: + /** + * Simply constructor. + */ + CCHDbStateHandler( CCHFactorySettings* aCallback ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: + /** + * From CActive. + * Invoke when asynchronous request will be completed. + * + * @since S60 S60 v3.1 + */ + void RunL(); + + /** + * From CActive. + * Invoke for canceling asynchronous request. + * + * @since S60 S60 v3.1 + */ + void DoCancel(); + + /** + * Override to handle leaves from RunL(). Default implementation causes + * the active scheduler to panic. + * + * @since S60 S60 v3.1 + */ + TInt RunError(TInt aError); + +private: + /** + */ + void ConstructFactorySettingsPathL(); + + /** + * Removes parsed Factory Settings files + */ + void RemoveFactorySettingsParsedFilesL(); + + /** + * Handle repository db state. + * If KSQLDBStateRestored state match then calls HandleRestoredDbStateL + * remove repository db state KSQLDBStateRestored, add KSQLDBStateNormal. + */ + void HandleDbStateL(); + + /** + * Handle restored db state. + * Calls RemoveFactorySettingsParsedFilesL and call UpdateL on iCallback + * member. + */ + void HandleRestoredDbStateL(); + +private: + + /** + * Pointer to repository. + * Own. + */ + CRepository* iRepository; + + /** + * Interface for notifying need of update after DB restore. + * Not own. + */ + CCHFactorySettings* iCallback; + + /** + * File server session. + */ + RFs iFs; + + /** + * Path of parsed Factory Settings + */ + TFileName iFSPath; + }; + +#endif // C_CHDBSTATEHANDLER_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsglobals.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef T_CHFACTORYSETTINGSGLOBALS_H +#define T_CHFACTORYSETTINGSGLOBALS_H + +// +const TInt KRootItemId( -1 ); +const TInt KMaxIntString( 10 ); + +_LIT8( KNullDes8, "" ); + +// CONSTANTS +_LIT( KMainDataItem, "cps:data" ); +_LIT( KMainPublisherItem, "cps:publisher" ); +_LIT( KDataItem, "cps:data_item" ); +_LIT( KNoArgumentsString, "-1" ); +_LIT( KAttributeKey, "key" ); +_LIT( KAttributeType, "type" ); +_LIT( KAttributeValue, "value" ); +_LIT( KTrue, "true" ); +_LIT( KFalse, "false" ); + +//Supported Types +_LIT( KInteger, "integer" ); +_LIT( KUInteger, "uinteger" ); +_LIT( KDescriptor8, "string8" ); +_LIT( KDescriptor16, "string" ); +_LIT( KMap, "map" ); +_LIT( KList, "list" ); +_LIT( KBool, "bool" ); +_LIT( KReal, "float" ); +_LIT( KUid, "uid" ); + +#endif // T_CHFACTORYSETTINGSGLOBALS_H +// End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsinstallnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsinstallnotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,129 @@ +/* +* 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: Sis package installation event listener + * +*/ + + +#ifndef C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H +#define C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H + +#include +#include + +class CCHFactorySettings; + +/** + * Central Repository notifier. + * + * @since S60 S60 v3.1 + */ +class CCHFactorySettingsInstallNotifier : public CActive + { + /** + * Enum defining the purpouse of the installation event. + */ + enum TInstOp + { + EInstOpNone = 0x00000000, + EInstOpInstall = 0x00000001, + EInstOpUninstall = 0x00000002, + EInstOpRestore = 0x00000004 + }; + + /** + * Enum defining the exit status of the installation event. + */ + enum TInstOpStatus + { + EInstOpStatusNone = 0x00000000, + EInstOpStatusSuccess = 0x00000100, + EInstOpStatusAborted = 0x00000200 + }; + +public: + + /** + * Creates an instance of CCHFactorySettingsInstallNotifier implementation. + * @param aCallBack Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + */ + static CCHFactorySettingsInstallNotifier* NewL( + CCHFactorySettings* aCallback, TUid aCategory, TUint aKey ); + + /** + * Destructor. + */ + virtual ~CCHFactorySettingsInstallNotifier(); + +private: + /** + * Constructor. + * @param aCallBack Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + */ + CCHFactorySettingsInstallNotifier( CCHFactorySettings* aCallback, + TUid aCategory, TUint aKey ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * From CActive. + */ + TInt RunError( TInt aError ); + +private: + /** + * User side interface to Publish & Subscribe. + * Own. + */ + RProperty iProperty; + + /** + * Interface for notifying changes in SWI. + * Not own. + */ + CCHFactorySettings* iCallback; + + /** + * Category uid. + * Own. + */ + TUid iCategory; + + /** + * Key identifier. + * Own. + */ + TUint iKey; + + }; + +#endif // C_CCHFACTORYSETTINGSINSTALLNOTIFIER_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: factory settings functionality for content harvester + * +*/ + + +#ifndef C_FACTORYSETTINGSPARSER_H +#define C_FACTORYSETTINGSPARSER_H + +// INCLUDES +#include +#include +// CONSTANTS + +// FORWARD DECLARATIONS +class CXCFWTree; +class MXCFWNode; +class CGECODefaultObject; +class CLiwDefaultMap; +class CLiwContainer; +class CLiwDefaultList; +class MLiwInterface; + +// CLASS DECLARATION +/** + * Factory Settings Observer. + * + * @lib XCFW.lib + * @since Series 60 3.1 + */ +class MADatFactorySettingsObserver + { +public: + //event enumeration + + enum TADatFactorySettingsStatus // statuses + + { + ECompleted = 0, // factory settings completed successfully + EFailed = -1 // factory settings failed + }; + +public: + /** + * Called when the factory settings finish the restoriation process + * + * @param aEvent Restoration status. + */ + virtual void HandleCompletionL( TADatFactorySettingsStatus aStatus ) = 0; + + }; + +/** + * Factory settings for + * + * @since Series Series60 3.1 + */ +class CCHFactorySettingsParser : public CBase, public MXCFWEngineObserver, + public MADatFactorySettingsObserver + + { + + enum TTypes + { + EUndefined, + EInteger, + EUInteger, + EDescriptor8, + EDescriptor16, + EMap, + EList, + EBool, + EReal, + EUid + }; + +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * @param aStorage instance of AS storage DB + */ + static CCHFactorySettingsParser* NewL( MLiwInterface* aInterface ); + static CCHFactorySettingsParser* NewLC( MLiwInterface* aInterface ); + + /** + * Destructor. + */ + virtual ~CCHFactorySettingsParser(); + +public: + // New functions + + + /** + * Restores all factory settings + * + * @since Series 60 3.1 + * @param aStorage instance of AS storage DB + */ + TInt RestoreL( const TDesC& aStr, TBool aUnInstall=EFalse ); + +public: + // Functions from base classes + + /** + * Called when Engine parsing / saving state changes + * User can do desired actions on corresponding events. + * @param aEvent Engine event. + */ + virtual void HandleEngineEventL( TXCFWEngineEvent aEvent ); + + /** + * Called when there's an error during parsing / saving + * @param aErrorCode Error code from engine + */ + virtual void HandleEngineErrorL( TInt aErrorCode ); + +public: + // function from MASpaFactorySettingsObserver + /** + * Called when the factory settings finish the restoriation process + * + * @param aEvent Restoration status. + */ + void HandleCompletionL( TADatFactorySettingsStatus aStatus ); + +private: + // New functions + + /** + * Handles the "entries" node. + * @since Series 60 3.1 + * @param aUnInstall Uninstall bool. + */ + void HandleEntriesL( TBool aUnInstall ); + + /** + * Adds an item do the database. + * @since Series 60 3.1 + * @param aItem An "item" node. + * @param aContainer container with item. + * @param aType type of item. + */ + void AddItemL( MXCFWNode* aItem, CLiwContainer* aContainer, TTypes aType ); + + /** + * Removes an item from the database. + * @since Series 60 3.2 + * @param aItem An "item" node. + * @param aMap CLiwDefaultMap with item. + */ + void RemoveItemL( MXCFWNode* aItem, CLiwDefaultMap* aMap ); + + /** + * Extracts deleted attributes from "item" node. + * @since Series 60 3.2 + * @param aItem An "item" node. + * @param aMap CLiwDefaultMap with item. + */ + void ExtractDeleteAttributesL( MXCFWNode* aItem, CLiwDefaultMap* aMap ); + + /** + * Extracts and adds attributes from "item" node to map. + * @since Series 60 3.2 + * @param aItem An "item" node. + * @param aMap CLiwDefaultMap with item. + */ + void ExtractAttributesAndAddL( MXCFWNode* aItem, CLiwDefaultMap* aMap ); + + /** + * Extracts and adds attributes from "item" node to list. + * @since Series 60 3.2 + * @param aItem An "item" node. + * @param aMap CLiwDefaultList with item. + */ + void ExtractAttributesAndAddL( MXCFWNode* aItem, CLiwDefaultList* aMap ); + + /** + * Converts type from TDesC to TTypes. + * @since Series 60 3.2 + * @param aType type key as attributes. + */ + TTypes ConvertToType( const TDesC& aType ); + +private: + + /** + * C++ default constructor. + */ + CCHFactorySettingsParser(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MLiwInterface* aInterface ); + +private: + // Data + /** + * Content tree + */ + CXCFWTree* iContentTree; + + /** + * Content parsing engine + */ + CXCFWEngine* iContentEngine; + + /** + * completion observer + * Not own. + */ + MADatFactorySettingsObserver* iCompletionObserver; + + /** + * scheduler for make synchronous restoration + */ + CActiveSchedulerWait* iActiveScheduler; + + /** + * status about completion of restoration + */ + TADatFactorySettingsStatus iCompletionStatus; + + /** + * CPS interface + * Not own + */ + MLiwInterface* iCPSInterface; + }; + +#endif // C_FACTORYSETTINGSPARSER_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactorysettingsplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Ecom plugin + * +*/ + + +#ifndef C_CCHFACTORYSETTINGS_H +#define C_CCHFACTORYSETTINGS_H + +#include +#include +#include + +class CCHFactorySettingsParser; +class MLiwInterface; +class CCHFactorySettingsInstallNotifier; +class CFileMan; +class CCHDbStateHandler; + +class CCHFactorySettings : public CContentHarvesterPlugin + + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + * @param aStorage instance of AS storage DB + */ + static CCHFactorySettings* NewL( MLiwInterface* aInterface ); + static CCHFactorySettings* NewLC( MLiwInterface* aInterface ); + /** + * C++ destructor + */ + ~CCHFactorySettings(); +private: + + /** + * C++ default constructor. + */ + CCHFactorySettings(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( MLiwInterface* aInterface ); + /** + * CreateStorageL. + */ + void CreateStorageL(); + /** + * AddNewL. + */ + void AddNewL(); + /** + * UnInstallL. + */ + void UnInstallL(); + /** + * CheckDrivesL. + */ + void CheckDrivesL(); + +public: + // from CADatServerPlugin + /** + * This function updates all information in CPS related to FactorySettings + */ + void UpdateL(); + +private: + /** + * Data base state handler + */ + CCHDbStateHandler* iDBStateHandler; + + /** + * Sis installation notifier + */ + CCHFactorySettingsInstallNotifier* iInstallNotifier; + + /** + *List containing xml files that should be installed from all drives + */ + CDesCArrayFlat* iFileNewList; + + /** + * File server session + */ + RFs iFs; + + /** + * File manager used for files copying + */ + CFileMan* iFileMan; + + /** + * An interface to Content Publisher Service + */ + MLiwInterface* iCPSInterface; + + /** + * Pointer to a parser object + */ + CCHFactorySettingsParser* iParser; + + /** + * Descriptor containing a path to a directory with files to parse + */ + RBuf iFilePath; + + }; + +#endif // C_CCHFACTORYSETTINGS_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactsetutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/inc/chfactsetutils.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Utils methods. + * +*/ + + +#ifndef FACTSETCHUTILS_H +#define FACTSETCHUTILS_H + +// INCLUDES +#include + +// CLASS DECLARATION +class CGECODefaultObject; +class MXCFWNode; + +/** + * Common utils methods. + * + * @lib aspafactorysettings.lib + * @since Series 60 3.1 + */ +class FactSetCHUtils + { +public: + // New functions + + /** + * Extracts a TUint from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the uint. + * @return TUint Object. + */ + static TUint Str2Uint( const TDesC& aStr ); + + /** + * Extracts a TInt from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the int. + * @return TInt Object. + */ + static TInt Str2Int( const TDesC& aStr ); + + /** + * Extracts a TBool from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the bool. + * @return TBool Object. + */ + static TBool Str2Bool( const TDesC& aStr ); + + /** + * Extracts a TUid from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the uid. + * @return Uid Object. + */ + static TUid Str2Uid( const TDesC& aStr ); + + /** + * Creates HBufC8* from the given string. + * @since Series 60 3.1 + * @param aStr A string to convert to HBufC8*. + * @return HBufC8* Pointer. + */ + static HBufC8* Str2Str8LC( const TDesC& aStr ); + + /** + * Extracts a TReal from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the real value. + * @return Real Object. + */ + static TReal Str2Real( const TDesC& aStr ); + + /** + * Extracts a TInt from the given string. + * @since Series 60 3.1 + * @param aStr A string defining the real value. + * @return Real Object. + */ + static TInt32 Str2Int32( const TDesC& aStr ); + +private: + + /** + * Extracts an integer from the given hex string. + * @since Series 60 3.1 + * @param aStr A hex string containg an integer number. + * @return Integer value of the number. + */ + static TUint StrHex2Uint( const TDesC& aStr ); + + /** + * Extracts an integer from the given string. + * @since Series 60 3.1 + * @param aStr A string containg an integer number. + * @return Integer value of the number. + */ + static TUint StrDec2Uint( const TDesC& aStr ); + + /** + * Handles bad argument passed into utility function + * @since Series 60 3.1 + * @param aCategory describes bad argument + * @param aArgument bad argument + * @param aReason bad argument code + */ + static void BadArgument( const TDesC& aCategory, const TDesC& aArgument, + TInt aReason ); + static void BadArgumentL( const TDesC& aCategory, const TDesC& aArgument, + TInt aReason ); + + /** + * Handles bad argument passed into utility function + * @since Series 60 3.1 + * @param aCategory describes bad argument + * @param aArgument bad argument + * @param aReason bad argument code + */ + static void BadArgument( const TDesC& aCategory, TInt aArgument, + TInt aReason ); + + /** + * Handles bad argument passed into utility function + * @since Series 60 3.1 + * @param aCategory describes bad argument + * @param aReason bad argument code + */ + static void BadArgument( const TDesC& aCategory, TInt aReason ); + + }; + +#endif // FACTSETCHUTILS_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/src/chdbstatehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chdbstatehandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,182 @@ +/* +* 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: Central Repository about DB state change information observer + * +*/ + +#include +#include +#include "cpserverdef.h" +#include "chdbstatehandler.h" +#include "chfactorysettingsplugin.h" + + +_LIT( KParsedDir, "parsed\\fs\\" ); +_LIT( KDriveC, "C:" ); + + +// ============================ MEMBER FUNCTIONS ============================= + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::CCHDbStateHandler() +// +// ----------------------------------------------------------------------------- +// +CCHDbStateHandler::CCHDbStateHandler( CCHFactorySettings* aCallback ) : + CActive( EPriorityStandard ), // Standard priority + iCallback( aCallback ) + { + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::NewL() +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CCHDbStateHandler* CCHDbStateHandler::NewL( + CCHFactorySettings* aCallback ) + { + CCHDbStateHandler* self = new (ELeave) CCHDbStateHandler( aCallback ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::NewL() +// Constructor +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + ConstructFactorySettingsPathL(); + iRepository = CRepository::NewL( KServerUid ); + HandleDbStateL(); + CActiveScheduler::Add(this); // Add to scheduler + iRepository->NotifyRequest( KCPStorageUid, iStatus ); + iStatus = KRequestPending; + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::NewL() +// +// ----------------------------------------------------------------------------- +// +CCHDbStateHandler::~CCHDbStateHandler() + { + Cancel(); // Cancel any request, if outstanding + delete iRepository; + iFs.Close(); + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::NewL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::DoCancel() + { + iRepository->NotifyCancel( KCPStorageUid ); + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::RunL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::RunL() + { + // status contais information about event type + if (iStatus.Int() >= KErrNone) + { + HandleDbStateL(); + iRepository->NotifyRequest( KCPStorageUid, iStatus ); + iStatus = KRequestPending; + SetActive(); + } + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::RunError() +// +// ----------------------------------------------------------------------------- +// +TInt CCHDbStateHandler::RunError(TInt aError) + { + return aError; + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::ConstructFactorySettingsPathL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::ConstructFactorySettingsPathL() + { + TFileName privatePath; + User::LeaveIfError( iFs.PrivatePath( privatePath ) ); + iFSPath.Append( KDriveC ); + iFSPath.Append( privatePath ); + iFSPath.Append( KParsedDir ); + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::RemoveFactorySettingsParsedFilesL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::RemoveFactorySettingsParsedFilesL() + { + CFileMan* fileManager = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileManager ); + fileManager->Delete( iFSPath, CFileMan::ERecurse ); + CleanupStack::PopAndDestroy( fileManager ); + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::HandleDbStateL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::HandleDbStateL() + { + TInt value( 0 ); + if( iRepository->Get( KCPStorageUid, value ) == KErrNone ) + { + if( value & KSQLDBStateRestored ) + { + HandleRestoredDbStateL(); + value ^= KSQLDBStateRestored; + value |= KSQLDBStateNormal; + iRepository->Set( KCPStorageUid, value ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCHDbStateHandler::HandleRestoredStateL() +// +// ----------------------------------------------------------------------------- +// +void CCHDbStateHandler::HandleRestoredDbStateL() + { + RemoveFactorySettingsParsedFilesL(); + iCallback->UpdateL(); + } + + +//End file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsinstallnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsinstallnotifier.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: Sis package installation event listener + * +*/ + + +#include +#include "chfactorysettingsinstallnotifier.h" +#include "chfactorysettingsplugin.h" +#include "cpdebug.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::CCHFactorySettingsInstallNotifier +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsInstallNotifier::CCHFactorySettingsInstallNotifier( + CCHFactorySettings* aCallback, TUid aCategory, TUint aKey ) : + CActive(EPriorityNormal) + { + CActiveScheduler::Add( this ); + + iCallback = aCallback; + iCategory = aCategory; + iKey = aKey; + // Prepare automatically + iProperty.Attach( iCategory, iKey ); + SetActive( ); + iProperty.Subscribe( iStatus ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::ConstructL +// S2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsInstallNotifier::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::NewL +// --------------------------------------------------------------------------- +// +CCHFactorySettingsInstallNotifier* CCHFactorySettingsInstallNotifier::NewL( + CCHFactorySettings* aCallback, TUid aCategory, TUint aKey ) + { + CCHFactorySettingsInstallNotifier* self = + new (ELeave) CCHFactorySettingsInstallNotifier( aCallback, + aCategory, aKey ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::~CCHFactorySettingsInstallNotifier +// --------------------------------------------------------------------------- +// +CCHFactorySettingsInstallNotifier::~CCHFactorySettingsInstallNotifier() + { + Cancel( ); + iProperty.Close( ); + } + +// --------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::DoCancel +// --------------------------------------------------------------------------- +// +void CCHFactorySettingsInstallNotifier::DoCancel() + { + iProperty.Cancel( ); + } + +// --------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::RunError +// --------------------------------------------------------------------------- +// +TInt CCHFactorySettingsInstallNotifier::RunError( TInt /*aError*/) + { + + // No need to do anything + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCHFactorySettingsInstallNotifier::RunL +// --------------------------------------------------------------------------- +// +void CCHFactorySettingsInstallNotifier::RunL() + { + CP_DEBUG(_L8("CCHFactorySettingsInstallNotifier::RunL" )); + // Re-issue request before notifying + SetActive( ); + iProperty.Subscribe( iStatus ); + + TInt status; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KSAUidSoftwareInstallKeyValue, status ) ); + + if ( (status & EInstOpInstall )||(status & EInstOpUninstall ) ) + { + iCallback->UpdateL( ); + } + + } +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsparser.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,502 @@ +/* +* 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: factory settings for content harvester + * +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include + +#include "chfactorysettingsparser.h" +#include "chfactorysettingsglobals.h" +#include "chfactsetutils.h" +#include "cpdebug.h" + +_LIT8( KType, "type" ); +_LIT8( KItem, "item" ); +_LIT8( KData, "data" ); +_LIT8( KAdd, "Add" ); +_LIT8( KDelete, "Delete" ); +_LIT( KCpData, "cp_data" ); +_LIT( KPublisher, "publisher" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::CCHFactorySettingsParser +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsParser::CCHFactorySettingsParser() + { + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::ConstructL( MLiwInterface* aInterface ) + { + iActiveScheduler = new ( ELeave ) CActiveSchedulerWait(); + + iContentEngine = CXCFWEngine::NewL( this ); + iCPSInterface = aInterface; + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsParser* CCHFactorySettingsParser::NewL( + MLiwInterface* aInterface ) + { + CCHFactorySettingsParser* self = NewLC( aInterface ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsParser* CCHFactorySettingsParser::NewLC( + MLiwInterface* aInterface ) + { + CCHFactorySettingsParser* self = new( ELeave ) CCHFactorySettingsParser(); + CleanupStack::PushL( self ); + self->ConstructL( aInterface ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsParser::~CCHFactorySettingsParser() + { + delete iContentTree; + delete iContentEngine; + delete iActiveScheduler; + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::RestoreL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CCHFactorySettingsParser::RestoreL( const TDesC& aStr, TBool aUnInstall ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::RestoreL" )); + TInt err; + iContentTree = CXCFWTree::NewL( ); + + iContentEngine->LoadL( *iContentTree, aStr ); + + iActiveScheduler->Start( ); + + if ( iCompletionStatus == MADatFactorySettingsObserver::ECompleted ) + { + //this trap ensures stoping the ActiveSheduler + //in case a leave occurs when updating data + TRAP( err, HandleEntriesL( aUnInstall ) ); + } + + delete iContentTree; + iContentTree = NULL; + return err; + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::HandleCompletionL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::HandleCompletionL( + TADatFactorySettingsStatus aStatus ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::HandleCompletionL" )); + iCompletionStatus = aStatus; + iActiveScheduler->AsyncStop( ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::HandleEngineEventL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::HandleEngineEventL( TXCFWEngineEvent aEvent ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::HandleEngineEventL" )); + // handle completion + if ( aEvent == EEvtParsingComplete ) + { + TADatFactorySettingsStatus status = + MADatFactorySettingsObserver::ECompleted; + HandleCompletionL( status ); + } + + // else => ignore + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::HandleEngineErrorL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::HandleEngineErrorL( TInt /*aErrorCode*/) + { + HandleCompletionL( MADatFactorySettingsObserver::EFailed ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::HandleEntriesL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::HandleEntriesL( TBool aUnInstall ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::HandleEntriesL" )); + MXCFWNode* root = iContentTree->Root( ); + // get children + RNodeArray entries; + CleanupClosePushL( entries ); + iContentTree->GetChildNodesL( root, entries ); + for ( TInt i = 0; i < entries.Count( ); i++ ) + { + TPtrC typeIdentifier(entries[i]->Data()->TypeIdentifier( )); + + if ( ( typeIdentifier == KMainDataItem ) + || ( typeIdentifier == KMainPublisherItem ) ) + { + CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); + CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + if ( typeIdentifier == KMainDataItem ) + { + TLiwGenericParam item_type( KType, TLiwVariant( KCpData )); + inparam->AppendL( item_type ); + } + else + { + TLiwGenericParam item_type( KType, TLiwVariant( KPublisher )); + inparam->AppendL( item_type ); + } + + if ( aUnInstall ) + { + RemoveItemL( entries[i], map ); + TLiwGenericParam item( KData, TLiwVariant( map )); + inparam->AppendL( item ); + iCPSInterface->ExecuteCmdL( KDelete, *inparam, *outparam ); + } + else + { + AddItemL( entries[i], map, EMap ); + TLiwGenericParam item( KItem, TLiwVariant( map )); + inparam->AppendL( item ); + iCPSInterface->ExecuteCmdL( KAdd, *inparam, *outparam ); + } + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( outparam ); + CleanupStack::PopAndDestroy( inparam ); + } + + } + // clean up + CleanupStack::PopAndDestroy( &entries ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::AddMapL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::AddItemL( MXCFWNode* aItem, + CLiwContainer* aContainer, TTypes aType ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::AddItemL" )); + RNodeArray children; + CleanupClosePushL( children ); + iContentTree->GetChildNodesL( aItem, children ); + for ( TInt i = 0; i < children.Count( ); i++ ) + { + if ( children[i]->Data()->TypeIdentifier( ) == KDataItem ) + { + switch ( aType ) + { + case EMap: + ExtractAttributesAndAddL( children[i], + static_cast(aContainer) ); + break; + case EList: + ExtractAttributesAndAddL( children[i], + static_cast(aContainer ) ); + break; + default: + { + User::Panic( _L("Wrong Type" ),1 ); + } + } + + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettingsParser::RemoveItemL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::RemoveItemL( MXCFWNode* aItem, + CLiwDefaultMap* aMap ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::RemoveItemL" )); + RNodeArray children; + CleanupClosePushL( children ); + iContentTree->GetChildNodesL( aItem, children ); + for ( TInt i = 0; i < children.Count( ); i++ ) + { + if ( children[i]->Data()->TypeIdentifier( ) == KDataItem ) + { + ExtractDeleteAttributesL( children[i], aMap ); + } + } + CleanupStack::PopAndDestroy( &children ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::ExtractAttributesAndAddL( MXCFWNode* aItem, + CLiwDefaultList* aList ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::ExtractAttributesAndAddL" )); + TPtrC type; + CGECODefaultObject* node= + static_cast(aItem->Data( )); + if ( !node->GetAttribute( KAttributeType, type ) ) + { + HBufC8* bufV= NULL; + CLiwDefaultMap* nestedMap= NULL; + CLiwDefaultList* nestedList= NULL; + TPtrC value; + TBool valueExist(node->GetAttribute( KAttributeValue, value ) ); + TTypes typeCheck = ConvertToType( type ); + //check if value exist + //it is not needed in case of Map and List + if ( valueExist==KErrNone || typeCheck==EMap || typeCheck==EList ) + { + switch ( typeCheck ) + { + case EInteger: + aList->AppendL( FactSetCHUtils::Str2Int32( value ) ); + break; + case EUInteger: + aList->AppendL( FactSetCHUtils::Str2Uint( value ) ); + break; + case EDescriptor8: + bufV = FactSetCHUtils::Str2Str8LC( value ); + aList->AppendL( *bufV ); + CleanupStack::PopAndDestroy( bufV ); + break; + case EDescriptor16: + aList->AppendL( value ); + break; + case EMap: + nestedMap = CLiwDefaultMap::NewLC( ); + AddItemL( aItem, nestedMap, EMap ); + aList->AppendL( nestedMap ); + CleanupStack::PopAndDestroy( nestedMap ); + break; + case EList: + nestedList = CLiwDefaultList::NewLC( ); + AddItemL( aItem, nestedList, EList ); + aList->AppendL( nestedList ); + CleanupStack::PopAndDestroy( nestedList ); + break; + case EBool: + aList->AppendL( FactSetCHUtils::Str2Bool( value ) ); + break; + case EReal: + aList->AppendL( FactSetCHUtils::Str2Real( value ) ); + case EUid: + aList->AppendL( FactSetCHUtils::Str2Uid( value ) ); + break; + default: + { + //wrong type - ignore + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::ExtractAttributesAndAddL( MXCFWNode* aItem, + CLiwDefaultMap* aMap ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::ExtractAttributesAndAddL" )); + TPtrC key; + TPtrC type; + CGECODefaultObject* node= + static_cast(aItem->Data( )); + if ( !node->GetAttribute( KAttributeType, type ) + && !node->GetAttribute( KAttributeKey, key ) ) + { + HBufC8* bufV= NULL; + CLiwDefaultMap* nestedMap= NULL; + HBufC8* buf = FactSetCHUtils::Str2Str8LC( key ); + TPtrC value; + CLiwDefaultList* nestedList= NULL; + TBool valueExist(node->GetAttribute( KAttributeValue, value ) ); + TTypes typeCheck = ConvertToType( type ); + //check if value exist + //it is not needed in case of Map and List + if ( valueExist==KErrNone || typeCheck==EMap || typeCheck==EList ) + { + switch ( typeCheck ) + { + case EInteger: + aMap->InsertL( *buf, FactSetCHUtils::Str2Int32( value ) ); + break; + case EUInteger: + aMap->InsertL( *buf, FactSetCHUtils::Str2Uint( value ) ); + break; + case EDescriptor8: + bufV = FactSetCHUtils::Str2Str8LC( value ); + aMap->InsertL( *buf, *bufV ); + CleanupStack::PopAndDestroy( bufV ); + break; + case EDescriptor16: + aMap->InsertL( *buf, value ); + break; + case EMap: + nestedMap = CLiwDefaultMap::NewL( ); + AddItemL( aItem, nestedMap, EMap ); + aMap->InsertL( *buf, nestedMap ); + nestedMap->DecRef( ); + break; + case EList: + nestedList = CLiwDefaultList::NewL( ); + AddItemL( aItem, nestedList, EList ); + aMap->InsertL( *buf, nestedList ); + nestedList->DecRef( ); + break; + case EBool: + aMap->InsertL( *buf, FactSetCHUtils::Str2Bool( value ) ); + break; + case EReal: + aMap->InsertL( *buf, FactSetCHUtils::Str2Real( value ) ); + break; + case EUid: + aMap->InsertL( *buf, FactSetCHUtils::Str2Uid( value ) ); + break; + default: + { + //wrong type - ignore + } + } + } + CleanupStack::PopAndDestroy( buf ); + } + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCHFactorySettingsParser::ExtractDeleteAttributesL( MXCFWNode* aItem, + CLiwDefaultMap* aMap ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::ExtractDeleteAttributesL" )); + TPtrC key; + TPtrC type; + CGECODefaultObject* node= + static_cast(aItem->Data( )); + if ( !node->GetAttribute( KAttributeType, type ) + && !node->GetAttribute( KAttributeKey, key ) ) + { + HBufC8* bufV= NULL; + HBufC8* buf = FactSetCHUtils::Str2Str8LC( key ); + TPtrC value; + TBool valueExist(node->GetAttribute( KAttributeValue, value ) ); + TTypes typeCheck = ConvertToType( type ); + //check if value exist + if ( valueExist==KErrNone ) + { + switch ( typeCheck ) + { + case EDescriptor8: + bufV = FactSetCHUtils::Str2Str8LC( value ); + aMap->InsertL( *buf, *bufV ); + CleanupStack::PopAndDestroy( bufV ); + break; + case EDescriptor16: + aMap->InsertL( *buf, value ); + break; + + default: + { + //wrong type - ignore + } + } + } + CleanupStack::PopAndDestroy( buf ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCHFactorySettingsParser::TTypes CCHFactorySettingsParser::ConvertToType( + const TDesC& aType ) + { + CP_DEBUG(_L8("CCHFactorySettingsParser::ConvertToType" )); + if ( !aType.Compare( KInteger ) ) + return EInteger; + if ( !aType.Compare( KUInteger ) ) + return EUInteger; + if ( !aType.Compare( KDescriptor8 ) ) + return EDescriptor8; + if ( !aType.Compare( KDescriptor16 ) ) + return EDescriptor16; + if ( !aType.Compare( KMap ) ) + return EMap; + if ( !aType.Compare( KList ) ) + return EList; + if ( !aType.Compare( KBool ) ) + return EBool; + if ( !aType.Compare( KReal ) ) + return EReal; + if ( !aType.Compare( KUid ) ) + return EUid; + return EUndefined; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactorysettingsplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +// INCLUDE FILES + +#include +#include + +#include "chfactorysettingsplugin.h" +#include "chfactorysettingsparser.h" +#include "chfactorysettingsinstallnotifier.h" +#include "cpdebug.h" +#include "chdbstatehandler.h" + +// LOCAL CONSTANTS AND MACROS +const TInt KADatFactorySettingsServerPluginUid( 0x102830EF); +// Dynamically loaded data storage handler + +const TInt KDefaultGranularity = 5; + +_LIT( KDirFSNew, "import\\fs\\" ); +_LIT( KParsedDir, "parsed\\fs\\" ); +_LIT( KParsed, "parsed\\" ); +_LIT( KFs, "fs\\" ); + +_LIT( KDriveC, "C:" ); +_LIT( KColen, ":" ); + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + { + { + KADatFactorySettingsServerPluginUid + }, ( TProxyNewLPtr )CCHFactorySettings::NewL + } + }; + +// ---------------------------------------------------------------------------- +// ImplementationGroupProxy +// Exported proxy for instantiation method resolution +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* +ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / + sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCHFactorySettings::CCHFactorySettings +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCHFactorySettings::CCHFactorySettings() + { + + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettings::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCHFactorySettings::ConstructL( MLiwInterface* aInterface ) + { + CP_DEBUG(_L8("CCHFactorySettings::ConstructL" )); + iCPSInterface = aInterface; + iFileNewList = new (ELeave) CDesCArrayFlat(KDefaultGranularity); + User::LeaveIfError( iFs.Connect( ) ); + iInstallNotifier = CCHFactorySettingsInstallNotifier::NewL( this, + KUidSystemCategory, KSAUidSoftwareInstallKeyValue ); + + iParser = CCHFactorySettingsParser::NewL( iCPSInterface ); + + iFileMan = CFileMan::NewL( iFs ); + iFilePath.CreateL( KMaxPath ); + + iFs.CreatePrivatePath( EDriveC ); + User::LeaveIfError( iFs.PrivatePath( iFilePath ) ); + + //create "parsed" directory if it doesn't exist yet; + RBuf filePath; + filePath.CreateL( KMaxPath ); + filePath.Append( KDriveC ); + filePath.Append( iFilePath ); + filePath.Append( KParsed ); + iFs.MkDir( filePath ); + filePath.Append( KFs ); + iFs.MkDir( filePath ); + filePath.Close( ); + iDBStateHandler = CCHDbStateHandler::NewL( this ); + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettings::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCHFactorySettings* CCHFactorySettings::NewL( MLiwInterface* aInterface ) + { + CCHFactorySettings* self = NewLC( aInterface ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCHFactorySettings::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCHFactorySettings* CCHFactorySettings::NewLC( MLiwInterface* aInterface ) + { + CCHFactorySettings* self = new( ELeave ) CCHFactorySettings(); + CleanupStack::PushL( self ); + self->ConstructL( aInterface ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CCHFactorySettings::~CCHFactorySettings() + { + delete iFileNewList; + delete iInstallNotifier; + delete iFileMan; + delete iParser; + iFs.Close( ); + iFilePath.Close( ); + delete iDBStateHandler; + } + +// ---------------------------------------------------------------------------- +// CCHFactorySettings::UpdateL +// +// ---------------------------------------------------------------------------- +// +void CCHFactorySettings::UpdateL() + { + CP_DEBUG(_L8("CCHFactorySettings::UpdateL" )); + CheckDrivesL( ); // fill in list with file names from all drives + AddNewL( ); // if any of them isn't added to db then add + UnInstallL( ); // if any of files from any drive was removed remove data + // from DB + + } + +// ---------------------------------------------------------------------------- +// CCHFactorySettings::AddNewL +// Add new entries after sis intallation. +// ---------------------------------------------------------------------------- +// +void CCHFactorySettings::AddNewL() + { + CP_DEBUG(_L8("CCHFactorySettings::AddNewL" )); + CDir* fileListInstalled= NULL; + RBuf filePath; + filePath.CreateL( KMaxPath ); + CleanupClosePushL( filePath ); + filePath.Append( KDriveC ); + filePath.Append( iFilePath ); + filePath.Append( KParsedDir ); + iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName, + fileListInstalled ); + CleanupStack::PushL( fileListInstalled ); + + for ( TInt i(0); iCount( ); i++ ) + { + TBool parse(ETrue); + TPtrC fileNewName = + (*iFileNewList)[i].Mid( (*iFileNewList)[i].LocateReverse( '\\' ) + 1 ); + TInt count = fileListInstalled->Count( ); + for ( TInt j(0); j< count; j++ ) + { + TPtrC existingFile = (*fileListInstalled)[j].iName; + if ( fileNewName.Compare( existingFile ) ) + { + parse = ETrue; + } + else + { + parse = EFalse; + break; + } + } + if ( parse ) + { + //file wasn't found in afterinstallation dir + //so should be copied and entries install + TBool fileOpened(ETrue); + iFs.IsFileOpen( (*iFileNewList)[i], fileOpened ); + + if ( !fileOpened ) + { + TInt error = iParser->RestoreL( (*iFileNewList)[i], EFalse ); + if ( error == KErrNone ) + { + iFileMan->Copy( (*iFileNewList)[i], filePath ); + } + } + + } + } + CleanupStack::PopAndDestroy( fileListInstalled ); + CleanupStack::PopAndDestroy( &filePath ); + } + +// ---------------------------------------------------------------------------- +// CCHFactorySettings::UnInstallL +// Removes entries after uninstallation. +// ---------------------------------------------------------------------------- +// +void CCHFactorySettings::UnInstallL() + { + CP_DEBUG(_L8("CCHFactorySettings::UnInstallL" )); + TBool found(EFalse); + CDir* fileListInstalled= NULL; + RBuf filePath; + filePath.CreateL( KMaxPath ); + CleanupClosePushL( filePath ); + filePath.Append( KDriveC ); + filePath.Append( iFilePath ); + filePath.Append( KParsedDir ); + iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName, + fileListInstalled ); + CleanupStack::PushL( fileListInstalled ); + + for ( TInt i(0); iCount( ); i++ ) + { + TPtrC fileInstalledName = (*fileListInstalled)[i].iName; + found = EFalse; + for ( TInt j(0); jCount( ); j++ ) + { + TPtrC fileNewPath = (*iFileNewList)[j]; + TPtrC fileNewName = + (*iFileNewList)[j].Mid( (*iFileNewList)[j].LocateReverse( '\\' ) + 1 ); + if ( fileInstalledName.Compare( fileNewName )==0 ) + { + if ( !(*fileListInstalled)[i].IsDir( ) ) + { + found = ETrue; + break; + } + } + } + if ( !found ) //this file should be removed also entries from database + { + filePath.Zero( ); + filePath.Append( KDriveC ); + filePath.Append( iFilePath ); + filePath.Append( KParsedDir ); + filePath.Append( fileInstalledName ); + + iParser->RestoreL( filePath, ETrue ); + iFileMan->Delete( filePath ); + } + } + CleanupStack::PopAndDestroy( fileListInstalled ); + CleanupStack::PopAndDestroy( &filePath ); + } + +// ---------------------------------------------------------------------------- +// CCHFactorySettings::CheckDrivesL +// +// ---------------------------------------------------------------------------- +// +void CCHFactorySettings::CheckDrivesL() + { + CP_DEBUG(_L8("CCHFactorySettings::CheckDrivesL" )); + iFileNewList->Reset( ); + TDriveList driveList; + TChar driveLetter; + User::LeaveIfError( iFs.DriveList( driveList ) ); + for ( TInt driveNumber=EDriveA; driveNumber <= EDriveZ; driveNumber++ ) + { + if ( driveList[driveNumber] ) + { + User::LeaveIfError( iFs.DriveToChar( driveNumber, driveLetter ) ); + RBuf filePath; + filePath.CreateL( KMaxPath ); + CleanupClosePushL( filePath ); + filePath.Append( driveLetter ); + filePath.Append( KColen ); + filePath.Append( iFilePath ); + filePath.Append( KDirFSNew ); + CDir* fileList; + iFs.GetDir( filePath, KEntryAttMaskSupported, ESortByName, + fileList ); + CleanupStack::PopAndDestroy( &filePath ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + for ( TInt i(0); iCount( ); i++ ) + { + RBuf fullFileName; + fullFileName.CreateL( KMaxPath ); + CleanupClosePushL( fullFileName ); + fullFileName.Append( driveLetter ); + fullFileName.Append( KColen ); + fullFileName.Append( iFilePath ); + fullFileName.Append( KDirFSNew ) ; + fullFileName.Append( (*fileList)[i].iName ); + if ( !(*fileList)[i].IsDir( ) ) + { + //check if already exist + iFileNewList->AppendL( fullFileName ); + } + CleanupStack::PopAndDestroy( &fullFileName ); + } + CleanupStack::PopAndDestroy( fileList ); + } + } + } + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactsetutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/src/chfactsetutils.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,227 @@ +/* +* 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: Utils methods. + * +*/ + + +// INCLUDE FILES +#include +#include + +#include "chfactsetutils.h" +#include "chfactorysettingsglobals.h" +#include "cpdebug.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::StrDec2Int +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TUint FactSetCHUtils::StrDec2Uint( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::StrDec2Uint" )); + TLex lexer(aStr); + TInt ret; + if ( lexer.Val( ret ) ) + { + _LIT(KDesc, "Int"); + BadArgument( KDesc, aStr, KErrArgument ) ; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2Uint +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TUint FactSetCHUtils::Str2Uint( const TDesC& aStr ) + { + TUint ret(Str2Int( aStr ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2Bool +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool FactSetCHUtils::Str2Bool( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::Str2Bool" )); + TBool ret; + if ( !aStr.Compare( KTrue ) ) + { + ret = ETrue; + } + else if ( !aStr.Compare( KFalse ) ) + { + ret = EFalse; + } + else + ret = (Str2Int( aStr ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2Int +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt FactSetCHUtils::Str2Int( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::Str2Int" )); + // if a string starts from '0x' then convert aStr from hex to int. + // else send aStr to the StrDec2Uint + _LIT(KHexStart,"0x"); + + TInt position(aStr.Find( KHexStart ) ); + TInt ret(KErrArgument); + if ( position == 0 ) + { + // is hex + TPtrC string(aStr.Mid( KHexStart().Length( ) ) ); + + ret = StrHex2Uint( string ); + } + else + { + ret = StrDec2Uint( aStr ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::StrHex2UintL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TUint FactSetCHUtils::StrHex2Uint( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::StrHex2Uint" )); + TLex lexer(aStr); + TUint ret; + if ( lexer.Val( ret, EHex ) ) + { + _LIT(KDesc, "Hex"); + BadArgument( KDesc, aStr, KErrArgument ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2Str8L +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC8* FactSetCHUtils::Str2Str8LC( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::Str2Str8LC" )); + HBufC8* ret = HBufC8::NewLC( aStr.Length( ) ); + ret->Des().Copy( aStr ); + return ret; + } +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2UidL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TUid FactSetCHUtils::Str2Uid( const TDesC& aStr ) + { + return TUid( TUid::Uid( Str2Uint( aStr ) ) ); + } +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2UidL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TReal FactSetCHUtils::Str2Real( const TDesC& aStr ) + { + CP_DEBUG(_L8("FactSetCHUtils::Str2Real" )); + TLex lexer(aStr); + TReal ret; + if ( lexer.Val( ret ) ) + { + _LIT(KDesc, "Real"); + BadArgument( KDesc, aStr, KErrArgument ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::Str2IntL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt32 FactSetCHUtils::Str2Int32( const TDesC& aStr ) + { + TInt32 ret(Str2Int( aStr ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// FactSetCHUtils::BadArgument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void FactSetCHUtils::BadArgument( const TDesC& aCategory, + const TDesC& aArgument, TInt aReason ) + { + TRAP_IGNORE( BadArgumentL(aCategory, aArgument, aReason) ); + } +// ----------------------------------------------------------------------------- +// FactSetCHUtils::BadArgumentL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void FactSetCHUtils::BadArgumentL( const TDesC& aCategory, + const TDesC& aArgument, TInt aReason ) + { + CP_DEBUG(_L8("FactSetCHUtils::BadArgumentL" )); + _LIT(K2Dot,":"); + HBufC* buf = HBufC::NewLC( aCategory.Length( ) + aArgument.Length( ) + + K2Dot().Length( ) ); + TPtr ptr(buf->Des( ) ); + ptr.Copy( aCategory ); + ptr.Append( K2Dot ); + ptr.Append( aArgument ); + BadArgument( ptr, aReason ); + CleanupStack::PopAndDestroy( buf ); + } +// ----------------------------------------------------------------------------- +// FactSetCHUtils::BadArgument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void FactSetCHUtils::BadArgument( const TDesC& aCategory, TInt aArgument, + TInt aReason ) + { + TBuf buf; + buf.Num( aArgument ); + BadArgument( aCategory, buf, aReason ); + } +// ----------------------------------------------------------------------------- +// FactSetCHUtils::BadArgument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void FactSetCHUtils::BadArgument( const TDesC& aCategory, TInt aReason ) + { + User::Panic( aCategory, aReason ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentharvester/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 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: Build info for the Content Publisher subsystem +* +*/ + +#include +PRJ_PLATFORMS +WINSCW ARMV5 +//DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES + +#include "../contentharvesterclient/group/bld.inf" +#include "../contentharvesterserver/group/bld.inf" +#include "../factorysettingsplugin/group/bld.inf" +#include "../contentharvesterswiplugin/group/bld.inf" + +PRJ_EXPORTS + + +#ifdef _MATRIX_MENU_INCLUDE_TEST_CONTENT +#include "../internal/group/bld.inf" +#endif +// End of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/data/20016b7b.txt Binary file contentpublishingsrv/contentpublishingserver/cpserver/data/20016b7b.txt has changed diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/data/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/data/backup_registration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Server +* +*/ + + + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS +../data/backup_registration.xml /epoc32/release/winscw/udeb/z/private/20016b7b/backup_registration.xml +../data/backup_registration.xml /epoc32/release/winscw/urel/z/private/20016b7b/backup_registration.xml +../data/backup_registration.xml /epoc32/data/z/private/20016b7b/backup_registration.xml + +// Cenrep +../data/20016b7b.txt /epoc32/release/winscw/udeb/z/private/10202be9/20016b7b.txt +../data/20016b7b.txt /epoc32/release/winscw/urel/z/private/10202be9/20016b7b.txt +../data/20016b7b.txt /epoc32/data/z/private/10202be9/20016b7b.txt + +../inc/cpglobals.h |../../../../inc/cpglobals.h +../inc/cpserverdef.h |../../../../inc/cpserverdef.h + +PRJ_MMPFILES +cpserver.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/group/cpserver.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 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: ?Description +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET cpserver.exe +TARGETTYPE exe +CAPABILITY CAP_SERVER + +UID 0 0x20016B7B + +SOURCEPATH ../src +SOURCE cpserver.cpp +SOURCE cpserversession.cpp +SOURCE cpserverdatamanager.cpp +SOURCE cpserveractionmanager.cpp +SOURCE cpnotificationhandler.cpp +SOURCE cpserverburlistener.cpp +SOURCE cpactionhandlerthread.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../cpsqlitestorage/inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingmap/inc + +// Default system include paths for application layer modules. +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY liwservicehandler.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY estor.lib +LIBRARY cputils.lib +LIBRARY cpstorage.lib +LIBRARY inetprotutil.lib +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif + + +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactionhandlerthread.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpactionhandlerthread.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,235 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPACTIONHANDLERTHREAD_H_ +#define CPACTIONHANDLERTHREAD_H_ + +#include +#include +#include + +class MLiwInterface; +class CLiwGenericParamList; +class CCPActionManager; + +/** + * The function to be passed as an argument to RThread::Create. + * + * It just calls CCPActionHandlerThread::ThreadFunction. The only + * reason this declaration is in the header file is to let + * CCPActionHandlerThread declare friendship with this funcion. + * + * @param aParam pointer to CCPActionHandlerThread object + * @return error code + */ +TInt CPExecutionThreadFunction( TAny* aParam ); + +/** + * Action handler thread. + * + * Provides easy-to-use interface for executing plugin actions + * in a separate thread. + * @since S60 5.0 + */ +class CCPActionHandlerThread: public CBase + { + friend TInt CPExecutionThreadFunction( TAny* ); + +public: + + /** + * Creates new instance of CCPActionHandlerThread. + * + * @return new instance of CCPActionHandlerThread + */ + static CCPActionHandlerThread* NewL(); + + /** + * Creates new instance of CCPActionHandlerThread. + * + * @return new instance of CCPActionHandlerThread + */ + static CCPActionHandlerThread* NewLC(); + + /** + * Destructor. + * Stops the action execution thread. + */ + ~CCPActionHandlerThread(); + + /** + * Executes an action handler action in the action execution thread. + * + * @param aActionParams action parameters + */ + void ExecuteL( const CLiwGenericParamList& aActionParams ); + + /** + * Starts the action execution thread. + * + * Creates a new instance of action execution thread + * provided it is not running already. + */ + void StartExecutionThreadIfNeededL(); + + /** + * Checks whether action execution thread is alive. + * + * @return ETrue if the thread is alive, EFalse otherwise. + */ + TBool ExecutionThreadRunning(); + +private: + /** + * Constructor. + */ + CCPActionHandlerThread(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * This function is run is a separate thread. It creates + * CServerEikonEnv and CServerAppUi objects, which provide + * a trap cleanup and an active scheduler for the thread and + * then starts the active scheduler. + * + * @return error code + */ + TInt ThreadFunction(); + +private: // internal data types + + /** + * EIkonEnv for the server process. + */ + class CServerEikonEnv : public CEikonEnv + { + public: + void DestroyEnvironment(); + void ConstructL(); + }; + + /** + * EikAppUi for the server process. + */ + class CServerAppUi : public CEikAppUi + { + public: + ~CServerAppUi(); + void ConstructL(); + }; + + /** + * A simple active object for executin actions. + * Objects of this class are created and destroyed + * by action execution thread. + */ + class CActionExecutorAO: public CActive + { + public: + /** + * Factory method. + */ + static CActionExecutorAO* NewL(); + /** + * Factory method. + */ + static CActionExecutorAO* NewLC(); + /** + * Destructor. + */ + ~CActionExecutorAO(); + /** + * The RunL method which is run whever an action needs + * to be executed in the action execution thread. + * It just executes the action using the parameters + * supplied with a call to SetActionParams. If that + * parameters are NULL, it stops the active scheduler + * thus terminating action execution thread. + */ + void RunL(); + /** + * A dummy cancel method required by Symbian. + */ + void DoCancel(); + /** + * Returns a pointer to this active object's iStatus + * member variable. + */ + TRequestStatus* RequestStatus(); + /** + * TODO + * Sets paramters of the action to be executed in RunL. + * This method is supposed to be called from the main CPS thread. + * @param aActionParams action parameters + */ + void SetActionParams( const CLiwGenericParamList* aActionParams ); + private: + /** + * Constructor. + */ + CActionExecutorAO(); + /** + * 2nd phase constructor. + */ + void ConstructL(); + private: + /** + * Parameters of the action to be executed in RunL. + * Not own. + */ + const CLiwGenericParamList* iActionParams; + /** + * Action manager instance. + * Own. + */ + CCPActionManager* iActionManager; + }; + +private: // data + /** + * Handle to the action execution thread. + * Own. + */ + RThread iActionExecThread; + + /** + * Active object created in the action execution thread. + * Own. + */ + CActionExecutorAO *iActionExecutorAO; + + /** + * ETrue if action execution thread was started at least once. + */ + TBool iActionExecThreadStarted; + + /** + * A counter for naming action execution thread. + * + * Every action execution thread has a number appended to its name. + * When the thread dies (i.e. as a result of panic in a plugin), a + * new instance of that thread is started with the number in the name + * increased by one. + */ + TUint iThreadNum; + }; + +#endif /* CPACTIONHANDLERTHREAD_H_ */ diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpglobals.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,207 @@ +/* +* 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: Class used by session to handle asynchronous requests + * +*/ + + +#ifndef C_CPNOTIFICATIONHANDLER_H +#define C_CPNOTIFICATIONHANDLER_H + +#include +#include + +class CLiwGenericParamList; +class CLiwDefaultList; +class CLiwDefaultMap; +class CCPLiwMap; + +/** + * Internal class for handling asynchronous request + * for notifications. Used by server session object. + * + * @since S60 v5.0 + */ +class CCPNotificationHandler : public CBase + { +public: + + /** + * Two-phased constructor. + */ + static CCPNotificationHandler* NewL( RPointerArray& + aNotifications ); + + /** + * Two-phased constructor. + */ + static CCPNotificationHandler* NewLC( RPointerArray& + aNotifications ); + + /** + * Destructor. + */ + virtual ~CCPNotificationHandler(); + + /** + * Save message from client and initialize needed members + */ + void SaveMessageL( const RMessage2& aMessage ); + + /** + * Adds observer + */ + void AddObserverL( const RMessage2& aMessage ); + + /** + * Removes observer + */ + void RemoveObserverL( const RMessage2& aMessage ); + + /** + * Invoked in order to send notification + * @param List of changes to send + */ + void SendNotificationL( CLiwDefaultList* aListOfMaps ); + + /** + * Getter + * @return pointer to current notification + */ + const CLiwGenericParamList* GetPointerToChangeInfoList(); + + /** + * Resets internal stare + */ + void Reset(); + + /** + * Completes iMessage with provided error + * @param Error Code + */ + void ErrorComplete( TInt aErrCode ); + +private: + + /** + * C++ default constructor. + */ + CCPNotificationHandler(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( RPointerArray& aNotifications ); + + /** + * Invoked in order to send notification + * @param List of changes to send + * @since Series 60 5.0 + */ + TBool SendChangeInfoListL( const CLiwDefaultList* aListOfMaps ); + + /** + * Compares argument to stored filter + * @param aMap Information about change + * @param aFilter filter to compare with + * @return ETrue if argument matches filter + */ + TBool IsProperForFilterL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ); + + /** + * Extracts parameter from LIW Map + * + * @param aMap Source Map + * @param aProperty Key of parameter to extract + * @param aResult Target for value + */ + void GetPropertyL( const CLiwDefaultMap& aMap, const TDesC8& aProperty, + RBuf& aResult ); + + /** + * Checks if IDs are the same + * + * @param aMap Map with notifications + * @param aFilter filter to compare with + * @return ETrue if ID are identical + */ + TBool CheckIdL( const CLiwDefaultMap& aMap, const CCPLiwMap& aFilter ); + + /** + * Checks if Properties like publisher,content type + * and content id are the same + * + * @param aMap Map with notifications + * @param aFilter filter to compare with + * @return ETrue if Parameters are identical + */ + TBool CheckPropertiesL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ); + + /** + * Checks if operation types are the same + * + * @param aMap Map with notifications + * @param aFilter filter to compare with + * @return ETrue if operation types are the same + */ + TBool CheckOperationTypeL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ); + + /** + * Checks if registry types are the same + * + * @param aMap Map with notifications + * @param aFilter filter to compare with + * @return ETrue if registry types are the same + */ + TBool CheckRegistryTypeL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ); + +private: + // data + + /* + * Own. + * ETrue if message is ready to send notification + */ + TBool iIsReadyToSend; + + /* + * Own. + * List of waiting notifications. + */ + RPointerArray iNotifications; + + /* + * Not own. + * Message from client + */ + RMessage2 iMessage; + + /* + * Own. + * Notification to send. + */ + CLiwGenericParamList* iChangeInfoList; + + /* + * Own. + * Filters + */ + RHashMap< TInt32, CCPLiwMap*> iFilters; + }; + +#endif // C_CPNOTIFICATIONHANDLER_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,227 @@ +/* +* 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: Content Publisher Server - Main class +* +*/ + + +#ifndef C_CCPSERVER_H +#define C_CCPSERVER_H + +// INCLUDES +#include +#include "cpserverdef.h" +#include "cpserverburlistener.h" + +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif + +class CCPDataManager; +class CCPActionHandlerThread; +class CCPServer; + +struct TPointersForSession + { + CCPServer* iServer; + CCPDataManager* iDataManager; + CCPActionHandlerThread* iActionHandlerThread; + }; + +// CLASS DECLARATION +/** + * Content Publisher Server implementation + * + * @since Series 60 5.0 + */ +class CCPServer : public CPolicyServer, public MBURListenerCallback + { +public: + // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCPServer* NewLC(); + + /** + * Destructor. + */ + virtual ~CCPServer(); + +public: + // New functions + + /** + * Stops server. + */ + void Stop(); + + /** + * Panic client. + * @param aMessage RMessage2 + * @param aPanic panic code + */ + static void PanicClient( const RMessage2& aMessage, + TCPServerPanic aPanic ); + + /** + * start server + * @return aErr Error code. + */ + static TInt ThreadStart(); + + /** + * Decrements session counter + */ + void RemoveSession(); + + /** + * Increments session counter + */ + void AddSession(); + + /** + * HandleBUREventL is called when Backup and Restore state has been changed. + * + * @since S60 v3.1 + * @param aStatus Current Backup and Restore status. + */ + void HandleBUREventL( TBURStatus aStatus ); + + /** + * Get Lock + * + * @return ETrue if Backup or Restore are running + */ + TBool GetLock(); + + /** + * Returns notifications array + */ + RPointerArray& CCPServer::GetNotifications( ); + +private: + // From CActive + + /** + * Process any errors. + * @param aError the leave code reported + * @return KErrNone if leave is handled + */ + TInt RunError( TInt aError ); + +private: + // New methods + + /** + * Constructs the server. + * @param aPriority CServer2 input parameter + */ + CCPServer( TInt aPriority ); + + /** + * Perform the second phase construction of a CCPServer object. + */ + void ConstructL(); + + /** + * Panic the server. + * @param param aPanic the panic code + * @return a updateId of container + */ + static void PanicServer( TCPServerPanic aPanic ); + + /** + * Send notification + * @param Map containing ids of item + */ + void AppendNotificationL( CCPLiwMap* aMap ); + + +private: + // From CServer2 + + /** + * Create a time server session, and return a pointer to the created object. + * @param aVersion the client version + * @param aMessage RMessage2 + * @return pointer to new session + */ + CSession2* NewSessionL( const TVersion& /*aVersion*/, + const RMessage2& /*aMessage*/) const; + + /** + * create and run server + */ + static void CreateAndRunServerL(); + + + /** + * Publishers deactivation + */ + void DeactivatePublishersL(); + + + /** + * Resets Activate flag and update item in the DB + */ + void ResetAndUpdateFlagL( CCPLiwMap* aMap ); + +private: + //data + + /* + * Manager to send and receive data beetween server and storage + * Own. + */ + CCPDataManager* iDataManager; + + /* + * Manager to prepare and execute action + * Own. + */ + CCPActionHandlerThread* iActionHandlerThread; + + /* + * Count of sessions + * Own. + */ + TInt iCountSession; + + /** + * Notifier for Backup and Restore changes. + * Own. + */ + CCPServerBURListener* iBURListener; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + + /* + * Own. + * True if database is lock + */ + TBool iBURLock; + + /* + * Own. + * List of waiting notifications about publisher + * activation during startup + */ + RPointerArray iNotifications; + }; + +#endif // C_CCPSERVER_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserveractionmanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,118 @@ +/* +* 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: Used by sessions for handling execute action requests + * +*/ + + +#ifndef C_CPACTION_MANAGER_H +#define C_CPACTION_MANAGER_H + +#include +// FORWARD DECLARATIONS +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif +class CLiwServiceHandler; +class MLiwInterface; +class CLiwDefaultMap; + +/** + * Used to execute action using Action Handler Service + * + * @since S60 5.0 + */ +class CCPActionManager : public CBase + { +public: + + /** + * C++ destructor + */ + ~CCPActionManager(); + + /** + * Two-phased constructor. + */ + static CCPActionManager* NewL(); + + /** + * Two-phased constructor. + */ + static CCPActionManager* NewLC(); + + /** + * Executes action + * @param Action to be executed + */ + void ExecuteL( const CLiwGenericParamList& aList ); + +private: + // methods + + /** + * Standard C++ constructor. + */ + CCPActionManager(); + + /** + * Standard 2nd phase constructor. + */ + void ConstructL(); + + /** + * Loads interface + * @param interface loaded from service + */ + void PrepareServiceL( MLiwInterface*& aInterface ); + + /** + * Prepares data to execute command + * @param paramList from server + * @param target list to execute action + */ + void PrepareInputListL( const CLiwGenericParamList& aList, + CLiwGenericParamList& aTarget ); + + /** + * Extracts and adds attributes from aMap to aTarget. + * @since Series 60 3.2 + * @param aMap CLiwDefaultMap with action. + * @param aTarget CLiwGenericParamList with Uid and Map. + */ + void ExtractUidAndMapL( const CLiwDefaultMap& aMap, + CLiwGenericParamList& aTarget ); + +private: + // data + + /* + * Own. + * Handler to service + */ + CLiwServiceHandler* iServiceHandler; + + /* + * Own. + * Interface to CPS service + */ + MLiwInterface* iInterface; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + }; + +#endif // C_CPACTION_MANAGER_H +// end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverburlistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverburlistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,120 @@ +/* +* 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: Backup and restore events listener. + * +*/ + + +#ifndef C_CPSERVERBURLISTENER_H +#define C_CPSERVERBURLISTENER_H + +#include +#include + +/** + * Interface for observing Backup and Restore events. + * + * @since S60 S60 v3.1 + */ +class MBURListenerCallback + { + +public: + /** + * Enum defining the status of Backup and Restore. + */ + enum TBURStatus + { + EBURStatusNone, + EBURStatusBackup, + EBURStatusRestore + }; + + /** + * HandleBUREventL is called when Backup and Restore state has been changed. + * @param aStatus Current Backup and Restore status. + */ + virtual void HandleBUREventL( TBURStatus aStatus ) = 0; + + }; + +/** + * Central Repository observer for Backup and Restore. + * + * @since S60 S60 v3.1 + */ +NONSHARABLE_CLASS(CCPServerBURListener) : public CActive + { + +public: + + /** + * Creates an instance of CCPServerBURListener implementation. + * @param aCallBack Pointer to observer interface. + */ + static CCPServerBURListener* NewL( MBURListenerCallback* aCallback ); + + /** + * Destructor. + */ + virtual ~CCPServerBURListener(); + + /** + * @return EFalse if the device as a whole is not engaged in a backup or restore . + */ + TBool CheckBUR(); + +private: + /** + * Constructor. + * @param aCallBack Pointer to observer interface. + */ + CCPServerBURListener( MBURListenerCallback* aCallback ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * From CActive. + */ + TInt RunError( TInt aError ); + +private: + /** + * User side interface to Publish & Subscribe. + */ + RProperty iProperty; + + /** + * Interface for notifying changes in Backup and Restore. + * Not own. + */ + MBURListenerCallback* iCallback; + + }; + +#endif // C_CPSERVERBURLISTENER_H +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdatamanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,274 @@ +/* +* 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: Used by sessions for handling data related requests + * +*/ + + +#ifndef C_CPDATA_MANAGER_H +#define C_CPDATA_MANAGER_H + +#include +#include "cpstorage.h" + +// FORWARD DECLARATIONS +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif +class CLiwMap; +class CCPLiwMap; +class CCpStorage; +class CCPServerSession; +class CCPNotificationHandler; +class TLiwVariant; + +/** + * Content publisher data manager. + * + * Used to add, modify and remove data and actions. + * @since S60 v5.0 + */ +class CCPDataManager : public CBase, MCPChangeNotifier + { +public: + // exported + + /** + * C++ destructor + */ + ~CCPDataManager(); + + /** + * Two-phased constructor. + */ + static CCPDataManager* NewL( TBool aTBool = EFalse ); + + /** + * Two-phased constructor. + */ + static CCPDataManager* NewLC( TBool aTBool = EFalse ); + + /** + * Add a new data to database + * + * @param aData Data to be added. + * @return Id of a newly created data item + */ + TUint AddDataL( CCPLiwMap& aMap ); + + /** + * Data is not added to database. Only notification is send to observers. + * + * @param aData Data to be added. + * @return Id of a newly created data item + */ + void AddNonPersistentDataL( const CCPLiwMap* aMap ); + + /** + * Fetches data from database + * @param aInParamList filter and sorting criteria + * @param aOutParamList results + */ + void GetListL( const CCPLiwMap& aMa, CLiwGenericParamList& aOutParamList ); + /** + * Fetches action from database + * @param aInParamList filter and sorting criteria + * @param aOutParamList results + * @param aNotificationList change info list (for notifications) + * @return KErrNotFound if data was not found + */ + TInt GetActionL( const CCPLiwMap& aMa, + CLiwGenericParamList& aOutParamList, + CLiwDefaultList* aNotificationList = NULL ); + + /** + * Fetches all activated publishers + * @param aInParamList filter and sorting criteria + * @param aOutParamList results + */ + void GetActivePublishersL( CLiwGenericParamList* aResultList ); + + /** + * Removes data from database + * @param aInParamList filter criteria + */ + void RemoveDataL( const CCPLiwMap& aMa ); + + /** + * Adds observer to database + * @param new observer + */ + void AddObserverL( CCPNotificationHandler* aNotificationHandler ); + + /** + * Removes observer from database + * @param aNotificationHandler observer to remove + */ + void RemoveObserver( CCPNotificationHandler* aNotificationHandler ); + + // from MCPChangeNotifier + /** + * @param Map containing change information + * @return + */ + void HandleChangeL( CLiwDefaultList* aListOfMaps ); + + /** + * Close database + * @return + */ + void CloseDatabase(); + /** + * Open database + * @return + */ + void OpenDatabaseL(); + +private: + // methods + + /** + * Standard C++ constructor. + */ + CCPDataManager(); + + /** + * Standard 2nd phase constructor. + */ + void ConstructL( TBool aTBool ); + + /** + * Fetches action bound to provided trigger. + * + * @param aOutParamList of all actions + * @param aMap for found action + * @param aTrigger + */ + void ExtractTriggerL( CLiwGenericParamList& aOutParamList, + const CLiwDefaultMap* aMap, const TDesC8& aTrigger ); + /** + * Sends notifications to observers stored in iNotificationsArray + * + * @param List of change information + * @param index od data item + */ + void SendNotificationL( CLiwDefaultList* aListOfMaps, TInt aIndex ); + + /** + * Exctracts action from input parameters + * + * @param aParam for data + * @param aAction for action + */ + void ExtractActionL( const TLiwGenericParam* aParam, RBuf8& aAction ); + + /** + * Fills aOutParamList with parameters for action. + * + * @param aOutParamList parsed list of items + * @param aParamList list of items from data base + * @param aActionTrigger action trigger + */ + void FillActionParamListL( + CLiwGenericParamList & aOutParamList, + const TLiwGenericParam* aParam, + RBuf8 & aActionTrigger); + + /** + * Creates map for GetList request - publisher, content_type + * and content_id are copied from aMap to returned map + * @param aMap - input map + * @return input map for GetList request + */ + CCPLiwMap* CreateMapForGetlistLC( const CCPLiwMap& aMap ); + + + /** + * Gets Flag for specified item from DB and returns activate + * info + * @param aMap - input map + * @return activate flag + */ + TBool GetActivateInfoL( const CCPLiwMap* aMap ); + + /** + * Builds change info list based on query result to database + * @param aMap - map containing parameters needed to build change info list + * @param aParam - param from getlist result + * @param aChangeInfoList - output list containing change info list sent + * as notification + */ + void BuildChangeInfoL( + const CCPLiwMap* aMap, + const TLiwGenericParam* aParam, + CLiwDefaultList* aChangeInfoList ); + /** + * Builds change info list when query to database returned nothing + * @param aMap - map containing parameters needed to build change info list + * @param aChangeInfoList - output list containing change info list sent + * as notification + */ + void BuildDefaultChangeInfoL( + const CCPLiwMap* aMap, + CLiwDefaultList* aChangeInfoList ); + /** + * Builds change info list when query to database returned nothing + * @param aMap - map containing parameters needed to build change info list + * @param aChangeInfoList - output list containing change info list sent + * as notification + */ + void BuildChangeInfoForAddL( + const CCPLiwMap* aMap, + CLiwDefaultList* aChangeInfoList ); + + /** + * Copies variant from in to out map if entry with provided key exists + * @param aKey a key + * @param aInMap input map + * @param aOutMap output map + */ + void CopyVariantL(const TDesC8& aKey, const CLiwMap* aInMap, + CLiwDefaultMap* aOutMap ); + + /** + * Copies variant from in map for key KActionTrigger to out map with key KActionTrigger16 + * and formated type(from TDesC8 to TDesC) + * @param aInMap input map + * @param aOutMap output map + */ + void CopyActionTrigger16L( const CLiwMap* aInMap, + CLiwDefaultMap* aOutMap ); + +private: + // data + + /* + * Storage database + * Own. + */ + CCpStorage* iStorage; + + /* + * Array of registered notification handlers. + * Own. + */ + RPointerArray iNotificationsArray; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + }; + +#endif // C_CPDATA_MANAGER_H +// end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserverdef.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpserversession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,249 @@ +/* +* 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: Server Session + * +*/ + + +#ifndef C_CCPSERVERSESSION_H +#define C_CCPSERVERSESSION_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif +class CLiwGenericParamList; +class CLiwDefaultMap; +class CLiwDefaultList; +class CCPServer; +class CCPDataManager; +class CCPLiwMap; +class CCPActionHandlerThread; +class CCPNotificationHandler; +struct TPointersForSession; + +// CLASS DECLARATION +/** + * Server side session representation + * + * @since Series 60 5.0 + */ +class CCPServerSession : public CSession2 + { + +public: + // New methods + + /** + * Two-phased constructor. + */ + static CCPServerSession* NewL( TPointersForSession& aPasser ); + + /** + * Two-phased constructor. + */ + static CCPServerSession* NewLC( TPointersForSession& aPasser ); + + /** + * Destroy the object and release all memory objects + */ + virtual ~CCPServerSession(); + +public: + // From CSession + + /** + * Called after a service request from client + * @param aMessage message from client (containing requested operation + * and any data) + */ + void ServiceL( const RMessage2& aMessage ); + + /** + * Selects correct function from message + * @param aMessage message from client (containing requested operation + * and any data) + */ + void DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient ); + +private: + // New methods + + /** + * Standard C++ constructor. + */ + CCPServerSession(); + + /** + * Perform the second phase construction of a CCPServerSession object + */ + void ConstructL( TPointersForSession& aPasser ); + + /** + * Add Data request + * @param Message from client + */ + void AddDataL( const RMessage2& aMessage ); + + /** + * Specific add data request - data is not actually added to database + * but notification is send. + * @param Message from client + */ + void AddDataNonPersistentL( const RMessage2& aMessage ); + + /** + * Get data request - first phase + * @param Message from client + */ + void GetListSizeL( const RMessage2& aMessage ); + + /** + * Get data request - second phase + * @param Message from client + */ + void GetListDataL( const RMessage2& aMessage ); + + /** + * Remove data request + * @param Message from client + */ + void RemoveDataL( const RMessage2& aMessage ); + + /** + * Executes action request + * @param Message from client + */ + void ExecuteActionL( const RMessage2& aMessage ); + + /** + * Executes action request + * @param aActionParams list with actions + */ + void ExecuteL( const CLiwGenericParamList& aActionParams ); + + /** + * Register for notification request + * @param Message from client + */ + void RegisterObserverL( const RMessage2& aMessage ); + + /** + * Adds new observer + * @param Message from client + */ + void AddObserverL( const RMessage2& aMessage ); + + /** + * Removes observer + * @param Message from client + */ + void RemoveObserverL( const RMessage2& aMessage ); + + /** + * Unregister from notification request + * @param Message from client + */ + void UnregisterObserverL(); + + /** + * Send information about change in database to client + * @param Message from client + */ + void GetChangeInfoDataL( const RMessage2& aMessage ); + + /** + * Converts CLiwGenericParamList to descriptor and + * sends to client + * @param Message to complete + * @param Parameters for message + */ + void ExternalizeAndWriteToClientL( const RMessage2& aMessage, + const CLiwGenericParamList* outParamList ); + + /** + * Unpacks message from client to map + * @param Message to complete + * @return CCPLiwMap with data from client + */ + CCPLiwMap* UnpackFromClientLC( const RMessage2& aMessage ); + + /** + * Send notification + * @param aNotificationList + */ + void SendNotificationL( CCPLiwMap* aMap, + CLiwDefaultList* aNotificationList ); + + /** + * Get and Execute Activate or Deactivate action from the DB + * @param Map containing ids of item + */ + void GetAndExecuteActionL( CCPLiwMap* aMap, CLiwDefaultList* aNotificationList, + TBool aInsertTrigger = EFalse ); + + /** + * Get Server Lock + * @return ETrue if aMessege cannot be processed + * because Backup or Restore is running + **/ + TBool GetServerLock( const RMessage2& aMessage ); + +private: + + /* + * Own. + * Handler for asynchronous request for notifications + */ + CCPNotificationHandler* iNotificationHandler; + + /* + * Not own. + * True if message is register + */ + TBool isRegister; + + /* + * Not own. + * Pointer to Content Publisher Server + */ + CCPServer* iServer; + + /* + * Not own. + * Manager to send and receive data beetween server and storage + */ + CCPDataManager* iDataManager; + + /* + * Own. + * List write to message with getList function + */ + CLiwGenericParamList* iParamList; + + /* + * Not Own. + * Manager to prepare and execute action + */ + CCPActionHandlerThread* iActionHandlerThread; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + }; + +#endif // C_CCPSERVERSESSION_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpactionhandlerthread.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpactionhandlerthread.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,410 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cpactionhandlerthread.h" +#include "cpserverdef.h" +#include "cpserveractionmanager.h" +#include "cpglobals.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CPExecutionThreadFunction( TAny* aParam ) + { + ASSERT( aParam ); + CCPActionHandlerThread* actionHandlerThread = + reinterpret_cast( aParam ); + return actionHandlerThread->ThreadFunction(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread* CCPActionHandlerThread::NewL() + { + CCPActionHandlerThread* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread* CCPActionHandlerThread::NewLC() + { + CCPActionHandlerThread* self = new ( ELeave ) CCPActionHandlerThread; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread::~CCPActionHandlerThread() + { + if ( ExecutionThreadRunning() && iActionExecutorAO ) + { + // stop action execution thread + + // request notification when action execution thread terminates + TRequestStatus exitStatus; + iActionExecThread.Logon( exitStatus ); + + // passing NULL as action parameters will cause the action executor to + // stop active scheduler in command execution thread + iActionExecutorAO->SetActionParams( NULL ); + // ask action executor to execute the action + TRequestStatus* actionExecutorAOStatus = + iActionExecutorAO->RequestStatus(); + iActionExecThread.RequestComplete( actionExecutorAOStatus, KErrNone ); + + // wait for the action execution thread to terminate + User::WaitForRequest( exitStatus ); + } + iActionExecThread.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::ExecuteL( + const CLiwGenericParamList& aActionParams ) + { + StartExecutionThreadIfNeededL(); + + ASSERT( iActionExecutorAO ); + iActionExecutorAO->SetActionParams( &aActionParams ); + + // create rendezvous so that we are notified when action + // execution finishes + TRequestStatus actionExecutionStatus = KRequestPending; + iActionExecThread.Rendezvous( actionExecutionStatus ); + + // request action execution by completing request for the AO running + // in the action execution thread + TRequestStatus* actionExecutorAOStatus = + iActionExecutorAO->RequestStatus(); + iActionExecThread.RequestComplete( actionExecutorAOStatus, KErrNone ); + + // wait until action execution finishes + User::WaitForRequest( actionExecutionStatus ); + + TInt err = actionExecutionStatus.Int(); + // please note that checking actionExecutionStatus is not a reliable way of + // determining whether everything is OK because if plugin panics with + // reason (panic number) KErrNone, actionExecutionStatus will contain KErrNone + if ( !ExecutionThreadRunning() ) + { + // action execution thread died, + // iActionExecutorAO pointer is no longer valid + iActionExecutorAO = NULL; + if ( err >= 0 ) + { + err = KErrDied; + } + } + else + { + iActionExecutorAO->SetActionParams( NULL ); + } + + User::LeaveIfError( err ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + void CCPActionHandlerThread::StartExecutionThreadIfNeededL() + { + if ( !ExecutionThreadRunning() ) + { + TBuf threadName; + if ( iActionExecThreadStarted ) + { + iActionExecThread.Close(); + } + + // create action execution thread + threadName.Format( KCPServerPluginThreadName, ++iThreadNum ); + TInt err = iActionExecThread.Create( threadName, + CPExecutionThreadFunction, + KDefaultStackSize, + KCPServerPluginThreadMinHeapSize, + KCPServerPluginThreadMaxHeapSize, + reinterpret_cast( this ) ); + User::LeaveIfError( err ); + + // create rendezvous so that we are notified when the thread + // has started + TRequestStatus threadStatus; + iActionExecThread.Rendezvous( threadStatus ); + + // start the action execution thread + iActionExecThread.Resume(); + + // wait for the thread to start + User::WaitForRequest( threadStatus ); + + User::LeaveIfError( threadStatus.Int() ); + + iActionExecThreadStarted = ETrue; + ASSERT( ExecutionThreadRunning() ); + } + } + +// --------------------------------------------------------------------------- +// RThread::ExitType() returns EExitPending if the thread is alive or has not +// been started yet. There is a member variable, iActionExecThreadStarted +// which tells if the thread was started or not. Combining the information +// from the member variable and RThread::ExitType() allows us to determine if +// the thread is running (alive). +// --------------------------------------------------------------------------- +// + TBool CCPActionHandlerThread::ExecutionThreadRunning() + { + TBool actionExecThreadDidNotDie = + iActionExecThread.ExitType() == EExitPending; + + TBool threadRunning = + iActionExecThreadStarted && actionExecThreadDidNotDie; + + // if the thread is alive, it must have created an active object for + // executing actions in plugins; verify that it is the case + ASSERT( !threadRunning || ( threadRunning && iActionExecutorAO )); + + return threadRunning; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + CCPActionHandlerThread::CCPActionHandlerThread() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPActionHandlerThread::ThreadFunction() + { + __UHEAP_MARK; + + CServerEikonEnv* env = new CServerEikonEnv; + if ( !env ) + { + return KErrNoMemory; + } + CServerAppUi* ui = new CServerAppUi; + if ( !ui ) + { + delete env; + return KErrNoMemory; + } + + TRAPD( err, + env->ConstructL(); + env->DisableExitChecks( ETrue ); + ui->ConstructL(); + + iActionExecutorAO = CActionExecutorAO::NewL(); + + // notify the main thread that action execution thread + // has successfully started + RThread::Rendezvous( KErrNone ); + + CActiveScheduler::Start(); + ); + + delete iActionExecutorAO; + iActionExecutorAO = NULL; + + ui->PrepareToExit(); + env->DestroyEnvironment(); + + __UHEAP_MARKEND; + + return err; + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEikonEnv::DestroyEnvironment +// +// ----------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CServerEikonEnv::DestroyEnvironment() + { + CEikonEnv::DestroyEnvironment( ); + } + +// ----------------------------------------------------------------------------- +// CContentHarvesterEikonEnv::ConstructL +// +// ----------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CServerEikonEnv::ConstructL() + { + CEikonEnv::ConstructL( EFalse ); + SetAutoForwarding( ETrue ); + User::SetPriorityControl( EFalse ); + } +// ----------------------------------------------------------------------------- +// CContentHarvesterAppUi::~CContentHarvesterAppUi +// +// ----------------------------------------------------------------------------- +// +CCPActionHandlerThread::CServerAppUi::~CServerAppUi() + { + } + +// --------------------------------------------------------------------------- +// CContentHarvesterAppUi::ConstructL +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CServerAppUi::ConstructL() + { + CEikAppUi::BaseConstructL( ENoAppResourceFile | ENoScreenFurniture ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread::CActionExecutorAO* +CCPActionHandlerThread::CActionExecutorAO::NewL() + { + CActionExecutorAO* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread::CActionExecutorAO* +CCPActionHandlerThread::CActionExecutorAO::NewLC() + { + CActionExecutorAO* self = new ( ELeave ) CActionExecutorAO(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread::CActionExecutorAO::~CActionExecutorAO() + { + delete iActionManager; + } + +// --------------------------------------------------------------------------- +// Any code executed in this method must not leave! +// This way we avoid implementing RunError while making sure that +// Rendezvous will always be called +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CActionExecutorAO::RunL() + { + if( iActionParams ) + { + // execute action + TRAPD( err, iActionManager->ExecuteL( *iActionParams ) ); + + // notify the main thread that action execution has finished + RThread::Rendezvous( err ); + + // wait until another action execution is requested + iStatus = KRequestPending; + SetActive(); + } + else + { + CActiveScheduler::Stop(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CActionExecutorAO::DoCancel() + { + TRequestStatus* myRequestStatus = &iStatus; + User::RequestComplete( myRequestStatus, KErrCancel ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TRequestStatus* CCPActionHandlerThread::CActionExecutorAO::RequestStatus() + { + return &iStatus; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CActionExecutorAO::SetActionParams( + const CLiwGenericParamList* aActionParams ) + { + iActionParams = aActionParams; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionHandlerThread::CActionExecutorAO::CActionExecutorAO() + : CActive( CActive::EPriorityLow ) + { + CActiveScheduler::Add( this ); + + // wait until action execution is requested + iStatus = KRequestPending; + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPActionHandlerThread::CActionExecutorAO::ConstructL() + { + iActionManager = CCPActionManager::NewL(); + } diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,520 @@ +/* +* 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: ?Description + + * +*/ + + +#include +#include + +#include "cpnotificationhandler.h" +#include "cpdebug.h" +#include "cpliwmap.h" +#include "cpglobals.h" +#include "cpserverdef.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPNotificationHandler::CCPNotificationHandler() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPNotificationHandler::ConstructL( RPointerArray& + aNotifications) + { + iChangeInfoList = CLiwGenericParamList::NewL( ); + for ( TInt i(0); i< aNotifications.Count( ); i++ ) + { + iNotifications.AppendL(aNotifications[i]); + aNotifications[i]->IncRef(); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPNotificationHandler* CCPNotificationHandler::NewL( + RPointerArray& aNotifications ) + { + CCPNotificationHandler* self = CCPNotificationHandler::NewLC( + aNotifications ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPNotificationHandler* CCPNotificationHandler::NewLC( + RPointerArray& aNotifications ) + { + CCPNotificationHandler* self = new( ELeave ) CCPNotificationHandler; + CleanupStack::PushL( self ); + self->ConstructL( aNotifications ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPNotificationHandler::~CCPNotificationHandler() + { + THashMapIter iter( iFilters ); + + const TInt32* transaction = iter.NextKey(); + while( transaction ) + { + CCPLiwMap** filter = iFilters.Find( *transaction );// leaves if not found + if ( filter ) + { + (*filter)->Reset(); + (*filter)->Close(); + } + transaction = iter.NextKey( ); + } + iFilters.Close(); + Reset( ); + for ( TInt i(0); i< iNotifications.Count( ); i++ ) + { + iNotifications[i]->Close( ); + } + iNotifications.Close( ); + delete iChangeInfoList; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPNotificationHandler::SaveMessageL( const RMessage2& aMessage ) + { + iIsReadyToSend = ETrue; + iMessage = aMessage; + + TInt32 transactionId = aMessage.Int3(); + if ( transactionId != KErrAlreadyExists ) + { + TInt deslen = aMessage.GetDesLengthL( KDescriptorPosition ); + if( deslen > 0 ) + { + HBufC8* buffer = HBufC8::NewLC( deslen ); + TPtr8 tempDes = buffer->Des( ); + aMessage.Read( KDescriptorPosition, tempDes ); + RDesReadStream datastrm( *buffer); + CleanupClosePushL( datastrm ); + CCPLiwMap* filterMap = CCPLiwMap::NewL( datastrm ); + CleanupStack::PushL( filterMap ); + iFilters.InsertL( transactionId, filterMap ); + CleanupStack::Pop( filterMap ); + CleanupStack::PopAndDestroy( &datastrm ); + CleanupStack::PopAndDestroy( buffer ); + } + } + if ( iNotifications.Count( ) ) + { + SendNotificationL( NULL ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPNotificationHandler::AddObserverL( const RMessage2& aMessage ) + { + TInt32 transactionId = aMessage.Int3(); + TInt deslen = aMessage.GetDesLength( KDescriptorPosition ); + if( deslen > 0 ) + { + HBufC8* buffer = HBufC8::NewLC( deslen ); + TPtr8 tempDes = buffer->Des( ); + aMessage.Read( KDescriptorPosition, tempDes ); + RDesReadStream datastrm( *buffer); + CleanupClosePushL( datastrm ); + CCPLiwMap* filterMap = CCPLiwMap::NewL( datastrm ); + CleanupStack::PushL( filterMap ); + iFilters.InsertL( transactionId, filterMap ); + CleanupStack::Pop( filterMap ); + CleanupStack::PopAndDestroy( &datastrm ); + CleanupStack::PopAndDestroy( buffer ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPNotificationHandler::RemoveObserverL( const RMessage2& aMessage ) + { + TInt32 transactionId = aMessage.Int3(); + CCPLiwMap* filter = iFilters.FindL( transactionId );// leaves if not found + filter->Reset(); + filter->Close(); + iFilters.Remove( transactionId ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::IsProperForFilterL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ) + { + CP_DEBUG( _L8("CCPNotificationHandler::IsProperForFilter()") ); + TBool result( EFalse ); + if( CheckRegistryTypeL( aMap, aFilter ) && + CheckOperationTypeL( aMap, aFilter ) ) + { + if( CheckIdL( aMap, aFilter ) ) + { + result= ETrue; + } + else if( CheckPropertiesL( aMap, aFilter ) ) + { + result = ETrue; + } + } + return result; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPNotificationHandler::SendNotificationL( CLiwDefaultList* aListOfMaps ) + { + CP_DEBUG( _L8("CCPNotificationHandler::SendNotificationL()") ); + if ( iIsReadyToSend ) + { + //notification can be send + if ( iNotifications.Count( ) ) + { + //at least one notification is waiting to be sent + TBool sent; + sent = SendChangeInfoListL( iNotifications[0] ); + iNotifications[0]->Close( ); + iNotifications.Remove( 0 ); + if ( !sent ) + { + //if notification from array wasn't sent because it didn't + //match the filter, try to send the next one + SendNotificationL( NULL ); + } + else + { + //message was send + iIsReadyToSend = EFalse; + } + } + else + { + //no notification is waiting, so send the new one + if ( aListOfMaps && SendChangeInfoListL( aListOfMaps ) ) + { + iIsReadyToSend = EFalse; + } + } + } + else + { + //notification cannot be sent in this moment + aListOfMaps->IncRef( ); + iNotifications.AppendL( aListOfMaps ); + } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// + +const CLiwGenericParamList* CCPNotificationHandler::GetPointerToChangeInfoList() + { + return iChangeInfoList; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPNotificationHandler::Reset() + { + iIsReadyToSend = EFalse; + iChangeInfoList->Reset( ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPNotificationHandler::ErrorComplete( TInt aErrCode ) + { + if( iIsReadyToSend && iMessage.IsNull() == EFalse ) + { + iMessage.Complete( aErrCode ); + iIsReadyToSend = EFalse; + } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::SendChangeInfoListL( + const CLiwDefaultList* aListOfMaps ) + { + CP_DEBUG( _L8("CCPNotificationHandler::SendChangeInfoListL()") ); + iChangeInfoList->Reset( ); + TBool sent(EFalse); + //for every observer in session + THashMapIter iter( iFilters ); + const CCPLiwMap*const* filter = iter.NextValue( ); + while( filter ) + { + + CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( ); + + //for every item in the input list + for ( TInt j = 0; j < aListOfMaps->Count( ); j++ ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + TLiwVariant variant; + variant.PushL( ); + aListOfMaps->AtL( j, variant ); + variant.Get( *map ); + if ( IsProperForFilterL( *map, **filter ) ) + { + listOfMatchingMaps->AppendL( TLiwVariant( map ) ); + } + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( map ); + } + if ( listOfMatchingMaps->Count( ) ) + { + //append transaction id + listOfMatchingMaps->AppendL( TLiwVariant( *iter.CurrentKey() )); + iChangeInfoList->AppendL( TLiwGenericParam( KChangeInfo, + TLiwVariant( listOfMatchingMaps ) ) ); + } + CleanupStack::PopAndDestroy( listOfMatchingMaps ); + filter = iter.NextValue( ); + } + + if( iChangeInfoList->Count( ) ) + { + TPckgBuf sizeDes( iChangeInfoList->Size( ) ); + TInt err = iMessage.Write( KReturnPosition, sizeDes ); + iMessage.Complete( err ); + sent = ETrue; + } + return sent; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPNotificationHandler::GetPropertyL( const CLiwDefaultMap& aMap, + const TDesC8& aProperty, RBuf& aResult ) + { + TLiwVariant value; + value.PushL( ); + if ( aMap.FindL( aProperty, value ) ) + { + TPtrC result( KNullDesC ); + value.Get( result ); + aResult.CreateL( result ); + } + CleanupStack::PopAndDestroy( &value ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::CheckIdL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ) + { + TBool result = EFalse; + TInt32 id( 0); + if ( aFilter.GetProperty( KId, id ) ) + { + TLiwVariant value; + value.PushL( ); + if ( aMap.FindL( KId, value ) ) + { + TUint idToCompare( 0); + if ( value.Get( idToCompare ) ) + { + if ( id == idToCompare ) + { + result = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &value ); + } + return result; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::CheckPropertiesL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ) + { + TBool result( EFalse ); + TBool publisherName( ETrue ); + TBool contentType( ETrue ); + TBool contentId( ETrue ); + RBuf publisher; + publisher.CleanupClosePushL(); + + if ( aFilter.GetPropertyL( KPublisherId, publisher ) ) + { + if ( publisher != KAll ) + { + RBuf str2compare; + str2compare.CleanupClosePushL(); + GetPropertyL( aMap, KPublisherId, str2compare ); + if ( publisher!=str2compare ) + { + publisherName = EFalse; + } + CleanupStack::PopAndDestroy( &str2compare ); + } + } + RBuf content; + content.CleanupClosePushL(); + if ( aFilter.GetPropertyL( KContentType, content ) ) + { + if ( content != KAll ) + { + RBuf str2compare; + str2compare.CleanupClosePushL(); + GetPropertyL( aMap, KContentType, str2compare ); + if ( content!=str2compare ) + { + contentType = EFalse; + } + CleanupStack::PopAndDestroy( &str2compare ); + } + } + RBuf content_id; + content_id.CleanupClosePushL(); + if ( (publisher != KAll)||(content != KAll) ) + { + if ( aFilter.GetPropertyL( KContentId, content_id ) ) + { + if ( content_id != KAll ) + { + RBuf str2compare; + str2compare.CleanupClosePushL(); + GetPropertyL( aMap, KContentId, str2compare ); + if ( content_id!=str2compare ) + { + contentId = EFalse; + } + CleanupStack::PopAndDestroy( &str2compare ); + } + } + } + if ( publisherName && contentType && contentId ) + { + result = ETrue; + } + CleanupStack::PopAndDestroy( &content_id ); + CleanupStack::PopAndDestroy( &content ); + CleanupStack::PopAndDestroy( &publisher ); + return result; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ) + { + TBool result = ETrue; + RBuf operation; + operation.CleanupClosePushL(); + if ( aFilter.GetPropertyL( KOperation, operation ) ) + { + result = EFalse; + TLiwVariant value; + value.PushL( ); + if ( aMap.FindL( KOperation, value ) ) + { + TPtrC operationToCompare( KNullDesC ); + if ( value.Get( operationToCompare ) ) + { + if ( operation.Find( operationToCompare ) != KErrNotFound ) + { + result = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &value ); + } + CleanupStack::PopAndDestroy( &operation ); + return result; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwDefaultMap& aMap, + const CCPLiwMap& aFilter ) + { + TBool result = ETrue; + RBuf type; + type.CleanupClosePushL(); + if ( aFilter.GetPropertyL( KType, type ) ) + { + result = EFalse; + TLiwVariant value; + value.PushL( ); + if ( aMap.FindL( KType, value ) ) + { + TPtrC typeToCompare( KNullDesC ); + if ( value.Get( typeToCompare ) ) + { + if ( type.Find( typeToCompare ) != KErrNotFound ) + { + result = ETrue; + } + } + } + CleanupStack::PopAndDestroy( &value ); + } + CleanupStack::PopAndDestroy( &type ); + return result; + } diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,393 @@ +/* +* 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: Content publisher Server +* +*/ + + +#include +#include +#include + +#include "cpublisherregistrymap.h" +#include "cpserver.h" +#include "cpglobals.h" +#include "cpdebug.h" +#include "cpserversession.h" +#include "cpserverdatamanager.h" +#include "cpactionhandlerthread.h" + + +// Policy Server +// ============================================================================ +const TUint KServerPolicyRangeCount = 3; +const TInt KServerPolicyRanges[KServerPolicyRangeCount] = + { + 0, // range 0 -- ECpServerExecuteAction - 1 + ECpServerGetListSize, // range ECpServerGetListSize -- ECpServerExecuteAction - 1 + ECpServerExecuteAction + // range ECpServerExecuteAction -- inf + }; + +const TUint8 KServerPolicyElementsIndex[KServerPolicyRangeCount] = + { + 0, // applies to 0th range + 1, // applies to 1st range + CPolicyServer::EAlwaysPass + }; + +const CPolicyServer::TPolicyElement KServerPolicyElements[] = + { + { + _INIT_SECURITY_POLICY_C1(ECapability_None), CPolicyServer::EFailClient + }, + { + _INIT_SECURITY_POLICY_C1(ECapability_None), CPolicyServer::EFailClient + } + }; + +const CPolicyServer::TPolicy KServerPolicy = + { + CPolicyServer::EAlwaysPass, // specifies all connect attempts should pass + KServerPolicyRangeCount, + KServerPolicyRanges, + KServerPolicyElementsIndex, + KServerPolicyElements + }; +// ============================================================================ + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCPServer::CCPServer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCPServer::CCPServer( TInt aPriority ) : + CPolicyServer( aPriority, KServerPolicy, EUnsharableSessions) + { + } + +// ----------------------------------------------------------------------------- +// CCPServer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCPServer::ConstructL() + { + CP_DEBUG( _L8("CCPServer::ConstructL()" ) ); + StartL(KCPServerName); + iBURListener = CCPServerBURListener::NewL(this); + iCountSession = 0; + iBURLock = iBURListener->CheckBUR(); + iDataManager = CCPDataManager::NewL(iBURLock); + iActionHandlerThread = CCPActionHandlerThread::NewL(); + if (!iBURLock) + { + TRAP_IGNORE( DeactivatePublishersL() ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServer::NewL +// Two-phased constructor. +// -------------------------------------- --------------------------------------- +// +CCPServer* CCPServer::NewLC() + { + CP_DEBUG( _L8("CCPServer::NewLC()" ) ); + CCPServer* self = new( ELeave ) CCPServer( EPriorityNormal ); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCPServer::~CCPServer() +// Destructor. +// -------------------------------------- --------------------------------------- +// +CCPServer::~CCPServer() + { + CP_DEBUG( _L8("CCPServer::~CCPServer()" ) ); + for ( TInt i(0); i< iNotifications.Count( ); i++ ) + { + iNotifications[i]->Close( ); + } + iNotifications.Close( ); + delete iDataManager; + delete iActionHandlerThread; + delete iBURListener; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPServer::RemoveSession() + { + CP_DEBUG( _L8("CCPServer::RemoveSession()" ) ); + iCountSession--; + if ( !iCountSession ) + { + Stop( ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPServer::AddSession() + { + CP_DEBUG( _L8("CCPServer::AddSession()" ) ); + iCountSession++; + } + +// --------------------------------------------------------------------------- +// CCPServer::HandleBUREventL +// --------------------------------------------------------------------------- +// +void CCPServer::HandleBUREventL( TBURStatus aStatus ) + { + CP_DEBUG( _L8("CCPServer::HandleBUREventL()" ) ); + if ( (aStatus == EBURStatusBackup ) || (aStatus == EBURStatusRestore ) ) + { + iBURLock = ETrue; + iDataManager->CloseDatabase( ); + } + else + { + iDataManager->OpenDatabaseL( ); + iBURLock = EFalse; + } + } + +// --------------------------------------------------------------------------- +// CCPServer::GetLock +// --------------------------------------------------------------------------- +// +TBool CCPServer::GetLock() + { + return iBURLock; + } + +// ----------------------------------------------------------------------------- +// CCPServer::GetNotifications +// ----------------------------------------------------------------------------- +// +RPointerArray& CCPServer::GetNotifications( ) + { + return iNotifications; + } + + +// ----------------------------------------------------------------------------- +// CCPServer::NewSessionL +// Create new session. +// ----------------------------------------------------------------------------- +// +CSession2* CCPServer::NewSessionL( const TVersion& /*aVersion*/, + const RMessage2& /*aMessage*/) const + { + CP_DEBUG( _L8("CCPServer::NewSessionL()" ) ); + TPointersForSession passer; + passer.iDataManager = iDataManager; + passer.iServer = const_cast(this); + passer.iActionHandlerThread = iActionHandlerThread; + return CCPServerSession::NewL( passer ); + } + +// ----------------------------------------------------------------------------- +// CCPServer::RunError +// RunError is called when RunL leaves. +// ----------------------------------------------------------------------------- +// +TInt CCPServer::RunError( TInt /*aError*/) + { + ReStart( ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCPServer::PanicClient +// Panic client. +// ----------------------------------------------------------------------------- +// +void CCPServer::PanicClient( const RMessage2& aMessage, TCPServerPanic aPanic ) + { + aMessage.Panic( KCPServerName, aPanic ); + } + +// ----------------------------------------------------------------------------- +// CCPServer::PanicServer +// Panic server. +// ----------------------------------------------------------------------------- +// +void CCPServer::PanicServer( TCPServerPanic aPanic ) + { + User::Panic( KCPServerName, aPanic ); + } + + +// ----------------------------------------------------------------------------- +// CCPServer::SendNotificationL +// ----------------------------------------------------------------------------- +// +void CCPServer::AppendNotificationL( CCPLiwMap* aMap ) + { + aMap->InsertL( KType, TLiwVariant( KPublisher ) ); + aMap->InsertL( KOperation, TLiwVariant( KOperationUpdate ) ); + CLiwDefaultList* list = CLiwDefaultList::NewLC( ); + list->AppendL( TLiwVariant( aMap ) ); + iNotifications.AppendL( list ); + CleanupStack::Pop( list ); + } + +// ----------------------------------------------------------------------------- +// CCPServer::Stop +// Stop serwer +// ----------------------------------------------------------------------------- +// +void CCPServer::Stop() + { + CP_DEBUG( _L8("CCPServer::Stop()" ) ); + CActiveScheduler::Stop( ); + } + +// ----------------------------------------------------------------------------- +// CCPServer::ThreadStart(void) +// Starts server. +// ----------------------------------------------------------------------------- +// +TInt CCPServer::ThreadStart( void ) + { + __UHEAP_MARK; + // Create the server, if one with this name does not already exist. + TFindServer findCountServer( KCPServerName ); + TFullName name; + + CTrapCleanup* trapCleanup = CTrapCleanup::New(); + if ( !trapCleanup ) + { + PanicServer( ECPServerSrvCreateServer ); + } + CActiveScheduler* activeScheduler = new CActiveScheduler; + if ( !activeScheduler ) + { + PanicServer( ECPServerSrvCreateServer ); + } + CActiveScheduler::Install( activeScheduler ); + + // Need to check that the server exists. + if ( findCountServer.Next( name ) != KErrNone ) + { + User::RenameThread( KCPServerName ); + + TRAPD( err, CreateAndRunServerL() ); + if ( err != KErrNone ) + { + PanicServer( ECPServerSrvCreateServer ); + } + } + + delete activeScheduler; + delete trapCleanup; + __UHEAP_MARKEND; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCPServer::CreateAndRunServerL(void) +// Creates and runs server. +// ----------------------------------------------------------------------------- +// +void CCPServer::CreateAndRunServerL( void ) + { + // Construct server + // + CCPServer* server = CCPServer::NewLC( ); + // Initialisation complete, now signal the client + // + RProcess::Rendezvous( KErrNone ); + CActiveScheduler::Start( ); + CleanupStack::PopAndDestroy( server ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPServer::DeactivatePublishersL() + { + CLiwGenericParamList* publishers = CLiwGenericParamList::NewLC( ); + CCPLiwMap* map = CPublisherRegistryMap::NewLC( ); + iDataManager->GetActivePublishersL( publishers ); + TInt pos( 0 ); + while( pos != KErrNotFound ) + { + publishers->FindFirst( pos, KListMap ); + + if( pos != KErrNotFound ) + { + TLiwVariant variant = ( *publishers )[pos++].Value( ); + map->Reset( ); + variant.Get( *map ); + + // update flag value in the database + TRAP_IGNORE( ResetAndUpdateFlagL( map ) ); + + //append update notification + TRAP_IGNORE( AppendNotificationL( map ) ); + + variant.Reset( ); + } + } + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( publishers ); + } + +// ----------------------------------------------------------------------------- +// CCPServer::ResetAndUpdateFlagL +// Resets Activate flag and update item in the DB +// ----------------------------------------------------------------------------- +// +void CCPServer::ResetAndUpdateFlagL( CCPLiwMap* aMap ) + { + TInt32 flag(0); + if( !aMap->GetProperty( KFlag, flag )) + { + User::Leave(KErrNotFound); + } + aMap->Remove( KFlag ); + flag &= 0xFFFFFFFE; + aMap->InsertL( KFlag, TLiwVariant( flag ) ); + iDataManager->AddDataL( *aMap ); + } + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// E32Main entry point. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + return CCPServer::ThreadStart( ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserveractionmanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". + * +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + +#include "cpserveractionmanager.h" +#include "cpdebug.h" +#include "cpglobals.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// C++ destructor +// --------------------------------------------------------------------------- +// +CCPActionManager::~CCPActionManager() + { + if ( iInterface ) + { + iInterface->Close( ); + } + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionManager* CCPActionManager::NewL() + { + CCPActionManager* self = CCPActionManager::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPActionManager* CCPActionManager::NewLC() + { + CCPActionManager* self = new( ELeave ) CCPActionManager; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CCPActionManager::CCPActionManager() + { + + } + +// --------------------------------------------------------------------------- +// Standard 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void CCPActionManager::ConstructL() + { + CP_DEBUG( _L8("CCPActionManager::ConstructL()") ); + iServiceHandler = CLiwServiceHandler::NewL( ); + } + +// ----------------------------------------------------------------------------- +// CCPActionManager::ExecuteL +// --------------- -------------------------------------------------------------- +// +void CCPActionManager::ExecuteL( const CLiwGenericParamList& aList ) + { + CP_DEBUG( _L8("CCPActionManager::ExecuteL()") ); + if ( !iInterface ) + { + PrepareServiceL( iInterface ); + } + CLiwGenericParamList* inparam = CLiwGenericParamList::NewLC( ); + CLiwGenericParamList* outparam = CLiwGenericParamList::NewLC( ); + PrepareInputListL( aList, *inparam ); + + iInterface->ExecuteCmdL( KCmdExecute, *inparam, *outparam ) ; + TInt pos(0); + outparam->FindFirst( pos, EGenericParamError ); + if ( pos != KErrNotFound ) + { + User::LeaveIfError( ( *outparam )[pos].Value().AsTInt32( ) ); + } + else + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( outparam ); + CleanupStack::PopAndDestroy( inparam ); + } + +// ----------------------------------------------------------------------------- +// CCPActionManager::ExecuteL +// --------------- -------------------------------------------------------------- +// +void CCPActionManager::PrepareServiceL( MLiwInterface*& aInterface ) + { + CP_DEBUG( _L8("CCPActionManager::PrepareServiceL()") ); + CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL( ) ); + CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL( ) ); + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( 1, + KActionHandlerInterface, KActionHandlerService ); + CleanupStack::PushL( crit ); + crit->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + RCriteriaArray array; + CleanupClosePushL( array ); + array.AppendL( crit ); + iServiceHandler->AttachL( array ); + iServiceHandler->ExecuteServiceCmdL( *crit, *inparam, *outparam ); + CleanupStack::PopAndDestroy( &array ); + CleanupStack::PopAndDestroy( crit ); + TInt pos = 0; + outparam->FindFirst( pos, KActionHandlerInterface ); + if ( pos != KErrNotFound ) + { + aInterface = ( *outparam )[pos].Value().AsInterface( ); + } + else + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CCPActionManager::PrepareInputListL +// --------------- -------------------------------------------------------------- +// +void CCPActionManager::PrepareInputListL( const CLiwGenericParamList& aList, + CLiwGenericParamList& aTarget ) + { + CP_DEBUG( _L8("CCPActionManager::PrepareInputListL()") ); + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aList.FindFirst( pos, KListMap, EVariantTypeMap ); + if ( param && pos !=KErrNotFound ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + param->Value().Get( *map ); + ExtractUidAndMapL( *map, aTarget ); + CleanupStack::PopAndDestroy( map ); + } + else + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CCPActionManager::ExtractUidAndMapL +// --------------- -------------------------------------------------------------- +// +void CCPActionManager::ExtractUidAndMapL( const CLiwDefaultMap& aMap, + CLiwGenericParamList& aTarget ) + { + CP_DEBUG( _L8("CCPActionManager::ExtractUidAndMapL()") ); + TLiwVariant variant; + variant.PushL( ); + if ( aMap.FindL( KActionMap, variant ) ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + variant.Get( *map ); + if ( map->FindL( KDataForActionHandler, variant ) ) + { + TLiwGenericParam param( KDataForActionHandler, variant); + aTarget.AppendL( param ); + } + if ( map->FindL( KPluginUid, variant ) ) + { + TLiwGenericParam param( KPluginUid, variant); + aTarget.AppendL( param ); + } + CleanupStack::PopAndDestroy( map ); + } + + CleanupStack::PopAndDestroy( &variant ); + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverburlistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverburlistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,148 @@ +/* +* 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: Backup and restore events listener. + * +*/ + + +#include + +#include "cpserverburlistener.h" +#include "cpdebug.h" +// conn - "Declaration of Types and Constants for Secure Backup and Restore" namespace, see sbdefs.h +using namespace conn; + +// ============================ MEMBER FUNCTIONS ============================= + +// ----------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::CSpaceDataStorageBURListener +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CCPServerBURListener::CCPServerBURListener( MBURListenerCallback* aCallback ) : + CActive(EPriorityNormal) + { + CActiveScheduler::Add( this ); + iCallback = aCallback; + + // Prepare automatically + iProperty.Attach( KUidSystemCategory, KUidBackupRestoreKey ); + SetActive( ); + iProperty.Subscribe( iStatus ); + } + +// ----------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::ConstructL +// S2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CCPServerBURListener::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::NewL +// --------------------------------------------------------------------------- +// +CCPServerBURListener* CCPServerBURListener::NewL( + MBURListenerCallback* aCallback ) + { + CCPServerBURListener* self = new (ELeave) + CCPServerBURListener( aCallback ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::~CSpaceDataStorageBURListener +// --------------------------------------------------------------------------- +// +CCPServerBURListener::~CCPServerBURListener() + { + Cancel( ); + iProperty.Close( ); + } + +// --------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::DoCancel +// --------------------------------------------------------------------------- +// +void CCPServerBURListener::DoCancel() + { + iProperty.Cancel( ); + } + +// --------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::RunError +// --------------------------------------------------------------------------- +// +TInt CCPServerBURListener::RunError( TInt /*aError*/) + { + // No need to do anything + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCPServerBURListener::CheckStatus +// --------------------------------------------------------------------------- +// +TBool CCPServerBURListener::CheckBUR() + { + TInt pnsStatus; + TInt err; + err = iProperty.Get( KUidSystemCategory, KUidBackupRestoreKey, pnsStatus ); + if ( pnsStatus < EBURBackupFull && err >= KErrNone ) + { + return EFalse; + } + else + { + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CSpaceDataStorageBURListener::RunL +// --------------------------------------------------------------------------- +// +void CCPServerBURListener::RunL() + { + CP_DEBUG( _L8("CCPServerBURListener::RunL()") ); + // Re-issue request before notifying + SetActive( ); + iProperty.Subscribe( iStatus ); + + TInt pnsStatus; + User::LeaveIfError( iProperty.Get( KUidSystemCategory, + KUidBackupRestoreKey, pnsStatus ) ); + + MBURListenerCallback::TBURStatus + burStatus(MBURListenerCallback::EBURStatusNone); + if ( pnsStatus & (EBURBackupFull | EBURBackupPartial ) ) + { + burStatus = MBURListenerCallback::EBURStatusBackup; + } + else if ( pnsStatus & (EBURRestoreFull | EBURRestorePartial ) ) + { + burStatus = MBURListenerCallback::EBURStatusRestore; + } + + iCallback->HandleBUREventL( burStatus ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserverdatamanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,582 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include +#include +#include + +#include "cpserverdatamanager.h" +#include "ccontentmap.h" +#include "cpublisherregistrymap.h" +#include "cpstorage.h" +#include "cpdebug.h" +#include "cpstoragefactory.h" +#include "cpglobals.h" +#include "cpserversession.h" +#include "cpnotificationhandler.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// C++ destructor +// --------------------------------------------------------------------------- +// +CCPDataManager::~CCPDataManager() + { + iNotificationsArray.Close( ); + delete iStorage; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPDataManager* CCPDataManager::NewL( TBool aBool ) + { + CCPDataManager* self = CCPDataManager::NewLC( aBool ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPDataManager* CCPDataManager::NewLC( TBool aBool ) + { + CCPDataManager* self = new( ELeave ) CCPDataManager; + CleanupStack::PushL( self ); + self->ConstructL( aBool ); + return self; + } + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CCPDataManager::CCPDataManager() + { + + } + +// --------------------------------------------------------------------------- +// Standard 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void CCPDataManager::ConstructL( TBool aBool ) + { + CP_DEBUG( _L8("CCPDataManager::ConstructL()") ); + if ( !aBool ) + { + iStorage = StorageFactory::NewDatabaseL( ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint CCPDataManager::AddDataL( CCPLiwMap& aMap ) + { + CP_DEBUG( _L8("CCPDataManager::AddDataL()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + + CCPLiwMap* getlistmap = CreateMapForGetlistLC( aMap ); + + TBool activateMap = aMap.GetActivateInfo(); + TBool activateDB ( EFalse ); + TBool activateSupport =aMap.ActivateActionSupport( ); + + if( activateSupport ) + { + activateDB = GetActivateInfoL( getlistmap ); + } + + TInt id = iStorage->AddL( &aMap ); + + if( activateSupport ) + { + if ( activateMap && !activateDB ) + { + // append action trigger for activate + aMap.InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) ); + } + if ( !activateMap && activateDB ) + { + // append action trigger for deactivate + aMap.InsertL( KActionTrigger, TLiwVariant( KDeactivateTrigger ) ); + } + //remove flag from map ( needed because map will be used in getlist + //operation ) + aMap.Remove( KFlag ); + } + + CleanupStack::PopAndDestroy( getlistmap ); + + return id; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::AddNonPersistentDataL( const CCPLiwMap* aMap ) + { + CLiwDefaultList* notificationList = CLiwDefaultList::NewLC( ); + BuildChangeInfoForAddL( aMap, notificationList ); + HandleChangeL( notificationList ); + CleanupStack::PopAndDestroy( notificationList ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::GetListL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList ) + { + CP_DEBUG( _L8("CCPDataManager::GetListL()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + iStorage->GetListL( &aMap, aOutParamList ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPDataManager::GetActionL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList, CLiwDefaultList* aNotificationList ) + { + CP_DEBUG( _L8("CCPDataManager::GetActionL()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( ); + TInt result( KErrNone ); + TRAP( result, iStorage->GetListL( &aMap, *paramList ) ); + RBuf8 actionTrigger; + actionTrigger.CleanupClosePushL(); + + if ( aMap.GetPropertyL( KActionTrigger, actionTrigger ) ) + { + const TLiwGenericParam* param; + TInt pos( 0); + + param = paramList->FindFirst( pos, KListMap ); + //at least one param should be valid to preceed + if ( !param || pos == KErrNotFound ) + { + BuildDefaultChangeInfoL(&aMap, aNotificationList); + } + + //iteration through paramList items + while ( param && pos != KErrNotFound ) + { + BuildChangeInfoL( &aMap, param, aNotificationList ); + FillActionParamListL( aOutParamList, param, actionTrigger ); + param = paramList->FindNext( pos, KListMap ); + } + } + else + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( &actionTrigger ); + CleanupStack::PopAndDestroy( paramList ); + return result; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::FillActionParamListL( + CLiwGenericParamList& aOutParamList, + const TLiwGenericParam* aParam, + RBuf8 & aActionTrigger) + { + CP_DEBUG( _L8("CCPDataManager::FillActionParamListL()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + + RBuf8 actionBinaries; + actionBinaries.CleanupClosePushL(); + ExtractActionL( aParam, actionBinaries ); + + RDesReadStream str(actionBinaries); + CleanupClosePushL( str ); + CLiwDefaultMap* actionMap = CLiwDefaultMap::NewLC( str ); + ExtractTriggerL( aOutParamList, actionMap, aActionTrigger ); + + CleanupStack::PopAndDestroy( actionMap ); + CleanupStack::PopAndDestroy( &str ); + CleanupStack::PopAndDestroy( &actionBinaries ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::GetActivePublishersL( CLiwGenericParamList* aResultList ) + { + CCPLiwMap *map = CPublisherRegistryMap::NewLC(); + map->InsertL( KFlag, TLiwVariant( TUint( 0 | EActivate ) ) ); + iStorage->GetListL( map, *aResultList ); + CleanupStack::PopAndDestroy(map); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::ExtractTriggerL( CLiwGenericParamList& aOutParamList, + const CLiwDefaultMap* aMap, const TDesC8& aTrigger ) + { + CP_DEBUG( _L8("CCPDataManager::GetActionL()") ); + CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( ); + TLiwVariant variant; + variant.PushL( ); + if ( aMap->FindL( aTrigger, variant ) ) + { + targetMap->InsertL( KActionMap, variant ); + } + else + { + User::Leave( KErrNotFound ); + } + + TLiwGenericParam result( KListMap, TLiwVariant( targetMap )); + aOutParamList.AppendL( result ); + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( targetMap ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::RemoveDataL( const CCPLiwMap& aMap ) + { + CP_DEBUG( _L8("CCPDataManager::RemoveData()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + iStorage->RemoveL( &aMap ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::AddObserverL( + CCPNotificationHandler* aNotificationHandler ) + { + CP_DEBUG( _L8("CCPDataManager::AddObserverL()") ); + __ASSERT_DEBUG( iStorage , User::Panic( _L("cpserver"), 0 ) ); + iNotificationsArray.AppendL( aNotificationHandler ); + if ( iNotificationsArray.Count( ) == 1 ) + { + iStorage->SetCallback( this ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::RemoveObserver( + CCPNotificationHandler* aNotificationHandler ) + { + CP_DEBUG( _L8("CCPDataManager::RemoveObserver()") ); + TInt index = iNotificationsArray.Find( aNotificationHandler ); + __ASSERT_DEBUG( index >= 0 , User::Panic( _L("cpserver"), 0 ) ); + iNotificationsArray.Remove( index ); + if ( iNotificationsArray.Count( ) == 0 ) + { + iStorage->SetCallback( 0 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::HandleChangeL( CLiwDefaultList* aListOfMaps ) + { + CP_DEBUG( _L8("CCPDataManager::HandleChangeL()") ); + //for every session + for ( TInt i = 0; iErrorComplete( error ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::CloseDatabase() + { + CP_DEBUG( _L8("CCPDataManager::CloseDatabase()") ); + delete iStorage; + iStorage = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::OpenDatabaseL() + { + CP_DEBUG( _L8("CCPDataManager::OpenDatabaseL()") ); + if ( !iStorage ) + { + iStorage = StorageFactory::NewDatabaseL( ); + + // Restore storage observers + if ( iNotificationsArray.Count() > 0 ) + { + iStorage->SetCallback( this ); + } + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::SendNotificationL( CLiwDefaultList* aListOfMaps, + TInt aIndex ) + { + CP_DEBUG( _L8("CCPDataManager::SendNotificationL()") ); + iNotificationsArray[aIndex]->SendNotificationL( aListOfMaps ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDataManager::ExtractActionL( const TLiwGenericParam* aParam, RBuf8& aAction ) + { + CP_DEBUG( _L8("CCPDataManager::ExtractActionL()") ); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + if ( !aParam->Value().Get( *map ) ) + { + User::Leave( KErrArgument ); + } + + TLiwVariant variant; variant.PushL( ); + TPtrC8 tempBuf( KNullDesC8 ); + if ( map->FindL( KActionMap, variant ) + && variant.Get( tempBuf ) ) + { + aAction.CreateL( tempBuf ); + } + else + { + User::Leave( KErrArgument ); + } + + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPLiwMap* CCPDataManager::CreateMapForGetlistLC( const CCPLiwMap& aMap ) + { + CCPLiwMap *resultmap = CPublisherRegistryMap::NewLC(); + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf content_type; + content_type.CleanupClosePushL(); + RBuf content_id; + content_id.CleanupClosePushL(); + aMap.GetPropertyL( KContentType, content_type ); + aMap.GetPropertyL( KContentId, content_id ); + aMap.GetPropertyL( KPublisherId, publisher ); + resultmap->InsertL( KPublisherId, TLiwVariant( publisher )); + resultmap->InsertL( KContentId, TLiwVariant( content_id )); + resultmap->InsertL( KContentType, TLiwVariant( content_type )); + CleanupStack::PopAndDestroy( &content_id ); + CleanupStack::PopAndDestroy( &content_type ); + CleanupStack::PopAndDestroy( &publisher ); + return resultmap; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CCPDataManager::GetActivateInfoL( const CCPLiwMap* aMap ) + { + TBool result( EFalse ); + CLiwGenericParamList* outList = CLiwGenericParamList::NewLC(); + TRAPD(err,GetListL(*aMap,*outList)); + if (err == KErrNone) + { + TInt pos( 0 ); + outList->FindFirst( pos, KListMap ); + if( pos != KErrNotFound ) + { + TLiwVariant variant = (*outList)[pos].Value(); + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + if (map->FindL( KFlag, variant )) + { + TUint flag; + variant.Get( flag ); + result = flag & EActivate; + } + CleanupStack::PopAndDestroy( map ); + variant.Reset(); + } + } + CleanupStack::PopAndDestroy( outList ); + return result; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::BuildChangeInfoL( const CCPLiwMap* aMap, + const TLiwGenericParam* aParam, + CLiwDefaultList* aChangeInfoList ) + { + TLiwVariant resultVar = aParam->Value(); + resultVar.PushL(); + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* resultMap = CLiwDefaultMap::NewLC(); + resultVar.Get( *resultMap ); + + CopyVariantL(KId, resultMap, changeInfoMap ); + CopyVariantL(KPublisherId, resultMap, changeInfoMap ); + CopyVariantL(KContentType, resultMap, changeInfoMap ); + CopyVariantL(KContentId, resultMap, changeInfoMap ); + CopyVariantL(KFlag, resultMap, changeInfoMap ); + CopyVariantL(KType, aMap, changeInfoMap ); + CopyVariantL(KActionTrigger, aMap, changeInfoMap ); + CopyActionTrigger16L( aMap, changeInfoMap ); + + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); + + aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( resultMap ); + CleanupStack::PopAndDestroy( changeInfoMap ); + CleanupStack::PopAndDestroy( &resultVar ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::BuildDefaultChangeInfoL( const CCPLiwMap* aMap, + CLiwDefaultList* aChangeInfoList ) + { + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); + + CopyVariantL(KId, aMap, changeInfoMap ); + CopyVariantL(KPublisherId, aMap, changeInfoMap ); + CopyVariantL(KContentType, aMap, changeInfoMap ); + CopyVariantL(KContentId, aMap, changeInfoMap ); + CopyVariantL(KFlag, aMap, changeInfoMap ); + CopyVariantL(KType, aMap, changeInfoMap ); + CopyVariantL(KActionTrigger, aMap, changeInfoMap ); + CopyActionTrigger16L( aMap, changeInfoMap ); + + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationExecute ) ); + + aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::BuildChangeInfoForAddL( const CCPLiwMap* aMap, + CLiwDefaultList* aChangeInfoList ) + { + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); + + CopyVariantL(KId, aMap, changeInfoMap ); + CopyVariantL(KPublisherId, aMap, changeInfoMap ); + CopyVariantL(KContentType, aMap, changeInfoMap ); + CopyVariantL(KContentId, aMap, changeInfoMap ); + CopyVariantL(KFlag, aMap, changeInfoMap ); + CopyVariantL(KType, aMap, changeInfoMap ); + CopyVariantL(KActionTrigger, aMap, changeInfoMap ); + CopyVariantL(KDataMap, aMap, changeInfoMap ); + CopyActionTrigger16L( aMap, changeInfoMap ); + + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) ); + + aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::CopyVariantL(const TDesC8& aKey, + const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ) + { + TLiwVariant variant; + variant.PushL(); + if ( aInMap->FindL( aKey, variant ) ) + { + aOutMap->InsertL( aKey, variant ); + } + CleanupStack::PopAndDestroy( &variant ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPDataManager::CopyActionTrigger16L( + const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ) + { + TLiwVariant variant; + variant.PushL(); + if ( aInMap->FindL( KActionTrigger(), variant ) ) + { + + TPtrC8 result8( KNullDesC8 ); + if( variant.Get( result8 ) ) + { + RBuf actionTrigger; + actionTrigger.CleanupClosePushL(); + actionTrigger.Assign( + EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) ); + + variant.Reset(); + variant.Set( actionTrigger ); + CleanupStack::PopAndDestroy( &actionTrigger ); + } + + aOutMap->InsertL( KActionTrigger16(), variant ); + } + CleanupStack::PopAndDestroy( &variant ); + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,501 @@ +/* +* 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: Content Publisher Server Session + * +*/ + + +// INCLUDE FILES +#include +// for CleanupResetAndDestroyPushL +#include +#include + +#include "cpserversession.h" +#include "cpliwmap.h" +#include "cpublisherregistrymap.h" +#include "cpsecuritypolicy.h" +#include "cpserverdef.h" +#include "cpdebug.h" +#include "cpserver.h" +#include "cpserverdatamanager.h" +#include "cpactionhandlerthread.h" +#include "cpnotificationhandler.h" + + +using namespace LIW; + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCPServerSession::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCPServerSession* CCPServerSession::NewL( TPointersForSession& aPasser ) + { + CCPServerSession* self = CCPServerSession::NewLC( aPasser ); + CleanupStack::Pop( self ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCPServerSession* CCPServerSession::NewLC( TPointersForSession& aPasser ) + { + CCPServerSession* self = new ( ELeave ) CCPServerSession(); + CleanupStack::PushL( self ); + self->ConstructL( aPasser ) ; + return self; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::~CCPServerSession +// Destructor. +// ----------------------------------------------------------------------------- +// +CCPServerSession::~CCPServerSession() + { + //remove notification handler from an array of sessions in data manager + if ( iNotificationHandler && iDataManager ) + { + iDataManager->RemoveObserver( iNotificationHandler ); + } + if ( isRegister && iNotificationHandler ) + { + iNotificationHandler->ErrorComplete( KErrCancel ); + } + if ( iServer ) + { + iServer->RemoveSession( ); + } + delete iNotificationHandler; + delete iParamList; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::CCPServerSession +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCPServerSession::CCPServerSession() : + CSession2() + { + + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCPServerSession::ConstructL( TPointersForSession& aPasser ) + { + CP_DEBUG( _L8("CCPServerSession::ConstructL()") ); + iDataManager = aPasser.iDataManager; + iServer = aPasser.iServer; + iActionHandlerThread = aPasser.iActionHandlerThread; + iServer->AddSession( ); + isRegister = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ServiceL +// Handle client requests. +// ----------------------------------------------------------------------------- +// +void CCPServerSession::ServiceL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::ServiceL()" ) ); + TBool serverLocked = GetServerLock( aMessage ); + if ( serverLocked ) + { + aMessage.Complete( KErrLocked ); + } + else + { + TInt err(KErrNone); + TBool panicedClient(EFalse); + TRAP( err , DispatchMessageL( aMessage, panicedClient ) ); + if ( (!(aMessage.Function( ) == ECpServerRegisterObserver ) + || err == KErrInUse) && !panicedClient ) + { + aMessage.Complete( err ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ServiceL +// Handle client requests. +// ----------------------------------------------------------------------------- +// +void CCPServerSession::DispatchMessageL( const RMessage2& aMessage, TBool& aPanicedClient ) + { + CP_DEBUG( _L8("CCPServerSession::DispatchMessageL()" ) ); + switch ( aMessage.Function( ) ) + { + case ECpServerAddData: + AddDataL( aMessage ); + break; + case ECpServerAddDataNonPersistent: + AddDataNonPersistentL( aMessage ); + break; + case ECpServerGetListSize: + GetListSizeL( aMessage ); + break; + case ECpServerGetListData: + GetListDataL( aMessage ); + break; + case ECpServerRemoveData: + RemoveDataL( aMessage ); + break; + case ECpServerRegisterObserver: + RegisterObserverL( aMessage ); + break; + case ECpServerAddObserver: + AddObserverL( aMessage ); + break; + case ECpServerRemoveObserver: + RemoveObserverL( aMessage ); + break; + case ECpServerUnRegisterObserver: + UnregisterObserverL( ); + break; + case ECpServerGetChangeInfoData: + GetChangeInfoDataL( aMessage ); + break; + case ECpServerExecuteAction: + ExecuteActionL( aMessage ); + break; + default: + iServer->PanicClient( aMessage, ECPServerBadRequest ); + aPanicedClient = ETrue; + break; + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::AddDataL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::AddDataL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::AddDataL()" ) ); + CCPLiwMap* map = UnpackFromClientLC( aMessage ); + map->SetSecurityL( aMessage ); + TBool activateSupport = map->ActivateActionSupport( ); + TUint id( 0 ); + id = iDataManager->AddDataL( *map ); + TPckg idData(id); + aMessage.WriteL( KReturnPosition, idData ); + if(activateSupport) + { + CLiwDefaultList* list = CLiwDefaultList::NewLC( ); + // execute activation or deactivation action for publisher + TRAP_IGNORE( GetAndExecuteActionL( map, list ) ); + TRAP_IGNORE( SendNotificationL( map, list ) ); + CleanupStack::PopAndDestroy( list ); + } + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::AddDataNonPersistentL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::AddDataNonPersistentL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::AddDataL()" ) ); + CCPLiwMap* map = UnpackFromClientLC( aMessage ); + map->SetSecurityL( aMessage ); + TUint id( 0 ); + TPckg idData(id); + iDataManager->AddNonPersistentDataL( map ); + aMessage.WriteL( KReturnPosition, idData ); + CleanupStack::PopAndDestroy( map ); + } +// ----------------------------------------------------------------------------- +// CCPServerSession::GetListL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::GetListSizeL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::GetListSizeL()" ) ); + CCPLiwMap* map = UnpackFromClientLC( aMessage ); + map->SetSecurityL( aMessage ); + delete iParamList; + iParamList = NULL; + iParamList = CLiwGenericParamList::NewL( ); + iDataManager->GetListL( *map, *iParamList ); + TPckg sizeDes(iParamList->Size( ) ); + aMessage.WriteL( KReturnPosition, sizeDes ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::GetListDataL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::GetListDataL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::GetListDataL()" ) ); + if( iParamList ) + { + ExternalizeAndWriteToClientL( aMessage, iParamList ); + delete iParamList; + } + iParamList = NULL; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::RemoveDataL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::RemoveDataL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::RemoveDataL()" ) ); + CCPLiwMap* map = UnpackFromClientLC( aMessage ); + map->SetSecurityL( aMessage ); + iDataManager->RemoveDataL( *map ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ExecuteActionL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::ExecuteActionL( const RMessage2& aMessage ) + { + TInt error(KErrNone); + CP_DEBUG( _L8("CCPServerSession::ExecuteActionSizeL()" ) ); + CCPLiwMap* map = UnpackFromClientLC( aMessage ); + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC( ); + CLiwDefaultList* list = CLiwDefaultList::NewLC(); + error = iDataManager->GetActionL( *map, *paramList, list ); + //we notify apart from action execution result. So in fact + //notification means there was an attempt to execute action + iDataManager->HandleChangeL( list ); + User::LeaveIfError( error ); + ExecuteL( *paramList ); + CleanupStack::PopAndDestroy( list ); + CleanupStack::PopAndDestroy( paramList ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ExecuteL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::ExecuteL( + const CLiwGenericParamList& aActionParams ) + { + for ( TInt i = 0; i < aActionParams.Count(); i++ ) + { + TLiwGenericParam param; + param.PushL(); + aActionParams.AtL( i, param ); + CLiwGenericParamList* singleAction = CLiwGenericParamList::NewLC(); + singleAction->AppendL( param ); + TRAP_IGNORE( iActionHandlerThread->ExecuteL( *singleAction ) ); + CleanupStack::PopAndDestroy( singleAction ); + CleanupStack::PopAndDestroy( ¶m ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::RegisterObserverL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::RegisterObserverL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::RegisterObserverL()" ) ); + if ( !isRegister ) + { + if (aMessage.Int3() != KErrAlreadyExists && + aMessage.GetDesLength( KDescriptorPosition) < KErrNone ) + { + iServer->PanicClient( aMessage, ECPServerBadRequest ); + User::Leave( KErrGeneral ); + } + if ( !iNotificationHandler ) + { + iNotificationHandler = CCPNotificationHandler::NewL( + iServer->GetNotifications()); + iDataManager->AddObserverL( iNotificationHandler ); + } + iNotificationHandler->SaveMessageL( aMessage ); + isRegister = ETrue; + } + else + { + User::Leave( KErrInUse ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::AddObserverL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::AddObserverL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::AddObserverL()" ) ); + if( iNotificationHandler ) + { + iNotificationHandler->AddObserverL( aMessage ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::RemoveObserverL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::RemoveObserverL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::RemoveObserverL()" ) ); + if( iNotificationHandler ) + { + iNotificationHandler->RemoveObserverL( aMessage ); + } + } + + +// ----------------------------------------------------------------------------- +// CCPServerSession::UnregisterObserverL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::UnregisterObserverL() + { + CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) ); + if ( isRegister ) + { + //remove notification handler from an array of sessions in data manager + iDataManager->RemoveObserver( iNotificationHandler ); + //reset filter for this session + iNotificationHandler->ErrorComplete( KErrCancel ); + delete iNotificationHandler; + iNotificationHandler = NULL; + isRegister = EFalse; + } + else + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::GetChangeInfoDataL +// ----------------------------------------------------------------------------- +// +void CCPServerSession::GetChangeInfoDataL( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) ); + if( iNotificationHandler ) + { + isRegister = EFalse; + ExternalizeAndWriteToClientL( aMessage, + iNotificationHandler->GetPointerToChangeInfoList( ) ); + iNotificationHandler->Reset( ); + } + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::ExternalizeAndWriteToClient +// ----------------------------------------------------------------------------- +// +void CCPServerSession::ExternalizeAndWriteToClientL( + const RMessage2& aMessage, const CLiwGenericParamList* outParamList ) + { + CP_DEBUG( _L8("CCPServerSession::ExternalizeAndWriteToClientL()" ) ); + HBufC8* buf = HBufC8::NewLC( outParamList->Size( ) ); + TPtr8 des = buf->Des( ); + RDesWriteStream writeStream(des); + CleanupClosePushL( writeStream ); + outParamList->ExternalizeL( writeStream ); + writeStream.CommitL( ); + aMessage.WriteL( KDescriptorPosition, des ); + CleanupStack::PopAndDestroy( &writeStream ); + CleanupStack::PopAndDestroy( buf ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPLiwMap* CCPServerSession::UnpackFromClientLC( const RMessage2& aMessage ) + { + CP_DEBUG( _L8("CCPServerSession::UnpackFromClientLC()") ); + TInt deslen = aMessage.GetDesLengthL( KDescriptorPosition ); + HBufC8* buffer = HBufC8::NewLC( deslen ); + TPtr8 tempDes = buffer->Des( ); + aMessage.Read( KDescriptorPosition, tempDes ); + RDesReadStream datastrm( *buffer); + CleanupClosePushL( datastrm ); + CCPLiwMap* inParamList = CCPLiwMap::NewL( datastrm ); + CleanupStack::PopAndDestroy( &datastrm ); + CleanupStack::PopAndDestroy( buffer ); + inParamList->PushL( ); + return inParamList; + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::SendNotificationL +// ----------------------------------------------------------------------------- +// +void CCPServerSession::SendNotificationL( CCPLiwMap* aMap, + CLiwDefaultList* aNotificationList ) + { + RBuf8 trigger; + trigger.CleanupClosePushL(); + aMap->GetPropertyL( KActionTrigger, trigger ); + if( ( trigger == KActivateTrigger ) || ( trigger == KDeactivateTrigger ) ) + { + iDataManager->HandleChangeL( aNotificationList ); + } + CleanupStack::PopAndDestroy( &trigger ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::GetAndExecuteActionL +// --------------- -------------------------------------------------------------- +// +void CCPServerSession::GetAndExecuteActionL( CCPLiwMap* aMap, + CLiwDefaultList* aNotificationList, TBool aInsertTrigger ) + { + if (aInsertTrigger) + { + aMap->InsertL( KActionTrigger, TLiwVariant( KActivateTrigger ) ); + } + CLiwGenericParamList* paramList = CLiwGenericParamList::NewLC(); + iDataManager->GetActionL( *aMap, *paramList, aNotificationList ); + iActionHandlerThread->ExecuteL( *paramList ); + CleanupStack::PopAndDestroy( paramList ); + } + +// ----------------------------------------------------------------------------- +// CCPServerSession::GetServerLock +// --------------- -------------------------------------------------------------- +// +TBool CCPServerSession::GetServerLock( const RMessage2& aMessage ) + { + // Allways allow to unregister + return ( (aMessage.Function() != ECpServerUnRegisterObserver) + && iServer->GetLock() ); + + } +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/bwins/cpstorageu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/bwins/cpstorageu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewDatabaseL@StorageFactory@@SAPAVCCpStorage@@XZ @ 1 NONAME ; class CCpStorage * StorageFactory::NewDatabaseL(void) + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/eabi/cpstorageu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/eabi/cpstorageu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN14StorageFactory12NewDatabaseLEv @ 1 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Storage +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +cpstorage.mmp diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/cpstorage.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/group/cpstorage.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET cpstorage.dll +TARGETTYPE dll +UID 0x1000008d 0x20016B7C + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE cpstorageengine.cpp +SOURCE cpstoragefactory.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../cpserver/inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingdebug/inc +USERINCLUDE ../../../contentpublishingutils/contentpublishingmap/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY sqldb.lib +LIBRARY efsrv.lib +LIBRARY cputils.lib +LIBRARY liwservicehandler.lib +LIBRARY centralrepository.lib + +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif + + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlcommands.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlcommands.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef C_CPSSQL_H +#define C_CPSSQL_H +#ifdef CONTENT_PUBLISHER_STORAGE_MT +_LIT( KCPpathdatabase, "c:\\cpdatastorage.sq" ); +#endif + +_LIT( KCPdatabase, "[20016B7B]cpdatastorage.sq" ); +_LIT( KCPdatabaseDrive, "C:" ); +_LIT8( KMdsSqlDbaConfig, + "cache_size=10000; page_size=4096; encoding=\"UTF-8\";" ); + +//Create Tables +_LIT( KSQLCreateMainTable, + "CREATE TABLE CP_MAIN_TABLE( Id INTEGER PRIMARY KEY ,\ + Publisher TEXT NOT NULL,\ + Content_type TEXT NOT NULL,\ + Content_id TEXT NOT NULL,\ + Expiration_date BIGINT NOT NULL,\ + Data BLOB, \ + Action BLOB, \ + UNIQUE( Publisher, Content_type, Content_id ));" ); + +_LIT( KSQLCreatePublisherTable, + "CREATE TABLE CP_PUBLISHER_TABLE( Id INTEGER PRIMARY KEY ,\ + Publisher TEXT NOT NULL,\ + Content_type TEXT NOT NULL,\ + Content_id TEXT NOT NULL, \ + Data BLOB, \ + UNIQUE( Publisher, Content_type, Content_id ));" ); + +//Create Indexes +_LIT( KSQLIndexOnMain_Publisher, + "CREATE INDEX Main_PublisherIndex ON CP_MAIN_TABLE(Publisher);" ); +_LIT( KSQLIndexOnMain_Content_type, + "CREATE INDEX Main_Content_typeIndex ON CP_MAIN_TABLE(Content_type);" ); + +_LIT( KSQLIndexOnPub_Content_type, + "CREATE INDEX Pub_Content_typeIndex ON CP_PUBLISHER_TABLE(Content_type);" ); +_LIT( KSQLIndexOnPub_Content_type_Content_id, + "CREATE INDEX Pub_Content_type_Content_Id_Index ON CP_PUBLISHER_TABLE(Content_type,Content_id);" ); + +//Insert Data +//Update Data +_LIT( KSQLUpdateComplete, + "UPDATE CP_MAIN_TABLE SET \ + Data = :Data, Action = :Action WHERE Id = :Id " ); + +_LIT( KSQLUpdateData, + "UPDATE CP_MAIN_TABLE SET \ + Data = :Data WHERE Id = :Id " ); + +_LIT( KSQLUpdateAction, + "UPDATE CP_MAIN_TABLE SET \ + Action = :Action WHERE Id = :Id " ); + +_LIT( KSQLInsert, + "INSERT INTO CP_MAIN_TABLE (Publisher,Content_type,Content_id,Expiration_date,Data,Action) VALUES ( \ + :Publisher,\ + :Content_type,\ + :Content_id,\ + :Expiration_date,\ + :Data,\ + :Action )" ); + +//Delete Data +_LIT( KSQLDelete, "DELETE FROM CP_MAIN_TABLE WHERE " ); + +//Get Data +_LIT( KSQLGetLastInsertId, "SELECT last_insert_rowid() " ); +_LIT( KSQLGetList, + "SELECT Id,Publisher,Content_type,Content_id,Expiration_date,Data,Action FROM CP_MAIN_TABLE WHERE " ); +_LIT( KSQLGetIds, + "SELECT Id,Publisher,Content_type,Content_id FROM CP_MAIN_TABLE WHERE " ); +_LIT( KSQLGetAction, "SELECT Id, Action FROM CP_MAIN_TABLE WHERE " ); +_LIT( KSQLGetPublisher, "Publisher = :Publisher" ); +_LIT( KSQLGetContentType, "Content_type = :Content_type" ); +_LIT( KSQLGetContentId, "Content_id = :Content_id" ); +_LIT( KSQLGetId, "Id = :Id" ); +_LIT( KAnd, " AND " ); + +_LIT( KSQLFetchId, + "SELECT Id FROM CP_MAIN_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id" ); +_LIT( KSQLFetchIds, + "SELECT Publisher,Content_type,Content_id FROM CP_MAIN_TABLE WHERE Id =:Id" ); + +_LIT( KSQLPublisher, ":Publisher" ); +_LIT( KSQLContent_type, ":Content_type" ); +_LIT( KSQLContent_id, ":Content_id" ); +_LIT( KSQLExpiration_date, ":Expiration_date" ); +_LIT( KSQLData, ":Data" ); +_LIT( KSQLAction, ":Action" ); +_LIT( KSQLId, ":Id" ); + +_LIT( KSQLOrderRecent, " ORDER BY Id DESC" ); +_LIT( KSQLOrderPublisher, " ORDER BY Publisher" ); +_LIT( KSQLOrderContent, " ORDER BY Content_type" ); + +_LIT( KColumnId, "Id" ); +_LIT( KColumnPublisher, "Publisher" ); +_LIT( KColumnContent_type, "Content_type" ); +_LIT( KColumnContent_id, "Content_id" ); +_LIT( KColumnExpiration_date, "Expiration_date" ); +_LIT( KColumnData, "Data" ); +_LIT( KColumnAction, "Action" ); + +_LIT8( KList, "List" ); + +#endif //C_CPSSQL_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpssqlconstants.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef C_CPSSQLCONSTS_H +#define C_CPSSQLCONSTS_H +#ifdef CONTENT_PUBLISHER_STORAGE_MT +_LIT( KCPpathdatabase, "c:\\cpdatastorage.sq" ); +#endif + +_LIT( KCPdatabase, "[20016B7B]cpdatastorage.sq" ); +_LIT( KCPdatabaseDrive, "C:" ); +_LIT8( KMdsSqlDbaConfig, + "cache_size=10000; page_size=4096; encoding=\"UTF-8\";" ); + +//Create Tables +_LIT( KSQLCreateMainTable, + "CREATE TABLE CP_MAIN_TABLE( Id INTEGER PRIMARY KEY ,\ + Publisher TEXT NOT NULL,\ + Content_type TEXT NOT NULL,\ + Content_id TEXT NOT NULL,\ + Expiration_date BIGINT NOT NULL,\ + Access_List BLOB,\ + Data BLOB, \ + Action BLOB, \ + UNIQUE( Publisher, Content_type, Content_id ));" ); + +_LIT( KSQLCreatePublisherTable, + "CREATE TABLE CP_PUBLISHER_TABLE( Id INTEGER PRIMARY KEY ,\ + Publisher TEXT NOT NULL,\ + Content_type TEXT NOT NULL,\ + Content_id TEXT NOT NULL, \ + Flag INTEGER NOT NULL, \ + Access_List BLOB,\ + Data BLOB, \ + Action BLOB, \ + UNIQUE( Publisher, Content_type, Content_id ));" ); + +//Create Indexes +_LIT( KSQLIndexOnMain_Publisher, + "CREATE INDEX Main_PublisherIndex ON CP_MAIN_TABLE(Publisher);" ); +_LIT( KSQLIndexOnMain_Content_type, + "CREATE INDEX Main_Content_typeIndex ON CP_MAIN_TABLE(Content_type);" ); + +_LIT( KSQLIndexOnPub_Content_type, + "CREATE INDEX Pub_Content_typeIndex ON CP_PUBLISHER_TABLE(Content_type);" ); +_LIT( KSQLIndexOnPub_Content_type_Content_id, + "CREATE INDEX Pub_Content_type_Content_Id_Index ON CP_PUBLISHER_TABLE(Content_type,Content_id);" ); + +#endif //C_CPSSQLCONSTS_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorage.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef C_CPSTORAGE_H +#define C_CPSTORAGE_H + +// FORWARD DECLARATIONS +class CLiwMap; +class CLiwGenericParamList; +class CLiwDefaultList; + +/** + * Callback Interface for observing changes in Content Publisher Database + * + * @since S60 v5.0 + */ +class MCPChangeNotifier + { +public: + + /** + * This method should be implemented by subscriber for changes in + * database + * + * @param Map containing change information + * @param Id of changed entry + * @return + */ + virtual void HandleChangeL( CLiwDefaultList* aListOfMaps ) = 0; + + }; + +/** + * Interface for CPS database implementations + * + */ +class CCpStorage : public CBase + { +public: + + /** + * Fetches data from database + * + * @param aMap Filtering and sorting criteria + * @param aList Target for results + */ + virtual void GetListL( const CLiwMap* aMap, + CLiwGenericParamList& aList ) = 0; + /** + * Adds or Updates data & action to database + * @param Map containing data item + * @return id of added entry + */ + virtual TInt32 AddL( const CLiwMap* aMap ) = 0; + + /** + * Removes data item from database + * @param Filtering and sorting criteria + */ + virtual void RemoveL( const CLiwMap* aMap ) = 0; + + /** + * Set database observer + * @param Callback pointer + */ + virtual void SetCallback( MCPChangeNotifier* aCallback ) = 0; + + }; + +#endif //C_CPSTORAGE_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorageengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstorageengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,145 @@ +/* +* 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: Database implementation + * +*/ + + +#ifndef C_CPSTORAGE_ENGINE_H +#define C_CPSTORAGE_ENGINE_H + +#include +#include +#include "cpstorage.h" + +// FORWARD DECLARATIONS +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif +class MCPChangeNotifier; +class CRepository; + +// CLASS DECLARATION +/** + * SQLite based databse for Content Publisher + * + * @lib cpstorage.dll + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CCpStorageEngine ): public CCpStorage + { +public: + + /** + * Two-phased constructor. + */ + static CCpStorageEngine* NewL(); + + /** + * Two-phased constructor. + */ + static CCpStorageEngine* NewLC(); + + /** + * Destructor. + */ + ~CCpStorageEngine(); + + //from CCpStorage + + /** + * Fetches data from database + * + * @param aMap Filtering and sorting criteria + * @param aList Target for results + */ + void GetListL( const CLiwMap* aMap, CLiwGenericParamList& aList ); + + /** + * Adds or Updates data & action to database + * @param Map containing data item + * @return id of added entry + */ + TInt32 AddL( const CLiwMap* aMap ); + + /** + * Remove data item from database + * @param Filtering and sorting criteria + */ + void RemoveL( const CLiwMap* aMap ); + + /** + * Set database observer + * @param Callback pointer + */ + void SetCallback( MCPChangeNotifier* aCallback ); + +private: + + /** + * Perform the second phase construction of a CCpStorageEngine object. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CCpStorageEngine(); + + /** + * Creates database tables. + */ + void CreateTablesL(); + + /** + * Creates new database. + * If Db is created for the first time, + * set repository db state into KSQLDBStateNormal + */ + void CreateNewDbL(); + + /** + * Deletes database. + * Called when opening Db try return KSqlErrCorrupt error. + * Removes KSQLDBStateNormal state and set KSQLDBStateRestored into + * repository db state. + */ + void DeleteCorruptedDbL(); + +private: + + /** + * Database. + * Own. + */ + RSqlDatabase iSqlDb; + + /** + * Callback pointer. + * Not own. + */ + MCPChangeNotifier* iCallback; + + /** + * Repository keeps information about Db state. + * Own. + */ + CRepository* iRepository; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + }; + +#endif //C_CPSTORAGE_ENGINE_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstoragefactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/inc/cpstoragefactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#ifndef C_CPSTORAGE_FACTORY_H +#define C_CPSTORAGE_FACTORY_H + +#include + +// FORWARD DECLARATIONS +class CCpStorage; + +// CLASS DECLARATION +/** + * Class with one static method used by CPS Server to + * instantiate storage database. + * + * @since S60 v5.0 + */ +class StorageFactory + { +public: + IMPORT_C static CCpStorage* NewDatabaseL(); + }; + +#endif //C_CPSTORAGE_FACTORY_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include "cpstorageengine.h" +#include "cpliwmap.h" +#include "ccontentmap.h" +#include "cpdebug.h" +#include "cpssqlconstants.h" +#include "cpserverdef.h" +#include + +// --------------------------------------------------------------------------- +// CCpStorageEngine::CCpStorageEngine() +// +// --------------------------------------------------------------------------- +// +CCpStorageEngine::CCpStorageEngine() + { + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::ConstructL() +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::ConstructL() + { +#ifdef CONTENT_PUBLISHER_DEBUG + if(!CCPDebug::Enable()) + { + iDebug = CCPDebug::NewL( KCPDebugFileName2 ); + } +#endif + CP_DEBUG( _L8("CCpStorageEngine::ConstructL()") ); + + iRepository = CRepository::NewL( KServerUid ); + TBool createNew( EFalse ); + TInt err = iSqlDb.Open( KCPdatabase, &KMdsSqlDbaConfig ); + if( err == KSqlErrCorrupt ) + { + DeleteCorruptedDbL(); + createNew = ETrue; + } + else if( err/* == KErrNotFound */) + { + createNew = ETrue; + } + + if ( createNew ) + { + CreateNewDbL(); + } + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::NewL() +// +// --------------------------------------------------------------------------- +// +CCpStorageEngine* CCpStorageEngine::NewL() + { + CCpStorageEngine* self = CCpStorageEngine::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::NewLC() +// +// --------------------------------------------------------------------------- +// +CCpStorageEngine* CCpStorageEngine::NewLC() + { + CCpStorageEngine* self = new (ELeave) CCpStorageEngine(); + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::~CCpStorageEngine() +// +// --------------------------------------------------------------------------- +// +CCpStorageEngine::~CCpStorageEngine() + { + CP_DEBUG( _L8("CCpStorageEngine::~CCpStorageEngine()") ); + iSqlDb.Close( ); + delete iRepository; +#ifdef CONTENT_PUBLISHER_DEBUG + delete iDebug; +#endif + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::CreateTablesL +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::CreateTablesL() + { + CP_DEBUG( _L8("CCpStorageEngine::CreateTablesL()") ); + + //Main Table + User::LeaveIfError( iSqlDb.Exec( KSQLCreateMainTable ) ); + User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnMain_Publisher ) ); + User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnMain_Content_type ) ); + //Publisher Table + User::LeaveIfError( iSqlDb.Exec( KSQLCreatePublisherTable ) ); + User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnPub_Content_type ) ); + User::LeaveIfError( iSqlDb.Exec( KSQLIndexOnPub_Content_type_Content_id ) ); + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::GetListL +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::GetListL( const CLiwMap* aMap, + CLiwGenericParamList& aList ) + { + CP_DEBUG( _L8("CCpStorageEngine::GetListL()") ); + const CCPLiwMap* map = static_cast(aMap); + RArray itemsToDelete; + TUint numberOfItems = map->GetListL( iSqlDb, &aList, itemsToDelete ); + //delete outdated items + CContentMap* removeItemMap = CContentMap::NewLC( ); + for ( TInt i = 0; iInsertL( KId, TLiwVariant( itemsToDelete[i] ) ); + removeItemMap->InsertL( KType, TLiwVariant( KCpData ) ); + RemoveL( removeItemMap ); + removeItemMap->Remove( KId ); + } + CleanupStack::PopAndDestroy( removeItemMap ); + itemsToDelete.Reset( ); + + if ( numberOfItems == 0 ) + { + User::Leave( KErrNotFound ); + } + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::AddL +// +// --------------------------------------------------------------------------- +// +TInt32 CCpStorageEngine::AddL( const CLiwMap* aMap ) + { + CP_DEBUG( _L8("CCpStorageEngine::AddL()") ); + TInt32 id(0); + const CCPLiwMap* map = static_cast(aMap); + if ( iCallback ) + { + CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC( ); + id = map->AddL( iSqlDb, listOfMaps ); + iCallback->HandleChangeL( listOfMaps ); + CleanupStack::PopAndDestroy( listOfMaps ) ; + } + else + { + id = map->AddL( iSqlDb ); + } + return id; + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::RemoveL +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::RemoveL( const CLiwMap* aMap ) + { + CP_DEBUG( _L8("CCpStorageEngine::RemoveL()") ); + const CCPLiwMap* map = static_cast(aMap); + if ( iCallback ) + { + CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC( ); + map->RemoveL( iSqlDb, listOfMaps ); + iCallback->HandleChangeL( listOfMaps ); + CleanupStack::PopAndDestroy( listOfMaps ) ; + } + else + { + map->RemoveL( iSqlDb ); + } + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::SetCallback() +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::SetCallback( MCPChangeNotifier* aCallback ) + { + iCallback = aCallback; + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::DeleteCorruptedDbL() +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::DeleteCorruptedDbL() + { + User::LeaveIfError( iSqlDb.Delete( KCPdatabase ) ); + TInt value( 0 ); + if( !iRepository->Get( KCPStorageUid, value ) ) + { + value ^= KSQLDBStateNormal; + value |= KSQLDBStateRestored; + } + else + { + value = KSQLDBStateRestored; + } + iRepository->Set( KCPStorageUid, value ); + } + +// --------------------------------------------------------------------------- +// CCpStorageEngine::CreateNewDbL() +// +// --------------------------------------------------------------------------- +// +void CCpStorageEngine::CreateNewDbL() + { + TSecureId id( KServerUid ); // Uid of CP Server - only this process has access rights + TSecurityPolicy defaultPolicy; + TSecurityPolicy securityPolicy(id); + RSqlSecurityPolicy sqlSecurityPolicy; + CleanupClosePushL( sqlSecurityPolicy ); + User::LeaveIfError( sqlSecurityPolicy.Create( defaultPolicy ) ); + User::LeaveIfError( sqlSecurityPolicy.SetDbPolicy( + RSqlSecurityPolicy::ESchemaPolicy, securityPolicy ) ); +#ifdef CONTENT_PUBLISHER_STORAGE_MT + iSqlDb.CreateL( KCPpathdatabase, &KMdsSqlDbaConfig ); +#else + iSqlDb.CreateL( KCPdatabase, sqlSecurityPolicy, &KMdsSqlDbaConfig ); +#endif + CleanupStack::PopAndDestroy( &sqlSecurityPolicy ); + CreateTablesL( ); + + TInt value( 0 ); + if( iRepository->Get( KCPStorageUid, value ) == KErrNotFound ) + { + value = KSQLDBStateNormal; + iRepository->Set( KCPStorageUid, value ); + } + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstoragefactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstoragefactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include "cpstoragefactory.h" +#include "cpstorageengine.h" + +EXPORT_C CCpStorage* StorageFactory::NewDatabaseL() + { + return CCpStorageEngine::NewL(); + } diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingserver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingserver/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +#include "../cpsqlitestorage/group/bld.inf" +#include "../cpserver/group/bld.inf" + + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/bwins/cpdebugu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + ?Data@CCPDebug@@CAPAUDebugData@@XZ @ 1 NONAME ; struct DebugData * CCPDebug::Data(void) + ?Enable@CCPDebug@@SAHXZ @ 2 NONAME ; int CCPDebug::Enable(void) + ?EnableLogging@CCPDebug@@SAXH@Z @ 3 NONAME ; void CCPDebug::EnableLogging(int) + ?NewL@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 4 NONAME ; class CCPDebug * CCPDebug::NewL(class TDesC16 const &) + ?NewLC@CCPDebug@@SAPAV1@ABVTDesC16@@@Z @ 5 NONAME ; class CCPDebug * CCPDebug::NewLC(class TDesC16 const &) + ?Printf@CCPDebug@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 6 NONAME ; void CCPDebug::Printf(class TRefByValue, ...) + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/eabi/cpdebugu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _ZN8CCPDebug13EnableLoggingEi @ 1 NONAME + _ZN8CCPDebug4DataEv @ 2 NONAME + _ZN8CCPDebug4NewLERK7TDesC16 @ 3 NONAME + _ZN8CCPDebug5NewLCERK7TDesC16 @ 4 NONAME + _ZN8CCPDebug6EnableEv @ 5 NONAME + _ZN8CCPDebug6PrintfE11TRefByValueIK6TDesC8Ez @ 6 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Debug +* +*/ + + + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS + + +PRJ_MMPFILES +cpdebug.mmp + + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/group/cpdebug.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 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: Project definition macros to log +* +*/ + + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET cpdebug.dll +TARGETTYPE dll +UID 0x1000018d 0x04066666 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LANG SC + +SOURCEPATH ../src + +SOURCE cpdebug.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib + +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/inc/cpdebug.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingdebug/src/cpdebug.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include "cpdebug.h" + +const TUint KMemDataSize( 100 ); +const TUint KBufMaxSize( 512 ); +const TUint KThousand( 1000 ); + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPDebug::ConstructL( const TDesC& aFile ) + { + iData = new (ELeave) DebugData(); + iData->iLogEnabled = EFalse; + iData->iFirstUpdateTime.UniversalTime( ); + iData->iFileName.Create( aFile.Length( ) ); + iData->iFileName = aFile; + Dll::SetTls( iData ); + User::LeaveIfError( iData->iFs.Connect( ) ); + EnableLogging( ETrue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCPDebug* CCPDebug::NewL( const TDesC& aFile ) + { + CCPDebug* self = NewLC( aFile ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCPDebug* CCPDebug::NewLC( const TDesC& aFile ) + { + CCPDebug* self = new (ELeave) CCPDebug(); + CleanupStack::PushL(self); + self->ConstructL( aFile ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPDebug::CCPDebug() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPDebug::~CCPDebug() + { + if ( iData ) + { + iData->iFileName.Close( ); + iData->iLogFile.Close( ); + iData->iFs.Close( ); + } + Dll::FreeTls( ); + delete iData; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CCPDebug::Enable() + { + DebugData* data = Data(); + if(!data) + { + return false; + } + else + { + return true; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPDebug::EnableLogging(TBool aEnable) + { + DebugData* data = Data(); + if(aEnable && !data->iLogEnabled) + { + if( data->iLogFile.Replace(data->iFs, data->iFileName, EFileWrite) == KErrNone ) + { + data->iLogEnabled = ETrue; + Printf(_L8("CCPDebug::EnableLogging()")); + } + } + else if(!aEnable && data->iLogEnabled) + { + data->iLogFile.Close(); + data->iLogEnabled = EFalse; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPDebug::Printf(TRefByValue aFormat, ...) + { + DebugData* data = Data(); + if(!data || !data->iLogEnabled) + { + return; + } + TTime now; + now.UniversalTime(); + TInt32 elapsed = (TInt32)(now.MicroSecondsFrom(data->iFirstUpdateTime).Int64() / KThousand); + + TBuf8 memData; + memData.Format(_L8("% 2d,%03d "), elapsed / KThousand, elapsed % KThousand); + + TBuf8 buf; + VA_LIST list; + VA_START(list, aFormat); + buf.FormatList(aFormat, list); + VA_END(list); + buf.Insert(0, memData); + buf.Append(_L8("\n")); + + data->iLogFile.Write(buf); + data->iLogFile.Flush(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C DebugData* CCPDebug::Data() + { + return static_cast(Dll::Tls()); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/bwins/cputilsu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,16 @@ +EXPORTS + ?GetProperty@CCPLiwMap@@QBEHABVTDesC8@@AAJ@Z @ 1 NONAME ; int CCPLiwMap::GetProperty(class TDesC8 const &, long &) const + ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf16@@@Z @ 2 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf16 &) const + ?GetPropertyL@CCPLiwMap@@QBEHABVTDesC8@@AAVRBuf8@@@Z @ 3 NONAME ; int CCPLiwMap::GetPropertyL(class TDesC8 const &, class RBuf8 &) const + ?IsValidForActionL@CCPLiwMap@@QBEXXZ @ 4 NONAME ; void CCPLiwMap::IsValidForActionL(void) const + ?IsValidForNotificationL@CCPLiwMap@@QBEXXZ @ 5 NONAME ; void CCPLiwMap::IsValidForNotificationL(void) const + ?NewL@CCPLiwMap@@SAPAV1@AAVRDesReadStream@@@Z @ 6 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class RDesReadStream &) + ?NewL@CCPLiwMap@@SAPAV1@ABVCLiwGenericParamList@@@Z @ 7 NONAME ; class CCPLiwMap * CCPLiwMap::NewL(class CLiwGenericParamList const &) + ?NewL@CContentMap@@SAPAV1@XZ @ 8 NONAME ; class CContentMap * CContentMap::NewL(void) + ?NewL@CPublisherRegistryMap@@SAPAV1@XZ @ 9 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewL(void) + ?NewLC@CContentMap@@SAPAV1@XZ @ 10 NONAME ; class CContentMap * CContentMap::NewLC(void) + ?NewLC@CPublisherRegistryMap@@SAPAV1@XZ @ 11 NONAME ; class CPublisherRegistryMap * CPublisherRegistryMap::NewLC(void) + ?PackForServerLC@CCPLiwMap@@QBEPAVHBufC8@@XZ @ 12 NONAME ; class HBufC8 * CCPLiwMap::PackForServerLC(void) const + ?Reset@CCPLiwMap@@QBEXXZ @ 13 NONAME ; void CCPLiwMap::Reset(void) const + ?SetSecurityL@CCPLiwMap@@QAEXABVRMessage2@@@Z @ 14 NONAME ; void CCPLiwMap::SetSecurityL(class RMessage2 const &) + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/eabi/cputilsu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +EXPORTS + _ZN11CContentMap4NewLEv @ 1 NONAME + _ZN11CContentMap5NewLCEv @ 2 NONAME + _ZN21CPublisherRegistryMap4NewLEv @ 3 NONAME + _ZN21CPublisherRegistryMap5NewLCEv @ 4 NONAME + _ZN9CCPLiwMap12SetSecurityLERK9RMessage2 @ 5 NONAME + _ZN9CCPLiwMap4NewLER14RDesReadStream @ 6 NONAME + _ZN9CCPLiwMap4NewLERK20CLiwGenericParamList @ 7 NONAME + _ZNK9CCPLiwMap11GetPropertyERK6TDesC8Rl @ 8 NONAME + _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R5RBuf8 @ 9 NONAME + _ZNK9CCPLiwMap12GetPropertyLERK6TDesC8R6RBuf16 @ 10 NONAME + _ZNK9CCPLiwMap15PackForServerLCEv @ 11 NONAME + _ZNK9CCPLiwMap17IsValidForActionLEv @ 12 NONAME + _ZNK9CCPLiwMap23IsValidForNotificationLEv @ 13 NONAME + _ZNK9CCPLiwMap5ResetEv @ 14 NONAME + _ZTI9CCPLiwMap @ 15 NONAME ; ## + _ZTV9CCPLiwMap @ 16 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Map +* +*/ + +// Macro definitions +#include + + +PRJ_PLATFORMS + +DEFAULT + +PRJ_EXPORTS +../inc/ccontentmap.h |../../../../inc/ccontentmap.h +../inc/cpliwmap.h |../../../../inc/cpliwmap.h +../inc/cpublisherregistrymap.h |../../../../inc/cpublisherregistrymap.h + +PRJ_MMPFILES +cputils.mmp + + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/cputils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/group/cputils.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 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: ?Description +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET cputils.dll +TARGETTYPE dll + +UID 0x1000008D 0x20016B7F + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LANG SC + +SOURCEPATH ../src +SOURCE cpliwmap.cpp +SOURCE ccontentmap.cpp +SOURCE cpublisherregistrymap.cpp +SOURCE cpsecuritypolicy.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../contentpublishingdebug/inc +USERINCLUDE ../../../contentpublishingserver/cpserver/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +LIBRARY sqldb.lib +LIBRARY bafl.lib +LIBRARY liwservicehandler.lib inetprotutil.lib + +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif + +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/ccontentmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/ccontentmap.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpliwmap.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpsecuritypolicy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpsecuritypolicy.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,145 @@ +/* +* 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: Class used by session to handle access control list + * Version : %version: 5 % << Don't touch! Updated by Synergy at check-out. + * +*/ + + +#ifndef C_CPSECURITYPOLICY_H +#define C_CPSECURITYPOLICY_H + +#include + +class CLiwDefaultMap; + +/** + * Internal class for Security related activities + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CCPSecurityPolicy ): public CBase + { +public: + + enum TACLPolicy + { + ERead, + EWrite, + EDelete + }; + + /** + * Two-phased constructor. + */ + static CCPSecurityPolicy* NewL( const RMessage2& aMessage ); + + /** + * Two-phased constructor. + */ + static CCPSecurityPolicy* NewLC( const RMessage2& aMessage ); + + /** + * Destructor. + */ + virtual ~CCPSecurityPolicy(); + + /** + * Sets default ACL map and serializes it + * + * @param aPolicy target for ACL binary + */ + void GetDefaultSecurityL( RBuf8& aResult ) const ; + + /** + * Checks if access for client (iMessage) + * should be granted or not + * + * @param aBinary serialized ACL map + * @param aPolicy secururity policy to check + * @return ETrue if security check is ok, + * EFalse if not + */ + TBool CheckSecurityL( TPtrC8& aBinary , TACLPolicy aPolicy ) const; + + /** + * Performs actuall security check + * should be granted or not + * + * @param aMap ACL map + * @return ETrue if security check is ok, + * EFalse if not + */ + TInt DoCheckSecurityL( const CLiwMap* aMap ) const; + + /** + * Performs security check based on client UIDs + * + * @param aList list of uids which have access + * + * @return access granted or not + */ + TBool CheckUids( const TDesC& aList ) const ; + + /** + * Performs security check based on client Capabilities + * + * @param aList list of capabilities which client must have + * + * @return access granted or not + */ + TBool CheckCapabilities( const TDesC& aList ) const; + + /** + * Exctracts from list next token( UID or Capability ) + * + * @param aList list as desciptor + * @param aResult single token extracted from list + * @param aPos position of the reuired token + */ + void ExctractNextToken( const TDesC& aList, + TPtrC& aResult , TInt& aPos ) const; + /** + * Converts capability given as descriptor to enum + * + * @param aCapability descriptor to convert + * + * @return Capablity as enum + */ + TCapability GetCapability( const TDesC& aCapability ) const; + +private: + + /** + * C++ default constructor. + */ + CCPSecurityPolicy( const RMessage2& aMessage ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: + // data + + /* + * Not own. + * Message from client + */ + const RMessage2& iMessage; + + }; + +#endif // C_CPSECURITYPOLICY_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpssqlcommands.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpssqlcommands.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: + * Version : %version: 8 % << Don't touch! Updated by Synergy at check-out. + * +*/ + + +#ifndef C_CPSSQL_H +#define C_CPSSQL_H + +//Insert Data +//Update Data + + +_LIT( KSQLUpdate, "UPDATE CP_MAIN_TABLE SET " ); +_LIT( KSQLUpdateData, "Data = :Data " ); +_LIT( KSQLUpdateAction, "Action = :Action " ); +_LIT( KSQLUpdateExpirationDate, "Expiration_date = :Expiration_date " ); +_LIT( KSQLUpdateFlag, "Flag = :Flag " ); +_LIT( KSQLUpdateWhere, "WHERE Id = :Id " ); +_LIT( KComma, ", " ); + +_LIT( KSQLUpdateRegistry, "UPDATE CP_PUBLISHER_TABLE SET " ); + +_LIT( KSQLInsert, + "INSERT INTO CP_MAIN_TABLE (Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action) VALUES ( \ + :Publisher,\ + :Content_type,\ + :Content_id,\ + :Expiration_date,\ + :Access_List,\ + :Data,\ + :Action )" ); + +_LIT( KSQLInsertToRegistry, + "INSERT INTO CP_PUBLISHER_TABLE (Publisher,Content_type,Content_id,Flag,Access_List,Data,Action) VALUES ( \ + :Publisher,\ + :Content_type,\ + :Content_id,\ + :Flag,\ + :Access_List,\ + :Data,\ + :Action )" ); + +//Delete Data +_LIT( KSQLDelete, "DELETE FROM CP_MAIN_TABLE" ); +_LIT( KSQLDeleteFromRegistry, "DELETE FROM CP_PUBLISHER_TABLE" ); + +//Get Data +_LIT( KSQLGetLastInsertId, "SELECT last_insert_rowid() "); + +_LIT( KSQLGetList, + "SELECT Id,Publisher,Content_type,Content_id,Expiration_date,Access_List,Data,Action FROM CP_MAIN_TABLE"); +_LIT( KSQLGetIds, + "SELECT Id,Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE"); +_LIT( KSQLGetIdsRegistry, + "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag FROM CP_PUBLISHER_TABLE" ); +_LIT( KSQLGetAction, + "SELECT Action FROM CP_MAIN_TABLE WHERE "); + +_LIT( KSQLGetListFromRegistry, + "SELECT Id,Publisher,Content_type,Content_id,Access_List,Flag,Data,Action FROM CP_PUBLISHER_TABLE"); +_LIT( KSQLGetIdsFromRegistry, + "SELECT Id,Publisher,Content_type,Content_id FROM CP_PUBLISHER_TABLE"); +_LIT( KSQLGetActionFromRegistry, + "SELECT Id,Action FROM CP_PUBLISHER_TABLE WHERE "); + +_LIT( KSQLGetFlag ,"Flag <> 0"); +_LIT( KSQLGetPublisher ,"Publisher = :Publisher"); +_LIT( KSQLGetContentType ,"Content_type = :Content_type"); +_LIT( KSQLGetContentId ,"Content_id = :Content_id"); +_LIT( KSQLGetId ,"Id = :Id"); +_LIT( KAnd," AND "); + +_LIT( KSQLFetchId, + "SELECT Id FROM CP_MAIN_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id"); +_LIT( KSQLFetchIds, + "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_MAIN_TABLE WHERE Id =:Id"); + +_LIT( KSQLFetchIdFromRegistry, + "SELECT Id FROM CP_PUBLISHER_TABLE WHERE Publisher =:Publisher AND Content_type=:Content_type AND Content_id =:Content_id" ); +_LIT( KSQLFetchIdsFromRegistry, + "SELECT Publisher,Content_type,Content_id,Access_List FROM CP_PUBLISHER_TABLE WHERE Id =:Id" ); + +_LIT( KSQLPublisher, ":Publisher" ); +_LIT( KSQLContent_type, ":Content_type" ); +_LIT( KSQLContent_id, ":Content_id" ); +_LIT( KSQLExpiration_date, ":Expiration_date" ); +_LIT( KSQLFlag, ":Flag" ); +_LIT( KSQLData, ":Data" ); +_LIT( KSQLAction, ":Action" ); +_LIT( KSQLAccessList, ":Access_List" ); +_LIT( KSQLId, ":Id" ); + +_LIT( KSQLOrderRecent, " ORDER BY Id DESC" ); +_LIT( KSQLOrderPublisher, " ORDER BY Publisher" ); +_LIT( KSQLOrderContent, " ORDER BY Content_type" ); +_LIT( KSQLOrderContentId, " ORDER BY Content_id" ); + +_LIT( KColumnId, "Id" ); +_LIT( KColumnPublisher, "Publisher" ); +_LIT( KColumnContent_type, "Content_type" ); +_LIT( KColumnContent_id, "Content_id" ); +_LIT( KColumnAccessList, "Access_List" ); +_LIT( KColumnExpiration_date, "Expiration_date" ); +_LIT( KColumnFlag, "Flag" ); +_LIT( KColumnData, "Data" ); +_LIT( KColumnAction, "Action" ); + +_LIT( KWhere, " WHERE "); + +_LIT8( KList, "List" ); + +#endif //C_CPSSQL_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpublisherregistrymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/inc/cpublisherregistrymap.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/ccontentmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/ccontentmap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,563 @@ +/* +* 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: ?Description + * +*/ + + +#include + +#include "ccontentmap.h" +#include "cpglobals.h" +#include "cpdebug.h" +#include "cpssqlcommands.h" +#include "cpsecuritypolicy.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +CContentMap::CContentMap() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::ConstructL() + { + CCPLiwMap::ConstructL( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CContentMap* CContentMap::NewL( ) + { + CContentMap* self = CContentMap::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CContentMap* CContentMap::NewLC( ) + { + CContentMap* self = new (ELeave) CContentMap(); + self->PushL(); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CContentMap::~CContentMap() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt32 CContentMap::AddL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CContentMap::AddL") ); + TInt32 id( 0); + if ( !GetProperty( KId, id ) ) + { + FetchIdL( aSqlDb, KSQLFetchId, id ); + } + if ( id ) + { + UpdateL( aSqlDb, id, aNotificationList ); + } + else + { + id = AddToDbL( aSqlDb, aNotificationList ); + } + return id; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint CContentMap::GetListL( RSqlDatabase aSqlDb, + CLiwGenericParamList* aList, RArray& aItemsToDelete ) const + { + CP_DEBUG( _L8("CContentMap::GetListL") ); + aItemsToDelete.Reset( ); + return CCPLiwMap::GetListL( aSqlDb, KSQLGetList, aList, aItemsToDelete ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::RemoveL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CContentMap::RemoveL") ); + //get ids of items to be deleted + GetIdsOfRemovedEntriesL( aSqlDb, KSQLGetIds, aNotificationList ); + CCPLiwMap::RemoveL( aSqlDb, KSQLDelete ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::SaveQueryResultsL( RSqlStatement& aStmt, + CLiwGenericParamList& aList, RArray& aItemsToDelete ) const + { + CP_DEBUG( _L8("CContentMap::SaveQueryResultsL") ); + TInt idIndex = ColumnIndexL( aStmt, KColumnId ); + TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher ); + TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type ); + TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id ); + TInt expiration_dateIndex = ColumnIndexL( aStmt, KColumnExpiration_date ); + TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList ); + TInt data_Index = ColumnIndexL( aStmt, KColumnData ); + TInt action_Index = ColumnIndexL( aStmt, KColumnAction ); + + TBool aclCheckFailed( EFalse ); + while ( aStmt.Next( ) == KSqlAtRow ) + { + TBool securityOk( EFalse ); + if( iPolicy ) + { + TPtrC8 acl; + User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) ); + securityOk = iPolicy->CheckSecurityL( acl , + CCPSecurityPolicy::ERead ); + if ( !securityOk ) + { + aclCheckFailed = ETrue; + } + } + if ( !iPolicy || securityOk ) + { + TInt32 id = aStmt.ColumnInt( idIndex ) ; + TPtrC publisher; + User::LeaveIfError( aStmt.ColumnText( publisherIndex, + publisher ) ); + TPtrC content_type; + User::LeaveIfError( aStmt.ColumnText( contentIndex, + content_type ) ); + TPtrC content_id; + User::LeaveIfError( aStmt.ColumnText( content_idIndex, + content_id ) ); + CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( ); + targetMap->InsertL( KId, TLiwVariant( id ) ); + targetMap->InsertL( KPublisherId, TLiwVariant( publisher ) ); + targetMap->InsertL( KContentType, TLiwVariant(content_type ) ); + targetMap->InsertL( KContentId, TLiwVariant( content_id ) ); + + TInt64 expiration_date; + expiration_date = aStmt.ColumnInt64( expiration_dateIndex ); + if ( ( expiration_date ) + &&(IsOutdated( TTime( expiration_date ) )) ) + { + // add id of item to be deleted to aItemsToDelete array + // do not continue getlist operation + aItemsToDelete.AppendL( id ); + }//if + else + { + // continue getlist operation + TPtrC8 data; + User::LeaveIfError( aStmt.ColumnBinary( data_Index, data ) ); + TPtrC8 action; + User::LeaveIfError( aStmt.ColumnBinary( action_Index, action ) ); + if( data.Ptr() ) + { + targetMap->InsertL( KDataMap , TLiwVariant( data ) ); + } + if( action.Ptr() ) + { + targetMap->InsertL( KActionMap , TLiwVariant( action ) ); + } + TLiwGenericParam result( KListMap, TLiwVariant( targetMap )); + aList.AppendL( result ); + }//else + CleanupStack::PopAndDestroy( targetMap ); + }// if + }//while + //leave only if ACL security check for all items failed + if ( aclCheckFailed && !aList.Count()) + { + User::Leave( KErrPermissionDenied ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::PrepareStmtforAddL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, const TDesC& aQuery ) const + { + CP_DEBUG( _L8("CContentMap::PrepareStmtforAddL") ); + CCPLiwMap::PrepareStmtforAddL( aSqlDb, aStmt, aQuery ); + TTime expiration_date( NULL); + GetExpirationDateL( expiration_date ); + TInt expiration_dateIndex = aStmt.ParameterIndex( KSQLExpiration_date ); + if ( expiration_dateIndex != KErrNotFound ) + { + BindInt64L( aStmt, expiration_dateIndex, expiration_date.Int64() ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::PrepareStmtforUpdateL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, TInt32 aId ) const + { + CP_DEBUG( _L8("CContentMap::PrepareStmtforUpdateL") ); + TTime expiration_date; + TBool isExpirationDate = GetExpirationDateL( expiration_date ); + TBool isParameter(EFalse); + RBuf query; + query.CleanupClosePushL(); + query.CreateL( KSQLUpdate().Length( ) ); + query.Append( KSQLUpdate ); + RBuf8 data; + data.CleanupClosePushL(); + RBuf8 action; + action.CleanupClosePushL(); + if ( GetPropertyL( KDataMap, data ) ) + { + query.ReAllocL( query.Length( ) + KSQLUpdateData().Length( ) ); + query.Append( KSQLUpdateData ); + isParameter = ETrue; + } + if ( GetPropertyL( KActionMap, action ) ) + { + if ( isParameter ) + { + query.ReAllocL( query.Length( ) + KComma().Length( ) ); + query.Append( KComma ); + } + query.ReAllocL( query.Length( ) + KSQLUpdateAction().Length( ) ); + query.Append( KSQLUpdateAction ); + isParameter = ETrue; + } + if ( isExpirationDate ) + { + if ( isParameter ) + { + query.ReAllocL( query.Length( ) + KComma().Length( ) ); + query.Append( KComma ); + } + query.ReAllocL( query.Length( ) + KSQLUpdateExpirationDate().Length( ) ); + query.Append( KSQLUpdateExpirationDate ); + isParameter = ETrue; + } + if ( !isParameter ) User::Leave( KErrPathNotFound ); + query.ReAllocL( query.Length( ) + KSQLUpdateWhere().Length( ) ); + query.Append( KSQLUpdateWhere ); + + User::LeaveIfError( aStmt.Prepare( aSqlDb, query ) ); + TInt dataId = aStmt.ParameterIndex( KSQLId ); + BindIntL( aStmt, dataId, aId ); + + if ( data.Length( ) ) + { + TInt dataIndex = aStmt.ParameterIndex( KSQLData ); + BindBinaryL( aStmt, dataIndex, data ); + } + if ( action.Length( ) ) + { + TInt actionIndex = aStmt.ParameterIndex( KSQLAction ); + BindBinaryL( aStmt, actionIndex, action ); + } + if ( isExpirationDate ) + { + TInt expiration_dateIndex = + aStmt.ParameterIndex( KSQLExpiration_date ); + BindInt64L( aStmt, expiration_dateIndex, + expiration_date.Int64( ) ); + + } + CleanupStack::PopAndDestroy( &action ); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( &query ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::UpdateL( RSqlDatabase aSqlDb, TInt32 aId, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CContentMap::UpdateL") ); + RSqlStatement stmt; + CleanupClosePushL( stmt ); + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( ); + FetchIdsL( aId, KSQLFetchIds, changeInfoMap, aSqlDb ); + if ( aNotificationList ) + { + changeInfoMap->InsertL( KType, TLiwVariant( KCpData ) ); + aNotificationList->AppendL( TLiwVariant( changeInfoMap ) ); + } + CleanupStack::PopAndDestroy( changeInfoMap ); + PrepareStmtforUpdateL( aSqlDb, stmt, aId ); + if ( stmt.Exec( ) <= 0 ) + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( &stmt ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt32 CContentMap::AddToDbL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CContentMap::AddToDbL") ); + RSqlStatement stmt; + CleanupClosePushL( stmt ); + PrepareStmtforAddL( aSqlDb, stmt, KSQLInsert ); + + TInt dataIndex = stmt.ParameterIndex( KSQLData ); + TInt actionIndex = stmt.ParameterIndex( KSQLAction ); + TInt aclIndex = stmt.ParameterIndex( KSQLAccessList ); + + RBuf8 data; + data.CleanupClosePushL(); + GetPropertyL( KDataMap, data ) ; + BindBinaryL( stmt, dataIndex, data ); + + RBuf8 action; + action.CleanupClosePushL(); + GetPropertyL( KActionMap, action ) ; + BindBinaryL( stmt, actionIndex, action ); + + RBuf8 acl; + acl.CleanupClosePushL(); + if( !GetPropertyL( KAccessList , acl ) ) + { + iPolicy->GetDefaultSecurityL( acl ); + } + + BindBinaryL( stmt, aclIndex, acl ); + if ( stmt.Exec( ) <= 0 ) + { + User::Leave( KErrGeneral ); + } + + TSqlScalarFullSelectQuery id_query(aSqlDb); + TInt32 ret( 0); + ret = id_query.SelectIntL( KSQLGetLastInsertId ); + + if ( aNotificationList ) + { + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf contentType; + contentType.CleanupClosePushL(); + RBuf contentId; + contentId.CleanupClosePushL(); + GetPropertyL( KPublisherId, publisher ) ; + GetPropertyL( KContentType, contentType ); + GetPropertyL( KContentId, contentId ); + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( ); + changeInfoMap->InsertL( KId, TLiwVariant( ret ) ); + changeInfoMap->InsertL( KType, TLiwVariant( KCpData ) ); + changeInfoMap->InsertL( KPublisherId, TLiwVariant( publisher ) ); + changeInfoMap->InsertL( KContentType, TLiwVariant( contentType ) ); + changeInfoMap->InsertL( KContentId, TLiwVariant( contentId ) ); + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) ); + aNotificationList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ) ; + CleanupStack::PopAndDestroy( &contentId ) ; + CleanupStack::PopAndDestroy( &contentType ) ; + CleanupStack::PopAndDestroy( &publisher ) ; + } + + CleanupStack::PopAndDestroy( &acl ) ; + CleanupStack::PopAndDestroy( &action ) ; + CleanupStack::PopAndDestroy( &data ) ; + CleanupStack::PopAndDestroy( &stmt ) ; + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const + { + CP_DEBUG( _L8("CContentMap::AppendSortL") ); + switch ( aSort ) + { + case ECPPublisher: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderPublisher().Length( ) ); + aQuery.Append( KSQLOrderPublisher ); + break; + case ECPContent: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContent().Length( ) ); + aQuery.Append( KSQLOrderContent ); + break; + default: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderRecent().Length( ) ); + aQuery.Append( KSQLOrderRecent ); + break; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CContentMap::IsOutdated( const TTime aExpirationTime ) const + { + CP_DEBUG( _L8("CContentMap::IsOutdated") ); + TBool result(EFalse); + TTime currentTime(0); + currentTime.HomeTime( ); + if ( currentTime>aExpirationTime ) + { + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::IsDataMapL() const + { + TInt pos( 0 ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, KDataMap ); + if ( pos != KErrNotFound ) + { + if( paramForValue->Value().TypeId() != LIW::EVariantTypeDesC8 ) + { + User::Leave( KErrBadName ); + } + } + else + { + User::Leave( KErrPathNotFound ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CContentMap::GetExpirationDateL( TTime& aResult ) const + { + CP_DEBUG( _L8("CContentMap::GetExpirationDateL") ); + TInt pos( 0); + TBool result(EFalse); + const TLiwGenericParam* param= NULL; + param = iMap->FindFirst( pos, KExpirationDate ); + if ( KErrNotFound != pos ) + { + if ( !param->Value().Get( aResult ) ) + User::Leave( KErrArgument ); + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::IsValidForDeleteL() const + { + CP_DEBUG( _L8("CContentMap::IsValidFilterL") ); + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + if( err == KErrNone && !IsId( ) && !( IsPublisherNameL( ) + || IsContentTypeL( ) || IsContentIdL() ) ) + { + err = KErrPathNotFound; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentMap::IsValidForGetListL() const + { + CP_DEBUG( _L8("CContentMap::IsValidForGetListL") ); + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CContentMap::ActivateActionSupport( ) const + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CContentMap::GetActivateInfo( ) const + { + return EFalse; + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpliwmap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1270 @@ +/* +* 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: ?Description + * +*/ + + +#include +#include +#include +#include + +#include "cpliwmap.h" +#include "cpdebug.h" +#include "cpssqlcommands.h" +#include "ccontentmap.h" +#include "cpublisherregistrymap.h" +#include "cpsecuritypolicy.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCPLiwMap* CCPLiwMap::NewL( RDesReadStream& aStream ) + { + CLiwGenericParamList* list = CLiwGenericParamList::NewLC( aStream ); + CCPLiwMap* map = CCPLiwMap::NewL( *list ); + CleanupStack::PopAndDestroy( list ); + return map; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CCPLiwMap* CCPLiwMap::NewL( const CLiwGenericParamList& aList ) + { + CP_DEBUG( _L8("CCPLiwMap::NewL") ); + const TLiwGenericParam* param = NULL; + TInt pos( 0 ); + param = aList.FindFirst( pos, KType ); + CCPLiwMap* map( NULL ); + if( param && pos !=KErrNotFound ) + { + RBuf typeBuf; + typeBuf.CleanupClosePushL(); + TPtrC type( KNullDesC ); + if( !param->Value().Get( type ) ) + { + TPtrC8 type8( KNullDesC8 ); + if( !param->Value().Get( type8 ) ) + { + User::Leave( KErrBadName ); + } + typeBuf.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( type8 ) ); + } + else + { + typeBuf.CreateL( type ); + } + if( typeBuf.Find( KCpData () ) != KErrNotFound ) + { + map = CContentMap::NewLC(); + } + else if ( typeBuf.Find( KPublisher () ) != KErrNotFound ) + { + map = CPublisherRegistryMap::NewLC(); + } + else User::Leave( KErrArgument ); + map->SetL( aList ); + CleanupStack::Pop( map ); + CleanupStack::PopAndDestroy( &typeBuf ); + } + else + { + User::Leave( KErrPathNotFound ); + } + return map; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CCPLiwMap::PackForServerLC() const + { + CP_DEBUG( _L8("CCPLiwMap::PackForServerLC") ); + HBufC8* datadesc = HBufC8::NewLC( Size() ); + TPtr8 ptr = datadesc->Des(); + RDesWriteStream datastrm( ptr ); + CleanupClosePushL(datastrm); + ExternalizeL(datastrm); + datastrm.CommitL(); + CleanupStack::PopAndDestroy(&datastrm); + return datadesc; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPLiwMap::Reset( ) const + { + iMap->Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::IsValidForAddL( ) const + { + CP_DEBUG( _L8("CCPLiwMap::IsValidForAddL") ); + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + CheckIdentifiersL(); + + if( err == KErrNone && !IsId() && !( IsPublisherNameL() + && IsContentTypeL() && IsContentIdL() ) ) + { + err = KErrPathNotFound; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPLiwMap::IsValidForActionL( )const + { + CP_DEBUG( _L8("CCPLiwMap::IsValidForActionL") ); + CCPLiwMap::IsValidForNotificationL(); + if( !IsTriggerL() ) User::Leave( KErrPathNotFound ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPLiwMap::IsValidForNotificationL( ) const + { + CP_DEBUG( _L8("CCPLiwMap::IsValidForAddL") ); + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + CheckIdentifiersL(); + + if( err == KErrNone && !IsId() && !IsPublisherNameL() + && !IsContentTypeL() && !IsContentIdL() ) + { + err = KErrPathNotFound; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CCPLiwMap::GetPropertyL( const TDesC8& aProperty , + RBuf& aResult ) const + { + //change name + CP_DEBUG( _L8("CCPLiwMap::GetProperty - TPtrC") ); + TBool result( EFalse ); + TInt pos( 0 ); + TPtrC result16( KNullDesC); + TPtrC8 result8( KNullDesC8); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty ); + if ( pos != KErrNotFound ) + { + if( paramForValue->Value().Get( result16 ) ) + { + aResult.CreateL( result16 ); + result = ETrue; + } + else if( paramForValue->Value().Get( result8 ) ) + { + aResult.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( result8 ) ); + result = ETrue; + } + else + { + User::Leave( KErrBadName ); + } + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CCPLiwMap::GetPropertyL( const TDesC8& aProperty , + RBuf8& aResult ) const + { + CP_DEBUG( _L8("CCPLiwMap::GetProperty - TPtrC8") ); + TBool result( EFalse ); + TInt pos( 0 ); + TPtrC8 result8( KNullDesC8 ); + TPtrC result16( KNullDesC ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty ); + if ( pos != KErrNotFound ) + { + if( paramForValue->Value().Get( result8 ) ) + { + aResult.CreateL( result8 ); + result = ETrue; + } + else if( paramForValue->Value().Get( result16 ) ) + { + aResult.Assign( EscapeUtils::ConvertFromUnicodeToUtf8L( result16 ) ); + result = ETrue; + } + else + { + User::Leave( KErrBadName ); + } + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CCPLiwMap::GetProperty( const TDesC8& aProperty , + TInt32& aResult ) const + { + CP_DEBUG( _L8("CCPLiwMap::GetProperty - TInt32") ); + TBool result( EFalse ); + TInt pos( 0 ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty ); + if ( pos != KErrNotFound ) + { + if( paramForValue->Value().Get( aResult ) ) + { + result = ETrue; + } + } + return result; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void CCPLiwMap::SetSecurityL( const RMessage2& aMessage ) + { + delete iPolicy; + iPolicy = NULL; + iPolicy = CCPSecurityPolicy::NewL( aMessage ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPLiwMap::~CCPLiwMap() + { + delete iMap; + delete iPolicy; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPLiwMap::CCPLiwMap() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::InsertL( const TDesC8& aKey, const TLiwVariant& aValue ) + { + CP_DEBUG( _L8("CCPLiwMap::InsertL") ); + Remove( aKey ); + TLiwGenericParam mp; + mp.SetNameAndValueL( aKey, aValue ); + iMap->AppendL( mp ); + mp.Reset( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::FindL( const TDesC8& aKey, TLiwVariant& aValue ) const + { + CP_DEBUG( _L8("CCPLiwMap::FindL") ); + TInt pos = 0; + TBool result(EFalse); + const TLiwGenericParam* tempParam = iMap->FindFirst( pos, aKey ); + if ( tempParam ) + { + aValue.SetL( tempParam->Value( ) ); + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPLiwMap::Count() const + { + return iMap->Count( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::AtL( TInt aIndex, TDes8& aKey ) const + { + CP_DEBUG( _L8("CCPLiwMap::AtL") ); + TBool result(EFalse); + if ( 0 <= aIndex && aIndex < iMap->Count( ) ) + { + aKey = ((*iMap)[aIndex]).Name( ); + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::Remove( const TDesC8& aKey ) + { + CP_DEBUG( _L8("CCPLiwMap::Remove") ); + TInt pos = 0; + iMap->FindFirst( pos, aKey ); + if ( pos != KErrNotFound ) + { + iMap->Remove( aKey ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPLiwMap::Size() const + { + return iMap->Size( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ExternalizeL( RWriteStream& aStream ) const + { + CP_DEBUG( _L8("CCPLiwMap::ExternalizeL") ); + iMap->ExternalizeL( aStream ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::FillChangeInfoMapL( RSqlStatement& aStmt, + CLiwDefaultMap* aMap )const + { + TInt idIndex = ColumnIndexL( aStmt, KColumnId ); + TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher ); + TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type ); + TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id ); + TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList ); + + TInt32 id = aStmt.ColumnInt( idIndex ) ; + TPtrC publisher; + User::LeaveIfError(aStmt.ColumnText( publisherIndex,publisher) ); + TPtrC content_type; + User::LeaveIfError(aStmt.ColumnText( contentIndex,content_type ) ); + TPtrC content_id; + User::LeaveIfError(aStmt.ColumnText( content_idIndex,content_id) ); + aMap->InsertL( KId, TLiwVariant( id ) ); + aMap->InsertL( KPublisherId, TLiwVariant( publisher ) ); + aMap->InsertL( KContentType, TLiwVariant( content_type ) ); + aMap->InsertL( KContentId, TLiwVariant( content_id ) ); + aMap->InsertL( KOperation, TLiwVariant( KOperationDelete ) ); + RBuf type; + type.CleanupClosePushL(); + if( GetPropertyL( KType, type ) ) + { + aMap->InsertL( KType , TLiwVariant( type ) ); + } + CleanupStack::PopAndDestroy( &type ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::SetL( const CLiwGenericParamList& aInParamList ) + { + + CP_DEBUG( _L8("CCPLiwMap::SetL") ); + for ( TInt i = 0; i < aInParamList.Count( ); i++ ) + { + const TLiwGenericParam& param = aInParamList[i]; + if ( param.Value().TypeId( ) == LIW::EVariantTypeMap ) + { + const CLiwMap* map = param.Value().AsMap( ); + for ( TInt i = 0; i Count( ); i++ ) + { + TBuf8<128> key; + map->AtL( i, key ); + TLiwVariant value; + value.PushL( ); + map->FindL( key, value ); + if ( key == KOperation ) + { + IsProperOperationL( value ); + } + RBuf8 datadesc; + datadesc.CleanupClosePushL(); + if ( value.TypeId( ) == LIW::EVariantTypeMap ) + { + const CLiwMap* internalMap = value.AsMap( ); + datadesc.CreateL( internalMap->Size( ) ); + RDesWriteStream datastrm(datadesc); + CleanupClosePushL( datastrm ); + internalMap->ExternalizeL( datastrm ); + datastrm.CommitL( ); + CleanupStack::PopAndDestroy( &datastrm ); + value.Reset( ); + value.Set( datadesc ); + } + TLiwGenericParam data( key, value); + iMap->AppendL( data ); + CleanupStack::PopAndDestroy( &datadesc ); + CleanupStack::PopAndDestroy( &value ); + } + } + else + { + iMap->AppendL( param ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::IsProperOperationL( const TLiwVariant& aValue ) const + { + CP_DEBUG( _L8("CContentMap::IsProperOperationL") ); + TPtrC valDesc( KNullDesC ); + TPtrC8 valDesc8( KNullDesC8 ); + RBuf desc; + desc.CleanupClosePushL(); + + if( aValue.Get( valDesc ) == EFalse ) + { + if( aValue.Get( valDesc8 ) != EFalse ) + { + desc.Assign( EscapeUtils::ConvertToUnicodeFromUtf8L( valDesc8 ) ); + valDesc.Set( desc ); + } + else + { + User::Leave( KErrBadName ); + } + } + + TLex input( valDesc ); + + CDesC16Array* array = new (ELeave) CDesC16ArrayFlat(4); + CleanupStack::PushL( array ); + + TLexMark startMark; + input.Mark( startMark ); + TBool notEmpty = EFalse; + while ( !input.Eos() ) + { + if( input.Peek() == ':') + { + array->AppendL( input.MarkedToken( startMark ) ); + input.Inc(); + input.Mark( startMark ); + } + input.Inc(); + notEmpty = ETrue; + } + if ( notEmpty ) + { + array->AppendL( input.MarkedToken( startMark ) ); + } + + for( TInt i= 0; i < array->MdcaCount(); i++ ) + { + TPtrC operValue( array->MdcaPoint(i) ); + + if( operValue.Compare( KOperationAdd ) && + operValue.Compare( KOperationUpdate ) && + operValue.Compare( KOperationDelete ) && + operValue.Compare( KOperationExecute ) ) + { + User::Leave( KErrArgument ); + } + } + CleanupStack::PopAndDestroy( array ); + CleanupStack::PopAndDestroy( &desc ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::AppendGetListFilterL( RBuf& aQuery, TUint& aFilter ) const + { + CP_DEBUG( _L8("CContentMap::AppendGetListFilterL") ); + if( !IsGetListAllL( aFilter ) ) + { + AppendFilterL( aQuery, aFilter ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::AppendRemoveFilterL( RBuf& aQuery, TUint& aFilter ) const + { + CP_DEBUG( _L8("CContentMap::AppendRemoveFilterL") ); + AppendFilterL( aQuery, aFilter ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::AppendFilterL( RBuf& aQuery, TUint& aFilter ) const + { + CP_DEBUG( _L8("CContentMap::AppendFilterL") ); + + TBool nextFilter( EFalse ); + + RemoveAllAttributeL( aFilter ); //remove "all" attribute from publisher, + //cont_type or cont_id + + aQuery.ReAllocL( aQuery.Length( ) + KWhere().Length( ) ); + aQuery.Append( KWhere ); + + if( aFilter & EContentType ) + { + aQuery.ReAllocL( aQuery.Length( ) + KSQLGetContentType().Length( ) ); + aQuery.Append( KSQLGetContentType ); + nextFilter = ETrue; + } + if( aFilter & EPublisher ) + { + if( nextFilter ) + { + aQuery.ReAllocL( aQuery.Length( ) + KAnd().Length( ) + + KSQLGetPublisher().Length( ) ); + aQuery.Append( KAnd ); + aQuery.Append( KSQLGetPublisher ); + } + else + { + aQuery.ReAllocL( aQuery.Length( ) + + KSQLGetPublisher().Length( ) ); + aQuery.Append( KSQLGetPublisher ); + } + nextFilter = ETrue; + } + if( aFilter & EContentId ) + { + if( nextFilter ) + { + aQuery.ReAllocL( aQuery.Length( ) + + KAnd().Length( ) + KSQLGetContentId().Length( ) ); + aQuery.Append( KAnd ); + aQuery.Append( KSQLGetContentId ); + } + else + { + aQuery.ReAllocL( aQuery.Length( ) + KSQLGetContentId().Length( ) ); + aQuery.Append( KSQLGetContentId ); + } + nextFilter = ETrue; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::PrepareStmtforAddL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, const TDesC& aQuery ) const + { + CP_DEBUG( _L8("CCPLiwMap::PrepareStmtforAddL") ); + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf content_type; + content_type.CleanupClosePushL(); + RBuf content_id; + content_id.CleanupClosePushL(); + if ( GetPropertyL( KPublisherId, publisher ) + && GetPropertyL( KContentType, content_type ) + && GetPropertyL( KContentId, content_id ) ) + { + User::LeaveIfError( aStmt.Prepare( aSqlDb, aQuery ) ); + TInt publisherIndex = aStmt.ParameterIndex( KSQLPublisher ); + TInt content_typeIndex = aStmt.ParameterIndex( KSQLContent_type ); + TInt content_idIndex = aStmt.ParameterIndex( KSQLContent_id ); + + BindTextL( aStmt, publisherIndex, publisher ); + BindTextL( aStmt, content_typeIndex, content_type ); + BindTextL( aStmt, content_idIndex, content_id ); + } + else + { + User::Leave( KErrArgument ); + } + CleanupStack::PopAndDestroy( &content_id ); + CleanupStack::PopAndDestroy( &content_type ); + CleanupStack::PopAndDestroy( &publisher ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint CCPLiwMap::GetFilterL( )const + { + CP_DEBUG( _L8("CCPLiwMap::GetFilterL") ); + TUint result (0); + if(IsPublisherNameL()) + { + result |= EPublisher; + } + if(IsContentTypeL()) + { + result |= EContentType; + } + if(IsContentIdL()) + { + result |= EContentId; + } + if(IsFlag()) + { + result |= EFlag; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPLiwMap::TCPSortOrder CCPLiwMap::GetSortL() const + { + CP_DEBUG( _L8("CCPLiwMap::GetSortL") ); + TCPSortOrder result(ECPRecent); + RBuf sort; + sort.CleanupClosePushL(); + if ( GetPropertyL( KSortOrder, sort ) ) + { + if ( !sort.Compare( KSortRecent ) ) + { + result = ECPRecent; + } + else if ( !sort.Compare( KSortPublisher ) ) + { + result = ECPPublisher; + } + else if ( !sort.Compare( KSortContentType ) ) + { + result = ECPContent; + } + else if ( !sort.Compare( KSortContentId ) ) + { + result = ECPContentId; + } + } + CleanupStack::PopAndDestroy( &sort ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsPublisherNameL() const + { + TBool result( EFalse ); + RBuf buffer; + buffer.CleanupClosePushL(); + result = GetPropertyL( KPublisherId, buffer ); + if( result && buffer.Length() == KErrNone ) + { + User::Leave( KErrArgument ); + } + CleanupStack::PopAndDestroy( &buffer ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsContentTypeL() const + { + TBool result( EFalse ); + RBuf buffer; + buffer.CleanupClosePushL(); + result = GetPropertyL( KContentType, buffer ); + if( result && buffer.Length() == KErrNone ) + { + User::Leave( KErrArgument ); + } + CleanupStack::PopAndDestroy( &buffer ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsContentIdL() const + { + TBool result( EFalse ); + RBuf buffer; + buffer.CleanupClosePushL(); + result = GetPropertyL( KContentId, buffer ); + if( result && buffer.Length() == KErrNone ) + { + User::Leave( KErrArgument ); + } + CleanupStack::PopAndDestroy( &buffer ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsTriggerL( ) const + { + TBool result( EFalse ); + RBuf8 buffer; + buffer.CleanupClosePushL(); + result = GetPropertyL( KActionTrigger, buffer ); + CleanupStack::PopAndDestroy( &buffer ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsFlag( ) const + { + TInt32 buffer( 0 ); + return GetProperty( KFlag, buffer ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsId() const + { + TInt32 id( 0); + return GetProperty( KId, id ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::PropertyExists( const TDesC8& aProperty ) const + { + TBool result( EFalse ); + TInt pos( 0 ); + const TLiwGenericParam* paramForValue = iMap->FindFirst( pos, aProperty ); + if ( pos != KErrNotFound ) + { + result = ETrue; + } + return result; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint CCPLiwMap::GetListL( RSqlDatabase aSqlDb, const TDesC& aQuery, + CLiwGenericParamList* aList, RArray& aItemsToDelete ) const + { + CP_DEBUG( _L8("CCPLiwMap::GetListL") ); + RBuf sqlquery; + sqlquery.CleanupClosePushL(); + sqlquery.CreateL( aQuery ); + TInt32 id( 0); + if ( GetProperty( KId, id ) ) + { + ConstructSelectIdL( sqlquery ); + } + else + { + ConstructGetListSelectL( sqlquery ); + } + RSqlStatement stmt; + CleanupClosePushL( stmt ); + User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) ); + BindValueL( sqlquery, stmt ); + SaveQueryResultsL( stmt, *aList, aItemsToDelete ); + CleanupStack::PopAndDestroy( &stmt ) ; + CleanupStack::PopAndDestroy( &sqlquery ); + return aList->Count( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::RemoveL( RSqlDatabase aSqlDb, const TDesC& aQuery ) const + { + CP_DEBUG( _L8("CCPLiwMap::RemoveL") ); + RBuf sqlquery; + sqlquery.CleanupClosePushL(); + sqlquery.CreateL( aQuery ); + TInt32 id( 0); + if ( GetProperty( KId, id ) ) + { + ConstructSelectIdL( sqlquery ); + } + else + { + ConstructRemoveSelectL( sqlquery, EFalse ); + } + + RSqlStatement stmt; + CleanupClosePushL( stmt ); + User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) ); + + BindValueL( sqlquery, stmt ); + if ( stmt.Exec( ) <= 0 ) + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( &stmt ) ; + CleanupStack::PopAndDestroy( &sqlquery ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::FetchIdsL( TInt32 aId, const TDesC& aQuery, + CLiwDefaultMap* aMap, RSqlDatabase aSqlDb ) const + { + CP_DEBUG( _L8("CCPLiwMap::FetchIdsL") ); + RSqlStatement stmt; + CleanupClosePushL( stmt ); + //prepare statment for "Get Ids" (Publisher, ContentType,ContentId) + User::LeaveIfError( stmt.Prepare( aSqlDb, aQuery ) ); + TInt idIndex = stmt.ParameterIndex( KSQLId ); + User::LeaveIfError( stmt.BindInt( idIndex, aId ) ); + + TInt publisherIndex = ColumnIndexL( stmt, KColumnPublisher ); + TInt contentTypeIndex = ColumnIndexL( stmt, KColumnContent_type ); + TInt contentIdIndex = ColumnIndexL( stmt, KColumnContent_id ); + TInt acl_Index = ColumnIndexL( stmt, KColumnAccessList ); + + if ( stmt.Next( ) == KSqlAtRow ) + { + if( iPolicy ) + { + TPtrC8 acl; + User::LeaveIfError( stmt.ColumnBinary( acl_Index, acl ) ); + if( !iPolicy->CheckSecurityL( acl , CCPSecurityPolicy::EWrite ) ) + { + User::Leave( KErrPermissionDenied ); + } + } + TPtrC publisher; + User::LeaveIfError( stmt.ColumnText( publisherIndex, publisher ) ); + TPtrC content_type; + User::LeaveIfError( stmt.ColumnText( contentTypeIndex, content_type ) ); + TPtrC content_id; + User::LeaveIfError( stmt.ColumnText( contentIdIndex, content_id ) ); + aMap->InsertL( KId, TLiwVariant( aId ) ); + aMap->InsertL( KPublisherId, TLiwVariant( publisher ) ); + aMap->InsertL( KContentType, TLiwVariant( content_type ) ); + aMap->InsertL( KContentId, TLiwVariant( content_id ) ); + aMap->InsertL( KOperation, TLiwVariant( KOperationUpdate ) ); + } + CleanupStack::PopAndDestroy( &stmt ) ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::FetchIdL( RSqlDatabase aSqlDb, const TDesC& aQuery, + TInt32& aId ) const + { + CP_DEBUG( _L8("CCPLiwMap::FetchIdL") ); + aId = 0; + RSqlStatement stmt; + CleanupClosePushL( stmt ); + PrepareStmtforAddL( aSqlDb, stmt, aQuery ); + TInt idIndex = ColumnIndexL( stmt, KColumnId ); + if ( stmt.Next( ) == KSqlAtRow ) + { + aId = stmt.ColumnInt( idIndex ); + } + CleanupStack::PopAndDestroy( &stmt ) ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::GetIdsOfRemovedEntriesL( RSqlDatabase aSqlDb, + const TDesC& aQuery, CLiwDefaultList* aList ) const + { + CP_DEBUG( _L8("CCPLiwMap::GetIdsOfRemovedEntriesL") ); + RBuf sqlquery; + sqlquery.CleanupClosePushL(); + sqlquery.CreateL( aQuery ); + TInt32 id( 0); + if ( GetProperty( KId, id ) ) + { + ConstructSelectIdL( sqlquery ); + } + else + { + ConstructRemoveSelectL( sqlquery ); + } + RSqlStatement stmt; + CleanupClosePushL( stmt ); + User::LeaveIfError( stmt.Prepare( aSqlDb, sqlquery ) ); + BindValueL( sqlquery, stmt ); + SaveQueryResultsIdsL( stmt, aList ); + if( aList && aList->Count()==0 ) + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( &stmt ) ; + CleanupStack::PopAndDestroy( &sqlquery ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::SaveQueryResultsIdsL( RSqlStatement& aStmt, + CLiwDefaultList* aList ) const + { + CP_DEBUG( _L8("CCPLiwMap::SaveQueryResultsIdsL") ); + TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList ); + + while ( aStmt.Next( ) == KSqlAtRow ) + { + if( iPolicy ) + { + TPtrC8 acl; + User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) ); + if ( !iPolicy->CheckSecurityL( acl , + CCPSecurityPolicy::EDelete ) ) + { + User::Leave( KErrPermissionDenied ); + } + } + if ( aList ) + { + CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC( ); + FillChangeInfoMapL( aStmt, targetMap ); + aList->AppendL( TLiwVariant( targetMap ) ); + CleanupStack::PopAndDestroy( targetMap ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ConstructSelectIdL( RBuf& aQuery ) const + { + aQuery.ReAllocL( aQuery.Length( ) + KSQLGetId().Length( ) + + KWhere().Length() ); + aQuery.Append( KWhere ); + aQuery.Append( KSQLGetId ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ConstructGetListSelectL( RBuf& aQuery, TBool aGet ) const + { + TUint filter = GetFilterL( ); + AppendGetListFilterL( aQuery, filter ); + if ( aGet ) + { + AppendSortL( aQuery, GetSortL( ) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ConstructRemoveSelectL( RBuf& aQuery, TBool aGet ) const + { + TUint filter = GetFilterL( ); + AppendRemoveFilterL( aQuery, filter ); + if ( aGet ) + { + AppendSortL( aQuery, GetSortL( ) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::BindValueL( const RBuf& aQuery, RSqlStatement& aStmt ) const + { + CP_DEBUG( _L8("CCPLiwMap::BindValueL") ); + if ( aQuery.Find( KSQLGetPublisher ) != KErrNotFound ) + { + TInt param = aStmt.ParameterIndex( KSQLPublisher ); + RBuf publisher; + publisher.CleanupClosePushL(); + User::LeaveIfError( GetPropertyL( KPublisherId, publisher )); + BindTextL( aStmt, param, publisher ); + CleanupStack::PopAndDestroy( &publisher ); + } + if ( aQuery.Find( KSQLGetContentType ) != KErrNotFound ) + { + TInt param = aStmt.ParameterIndex( KSQLContent_type ); + RBuf content_type; + content_type.CleanupClosePushL(); + User::LeaveIfError( GetPropertyL( KContentType, content_type )); + BindTextL( aStmt, param, content_type ); + CleanupStack::PopAndDestroy( &content_type ); + } + if ( aQuery.Find( KSQLGetContentId ) != KErrNotFound ) + { + TInt param = aStmt.ParameterIndex( KSQLContent_id ); + RBuf content_id; + content_id.CleanupClosePushL(); + User::LeaveIfError( GetPropertyL( KContentId, content_id )); + BindTextL( aStmt, param, content_id ); + CleanupStack::PopAndDestroy( &content_id ); + } + if ( aQuery.Find( KSQLGetId ) != KErrNotFound ) + { + TInt param = aStmt.ParameterIndex( KSQLId ); + TInt32 id( 0); + User::LeaveIfError( GetProperty( KId, id )); + BindIntL( aStmt, param, id ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPLiwMap::IsGetListAllL( TUint aFilter ) const + { + TBool result( EFalse ); + if ( !( aFilter & EContentType ) && + !( aFilter & EContentId ) && + !( aFilter & EPublisher ) ) + { + result = ETrue; + } + else if ( ( aFilter & EContentType ) && + ( aFilter & EContentId ) && + ( aFilter & EPublisher ) ) + { + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf content_type; + content_type.CleanupClosePushL(); + RBuf content_id; + content_id.CleanupClosePushL(); + GetPropertyL( KPublisherId, publisher ); + GetPropertyL( KContentType, content_type ); + GetPropertyL( KContentId, content_id ); + + if( ( publisher == KAll ) && + ( content_type == KAll ) && + ( content_id == KAll) ) + { + result = ETrue; + } + CleanupStack::PopAndDestroy( &content_id ); + CleanupStack::PopAndDestroy( &content_type ); + CleanupStack::PopAndDestroy( &publisher ); + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::RemoveAllAttributeL( TUint& aFilter ) const + { + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf content_type; + content_type.CleanupClosePushL(); + RBuf content_id; + content_id.CleanupClosePushL(); + GetPropertyL( KPublisherId, publisher ); + GetPropertyL( KContentType, content_type ); + GetPropertyL( KContentId, content_id ); + + if( publisher == KAll ) + { + iMap->Remove( KPublisherId ); + aFilter = aFilter & ~EPublisher; + } + if( content_type == KAll ) + { + iMap->Remove( KContentType ); + aFilter = aFilter & ~EContentType; + } + if( content_id == KAll ) + { + iMap->Remove( KContentId ); + aFilter = aFilter & ~EContentId; + } + + CleanupStack::PopAndDestroy( &content_id ); + CleanupStack::PopAndDestroy( &content_type ); + CleanupStack::PopAndDestroy( &publisher ); + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::ConstructL() + { + iMap = CLiwGenericParamList::NewL( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::CheckIdentifiersL() const + { + IsPublisherNameL(); + IsContentTypeL(); + IsContentIdL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::BindTextL(RSqlStatement& aStmt, TInt aParameterIndex, + const TDesC& aParameterText) const + { + User::LeaveIfError( aParameterIndex ); + User::LeaveIfError( aStmt.BindText( aParameterIndex, aParameterText ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex, + const TDesC8& aParameterData) const + { + User::LeaveIfError(aParameterIndex); + User::LeaveIfError(aStmt.BindBinary(aParameterIndex, aParameterData)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::BindInt64L(RSqlStatement& aStmt, TInt aParameterIndex, + TInt64 aParameterValue) const + { + User::LeaveIfError(aParameterIndex); + User::LeaveIfError(aStmt.BindInt64(aParameterIndex, aParameterValue)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPLiwMap::BindIntL(RSqlStatement& aStmt, TInt aParameterIndex, + TInt aParameterValue) const + { + User::LeaveIfError(aParameterIndex); + User::LeaveIfError(aStmt.BindInt(aParameterIndex, aParameterValue)); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CCPLiwMap::ColumnIndexL(RSqlStatement& aStmt, const TDesC& aColumnName ) + const + { + TInt ret( aStmt.ColumnIndex( aColumnName ) ); + User::LeaveIfError( ret ); + return ret; + } + + + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpsecuritypolicy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpsecuritypolicy.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,372 @@ +/* +* 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: ?Description + * Version : %version: 7 % << Don't touch! Updated by Synergy at check-out. + * +*/ + + +#include +#include +#include + +#include "cpsecuritypolicy.h" +#include "cpdebug.h" +#include "cpglobals.h" + +_LIT( KHex, "0x" ); +_LIT( KTCB, "TCB" ); +_LIT( KLocalServices, "LocalServices" ); +_LIT( KLocation, "Location" ); +_LIT( KNetworkServices, "NetworkServices" ); +_LIT( KReadUserData, "ReadUserData" ); +_LIT( KUserEnvironment, "UserEnvironment" ); +_LIT( KWriteUserData, "WriteUserData" ); +_LIT( KAllFiles, "AllFiles" ); +_LIT( KCommDD, "CommDD" ); +_LIT( KDiskAdmin, "DiskAdmin" ); +_LIT( KDrm, "Drm" ); +_LIT( KMultimediaDD, "MultimediaDD" ); +_LIT( KNetworkControl, "NetworkControl" ); +_LIT( KPowerMgmt, "PowerMgmt" ); +_LIT( KProtServ, "ProtServ" ); +_LIT( KReadDeviceData, "ReadDeviceData" ); +_LIT( KSurroundingsDD, "SurroundingsDD" ); +_LIT( KSwEvent, "SwEvent" ); +_LIT( KTrustedUI, "TrustedUI" ); +_LIT( KWriteDeviceData, "WriteDeviceData" ); + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPSecurityPolicy::CCPSecurityPolicy( const RMessage2& aMessage ): + iMessage( aMessage ) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPSecurityPolicy::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPSecurityPolicy* CCPSecurityPolicy::NewL( const RMessage2& aMessage ) + { + CCPSecurityPolicy* self = CCPSecurityPolicy::NewLC( aMessage ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPSecurityPolicy* CCPSecurityPolicy::NewLC( const RMessage2& aMessage ) + { + CCPSecurityPolicy* self = new( ELeave ) CCPSecurityPolicy( aMessage ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPSecurityPolicy::~CCPSecurityPolicy() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPSecurityPolicy::GetDefaultSecurityL( RBuf8& aResult ) const + { + CLiwDefaultMap* aclMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* writeMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* deleteMap = CLiwDefaultMap::NewLC(); + + TUint32 publisherUid = iMessage.SecureId(); + + TBuf<10> uidString; + uidString.Append( KHex ); + uidString.AppendNumFixedWidth(publisherUid,EHex,8); + + writeMap->InsertL( KUIDs, TLiwVariant( uidString ) ); + deleteMap->InsertL( KUIDs, TLiwVariant( uidString ) ); + + aclMap->InsertL( KACLWrite, TLiwVariant( writeMap ) ); + aclMap->InsertL( KACLDelete, TLiwVariant( deleteMap ) ); + + //externalize + aResult.CreateL( aclMap->Size() ); + RDesWriteStream strm( aResult ); + CleanupClosePushL( strm ); + aclMap->ExternalizeL( strm ); + strm.CommitL( ); + + CleanupStack::PopAndDestroy( &strm ); + CleanupStack::PopAndDestroy( deleteMap ); + CleanupStack::PopAndDestroy( writeMap ); + CleanupStack::PopAndDestroy( aclMap ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPSecurityPolicy::CheckSecurityL( TPtrC8& aBinary, + TACLPolicy aPolicy ) const + { + TBool error( ETrue ); + RDesReadStream datastrm( aBinary ); + CleanupClosePushL( datastrm ); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( datastrm ); + TLiwVariant variant; + variant.PushL(); + switch( aPolicy ) + { + case ERead: + if( map->FindL( KACLRead, variant ) ) + { + error = DoCheckSecurityL( variant.AsMap() ); + } + break; + case EWrite: + if( map->FindL( KACLWrite, variant ) ) + { + error = DoCheckSecurityL( variant.AsMap() ); + } + break; + case EDelete: + if( map->FindL( KACLDelete, variant ) ) + { + error = DoCheckSecurityL( variant.AsMap() ); + } + break; + default: + User::Leave( KErrNotSupported ); + } + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( &datastrm ); + return error; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPSecurityPolicy::DoCheckSecurityL( const CLiwMap* aMap ) const + { + TLiwVariant variant; + variant.PushL(); + TBool denyAccess( ETrue ); + if( aMap->FindL( KUIDs, variant ) ) + { + TPtrC uidList( KNullDesC ); + if( variant.Get( uidList) ) + { + denyAccess = CheckUids( uidList ); + } + } + if( denyAccess && aMap->FindL( KCapability, variant ) ) + { + TPtrC capList( KNullDesC ); + if( variant.Get( capList ) ) + { + denyAccess = CheckCapabilities( capList ); + } + } + CleanupStack::PopAndDestroy( &variant ); + return !denyAccess; + } + + // --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPSecurityPolicy::CheckUids( const TDesC& aList ) const + { + TInt i( 1 ); + TBool denyAccess( ETrue ); + TPtrC singleUid( KNullDesC ); + while( i ) + { + ExctractNextToken( aList , singleUid, i ); + TLex converter( singleUid ); + converter.Inc( KHex().Length() ); + TUint32 aclUid( 0 ); + converter.Val( aclUid , EHex ); + if( iMessage.SecureId().iId == aclUid ) + { + denyAccess = EFalse; + break; + } + ++i; + } + return denyAccess; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CCPSecurityPolicy::CheckCapabilities( const TDesC& aList ) const + { + TInt i( 1 ); + TBool denyAccess( EFalse ); + TPtrC singleCap( KNullDesC ); + while( i ) + { + ExctractNextToken( aList , singleCap, i ); + if( !iMessage.HasCapability( GetCapability( singleCap ) ) ) + { + denyAccess = ETrue; + break; + } + ++i; + } + return denyAccess; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPSecurityPolicy::ExctractNextToken( const TDesC& aList, + TPtrC& aResult , TInt& aPos ) const + { + TPtrC buf( aList ); + for( TInt x(0); x < aPos; x++ ) + { + TInt pos = buf.Locate(':'); + if( pos!= KErrNotFound ) + { + aResult.Set( buf.Left( pos ) ); + buf.Set( buf.Right( buf.Length() - pos - 1 ) ); + } + else + { + aResult.Set( buf ); + aPos = -1; + break; + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCapability CCPSecurityPolicy::GetCapability( const TDesC& aCapability ) const + { + TCapability ret( ECapability_None ); + if( aCapability == KTCB ) + { + ret = ECapabilityTCB; + } + else if( aCapability == KLocalServices ) + { + ret = ECapabilityLocalServices; + } + else if( aCapability == KLocation ) + { + ret = ECapabilityLocation; + } + else if( aCapability == KNetworkServices ) + { + ret = ECapabilityNetworkServices; + } + else if( aCapability == KReadUserData ) + { + ret = ECapabilityReadUserData; + } + else if( aCapability == KUserEnvironment ) + { + ret = ECapabilityUserEnvironment; + } + else if( aCapability == KWriteUserData ) + { + ret = ECapabilityWriteUserData; + } + else if( aCapability == KAllFiles ) + { + ret = ECapabilityAllFiles; + } + else if( aCapability == KDiskAdmin ) + { + ret = ECapabilityDiskAdmin; + } + else if( aCapability == KCommDD ) + { + ret = ECapabilityCommDD; + } + else if( aCapability == KDrm ) + { + ret = ECapabilityDRM; + } + else if( aCapability == KMultimediaDD ) + { + ret = ECapabilityMultimediaDD; + } + else if( aCapability == KNetworkControl ) + { + ret = ECapabilityNetworkControl; + } + else if( aCapability == KPowerMgmt ) + { + ret = ECapabilityPowerMgmt; + } + else if( aCapability == KProtServ ) + { + ret = ECapabilityProtServ; + } + else if( aCapability == KReadDeviceData ) + { + ret = ECapabilityReadDeviceData; + } + else if( aCapability == KSurroundingsDD ) + { + ret = ECapabilitySurroundingsDD; + } + else if( aCapability == KSwEvent ) + { + ret = ECapabilitySwEvent; + } + else if( aCapability == KTrustedUI ) + { + ret = ECapabilityTrustedUI; + } + else if( aCapability == KWriteDeviceData ) + { + ret = ECapabilityWriteDeviceData; + } + else ret = ECapability_None; + return ret; + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpublisherregistrymap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/contentpublishingmap/src/cpublisherregistrymap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,550 @@ +/* +* 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: ?Description + * +*/ + + +#include + +#include "cpserverdef.h" +#include "cpublisherregistrymap.h" +#include "cpglobals.h" +#include "cpdebug.h" +#include "cpssqlcommands.h" +#include "cpsecuritypolicy.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +CPublisherRegistryMap::CPublisherRegistryMap() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::ConstructL() + { + CCPLiwMap::ConstructL( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CPublisherRegistryMap* CPublisherRegistryMap::NewL( ) + { + CPublisherRegistryMap* self = CPublisherRegistryMap::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C CPublisherRegistryMap* CPublisherRegistryMap::NewLC( ) + { + CPublisherRegistryMap* self = new (ELeave) CPublisherRegistryMap(); + self->PushL(); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CPublisherRegistryMap::~CPublisherRegistryMap() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt32 CPublisherRegistryMap::AddL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::AddL") ); + TInt32 id( 0); + if ( !GetProperty( KId, id ) ) + { + FetchIdL( aSqlDb, KSQLFetchIdFromRegistry, id ); + } + if ( id ) + { + UpdateL( aSqlDb, id , aNotificationList ); + } + else + { + id = AddToDbL( aSqlDb , aNotificationList ); + } + return id; + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint CPublisherRegistryMap::GetListL( RSqlDatabase aSqlDb, + CLiwGenericParamList* aList, RArray& aItemsToDelete ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::GetListL") ); + aItemsToDelete.Reset( ); //no items to delete + return CCPLiwMap::GetListL( aSqlDb, KSQLGetListFromRegistry, aList, + aItemsToDelete ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::RemoveL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CContentMap::RemoveL") ); + //get ids of items to be deleted + GetIdsOfRemovedEntriesL( aSqlDb, KSQLGetIdsRegistry, aNotificationList ); + CCPLiwMap::RemoveL( aSqlDb, KSQLDeleteFromRegistry ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::SaveQueryResultsL( RSqlStatement& aStmt, + CLiwGenericParamList& aList, RArray& /*aItemsToDelete*/) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::SaveQueryResultsL") ); + TInt idIndex = ColumnIndexL( aStmt, KColumnId ); + TInt publisherIndex = ColumnIndexL( aStmt, KColumnPublisher ); + TInt contentIndex = ColumnIndexL( aStmt, KColumnContent_type ); + TInt content_idIndex = ColumnIndexL( aStmt, KColumnContent_id ); + TInt flagIndex = ColumnIndexL( aStmt, KColumnFlag ); + TInt acl_Index = ColumnIndexL( aStmt, KColumnAccessList ); + TInt data_Index = ColumnIndexL( aStmt, KColumnData ); + TInt action_Index = ColumnIndexL( aStmt, KColumnAction ); + + TBool aclCheckFailed( EFalse ); + while ( aStmt.Next( ) == KSqlAtRow ) + { + TBool securityOk(EFalse); + if( iPolicy ) + { + TPtrC8 acl; + User::LeaveIfError( aStmt.ColumnBinary( acl_Index, acl ) ); + securityOk = iPolicy->CheckSecurityL( acl , + CCPSecurityPolicy::ERead ); + if ( !securityOk ) + { + aclCheckFailed = ETrue; + } + } + + if( !iPolicy || securityOk ) + { + TInt32 id = aStmt.ColumnInt( idIndex ) ; + TPtrC publisher; + User::LeaveIfError( aStmt.ColumnText( publisherIndex, + publisher ) ); + TPtrC content_type; + User::LeaveIfError( aStmt.ColumnText( contentIndex, + content_type ) ); + TPtrC content_id; + User::LeaveIfError( aStmt.ColumnText( content_idIndex, + content_id )); + TInt32 flag_db = aStmt.ColumnInt( flagIndex ); + TInt32 flag_map(0); + + TUint filter = GetFilterL(); + GetProperty( KFlag, flag_map ); + + if (!(filter & EFlag) || ( (flag_db & flag_map)==flag_map)) + { + CLiwDefaultMap* targetMap = CLiwDefaultMap::NewLC(); + targetMap->InsertL( KId , TLiwVariant( id ) ); + targetMap->InsertL( KPublisherId , TLiwVariant( publisher ) ); + targetMap->InsertL( KContentType , TLiwVariant( content_type ) ); + targetMap->InsertL( KContentId , TLiwVariant( content_id ) ); + targetMap->InsertL( KFlag , TLiwVariant( flag_db ) ); + TPtrC8 data; + User::LeaveIfError( aStmt.ColumnBinary( data_Index, data ) ); + TPtrC8 action; + User::LeaveIfError( aStmt.ColumnBinary( action_Index, action ) ); + if( data.Ptr() ) + { + targetMap->InsertL( KDataMap , TLiwVariant( data ) ); + } + if( action.Ptr() ) + { + targetMap->InsertL( KActionMap , TLiwVariant( action ) ); + } + TLiwGenericParam result( KListMap, TLiwVariant( targetMap )); + aList.AppendL( result ); + CleanupStack::PopAndDestroy( targetMap ); + } + }//if + }//while + //leave only if ACL security check for all items failed + if ( aclCheckFailed && !aList.Count()) + { + User::Leave( KErrPermissionDenied ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt32 CPublisherRegistryMap::AddToDbL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::AddToDbL") ); + RSqlStatement stmt; + CleanupClosePushL( stmt ); + PrepareStmtforAddL( aSqlDb, stmt, KSQLInsertToRegistry ); + + TInt dataIndex = stmt.ParameterIndex( KSQLData ); + TInt actionIndex = stmt.ParameterIndex( KSQLAction ); + TInt aclIndex = stmt.ParameterIndex( KSQLAccessList ); + + RBuf8 data; + data.CleanupClosePushL(); + GetPropertyL( KDataMap, data ) ; + BindBinaryL( stmt, dataIndex, data ); + RBuf8 action; + action.CleanupClosePushL(); + GetPropertyL( KActionMap, action ) ; + BindBinaryL( stmt, actionIndex, action ); + + RBuf8 acl; + acl.CleanupClosePushL(); + if( !GetPropertyL( KAccessList , acl ) ) + { + iPolicy->GetDefaultSecurityL( acl ); + } + BindBinaryL( stmt, aclIndex, acl ); + + if ( stmt.Exec( ) <= 0 ) + { + User::Leave( KErrGeneral ); + } + + TSqlScalarFullSelectQuery id_query(aSqlDb); + TInt32 ret( 0); + ret = id_query.SelectIntL( KSQLGetLastInsertId ); + + if ( aNotificationList ) + { + RBuf publisher; + publisher.CleanupClosePushL(); + RBuf contentType; + contentType.CleanupClosePushL(); + RBuf contentId; + contentId.CleanupClosePushL(); + GetPropertyL( KPublisherId, publisher ) ; + GetPropertyL( KContentType, contentType ); + GetPropertyL( KContentId, contentId ); + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( ); + changeInfoMap->InsertL( KId, TLiwVariant( ret ) ); + changeInfoMap->InsertL( KType, TLiwVariant( KPublisher ) ); + changeInfoMap->InsertL( KPublisherId, TLiwVariant( publisher ) ); + changeInfoMap->InsertL( KContentType, TLiwVariant( contentType ) ); + changeInfoMap->InsertL( KContentId, TLiwVariant( contentId ) ); + changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) ); + TInt32 flag( 0 ); + GetProperty( KFlag, flag ); + changeInfoMap->InsertL( KFlag, TLiwVariant( flag ) ); + aNotificationList->AppendL( TLiwVariant( changeInfoMap ) ); + CleanupStack::PopAndDestroy( changeInfoMap ) ; + CleanupStack::PopAndDestroy( &contentId ) ; + CleanupStack::PopAndDestroy( &contentType ) ; + CleanupStack::PopAndDestroy( &publisher ) ; + } + + CleanupStack::PopAndDestroy( &acl ); + CleanupStack::PopAndDestroy( &action ); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( &stmt ) ; + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::AppendFilterL( RBuf& aQuery, + TUint& aFilter ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::AppendFilterL") ); + if( aFilter & EFlag ) + { + aQuery.ReAllocL( aQuery.Length() + KSQLGetFlag().Length() + + KWhere().Length() ); + aQuery.Append( KWhere ); + aQuery.Append( KSQLGetFlag ); + } + else + { + CCPLiwMap::AppendFilterL( aQuery, aFilter ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::AppendSortL( RBuf& aQuery, + const TCPSortOrder& aSort ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::AppendSortL") ); + switch ( aSort ) + { + case ECPContentId: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContentId().Length( ) ); + aQuery.Append( KSQLOrderContentId ); + break; + case ECPContent: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderContent().Length( ) ); + aQuery.Append( KSQLOrderContent ); + break; + case ECPPublisher: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderPublisher().Length( ) ); + aQuery.Append( KSQLOrderPublisher ); + break; + default: + aQuery.ReAllocL( aQuery.Length( ) + KSQLOrderRecent().Length( ) ); + aQuery.Append( KSQLOrderRecent ); + break; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::PrepareStmtforAddL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt , + const TDesC& aQuery ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::PrepareStmtforAddL") ); + CCPLiwMap::PrepareStmtforAddL( aSqlDb,aStmt,aQuery); + TInt32 flag( 0x00000000 ); + GetProperty( KFlag, flag ); + TInt flagIndex = aStmt.ParameterIndex( KSQLFlag ); + if (flagIndex != KErrNotFound) + { + BindIntL( aStmt, flagIndex , flag ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::PrepareStmtforUpdateL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, TInt32 aId ) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::PrepareStmtforUpdateL") ); + TInt32 flag; + TBool isFlagInfo = GetProperty( KFlag, flag ); + + TBool isParameter(EFalse); + RBuf query; + query.CleanupClosePushL(); + query.CreateL( KSQLUpdateRegistry().Length( ) ); + query.Append( KSQLUpdateRegistry ); + RBuf8 data; + data.CleanupClosePushL(); + if ( GetPropertyL( KDataMap, data ) ) + { + query.ReAllocL( query.Length( ) + KSQLUpdateData().Length( ) ); + query.Append( KSQLUpdateData ); + isParameter = ETrue; + } + RBuf8 action; + action.CleanupClosePushL(); + if ( GetPropertyL( KActionMap, action ) ) + { + if ( isParameter ) + { + query.ReAllocL( query.Length( ) + KComma().Length( ) ); + query.Append( KComma ); + } + query.ReAllocL( query.Length( ) + KSQLUpdateAction().Length( ) ); + query.Append( KSQLUpdateAction ); + isParameter = ETrue; + } + if( isFlagInfo ) + { + if(isParameter) + { + query.ReAllocL( query.Length() + KComma().Length()); + query.Append( KComma ); + } + query.ReAllocL( query.Length() + KSQLUpdateFlag().Length()); + query.Append( KSQLUpdateFlag ); + isParameter = ETrue; + } + if( !isParameter ) User::Leave( KErrPathNotFound ); + query.ReAllocL( query.Length( ) + KSQLUpdateWhere().Length( ) ); + query.Append( KSQLUpdateWhere ); + User::LeaveIfError( aStmt.Prepare( aSqlDb, query ) ); + TInt dataId = aStmt.ParameterIndex( KSQLId ); + BindIntL( aStmt, dataId, aId ); + + if ( data.Length( ) ) + { + TInt dataIndex = aStmt.ParameterIndex( KSQLData ); + BindBinaryL( aStmt,dataIndex, data ); + } + if ( action.Length( ) ) + { + TInt actionIndex = aStmt.ParameterIndex( KSQLAction ); + BindBinaryL( aStmt, actionIndex, action ); + } + if( isFlagInfo ) + { + TInt flagIndex = aStmt.ParameterIndex( KSQLFlag ); + BindIntL( aStmt, flagIndex , flag ); + } + CleanupStack::PopAndDestroy( &action ); + CleanupStack::PopAndDestroy( &data ); + CleanupStack::PopAndDestroy( &query ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::UpdateL( RSqlDatabase aSqlDb, TInt32 aId, + CLiwDefaultList* aNotificationList) const + { + CP_DEBUG( _L8("CPublisherRegistryMap::UpdateL") ); + RSqlStatement stmt; + CleanupClosePushL( stmt ); + CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC( ); + FetchIdsL( aId, KSQLFetchIdsFromRegistry, changeInfoMap, aSqlDb ); + if ( aNotificationList ) + { + changeInfoMap->InsertL( KType, TLiwVariant( KPublisher ) ); + TInt32 flag( 0 ); + GetProperty( KFlag, flag ); + changeInfoMap->InsertL( KFlag, TLiwVariant( flag ) ); + aNotificationList->AppendL( TLiwVariant( changeInfoMap ) ); + } + CleanupStack::PopAndDestroy( changeInfoMap ) ; + PrepareStmtforUpdateL( aSqlDb, stmt, aId ); + if ( stmt.Exec( ) <= 0 ) + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( &stmt ) ; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::IsValidForDeleteL() const + { + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + if( err == KErrNone && !IsFlag() && !IsId( ) && !( IsPublisherNameL( ) + || IsContentTypeL( ) || IsContentIdL() ) ) + { + err = KErrPathNotFound; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::IsValidForGetListL() const + { + TInt err( KErrNone ); + TInt32 id( 0 ); + if( GetProperty( KId, id ) && ( id < 1 ) ) + { + err = KErrArgument; + } + else if( !IsId() && PropertyExists( KId ) ) + { + err = KErrBadName; + } + + if( err != KErrNone ) + { + User::Leave( err ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CPublisherRegistryMap::ActivateActionSupport( ) const + { + return ETrue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CPublisherRegistryMap::GetActivateInfo( ) const + { + TInt32 flag; + GetProperty( KFlag, flag ); + TBool activate = flag & EActivate; + return activate; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPublisherRegistryMap::FillChangeInfoMapL( RSqlStatement& aStmt, + CLiwDefaultMap* aMap )const + { + CCPLiwMap::FillChangeInfoMapL(aStmt, aMap); + TInt flagIndex = ColumnIndexL( aStmt, KColumnFlag ); + TInt32 flag_db = aStmt.ColumnInt( flagIndex ); + aMap->InsertL( KFlag , TLiwVariant( flag_db ) ); + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Utils +* +*/ + + + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS +../contentpublishingdebug/inc/cpdebug.h |../../../inc/cpdebug.h + + +PRJ_MMPFILES +#include "../contentpublishingmap/group/bld.inf" +#include "../pluginvalidator/group/bld.inf" + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/bwins/pluginvalidatoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/bwins/pluginvalidatoru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,9 @@ +EXPORTS + ?GetCount@CPluginValidator@@QAEHXZ @ 1 NONAME ; int CPluginValidator::GetCount(void) + ?GetImplementation@CPluginValidator@@QAEPAXH@Z @ 2 NONAME ; void * CPluginValidator::GetImplementation(int) + ?GetImplementation@CPluginValidator@@QAEPAXVTUid@@@Z @ 3 NONAME ; void * CPluginValidator::GetImplementation(class TUid) + ?NewL@CPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 4 NONAME ; class CPluginValidator * CPluginValidator::NewL(class TUid, void *) + ?NewLC@CPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 5 NONAME ; class CPluginValidator * CPluginValidator::NewLC(class TUid, void *) + ?NewL@CHarvesterPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 6 NONAME ; class CHarvesterPluginValidator * CHarvesterPluginValidator::NewL(class TUid, void *) + ?NewLC@CHarvesterPluginValidator@@SAPAV1@VTUid@@PAX@Z @ 7 NONAME ; class CHarvesterPluginValidator * CHarvesterPluginValidator::NewLC(class TUid, void *) + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/eabi/pluginvalidatoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/eabi/pluginvalidatoru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,9 @@ +EXPORTS + _ZN16CPluginValidator17GetImplementationE4TUid @ 1 NONAME + _ZN16CPluginValidator17GetImplementationEi @ 2 NONAME + _ZN16CPluginValidator4NewLE4TUidPv @ 3 NONAME + _ZN16CPluginValidator5NewLCE4TUidPv @ 4 NONAME + _ZN16CPluginValidator8GetCountEv @ 5 NONAME + _ZN25CHarvesterPluginValidator4NewLE4TUidPv @ 6 NONAME + _ZN25CHarvesterPluginValidator5NewLCE4TUidPv @ 7 NONAME + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Debug +* +*/ + +// Macro definitions +#include + +PRJ_PLATFORMS + +DEFAULT + +PRJ_EXPORTS +../inc/cpluginvalidator.h |../../../../inc/cpluginvalidator.h + +PRJ_MMPFILES +pluginvalidator.mmp + + +// End of File diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/group/pluginvalidator.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 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: ?Description +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET pluginvalidator.dll +TARGETTYPE dll + +UID 0x1000008D 0x2001CB6C + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LANG SC + +SOURCEPATH ../src +SOURCE cpluginvalidator.cpp +SOURCE cblacklisthandler.cpp +SOURCE charvesterpluginvalidator.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY estor.lib +LIBRARY centralrepository.lib +//end of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cblacklisthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cblacklisthandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,108 @@ +/* +* 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 CBLACKLISTHANDLER_H_ +#define CBLACKLISTHANDLER_H_ + +//INCLUDES +#include + +//FORWARD DECLARATIONS +class CRepository; + +/* + * Blacklist Handler + */ +NONSHARABLE_CLASS( CBlacklistHandler ): public CBase + { +public: + + /** + * Two-phased constructor. + * + */ + static CBlacklistHandler* NewL( ); + + /** + * Two-phased constructor. + * + */ + static CBlacklistHandler* NewLC( ); + + /** + * Desctructor. + */ + ~CBlacklistHandler(); + + /* + * Appends plugin UID to blacklist + * @param aUid uid of the plugin + */ + void AppendL( TUid aUid ); + + /* + * Removes plugin UID from blacklist + * @param aUid uid of the plugin + */ + void RemoveL( TUid aUid ); + + /* + * Checks if plugin with provided UID is on the blacklist + * @param aUid uid of the plugin + */ + TBool IsPresentL( TUid aUid ); + + /* + * Copies blacklist unofficial blacklist to official + * if flag is set to EFalse and official to unofficial if flag = ETrue + * @param aUnofficialToOfficial flag indicating which blacklist + * should be copied + */ + void CopyBlacklistL( TBool aOfficialToUnofficial ); + +private: + + /** + * C++ default constructor. + */ + CBlacklistHandler( ); + + /** + * Perform the second phase construction of a CPluginValidator object. + */ + void ConstructL(); + + /* + * Gets blacklist array from CPS + */ + void GetArrayL( RArray& aArray, TBool aOfficial ); + + /* + * Stores blacklist array in CPS + */ + void StoreArrayL( const RArray& aArray, TBool aOfficial ); + +private: + + /** + * Provides access to repository + * Own + */ + CRepository* iRepository; + }; + +#endif /* CBLACKLISTHANDLER_H_ */ diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/charvesterpluginvalidator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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 CHARVESTERPLUGINVALIDATOR_H +#define CHARVESTERPLUGINVALIDATOR_H + +// INCLUDES +#include +#include +#include "cpluginvalidator.h" + +// FORWARD DECLARATIONS +class CBlacklistHandler; + +//CONSTS +//PubSub Category AI plug-in registry API +const TUid KPSUidActiveIdle2 = {0x102750F0}; // ActiveIdle2 SID +// Indicates that all the CPS Harvester plugins have been updated +const TUint KActiveIdleCpsPluginsUpdated = 0x0000000C; +enum EPSActiveIdleCpsPluginsUpdated + { + EPSAiPluginsNotUpdated = 0, + EPSAiPluginsUpdated + }; + +/** + * Class used to maintain required ECOM plugins implementations + * + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +NONSHARABLE_CLASS( CHarvesterPluginValidator ): public CPluginValidator + { +public: + + /** + * Two-phased constructor. + * + */ + IMPORT_C static CHarvesterPluginValidator* NewL( TUid aUid, + TAny *aParameter = NULL ); + + /** + * Two-phased constructor. + * + */ + IMPORT_C static CHarvesterPluginValidator* NewLC( TUid aUid, + TAny *aParameter = NULL ); + + /** + * Desctructor. + */ + ~CHarvesterPluginValidator(); + + +private: + + /** + * C++ default constructor. + */ + CHarvesterPluginValidator( TUid aUid, TAny *aParameter ); + + /** + * Perform the second phase construction of a CPluginValidator object. + */ + void ConstructL(); + + /** + * Loads or destroys plugins + */ + void ManagePluginsL(); + + /** + * Loads ECOM plugins + */ + void LoadPluginL( TPluginInfo& aPluginInfo ); + + +private: + + /** + * Blacklist Handler + * Own + */ + CBlacklistHandler* iBlacklist; + + /* + * Startup flag + * + */ + TBool iStartup; + + /* + * Property indicating the status of load operation + * Own + */ + RProperty iInProgressProperty; + }; + +#endif // CHARVESTERPLUGINVALIDATOR_H diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/inc/cpluginvalidator.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cblacklisthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cblacklisthandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 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: + * +*/ + +#include +#include +#include "cpserverdef.h" + +#include "cpglobals.h" +#include "cblacklisthandler.h" +#include "centralrepository.h" + + +//CONST +const TUint32 KOfficialBlacklistCRKey = { 0x1028000A }; +const TUint32 KOfficialBlacklistSizeCRKey = { 0x1028000B }; +const TUint32 KUnofficialBlacklistCRKey = { 0x1028000C }; +const TUint32 KUnoficialBlacklistSizeCRKey = { 0x1028000D }; + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CBlacklistHandler* CBlacklistHandler::NewL( ) + { + CBlacklistHandler* self = CBlacklistHandler::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CBlacklistHandler* CBlacklistHandler::NewLC( ) + { + CBlacklistHandler* self = new( ELeave ) CBlacklistHandler( ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CBlacklistHandler::~CBlacklistHandler() + { + delete iRepository; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CBlacklistHandler::CBlacklistHandler( ) + { + + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::ConstructL() + { + iRepository = CRepository::NewL( KServerUid ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::AppendL( TUid aUid ) + { + RArray blacklist; + CleanupClosePushL( blacklist ); + GetArrayL( blacklist, EFalse ); //unofficial blacklist + blacklist.AppendL( aUid ); + StoreArrayL( blacklist, EFalse );//unofficial blacklist + CleanupStack::PopAndDestroy( &blacklist ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::RemoveL( TUid aUid ) + { + RArray blacklist; + CleanupClosePushL( blacklist ); + GetArrayL( blacklist, EFalse );//from unofficial blacklist + TInt index = blacklist.Find( aUid ); + if ( index != KErrNotFound ) + { + blacklist.Remove( index ); + } + StoreArrayL( blacklist, EFalse );//unofficial blacklist + CleanupStack::PopAndDestroy( &blacklist ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CBlacklistHandler::IsPresentL( TUid aUid ) + { + TBool result(EFalse); + RArray blacklist; + CleanupClosePushL( blacklist ); + GetArrayL( blacklist, ETrue );// from official blacklist + TInt index = blacklist.Find( aUid ); + if ( index != KErrNotFound ) + { + result = ETrue; + } + CleanupStack::PopAndDestroy( &blacklist ); + return result; + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::GetArrayL( RArray& aArray, TBool aOfficial ) + { + TInt32 repositoryKey( NULL ); + TInt32 repositorySize( NULL ); + if( aOfficial ) + { + repositorySize = KOfficialBlacklistSizeCRKey; + repositoryKey = KOfficialBlacklistCRKey; + } + else + { + repositorySize = KUnoficialBlacklistSizeCRKey; + repositoryKey = KUnofficialBlacklistCRKey; + } + + TInt size(-1); + if ( KErrNone == iRepository->Get( repositorySize, size ) ) + { + RBuf8 serializedBlacklist; + serializedBlacklist.Create( size ); + CleanupClosePushL( serializedBlacklist ); + if ( KErrNone == iRepository->Get( repositoryKey, serializedBlacklist ) ) + { + RDesReadStream stream( serializedBlacklist ); + CleanupClosePushL( stream ); + TUint16 count = stream.ReadUint16L(); + for ( TInt i = 0; i < count; i++ ) + { + aArray.AppendL(TUid::Uid(stream.ReadInt32L())); + } + CleanupStack::PopAndDestroy( &stream ); + } + CleanupStack::PopAndDestroy( &serializedBlacklist ); + } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::StoreArrayL( const RArray& aArray, + TBool aOfficial ) + { + TInt32 repositoryKey( NULL ); + TInt32 repositorySize( NULL ); + if( aOfficial ) + { + repositorySize = KOfficialBlacklistSizeCRKey; + repositoryKey = KOfficialBlacklistCRKey; + } + else + { + repositorySize = KUnoficialBlacklistSizeCRKey; + repositoryKey = KUnofficialBlacklistCRKey; + } + + RBuf8 serializedBlacklist; + serializedBlacklist.Create( aArray.Count() * sizeof(TInt32) + + sizeof(TUint16) ); + CleanupClosePushL( serializedBlacklist ); + RDesWriteStream stream( serializedBlacklist ); + CleanupClosePushL( stream ); + stream.WriteUint16L( aArray.Count() ); + for ( TInt i = 0; i< aArray.Count(); i++ ) + { + stream.WriteInt32L( aArray[i].iUid ); + } + stream.CommitL(); + if ( KErrNone == iRepository->Set( repositoryKey, serializedBlacklist ) ) + { + iRepository->Set( repositorySize, serializedBlacklist.Size() ); + } + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::PopAndDestroy( &serializedBlacklist ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CBlacklistHandler::CopyBlacklistL( TBool aOfficialToUnofficial ) + { + RArray blacklist; + CleanupClosePushL( blacklist ); + GetArrayL( blacklist, aOfficialToUnofficial ); + StoreArrayL( blacklist, !aOfficialToUnofficial ); + CleanupStack::PopAndDestroy( &blacklist ); + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/charvesterpluginvalidator.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 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: + * +*/ + +#include +#include +#include +#include // harvesting plugin + +#include "charvesterpluginvalidator.h" +#include "cblacklisthandler.h" + +const TUint32 KInProgressPropertyKey = { 0x1028000E }; +const TUint32 KHarvesterUid = { 0x10282E5A }; + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewL( TUid aUid, + TAny *aParameter ) + { + CHarvesterPluginValidator* self = + CHarvesterPluginValidator::NewLC( aUid , aParameter ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C CHarvesterPluginValidator* CHarvesterPluginValidator::NewLC( TUid aUid, + TAny *aParameter ) + { + CHarvesterPluginValidator* self = new( ELeave ) + CHarvesterPluginValidator( aUid, aParameter ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CHarvesterPluginValidator::~CHarvesterPluginValidator() + { + iInProgressProperty.Close( ); + delete iBlacklist; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CHarvesterPluginValidator::CHarvesterPluginValidator( TUid aUid, TAny* aParameter ): + CPluginValidator(aUid, aParameter), + iStartup( ETrue ) + { + + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CHarvesterPluginValidator::ConstructL() + { + iBlacklist = CBlacklistHandler::NewL( ); + CPluginValidator::ConstructL(); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CHarvesterPluginValidator::ManagePluginsL() + { + TInt errorCode = iInProgressProperty.Define( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, RProperty::EInt ); + + if ( KErrAlreadyExists == errorCode ) + { + TInt value(-1); + iInProgressProperty.Get( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, value); + if ( value == 1 ) + { + // property value == inprogress + // there was a panic in the previous startup + // so we make unofficial blacklist official + iBlacklist->CopyBlacklistL( EFalse ); + } + } + else + { + User::LeaveIfError( errorCode ); + } + // copy blacklisted plugins to unoffical blacklist at startup + iBlacklist->CopyBlacklistL( ETrue ); + + // set property value to 1 (which means "in progress") + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 1 ); + + CPluginValidator::ManagePluginsL(); + + if ( iStartup ) + { + RProperty::Set( KPSUidActiveIdle2, + KActiveIdleCpsPluginsUpdated , EPSAiPluginsUpdated ); + iStartup = EFalse; + } + // set property value to 0 (which means "finished") + iInProgressProperty.Set( TUid::Uid( KHarvesterUid ), + KInProgressPropertyKey, 0 ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CHarvesterPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) + { + if ( !iBlacklist->IsPresentL( aPluginInfo.iImplementationUid ) ) + { + //first we append UID to the blacklist + iBlacklist->AppendL( aPluginInfo.iImplementationUid ); + TAny* plug ( NULL ); + TInt err( KErrNone ); + TRAP( err, plug = REComSession::CreateImplementationL( + aPluginInfo.iImplementationUid, + aPluginInfo.iDtor_ID_Key, iParameter ) ); + if( err==KErrNone && plug ) + { + TRAP_IGNORE( + CleanupStack::PushL( plug ); + aPluginInfo.iPlugin = plug; + iPluginArray.AppendL( aPluginInfo ); + CleanupStack::Pop( plug ); + static_cast( plug )->UpdateL() + ); + } + //no panic during load so we can remove UID from blacklist + iBlacklist->RemoveL( aPluginInfo.iImplementationUid ); + } + } + + + + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentpublishingutils/pluginvalidator/src/cpluginvalidator.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,269 @@ +/* +* Copyright (c) 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: + * +*/ + + +#include +#include +#include "cpluginvalidator.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C CPluginValidator* CPluginValidator::NewL( TUid aUid, + TAny *aParameter ) + { + CPluginValidator* self = CPluginValidator::NewLC( aUid , aParameter ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C CPluginValidator* CPluginValidator::NewLC( TUid aUid, + TAny *aParameter ) + { + CPluginValidator* self = new( ELeave ) CPluginValidator( aUid, + aParameter ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C TAny* CPluginValidator::GetImplementation( TUid aUid ) + { + TPluginInfo pluginInfo; + pluginInfo.iImplementationUid = aUid; + TInt index = iPluginArray.Find( pluginInfo, + TIdentityRelation< TPluginInfo >(UidMatch) ); + return GetImplementation( index ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C TAny* CPluginValidator::GetImplementation( TInt aIndex ) + { + TAny* ret( NULL ); + if (( aIndex != KErrNotFound ) && ( aIndex < iPluginArray.Count() )) + { + ret= iPluginArray[aIndex].iPlugin; + } + return ret; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +EXPORT_C TInt CPluginValidator::GetCount( ) + { + return iPluginArray.Count(); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CPluginValidator::~CPluginValidator() + { + Cancel(); + CleanPluginsTable(); + iPluginArray.Close( ); + if( iSession ) + { + iSession->Close(); + } + REComSession::FinalClose( ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::RunL() + { + ManagePluginsL(); + iSession->NotifyOnChange( iStatus ); + SetActive(); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::DoCancel() + { + iSession->CancelNotifyOnChange( iStatus ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TInt CPluginValidator::RunError( TInt /*aError*/) + { + return KErrNone; + } +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CPluginValidator::CPluginValidator( TUid aUid, TAny* aParameter ): + CActive(EPriorityStandard), + iUid( aUid ), + iParameter( aParameter ) + { + + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::ConstructL() + { + iSession = &REComSession::OpenL(); + ManagePluginsL(); + iSession->NotifyOnChange( iStatus ); + CActiveScheduler::Add( this ); + SetActive(); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CPluginValidator::PresentInArrayL( TPluginInfo aPluginInfo, + const RImplInfoPtrArray& aInfoArray ) + { + TBool result(EFalse); + for ( TInt i = 0; i< aInfoArray.Count(); i++ ) + { + if ( aPluginInfo.iImplementationUid.iUid == + aInfoArray[i]->ImplementationUid().iUid) + { + result = ETrue; + break; + } + } + return result; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::DestroyPlugin( TInt aIndex ) + { + CBase* plugin = static_cast( iPluginArray[aIndex].iPlugin ); + delete plugin; + REComSession::DestroyedImplementation( + iPluginArray[aIndex].iDtor_ID_Key ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::CleanPluginsTable() + { + for ( TInt i = 0; i < iPluginArray.Count(); i++ ) + { + DestroyPlugin( i ); + } + } + + + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::ManagePluginsL() + { + // Read info about all implementations into infoArray + RImplInfoPtrArray infoArray; + CleanupResetAndDestroyPushL( infoArray ); + + REComSession::ListImplementationsL( iUid , infoArray ); + TPluginInfo pluginInfo; + //Load new plugins + for ( TInt i = 0; i < infoArray.Count( ); i++ ) + { + pluginInfo.iImplementationUid = infoArray[i]->ImplementationUid( ); + pluginInfo.iVersion = infoArray[i]->Version(); + + TInt index = iPluginArray.Find( pluginInfo, + TIdentityRelation< TPluginInfo >(UidMatch) ); + + if ( index == KErrNotFound ) + { + //plugin wasn't present, we load it now + LoadPluginL( pluginInfo ); + } + else if ( pluginInfo.iVersion > iPluginArray[index].iVersion ) + { + //plugin was present but it is a newer version, + //remove old and load a new one + DestroyPlugin( index ); + iPluginArray.Remove( index ); + LoadPluginL( pluginInfo ); + } + } + //Remove old plugins + for ( TInt i = iPluginArray.Count() - 1 ; i >= 0; i-- ) + { + pluginInfo = iPluginArray[i]; + if ( !PresentInArrayL( pluginInfo, infoArray ) ) + { + DestroyPlugin( i ); + iPluginArray.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &infoArray ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CPluginValidator::LoadPluginL( TPluginInfo& aPluginInfo ) + { + TAny* plug ( NULL ); + TInt err( KErrNone ); + TRAP( err, plug = REComSession::CreateImplementationL( + aPluginInfo.iImplementationUid, + aPluginInfo.iDtor_ID_Key, iParameter ) ); + if( err==KErrNone && plug ) + { + CleanupStack::PushL( plug ); + aPluginInfo.iPlugin = plug; + iPluginArray.AppendL( aPluginInfo ); + CleanupStack::Pop( plug ); + } + } + diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 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: Build info file for the Content Publisher +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/contentpublishingservice.iby CORE_MW_LAYER_IBY_EXPORT_PATH(contentpublishingservice.iby) + +PRJ_MMPFILES +#ifdef CONTENT_PUBLISHER_DEBUG +#include "../contentpublishingutils/contentpublishingdebug/group/bld.inf" +#endif + +#include "../contentpublishingutils/group/bld.inf" +#include "../contentpublishingserver/group/bld.inf" +#include "../contentharvester/group/bld.inf" + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of file diff -r 000000000000 -r 79c6a41cd166 contentpublishingsrv/rom/contentpublishingservice.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/rom/contentpublishingservice.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* 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: IBY file for the content publishing +* +*/ + + +#ifndef CONTENTPUBLISHINGSERVICE_IBY +#define CONTENTPUBLISHINGSERVICE_IBY + +file=ABI_DIR\BUILD_DIR\cpserver.exe SHARED_LIB_DIR\cpserver.exe +file=ABI_DIR\BUILD_DIR\cpstorage.dll SHARED_LIB_DIR\cpstorage.dll +file=ABI_DIR\BUILD_DIR\cputils.dll SHARED_LIB_DIR\cputils.dll +file=ABI_DIR\BUILD_DIR\contentharvesterclient.dll SHARED_LIB_DIR\contentharvesterclient.dll +file=ABI_DIR\BUILD_DIR\contentharvester.exe SHARED_LIB_DIR\contentharvester.exe +file=ABI_DIR\BUILD_DIR\pluginvalidator.dll SHARED_LIB_DIR\pluginvalidator.dll + +ECOM_PLUGIN(chswiplugin.dll,chswiplugin.rsc) +ECOM_PLUGIN(chfactorysettingsplugin.dll,chfactorysettingsplugin.rsc) + +#ifdef CONTENT_PUBLISHER_DEBUG +file=ABI_DIR\BUILD_DIR\cpdebug.dll SHARED_LIB_DIR\cpdebug.dll +#endif // CONTENT_PUBLISHER_DEBUG + +data=\epoc32\data\z\private\20016b7b\backup_registration.xml private\20016b7b\backup_registration.xml +data=\epoc32\data\z\private\10202be9\20016b7b.txt private\10202be9\20016b7b.txt + +#endif // CONTENTPUBLISHING_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contextutility/bwins/hgcontextutilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/bwins/hgcontextutilityu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +EXPORTS + ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 1 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 2 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray const &, class TTimeIntervalMicroSeconds32 const &) + ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 4 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 5 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ??1CHgContextUtility@@UAE@XZ @ 6 NONAME ; CHgContextUtility::~CHgContextUtility(void) + ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 7 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void) + ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 8 NONAME ; void CHgContextUtility::RePublishWhenFgL(int) + ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 10 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &) + ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 12 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 13 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 14 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) + ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 15 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &) + ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 16 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 17 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &) + ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 18 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &) + ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &) + ?NewL@CHgContextUtility@@SAPAV1@XZ @ 20 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void) + ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 22 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 23 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &) + ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 24 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &) + ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 25 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) + ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) + diff -r 000000000000 -r 79c6a41cd166 contextutility/eabi/hgcontextutilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/eabi/hgcontextutilityu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +EXPORTS + _ZN17CHgContextUtility16RePublishWhenFgLEi @ 1 NONAME + _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 2 NONAME + _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 3 NONAME + _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 4 NONAME + _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME + _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 6 NONAME + _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 7 NONAME + _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 8 NONAME + _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 9 NONAME + _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 10 NONAME + _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 11 NONAME + _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 12 NONAME + _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 13 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 15 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 16 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 17 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 18 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 19 NONAME + _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 20 NONAME + _ZN17CHgContextUtility4NewLEv @ 21 NONAME + _ZN17CHgContextUtility5NewLCEv @ 22 NONAME + _ZN17CHgContextUtilityD0Ev @ 23 NONAME + _ZN17CHgContextUtilityD1Ev @ 24 NONAME + _ZN17CHgContextUtilityD2Ev @ 25 NONAME + _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 26 NONAME + _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 27 NONAME + _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 28 NONAME + _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 29 NONAME + _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 30 NONAME + _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 31 NONAME + _ZTI21CHgContextUtilityBase @ 32 NONAME + _ZTV21CHgContextUtilityBase @ 33 NONAME + diff -r 000000000000 -r 79c6a41cd166 contextutility/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Build info file for Context publishing helper DLL. +* +*/ + + +#include + +PRJ_EXPORTS +../rom/hgcontextutility.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hgcontextutility.iby) + + +PRJ_MMPFILES +hgcontextutility.mmp + +PRJ_TESTMMPFILES + + diff -r 000000000000 -r 79c6a41cd166 contextutility/group/hgcontextutility.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/group/hgcontextutility.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* 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: Context publishing helper dll +* +*/ + + +#include +#include + +TARGETTYPE DLL +TARGET hgcontextutility.dll +UID 0x1000008d +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hgcontextutilitybase.cpp +SOURCE hgcontextutility.cpp +SOURCE hgcontextutilityimpl.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY cfclient.lib +LIBRARY cfservices.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY mdeclient.lib +LIBRARY vpbkeng.lib + diff -r 000000000000 -r 79c6a41cd166 contextutility/inc/hgcontexttypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/inc/hgcontexttypes.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: CFW source and type names +* +*/ + +#ifndef HGCONTEXTTYPES_H +#define HGCONTEXTTYPES_H + +#include +#include // pull in the public part + +_LIT( KHgCFTypeFgApp, "FgApp" ); // published by fswserver + +_LIT( KHgCFTypeUpdateAvail, "UpdateAvail" ); // for iad source plug-in + +_LIT( KHgCFTypeMdsObjChanged, "MdsObjChanged" ); +_LIT( KHgCFTypeMdsRelChanged, "MdsRelChanged" ); + +_LIT( KHgCFValueDuplicateMarker, "" ); // may be used in PbkContactMulti + +const TInt KHgCFValueLinkMarker = 2; // prefix when Contact holds a vpbk contact link + +_LIT( KHgCFTypeCallState, "CallState" ); +_LIT( KHgCFTypeCallSusp, "CallSusp" ); // see hgcfcallsourceplugin +_LIT( KHgCFTypeContactFromCall, "ContactFromCall" ); // contains "1" if contact is coming from a voice/video call + +#endif // HGCONTEXTTYPES_H diff -r 000000000000 -r 79c6a41cd166 contextutility/inc/hgcontextutilityimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/inc/hgcontextutilityimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,434 @@ +/* +* 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: Context publishing helper dll +* +*/ + + +#ifndef HGCONTEXTUTILITYIMPL_H +#define HGCONTEXTUTILITYIMPL_H + +#include +#include +#include +#include +#include +#include +#include + +class CCFClient; +class MVPbkContactLink; +class MVPbkStoreContact; +class CVPbkContactLinkArray; +class CMdESession; + +/** + * Utility class offering static and non-static functions for + * publishing and accessing context through the Context Framework. + */ +NONSHARABLE_CLASS( CHgContextUtilityImpl ) : + public CTimer, + public MCFListener, + public MCoeForegroundObserver + { +public: + static CHgContextUtilityImpl* NewL(); + static CHgContextUtilityImpl* NewLC(); + virtual ~CHgContextUtilityImpl(); + + /** + * Publishes context. + * Also defines the context if it has not been defined. + * Publishing empty value is not allowed, however such errors are ignored + * here so the function will not leave when CFW responds with KErrArgument. + * The security policy for the context will be set to require + * LocalServices capability. + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context + */ + void PublishContextL( const TDesC& aContextType, + const TDesC& aContextData ); + + /** + * Publishes context, the value will contain all the strings + * from the given array, typically by using some separator character. + * @see PublishContextL + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context will be a combined + * version of all the strings from this array + */ + void PublishContextL( const TDesC& aContextType, + const MDesCArray& aContextData ); + + /** + * Static version that uses the given CCFClient instance. + * @param aCFClient a CCFClient instance + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context + */ + static void PublishContextL( CCFClient& aCFClient, + const TDesC& aContextType, const TDesC& aContextData ); + + /** + * Publishes context but only after a short interval, using a timer. + * If it is called again before the timer expires then the timer + * is restarted (and so the previous pending value is never published). + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context + * @param aDelay delay for the timer + */ + void PublishContextDelayedL( const TDesC& aContextType, + const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Overload for delayed publishing of a value combined from multiple strings. + * @param aContextType context type + * @param aContextData string array + * @param aDelay delay for the timer, in microseconds + */ + void PublishContextDelayedL( const TDesC& aContextType, + const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay ); + + /** + * Requests the given context and returns the value for the + * first result. Returns NULL if not found. + * @param aContextType context type, the source is always KHgCFSource + */ + HBufC* GetContextL( const TDesC& aContextType ); + + /** + * Requests the given context and returns the value for the + * first result. Returns NULL if not found. + * @param aContextSource context source + * @param aContextType context type + */ + HBufC* GetContextL( const TDesC& aContextSource, + const TDesC& aContextType ); + + /** + * Creates a combined string from the elements of the given array. + * Returns NULL if the array has less than 2 elements. + * @param aArray string array + * @return combined string or NULL, ownership transferred to caller + */ + static HBufC* BuildCombinedStringL( const MDesCArray& aArray ); + + /** + * Splits the given combined string and appends the components to + * the given array. The initial content of the array is not modified. + * If aString does not seem to be a string combined from multiple entries + * then aString is appended to aArray without any changes. + * @param aString combined string, input + * @param aArray array, output + */ + static void SplitCombinedStringL( const TDesC& aString, + CDesCArray& aArray ); + + /** + * Gets a string that can be published straight via PublishContextL. + * The pointer is left on the cleanup stack. + * Returned & pushed pointer may also be NULL is something goes wrong. + */ + HBufC* MakeLinkPublishableLC( const MVPbkContactLink& aLink ); + + /** + * Publishes contact context. + * @param aContact contact + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( const MVPbkStoreContact& aContact, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes contact context. + * This may include async operations and therefore the actual publishing may happen + * only after this function returns. + * @param aContactLink contact link + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( const MVPbkContactLink& aContactLink, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes contact context. + * Attempts to publish an empty value will be ignored. + * + * Prefer using the overloads taking vpbk contact or link, whenever possible. + * Use this in case of unknown contacts only, that is, a name, phone number, + * or email address that does not belong to a phonebook contact. + * + * @param aContactName formatted name, phone number, or email address, + * or a combination of them, e.g. "firstname lastname", "+12345678", + * "lastname firstname ", "firstname, lastname <0501234567>". + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( const TDesC& aContactName, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Overload for publishing multiple contacts. + * @param aContacts contact array + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( + const RPointerArray& aContacts, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Overload for publishing multiple contacts. + * This may include async operations and therefore the actual publishing may happen + * only after this function returns. + * @param aContactLinks contact link array + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( + const CVPbkContactLinkArray& aContactLinks, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Overload for publishing multiple contacts. + * @param aContactNames string array, for element format + * see PublishContactContextL(const TDesC&) + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishContactContextL( const MDesCArray& aContactNames, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes freetext context. + * Not to be used for bulk text (e.g. full content of some text viewer component). + * @param aText some text, typically the highlighted substring + * from a viewer or editor control + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishTextContextL( const TDesC& aText, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes URL context. + * @param aUrl URL + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishUrlContextL( const TDesC& aUrl, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes date/time context. + * @param aTime time + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishTimeContextL( const TTime& aTime, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes photo context. + * @param aFilename name of image file, with full path + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishPhotoContextL( const TDesC& aFilename, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes photo context. + * @param aMdeItemId item id for the Image object in MDS + * @param aMdeSession opened metadata engine session + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishPhotoContextL( TItemId aMdeItemId, + CMdESession& aMdeSession, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Publishes TV context. + * Pass KNullDesC if some of the needed data is not available. + * @param aChannelName channel name + * @param aProgramName program name + * @param aProgramDescription program description + * @param aGenre genre + */ + void PublishTvContextL( const TDesC& aChannelName, + const TDesC& aProgramName, const TDesC& aProgramDescription, + const TDesC& aGenre ); + + /** + * Publishes an account id as contact context. + * + * @param aServiceId the service prefix, e.g. "Ovi" + * @param aAccountId the account id + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + void PublishServiceIdL( const TDesC& aServiceId, + const TDesC& aAccountId, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Enables or disables automatic re-publishing of the latest + * context (published via this context utility instance) whenever + * the application comes to foreground. + * + * It is DISABLED by default. + * + * By enabling this the applications do not have to care about + * context publishing in HandleForegroundEventL etc. + * + * The feature needs CCoeEnv and calls will be ignored if the + * environment is not available. + * + * @param aEnable flag to turn the feature on/off + */ + void RePublishWhenFgL( TBool aEnable ); + + /** + * Enables or disables context publishing when being in background. + * Applies to all PublishContextL variants. + * If disabled then no context will be published if it seems that the + * caller application is not in foreground. + * Has no effect if there is no CCoeEnv available, publishing is always + * allowed in that case. + * + * It is DISABLED by default, that is, publishing is not allowed + * from applications that are not in foreground. + * + * @param aAllow flag to turn the feature on/off + */ + void AllowPublishFromBackground( TBool aAllow ); + + /** + * @see CHgContextUtility::AddMusicContextInfo + */ + void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData ); + + /** + * @see CHgContextUtility::AddMusicContextInfo + */ + void PublishMusicContextL( + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * @see CHgContextUtility::PublishRadioContextL + */ + void PublishRadioContextL( + const TDesC& aRadioName, + const TDesC& aRadioUrl, + const TDesC& aRadioFrequency, + const TDesC& aRadioRDSPI ); + +private: // from MCFListener + void ContextIndicationL( const CCFContextIndication& aChangedContext ); + void ActionIndicationL( const CCFActionIndication& aActionToExecute ); + void HandleContextFrameworkError( TCFError aError, + const TDesC& aSource, const TDesC& aType ); + TAny* Extension( const TUid& aExtensionUid ) const; + +private: // from MCoeForegroundObserver + void HandleGainingForeground(); + void HandleLosingForeground(); + +private: // from CTimer + void RunL(); + TInt RunError( TInt aError ); + +private: + /** + * Constructor. + */ + CHgContextUtilityImpl(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Creates CCFClient instance if not yet done. + * Does not leave if creation fails. + * Returns ETrue if iCFClient is usable. + */ + TBool CFReady(); + + /** + * Returns ETrue if the root window's wgid is same as + * the focused window group's wgid. + * Always returns ETrue if CCoeEnv is not available. + */ + TBool IsForeground(); + + /** + * Returns ETrue if publishing context is allowed at the moment. + * Uses IsForeground and the allow-publish-from-background setting. + */ + TBool AllowedToPublish(); + + /** + * Makes sure the specific key contains valid data and publishes it. + * + * @param aKey Key to be checked and published. + * @param aDelay Delay for publishing the context data. + */ + void VerifyAndPublishMusicContextL( + const TDesC& aKey, + const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Simple wrapper to handle between delayed and instant publish. + * @see PublishContextL + * @see PublishContextDelayedL + */ + void PublishContextL( + const TDesC& aContextType, + const TDesC& aContextData, + const TTimeIntervalMicroSeconds32& aDelay ); + + CCFClient* iCFClient; + HBufC* iPendingContextType; + HBufC* iPendingContextData; + CDesCArray* iPendingContextDataArray; + + HBufC* iLastContextType; + HBufC* iLastContextData; + TBool iFgWatchEnabled; + CCoeEnv* iEnv; // not own + TBool iAllowPublishFromBackground; + + /** + * List of parameters to be published. Owns pointers. + */ + RPtrHashMap iMusicContextInfo; + }; + +#endif /* HGCONTEXTUTILITYIMPL_H */ diff -r 000000000000 -r 79c6a41cd166 contextutility/inc/hgctxutilslogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/inc/hgctxutilslogging.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* 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: Logging utils +* +*/ + + +#ifdef _DEBUG +_LIT( KHgLogFile, "hgctxutils.txt" ); +_LIT( KHgLogPath, "teleport" ); +#define _HGLOG_LOG_COMPONENT_ID 0x1000008d + +#endif +#include "hglogging.h" diff -r 000000000000 -r 79c6a41cd166 contextutility/inc/hglogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/inc/hglogging.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,218 @@ +/* +* 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: Logging utils +* +*/ + + +#ifndef HGLOGLOGUTILS_H +#define HGLOGLOGUTILS_H + +/** + * @file + * + * TAKING LOGGING INTO USE: + * + * This step is needed to do once per component. + * + * For each component that uses these common logging macros should specify + * their own logging configuration file, which includes this file. In that + * configuration file, following constants and macros must be defined. + * For example: + * @code + * + * _LIT( KHgLogFile, "text_file_for_logging.txt" ); + * _LIT( KHgLogPath, "folder_for_text_file" ); + * #define _HGLOG_LOG_COMPONENT_ID + * + * #include "hglogging.h" + * + * @/code + * + * KHgLogFile : This is the name of the file, where all the logs for + * this components are being written. + * + * KHgLogPath : This is the folder name under c:\logs, where the file + * is to be stored. For example, if KHgLogPath is "test", + * log file is created into folder c:\logs\test. + * + * _HGLOG_LOG_COMPONENT_ID : Unique number id of the component. This is + * for filtering purposes. + * + * _HGLOG_RDEBUG : When defined tracing instead of file logging. + * Default is for file logging. + * + * -------------------------------------------------------------------------- + * + * USING LOGGING: + * + * Basically the use is simple, register function use with HGLOG_CONTEXT, + * then log function enter by any HGLOG_IN -macro, then possibly use HGLOG + * -macros for function logging and finally HGLOG_OUT -macros for returning + * from the function. + * + * @code + * TInt CGood::Example( TInt aSomething ) + * { + * // Create log context class, which is maintained for lifetime of the + * // method. + * HGLOG_CONTEXT( Example, HGLOG_LOCAL ); + * + * // Indicate we are entering the function. + * HGLOG_IN1( "aSomething contains value %d", aSomething ); + * + * // Your buggy code... + * + * // Before leaving, indicate function execution has ended. + * HGLOG_OUT(); + * + * return 0; + * } + * @/code + */ + +#include +#include + +#include "hglogutils.h" + +#define HGLOG_API 0 +#define HGLOG_LOCAL 1 + +#define HGLOG_INFO 0 +#define HGLOG_WARNING 1 +#define HGLOG_ERROR 2 + +#define HGLOG_ASSERT(_assertion) __HGLOG_ASSERT_DBG(_assertion) +#define HGLOG_TRACE_ASSERT(_assertion) __ASSERT_DEBUG((_assertion), User::Invariant() ) + +#ifdef _DEBUG + +/***************************************************************************** + LOGGING MACROS - LOGGING ON +*****************************************************************************/ + + /** + * Context initialization + * NOTE: HGLOG_STATIC_CONTEXT is meant for static methods. + * + * @param _fn Name of the function. + * @param _vis Visibility for the client, use values HGLOG_API or HGLOG_LOCAL + * @param _thdId For static functions, thread id can be given here. + */ + #define HGLOG_CONTEXT(_fn, _vis ) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, (TUint)this, RProcess().SecureId().iId ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) _THgLogContext _dc((TText*)L ## #_fn, _HGLOG_LOG_COMPONENT_ID, _vis, _thdId, RProcess().SecureId().iId ) + + /** + * Entering function + * + * @param string Custom text. Example: HGLOG_IN0( "Yeah!!!" ); + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG_IN() do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG0_IN(string) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_ENTRY(); } while(0) + #define HGLOG1_IN(string, p1) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_ENTRY(); } while(0) + #define HGLOG2_IN(string, p1, p2) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_ENTRY(); } while(0) + #define HGLOG3_IN(string, p1, p2, p3) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_ENTRY(); } while(0) + #define HGLOG4_IN(string, p1, p2, p3, p4) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_ENTRY(); } while(0) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) do { _CHK_MULTIIN(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]>%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_ENTRY(); } while(0) + + /** Leaving function */ + #define HGLOG_OUT() do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s "), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG0_OUT(string) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); _MARK_EXIT(); } while(0) + #define HGLOG1_OUT(string, p1) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); _MARK_EXIT(); } while(0) + #define HGLOG2_OUT(string, p1, p2) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); _MARK_EXIT(); } while(0) + #define HGLOG3_OUT(string, p1, p2, p3) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); _MARK_EXIT(); } while(0) + #define HGLOG4_OUT(string, p1, p2, p3, p4) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); _MARK_EXIT(); } while(0) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## string), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0) + + /** Leaving function with return value */ + #define HGLOG0_RET(val, fmtstr) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG1_RET(val, fmtstr, p1) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG2_RET(val, fmtstr, p1, p2) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4); _MARK_EXIT(); } while(0); return val;} while(0) + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) do { do { _DOINCHK(); _CHK_MULTIOUT(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s " L ## fmtstr), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, val, p1, p2, p3, p4, p5); _MARK_EXIT(); } while(0); return val;} while(0) + + /** + * General log lines + * + * @param level This can be used as internal information + * field, such as info, error, warning etc. + * @param string Custom string + * @param p1 - p5 For multiple variables in same string. + */ + #define HGLOG0(level, string) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn); } while(0) + #define HGLOG1(level, string, p1) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1); } while(0) + #define HGLOG2(level, string, p1, p2) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2); } while(0) + #define HGLOG3(level, string, p1, p2, p3) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3); } while(0) + #define HGLOG4(level, string, p1, p2, p3, p4) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4); } while(0) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) do { _DOINCHK(); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]%s " L ## string), _dc.iVis, level, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, p1, p2, p3, p4, p5); } while(0) + + /** Error logging */ + #define __HGLOG_ASSERT_DBG( _assertion ) do { if( _assertion ) { break; } TFileName file; file.Copy( _L8( __FILE__ ) ); _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s Assert:%S:%d:" L ## #_assertion) , _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, &file, __LINE__ ); User::Invariant(); } while( 0 ) + #define __HGLOG_TRACE_ASSERT_DBG(_assertion, _textToPrint, _panicCode) do { if (_assertion) { break; } _HGLOGPRINTER(_IT(L ## "%s%d[%x:%x:%x]<%s ASSERTION FAILED!!! %s file: %s, line: %s"), _dc.iVis, _dc.iCategory, _dc.iId, _dc.iThdId, _dc.iAddr, _dc.iFn, _textToPrint, __FILE__, __LINE__); User::Panic(_L("AssertionFailed"), _panicCode} while(0) + #define HGLOG_TRAPHANDLER() _THgLogTrapHandler _traceTrapHandler; _traceTrapHandler.oldHandler = User::SetTrapHandler(&_traceTrapHandler) + +/***************************************************************************** + LOGGING MACROS - NO LOGGING +*****************************************************************************/ +#else // _DEBUG + + #define HGLOG_CONTEXT(_fn, _vis ) + #define HGLOG_STATIC_CONTEXT(_fn, _vis, _thdId) + + #define HGLOG_IN() + #define HGLOG0_IN(string) + #define HGLOG1_IN(string, p1) + #define HGLOG2_IN(string, p1, p2) + #define HGLOG3_IN(string, p1, p2, p3) + #define HGLOG4_IN(string, p1, p2, p3, p4) + #define HGLOG5_IN(string, p1, p2, p3, p4, p5) + + #define HGLOG_OUT() + #define HGLOG0_OUT(string) + #define HGLOG1_OUT(string, p1) + #define HGLOG2_OUT(string, p1, p2) + #define HGLOG3_OUT(string, p1, p2, p3) + #define HGLOG4_OUT(string, p1, p2, p3, p4) + #define HGLOG5_OUT(string, p1, p2, p3, p4, p5) + + #define HGLOG0_RET(val, fmtstr) return val + #define HGLOG1_RET(val, fmtstr, p1) return val + #define HGLOG2_RET(val, fmtstr, p1, p2) return val + #define HGLOG3_RET(val, fmtstr, p1, p2, p3) return val + #define HGLOG4_RET(val, fmtstr, p1, p2, p3, p4) return val + #define HGLOG5_RET(val, fmtstr, p1, p2, p3, p4, p5) return val + + #define HGLOG0(level, string) + #define HGLOG1(level, string, p1) + #define HGLOG2(level, string, p1, p2) + #define HGLOG3(level, string, p1, p2, p3) + #define HGLOG4(level, string, p1, p2, p3, p4) + #define HGLOG5(level, string, p1, p2, p3, p4, p5) + + #define BIND_TRACE_TRAPHANDLER() + #define TRACE_DECL() TInt _iTraceThreadId + #define TRACE_FAST_CREATE(_thdId) _thdId++; + #define TRACE_CREATE() + + #define __HGLOG_ASSERT_DBG(_assertion) + #define __TRACE_ASSERT_DBG(_assertion, _message, _panicCode ) + +#endif // _DEBUG + +#endif // HGLOGLOGUTILS_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 contextutility/inc/hglogutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/inc/hglogutils.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,211 @@ +/* +* 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: Logging utils +* +*/ + + +#ifndef HGLOGUTILS_H +#define HGLOGUTILS_H + +/** + * NOTE: This file contains the logic related to logging. Change only if you + * know what you're doing. + */ + + + + + + + + + + +#ifdef _DEBUG + +#include +#include + +static const TUint HGLOGERR = 2; /**< Used to create an error message */ + +// These macros are real macros, that should be used. For temporary purposes, these +// are left out and the logging is done by simple entry logging +#define _HGLOG_UNCONTROLLED_INPUT_MSG L"%s%d[%x:%x:%x]>%s UNCONTROLLED ENTRY!" +#define _HGLOG_MULTIPLE_ENTRY_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL ENTRY!" +#define _HGLOG_UNCONTROLLER_EXIT_MSG L"%s%d[%x:%x:%x]<%s UNCONTROLLED EXIT!" +#define _HGLOG_MULTIPLE_EXIT_MSG L"%s%d[%x:%x:%x]%s ADDITIONAL EXIT!" +#define _HGLOG_TRAP_HARNESS_ENTRY L"_D%d[%x:%x:%x]TraceFramework: Entering trap harness" +#define _HGLOG_TRAP_HARNESS_EXIT L"_D%d[%x:%x:%x]TraceFramework: Exiting trap harness" +#define _HGLOG_TRAP_HARNESS_LEAVE L"_D%d[%x:%x:%x]TraceFramework: ---------- LEAVE OCCURRED !!! ---------- " +#define _HGLOG_API_PREFIX L"_A" +#define _HGLOG_LOCAL_PREFIX L"_L" + +/** +* @file +* trace_utils.h contains definitions needed for advanced tracing features. +* Tracing can be customized using the following compile time flags: +* - _DEBUG +* - With this flag undefined, all traces are disabled +* - __KERNEL_MODE__ +* - if kernel mode flag is defined, kernel macro variants are used (no unicode or shared heap related stuff, faster) +* - DISABLE_SYNTAX_CHECK +* - If this flag is defined, runtime syntax checking features are disabled from traces +*/ +#ifndef DISABLE_SYNTAX_CHECK + #define _MARK_ENTRY() _dc.inOk=ETrue + #define _DOINCHK() _dc.DoInChk() + #define _CHK_MULTIIN() _dc.ChkMultiIn() + #define _CHK_MULTIOUT() _dc.ChkMultiOut() + #define _MARK_EXIT() _dc.outOk=ETrue +#else + #define _MARK_ENTRY() + #define _DOINCHK() + #define _CHK_MULTIIN() + #define _CHK_MULTIOUT() + #define _MARK_EXIT() +#endif // DISABLE_SYNTAX_CHECK + +/** For tracing */ +#ifdef _HGLOG_RDEBUG + #define _IT(a) (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RDebug::Print + +/** For filedebug */ +#else // _HGLOG_RDEBUG + + /** Includes */ + #include + #include + #include + #include + +// both of headers defines KLogBufferSize +#ifndef __COMMSDEBUGUTILITY_H__ + #include +#endif + + #define _IT(a) KHgLogPath, KHgLogFile, EFileLoggingModeAppend, (TPtrC((const TText *)(a))) + #define _HGLOGPRINTER RFileLogger::WriteFormat +#endif // _HGLOG_RDEBUG + +class _THgLogContext + { + public: + _THgLogContext( + const TText* _fn, + const TUint _id, + const TUint _vis, + const TUint _addr, + const TUint _thdId, + const TUint _category=0 ) + : + iFn(_fn), + iId(_id), + iApi((TBool)_vis), + iAddr(_addr), + iThdId(_thdId), + iVis((_vis == 0 ? (TText*)_HGLOG_API_PREFIX : (TText*)_HGLOG_LOCAL_PREFIX)), + iCategory(_category) + #ifndef DISABLE_SYNTAX_CHECK + ,outOk(EFalse), inOk(EFalse) + #endif + { + } + ~_THgLogContext() + { + #ifndef DISABLE_SYNTAX_CHECK + do + { + DoInChk(); + if (!outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLER_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } while (0); + #endif // DISABLE_SYNTAX_CHECK + } + + const TText* iFn; + const TUint iId; + const TText* iVis; + const TUint iAddr; + const TInt iThdId; + const TBool iApi; + const TUint iCategory; + + #ifndef DISABLE_SYNTAX_CHECK + inline void DoInChk() + { + if (!inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_UNCONTROLLED_INPUT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + inOk = ETrue; + } + } + + inline void ChkMultiIn() + { + if (inOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_ENTRY_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + inline void ChkMultiOut() + { + if (outOk) + { + _HGLOGPRINTER(_IT(_HGLOG_MULTIPLE_EXIT_MSG), iVis, iCategory, iId, iThdId, iAddr, iFn); + } + } + + TBool inOk; + TBool outOk; + #endif // DISABLE_SYNTAX_CHECK + }; + +class _THgLogTrapHandler: public TTrapHandler + { + public: + + _THgLogTrapHandler(_THgLogContext& _context) : _dc( _context ) + { + RThread me; + iThdId = (TInt)me.Id(); + } + void Trap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_ENTRY), 0, HGLOGERR, iThdId, this); + oldHandler->Trap(); + } + void UnTrap() + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_EXIT), 0, HGLOGERR, iThdId, this); + oldHandler->UnTrap(); + } + void Leave(TInt aValue) + { + _HGLOGPRINTER(_IT(_HGLOG_TRAP_HARNESS_LEAVE), 0, HGLOGERR, iThdId, this); + oldHandler->Leave(aValue); + } + TTrapHandler* oldHandler; + private: + _THgLogContext& _dc; + TInt iThdId; + }; + +#endif // _DEBUG + +#endif // HGLOGUTILS_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 contextutility/rom/hgcontextutility.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/rom/hgcontextutility.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Iby file +* +*/ + + +#ifndef HGCONTEXTUTILITY_IBY +#define HGCONTEXTUTILITY_IBY + +#include + +file=ABI_DIR\BUILD_DIR\hgcontextutility.dll SHARED_LIB_DIR\hgcontextutility.dll + +#endif // HGCONTEXTUTILITY_IBY diff -r 000000000000 -r 79c6a41cd166 contextutility/src/hgcontextutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/src/hgcontextutility.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,281 @@ +/* +* 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: Context publishing helper dll +* +*/ + + +#include +#include "hgcontextutilityimpl.h" + +// ----------------------------------------------------------------------------- +// CHgContextUtility::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CHgContextUtility* CHgContextUtility::NewL() + { + CHgContextUtility* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CHgContextUtility* CHgContextUtility::NewLC() + { + CHgContextUtility* self = new ( ELeave ) CHgContextUtility; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::CHgContextUtility +// ----------------------------------------------------------------------------- +// +CHgContextUtility::CHgContextUtility() + { + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgContextUtility::ConstructL() + { + BaseConstructL(); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::~CHgContextUtility +// ----------------------------------------------------------------------------- +// +EXPORT_C CHgContextUtility::~CHgContextUtility() + { + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const MVPbkStoreContact& aContact, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContact, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const MVPbkContactLink& aContactLink, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContactLink, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const TDesC& aContactName, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContactName, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const RPointerArray& aContacts, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContacts, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const CVPbkContactLinkArray& aContactLinks, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContactLinks, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishContactContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishContactContextL( + const MDesCArray& aContactNames, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContactContextL( aContactNames, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishTextContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishTextContextL( const TDesC& aText, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishTextContextL( aText, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishUrlContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishUrlContextL( const TDesC& aUrl, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishUrlContextL( aUrl, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishTimeContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishTimeContextL( const TTime& aTime, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishTimeContextL( aTime, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishPhotoContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishPhotoContextL( + const TDesC& aFilename, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishPhotoContextL( aFilename, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishPhotoContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishPhotoContextL( + TItemId aMdeItemId, + CMdESession& aMdeSession, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishPhotoContextL( aMdeItemId, aMdeSession, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishTvContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishTvContextL( const TDesC& aChannelName, + const TDesC& aProgramName, const TDesC& aProgramDescription, + const TDesC& aGenre ) + { + iImpl->PublishTvContextL( aChannelName, aProgramName, + aProgramDescription, aGenre ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishServiceIdL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishServiceIdL( const TDesC& aServiceId, + const TDesC& aAccountId, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishServiceIdL( aServiceId, aAccountId, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::RePublishWhenFgL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::RePublishWhenFgL( TBool aEnable ) + { + iImpl->RePublishWhenFgL( aEnable ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::AllowPublishFromBackground +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::AllowPublishFromBackground( TBool aAllow ) + { + iImpl->AllowPublishFromBackground( aAllow ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::AddMusicContextInfoL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::AddMusicContextInfoL( + const TDesC& aKey, const TDesC& aData ) + { + iImpl->AddMusicContextInfoL( aKey, aData ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishMusicContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishMusicContextL( + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishMusicContextL( aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::PublishRadioContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtility::PublishRadioContextL( + const TDesC& aRadioName, + const TDesC& aRadioUrl, + const TDesC& aRadioFrequency, + const TDesC& aRadioRDSPI ) + { + iImpl->PublishRadioContextL( aRadioName, aRadioUrl, + aRadioFrequency, aRadioRDSPI ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtility::BuildCombinedStringL +// ----------------------------------------------------------------------------- +EXPORT_C HBufC* CHgContextUtility::BuildCombinedStringL( const MDesCArray& aArray ) +{ + return CHgContextUtilityImpl::BuildCombinedStringL(aArray); +} + +// ----------------------------------------------------------------------------- +// CHgContextUtility::SplitCombinedStringL +// ----------------------------------------------------------------------------- +EXPORT_C void CHgContextUtility::SplitCombinedStringL( const TDesC& aString, + CDesCArray& aArray ) +{ + CHgContextUtilityImpl::SplitCombinedStringL(aString, aArray); +} +// +// end of file diff -r 000000000000 -r 79c6a41cd166 contextutility/src/hgcontextutilitybase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/src/hgcontextutilitybase.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Context publishing helper dll +* +*/ + + +#include +#include "hgcontextutilityimpl.h" + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::CHgContextUtilityBase +// ----------------------------------------------------------------------------- +// +CHgContextUtilityBase::CHgContextUtilityBase() + { + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::BaseConstructL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityBase::BaseConstructL() + { + iImpl = CHgContextUtilityImpl::NewL(); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::~CHgContextUtilityBase +// ----------------------------------------------------------------------------- +// +CHgContextUtilityBase::~CHgContextUtilityBase() + { + delete iImpl; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::PublishContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType, + const TDesC& aContextData ) + { + iImpl->PublishContextL( aContextType, aContextData ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::PublishContextL +// Array version +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtilityBase::PublishContextL( const TDesC& aContextType, + const MDesCArray& aContextData ) + { + iImpl->PublishContextL( aContextType, aContextData ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::GetContextL +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextSource, + const TDesC& aContextType ) + { + return iImpl->GetContextL( aContextSource, aContextType ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::GetContextL +// Version using a fixed context source +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC* CHgContextUtilityBase::GetContextL( const TDesC& aContextType ) + { + return iImpl->GetContextL( aContextType ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::PublishContextDelayedL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL( + const TDesC& aContextType, + const TDesC& aContextData, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityBase::PublishContextDelayedL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CHgContextUtilityBase::PublishContextDelayedL( + const TDesC& aContextType, + const MDesCArray& aContextData, + const TTimeIntervalMicroSeconds32& aDelay ) + { + iImpl->PublishContextDelayedL( aContextType, aContextData, aDelay ); + } + + +// end of file diff -r 000000000000 -r 79c6a41cd166 contextutility/src/hgcontextutilityimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contextutility/src/hgcontextutilityimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,972 @@ +/* +* 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: Context publishing helper dll +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "hgcontextutilityimpl.h" +#include "hgcontexttypes.h" + +// max number of entries processed when aContextData is an array in PublishContextL +const TInt KMaxEntriesInMulti = 20; + +// separator character in combined string for multiple entries +const TInt KMultiSepChar = 0x0001; + +// granularity for string array +const TInt KArrayGranularity = 4; + +// argument for CBufFlat ctor when serializing contact links +const TInt KBufGranularity = 64; + +// default security policy (use LocalServices cap) for contexts +_LIT_SECURITY_POLICY_C1( KContextSecurity, ECapabilityLocalServices ); + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::NewL +// ----------------------------------------------------------------------------- +// +CHgContextUtilityImpl* CHgContextUtilityImpl::NewL() + { + CHgContextUtilityImpl* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::NewLC +// ----------------------------------------------------------------------------- +// +CHgContextUtilityImpl* CHgContextUtilityImpl::NewLC() + { + CHgContextUtilityImpl* self = new ( ELeave ) CHgContextUtilityImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::CHgContextUtilityImpl +// ----------------------------------------------------------------------------- +// +CHgContextUtilityImpl::CHgContextUtilityImpl() + : CTimer( CActive::EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::ConstructL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::ConstructL() + { + CTimer::ConstructL(); + + iEnv = CCoeEnv::Static(); // may be NULL + + // Do not create iCFClient here as cf server may not be available yet + // if we are early in the boot phase. + + // set defaults + RePublishWhenFgL( EFalse ); + AllowPublishFromBackground( EFalse ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::~CHgContextUtilityImpl +// ----------------------------------------------------------------------------- +// +CHgContextUtilityImpl::~CHgContextUtilityImpl() + { + Cancel(); + delete iPendingContextType; + delete iPendingContextData; + delete iPendingContextDataArray; + delete iCFClient; + delete iLastContextType; + delete iLastContextData; + if ( iFgWatchEnabled && iEnv ) + { + iEnv->RemoveForegroundObserver( *this ); + } + + iMusicContextInfo.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::CFReady +// ----------------------------------------------------------------------------- +// +TBool CHgContextUtilityImpl::CFReady() + { + if ( !iCFClient ) + { + TRAPD( err, iCFClient = CCFClient::NewL( *this ) ); + if ( err != KErrNone ) + { + RDebug::Printf( "[hgctxutil] cfw not ready" ); + return EFalse; + } + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextL +// All other non-static versions of this function will fall back to this one. +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType, + const TDesC& aContextData ) + { + RDebug::Print( _L("[hgctxutil] PublishContextL [%S] [%S]"), + &aContextType, &aContextData ); + // create cf client instance if not yet done + // and check foreground status if needed + if ( CFReady() && AllowedToPublish() ) + { + // call static version with our cf client instance + PublishContextL( *iCFClient, aContextType, aContextData ); + } + // store type and value for later use + // (even when cfserver is not available yet, the data may still be + // used later when the app comes to foreground, for example) + if ( iLastContextType != &aContextType ) + { + delete iLastContextType; iLastContextType = 0; + iLastContextType = aContextType.AllocL(); + } + if ( iLastContextData != &aContextData ) + { + delete iLastContextData; iLastContextData = 0; + iLastContextData = aContextData.AllocL(); + } + } + +// ----------------------------------------------------------------------------- +// AppendCharL +// Appends a char to aDst, calls ReAllocL when needed, assumes that aDst +// is also on cleanupstack (at top position) so it updates that pointer too. +// ----------------------------------------------------------------------------- +// +LOCAL_C void AppendCharL( HBufC*& aDst, TChar aChar ) + { + TPtr des( aDst->Des() ); + if ( des.Length() == des.MaxLength() ) + { + HBufC* oldDst = aDst; + aDst = aDst->ReAllocL( des.MaxLength() * 2 ); + CleanupStack::Pop( oldDst ); // pop the old pointer + CleanupStack::PushL( aDst ); // and push the new (possibly different) one + des.Set( aDst->Des() ); + } + des.Append( aChar ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::BuildCombinedStringL +// ----------------------------------------------------------------------------- +// +HBufC* CHgContextUtilityImpl::BuildCombinedStringL( + const MDesCArray& aArray ) + { + TInt arrayCount = aArray.MdcaCount(); + if ( arrayCount >= 2 ) + { + // Rules: + // 1. escape all separator chars in the input with a preceeding \ + // 2. escape all \ chars in the input with \\ + // 3. take only the first KMaxEntriesInMulti elements from the array + // 4. append a separator also after last entry + // 5. prepend two separators to the combined string + TInt processedEntryCount = Min( arrayCount, KMaxEntriesInMulti ); + // calculate a big enough size so we can avoid ReAllocL calls later + TInt sz = 0; + for ( TInt i = 0; i < processedEntryCount; ++i ) + { + sz += aArray.MdcaPoint( i ).Length() + 1; + } + sz += 2; // for the magic prefix + HBufC* value = HBufC::NewLC( sz ); + AppendCharL( value, KMultiSepChar ); + AppendCharL( value, KMultiSepChar ); + for ( TInt i = 0; i < processedEntryCount; ++i ) + { + TPtrC entry( aArray.MdcaPoint( i ) ); + // append, also do the escaping + for ( TInt j = 0, je = entry.Length(); j != je; ++j ) + { + TChar c = entry[j]; + if ( c == KMultiSepChar || c == '\\' ) + { + AppendCharL( value, '\\' ); + } + AppendCharL( value, c ); + } + AppendCharL( value, KMultiSepChar ); + } + CleanupStack::Pop( value ); + return value; + } + return 0; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::SplitCombinedStringL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::SplitCombinedStringL( + const TDesC& aString, CDesCArray& aArray ) + { + TInt inputLength = aString.Length(); + TBool isMulti = inputLength > 2 + && aString[0] == KMultiSepChar && aString[1] == KMultiSepChar; + if ( isMulti ) + { + // allocate a work buffer that is big enough for sure + HBufC* buf = HBufC::NewLC( inputLength ); + TPtr des( buf->Des() ); + TBool esc = EFalse; + // go through the string, find entries, and add them to output array + for ( TInt i = 2; i < inputLength; ++i ) // start from 2 because of the magic prefix + { + TChar c = aString[i]; + if ( c == '\\' && !esc ) + { + esc = ETrue; + } + else if ( c == KMultiSepChar && !esc ) + { + // found separator: append to output array, clear buffer, and continue + aArray.AppendL( des ); + des.Zero(); + } + else + { + esc = EFalse; + des.Append( c ); + } + } + CleanupStack::PopAndDestroy( buf ); + } + else + { + // not a combined string: append to array as it is + aArray.AppendL( aString ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextL( const TDesC& aContextType, + const MDesCArray& aContextData ) + { + TInt entryCount = aContextData.MdcaCount(); + // do nothing if array is empty + if ( !entryCount ) + { + return; + } + // nothing special when having only 1 item + if ( entryCount == 1 ) + { + PublishContextL( aContextType, aContextData.MdcaPoint( 0 ) ); + return; + } + // at least two items: create the special combined string + HBufC* value = BuildCombinedStringL( aContextData ); + CleanupStack::PushL( value ); + // publish the combined string + PublishContextL( aContextType, *value ); + CleanupStack::PopAndDestroy( value ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextL +// This is the version of the function where the real work is performed. +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextL( CCFClient& aCFClient, + const TDesC& aContextType, const TDesC& aContextData ) + { + CCFContextObject* context = CCFContextObject::NewLC(); + context->SetSourceL( KHgCFSource ); + context->SetTypeL( aContextType ); + context->SetValueL( aContextData ); + TInt err = aCFClient.PublishContext( *context ); + if ( err == KErrNotFound ) + { + User::LeaveIfError( aCFClient.DefineContext( KHgCFSource, + aContextType, KContextSecurity ) ); + err = aCFClient.PublishContext( *context ); + if ( err != KErrArgument ) // ignore -6 which comes e.g. when trying to publish an empty value + { + User::LeaveIfError( err ); + } + } + else if ( err != KErrArgument ) + { + User::LeaveIfError( err ); + } + CleanupStack::PopAndDestroy( context ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::GetContextL +// ----------------------------------------------------------------------------- +// +HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextSource, + const TDesC& aContextType ) + { + HBufC* ret = 0; + if ( CFReady() ) + { + CCFContextQuery* query = CCFContextQuery::NewLC(); + query->SetSourceL( aContextSource ); + query->SetTypeL( aContextType ); + RContextObjectArray result; + TInt err = iCFClient->RequestContext( *query, result ); + if ( err == KErrNone && result.Count() ) + { + ret = result[0]->Value().Alloc(); + } + result.ResetAndDestroy(); + CleanupStack::PopAndDestroy( query ); + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::GetContextL +// ----------------------------------------------------------------------------- +// +HBufC* CHgContextUtilityImpl::GetContextL( const TDesC& aContextType ) + { + return GetContextL( KHgCFSource, aContextType ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextDelayedL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType, + const TDesC& aContextData, TTimeIntervalMicroSeconds32 aDelay ) + { + Cancel(); + delete iPendingContextType; iPendingContextType = 0; + iPendingContextType = aContextType.AllocL(); + delete iPendingContextData; iPendingContextData = 0; + iPendingContextData = aContextData.AllocL(); + delete iPendingContextDataArray; iPendingContextDataArray = 0; + After( aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextDelayedL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextDelayedL( const TDesC& aContextType, + const MDesCArray& aContextData, TTimeIntervalMicroSeconds32 aDelay ) + { + Cancel(); + delete iPendingContextType; iPendingContextType = 0; + iPendingContextType = aContextType.AllocL(); + delete iPendingContextData; iPendingContextData = 0; + if ( iPendingContextDataArray ) + { + iPendingContextDataArray->Reset(); + } + else + { + iPendingContextDataArray = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); + } + for ( TInt i = 0, ie = aContextData.MdcaCount(); i != ie; ++i ) + { + iPendingContextDataArray->AppendL( aContextData.MdcaPoint( i ) ); + } + After( aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::RunL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::RunL() + { + if ( iPendingContextType ) + { + if ( iPendingContextData ) + { + PublishContextL( *iPendingContextType, *iPendingContextData ); + } + else if ( iPendingContextDataArray ) + { + PublishContextL( *iPendingContextType, *iPendingContextDataArray ); + } + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::RunError +// ----------------------------------------------------------------------------- +// +TInt CHgContextUtilityImpl::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// empty implementations for cfw + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::ContextIndicationL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::ContextIndicationL( + const CCFContextIndication& /*aChangedContext*/ ) + { + // empty + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::ActionIndicationL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::ActionIndicationL( + const CCFActionIndication& /*aActionToExecute*/ ) + { + // empty + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::HandleContextFrameworkError +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::HandleContextFrameworkError( TCFError /*aError*/, + const TDesC& /*aSource*/, + const TDesC& /*aType*/ ) + { + // empty + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::Extension +// ----------------------------------------------------------------------------- +// +TAny* CHgContextUtilityImpl::Extension( const TUid& /*aExtensionUid*/ ) const + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::MakeLinkPublishableLC +// ----------------------------------------------------------------------------- +// +HBufC* CHgContextUtilityImpl::MakeLinkPublishableLC( + const MVPbkContactLink& aLink ) + { + HBufC* ret = 0; + // serialize the link and place it into a 16-bit descriptor + // prefixed with one special mark character + const MVPbkStreamable* strm = aLink.Streamable(); + User::LeaveIfNull(strm); + CBufFlat* buf = CBufFlat::NewL( KBufGranularity ); + CleanupStack::PushL( buf ); + RBufWriteStream ws; + CleanupClosePushL( ws ); + ws.Open( *buf ); + strm->ExternalizeL( ws ); + CleanupStack::PopAndDestroy( &ws ); + TPtr8 p( buf->Ptr( 0 ) ); + ret = HBufC::NewLC( p.Length() + 1 ); + TPtr des( ret->Des() ); + des.Copy( p ); + _LIT( KTemp, " " ); + des.Insert( 0, KTemp ); + des[0] = KHgCFValueLinkMarker; // codescanner::accessArrayElementWithoutCheck2 + CleanupStack::Pop( ret ); + CleanupStack::PopAndDestroy( buf ); + CleanupStack::PushL( ret ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const MVPbkStoreContact& aContact, + const TTimeIntervalMicroSeconds32& aDelay ) + { + MVPbkContactLink* link = aContact.CreateLinkLC(); + if ( link ) + { + HBufC* pubstr = MakeLinkPublishableLC( *link ); + PublishContactContextL( *pubstr, aDelay ); + CleanupStack::PopAndDestroy( pubstr ); + } + CleanupStack::PopAndDestroy( );//link + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const MVPbkContactLink& aContactLink, + const TTimeIntervalMicroSeconds32& aDelay ) + { + HBufC* pubstr = MakeLinkPublishableLC( aContactLink ); + PublishContactContextL( *pubstr, aDelay ); + CleanupStack::PopAndDestroy( pubstr ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const TDesC& aContactName, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypeContact, aContactName ); + } + else + { + PublishContextDelayedL( KHgCFTypeContact, aContactName, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const RPointerArray& aContacts, + const TTimeIntervalMicroSeconds32& aDelay ) + { + CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); + CleanupStack::PushL( arr ); + for ( TInt i = 0, ie = aContacts.Count(); i != ie; ++i ) + { + MVPbkContactLink* link = aContacts[i]->CreateLinkLC(); + if ( link ) + { + HBufC* pubstr = MakeLinkPublishableLC( *link ); + arr->AppendL( *pubstr ); + CleanupStack::PopAndDestroy( pubstr ); + } + CleanupStack::PopAndDestroy( );//link + } + PublishContactContextL( *arr, aDelay ); + CleanupStack::PopAndDestroy( arr ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const CVPbkContactLinkArray& aContactLinks, + const TTimeIntervalMicroSeconds32& aDelay ) + { + CDesCArray* arr = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); + CleanupStack::PushL( arr ); + for ( TInt i = 0, ie = aContactLinks.Count(); i != ie; ++i ) + { + HBufC* pubstr = MakeLinkPublishableLC( aContactLinks.At( i ) ); + arr->AppendL( *pubstr ); + CleanupStack::PopAndDestroy( pubstr ); + } + PublishContactContextL( *arr, aDelay ); + CleanupStack::PopAndDestroy( arr ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContactContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContactContextL( + const MDesCArray& aContactNames, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypeContact, aContactNames ); + } + else + { + PublishContextDelayedL( KHgCFTypeContact, aContactNames, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishTextContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishTextContextL( const TDesC& aText, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypeText, aText ); + } + else + { + PublishContextDelayedL( KHgCFTypeText, aText, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishUrlContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishUrlContextL( const TDesC& aUrl, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypeUrl, aUrl ); + } + else + { + PublishContextDelayedL( KHgCFTypeUrl, aUrl, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishTimeContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishTimeContextL( const TTime& aTime, + const TTimeIntervalMicroSeconds32& aDelay ) + { + // YYYYMMDD:HHMMSS.MMMMMM + const TInt KDateTimeLength = 22; + const TInt KYearLength = 4; + const TInt KMonthLength = 2; + const TInt KDayLength = 2; + _LIT( KTimeZero, ":010101.000000"); + + TDateTime dt = aTime.DateTime(); + TBuf buf; + buf.AppendNumFixedWidth( dt.Year(), EDecimal, KYearLength ); + buf.AppendNumFixedWidth( dt.Month(), EDecimal, KMonthLength ); + buf.AppendNumFixedWidth( dt.Day(), EDecimal, KDayLength ); + buf.Append( KTimeZero ); + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypeActiveDate, buf ); + } + else + { + PublishContextDelayedL( KHgCFTypeActiveDate, buf, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishPhotoContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishPhotoContextL( + const TDesC& aFilename, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( KHgCFTypePhoto, aFilename ); + } + else + { + PublishContextDelayedL( KHgCFTypePhoto, aFilename, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishPhotoContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishPhotoContextL( + TItemId aMdeItemId, + CMdESession& aMdeSession, + const TTimeIntervalMicroSeconds32& aDelay ) + { + CMdEObject* obj = aMdeSession.GetObjectL( aMdeItemId ); + if ( obj ) + { + CleanupStack::PushL( obj ); + PublishPhotoContextL( obj->Uri(), aDelay ); + CleanupStack::PopAndDestroy( obj ); + } + else + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishTvContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishTvContextL( const TDesC& aChannelName, + const TDesC& aProgramName, const TDesC& aProgramDescription, + const TDesC& aGenre ) + { + TPtrC channelName( aChannelName.Length() ? aChannelName + : KHgCFValueUnknownInfo ); + TPtrC programName( aProgramName.Length() ? aProgramName + : KHgCFValueUnknownInfo ); + TPtrC programDesc( aProgramDescription.Length() ? aProgramDescription + : KHgCFValueUnknownInfo ); + TPtrC programGenre( aGenre.Length() ? aGenre : KHgCFValueUnknownInfo ); + + // Publish description/genre first because it is unlikely to have those + // in rules so their content will be available for sure when an action + // is triggered. + PublishContextL( KHgCFTypeTvProgramDesc, programDesc ); + PublishContextL( KHgCFTypeTvProgramGenre, programGenre ); + PublishContextL( KHgCFTypeTvChannelName, channelName ); + PublishContextL( KHgCFTypeTvProgramName, programName ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishServiceIdL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishServiceIdL( const TDesC& aServiceId, + const TDesC& aAccountId, + const TTimeIntervalMicroSeconds32& aDelay ) + { + HBufC* combinedIdBuf = HBufC::NewLC( aServiceId.Length() + + aAccountId.Length() + 1 ); + TPtr combinedId( combinedIdBuf->Des() ); + _LIT( KCombinedFormat, "%S:%S" ); + combinedId.Format( KCombinedFormat, &aServiceId, &aAccountId ); + PublishContactContextL( combinedId, aDelay ); + CleanupStack::PopAndDestroy( combinedIdBuf ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::RePublishWhenFgL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::RePublishWhenFgL( TBool aEnable ) + { + if ( iEnv ) + { + if ( iFgWatchEnabled ) + { + iEnv->RemoveForegroundObserver( *this ); + } + iFgWatchEnabled = aEnable; + if ( iFgWatchEnabled ) + { + iEnv->AddForegroundObserverL( *this ); + } + } + } + +// callbacks from CCoeEnv + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::HandleGainingForeground +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::HandleGainingForeground() + { + if ( iLastContextType && iLastContextData ) + { + TRAP_IGNORE( PublishContextL( *iLastContextType, *iLastContextData ) ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::HandleLosingForeground +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::HandleLosingForeground() + { + // nothing to do here + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::IsForeground +// ----------------------------------------------------------------------------- +// +TBool CHgContextUtilityImpl::IsForeground() + { + if ( iEnv ) + { + TInt rootWgId = iEnv->RootWin().WindowGroupId(); + TInt focusWgId = iEnv->WsSession().GetFocusWindowGroup(); + return rootWgId == focusWgId; + } + else + { + return ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::AllowedToPublish +// ----------------------------------------------------------------------------- +// +TBool CHgContextUtilityImpl::AllowedToPublish() + { + TBool result = !iEnv || iAllowPublishFromBackground || IsForeground(); + RDebug::Printf( "[hgctxutil] AllowedToPublish = %d", result ); + return result; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::AllowPublishFromBackground +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::AllowPublishFromBackground( TBool aAllow ) + { + iAllowPublishFromBackground = aAllow; + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::AddMusicContextInfoL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::AddMusicContextInfoL( + const TDesC& aKey, const TDesC& aData ) + { + // Key needs to be provided and also it shouldn't exist in the table. + // Latter case is simple safe measure, as RPtrHasMap won't delete existing + // objects in InsertL, so adding same key twice would cause memory leak. + // The use case of adding same key twice is not 'real world' case, so + // this method can simply leave, when same key is offered again. + __ASSERT_ALWAYS( aKey.Length(), User::Leave( KErrNotFound ) ); + __ASSERT_ALWAYS( + !iMusicContextInfo.Find( aKey ), User::Leave( KErrAlreadyExists ) ); + + // Hash table needs pointers and it should own the pointers, so allocate + // key and data, and add them to table. In case the data is empty, add + // unknown information, since some data needs to be in the action field. + HBufC* key = aKey.AllocLC(); + HBufC* data = aData.Length() ? + aData.AllocLC() : KHgCFValueUnknownInfo().AllocLC(); + iMusicContextInfo.InsertL( key, data ); + CleanupStack::Pop( 2, key ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishMusicContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishMusicContextL( + const TTimeIntervalMicroSeconds32& aDelay ) + { + // If nothing has been done, just leave. No point of publishing entirely + // empty music context. + __ASSERT_ALWAYS( iMusicContextInfo.Count(), User::Leave( KErrNotReady ) ); + + // Before publishing anything, make sure all keys contain at least some + // data. + VerifyAndPublishMusicContextL( KHgCFTypeMusicState, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicArtist, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicTitle, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbum, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicAlbumArt, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicUri, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicGenre, aDelay ); + VerifyAndPublishMusicContextL( KHgCFTypeMusicType, aDelay ); + + // Clear all data from hash table, so new music context can be published. + iMusicContextInfo.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::VerifyAndPublishMusicContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::VerifyAndPublishMusicContextL( + const TDesC& aKey, + const TTimeIntervalMicroSeconds32& aDelay ) + { + TDesC* data = iMusicContextInfo.Find( aKey ); + if ( !data ) + { + // Key didn't contain any data, just create the key with empty info. + AddMusicContextInfoL( aKey, KNullDesC ); + data = iMusicContextInfo.Find( aKey ); + } + + PublishContextL( aKey, *data, aDelay ); + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishContextL( + const TDesC & aContextType, + const TDesC & aContextData, + const TTimeIntervalMicroSeconds32& aDelay ) + { + if ( !aDelay.Int() ) + { + PublishContextL( aContextType, aContextData ); + } + else + { + PublishContextDelayedL( aContextType, aContextData, aDelay ); + } + } + +// ----------------------------------------------------------------------------- +// CHgContextUtilityImpl::PublishRadioContextL +// ----------------------------------------------------------------------------- +// +void CHgContextUtilityImpl::PublishRadioContextL( + const TDesC& aRadioName, + const TDesC& aRadioUrl, + const TDesC& aRadioFrequency, + const TDesC& aRadioRDSPI ) + { + TPtrC radioName( aRadioName.Length() ? aRadioName + : KHgCFValueUnknownInfo ); + TPtrC radioUrl( aRadioUrl.Length() ? aRadioUrl + : KHgCFValueUnknownInfo ); + TPtrC radioFrequency( aRadioFrequency.Length() ? aRadioFrequency + : KHgCFValueUnknownInfo ); + TPtrC radioRDSPI( aRadioRDSPI.Length() ? aRadioRDSPI + : KHgCFValueUnknownInfo ); + + PublishContextL( KHgCFTypeMusicRadioRDSPI, radioRDSPI ); + PublishContextL( KHgCFTypeMusicRadioFrequency, radioFrequency ); + PublishContextL( KHgCFTypeMusicRadioUrl, radioUrl ); + PublishContextL( KHgCFTypeMusicRadioName, radioName ); + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +PRJ_EXPORTS +../inc/aisystemuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aisystemuids.hrh) + +#include "../xcfw/group/bld.inf" +#include "../homescreenpluginsrv/group/bld.inf" +#include "../idlefw/group/bld.inf" +#include "../menucontentsrv/group/bld.inf" +#include "../backsteppingsrv/group/bld.inf" +#include "../contentpublishingsrv/group/bld.inf" +#include "../homescreensrv_plat/group/bld.inf" +#include "../contextutility/group/bld.inf" +#include "../contentcontrolsrv/group/bld.inf" + + diff -r 000000000000 -r 79c6a41cd166 group/robot_patch.zip Binary file group/robot_patch.zip has changed diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/conf/hsps.confml Binary file homescreenpluginsrv/conf/hsps.confml has changed diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/conf/hsps_200159c9.crml Binary file homescreenpluginsrv/conf/hsps_200159c9.crml has changed diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/group/200159c9.txt Binary file homescreenpluginsrv/group/200159c9.txt has changed diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,81 @@ +/* +* 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: Build information file for project Homescreenpluginservice (HSPS) +* +*/ + + +// Macro definitions +#include + +// Components +#include "../inc/hsps_builds_cfg.hrh" +#include "../hspsdefinitionengine/group/bld.inf" +#include "../hspsdom/group/bld.inf" + +#ifdef ____HSPS_CFG_LOG_ON____ +#include "../hspsTools/group/bld.inf" +#endif + +#include "../hspspluginregistry/group/bld.inf" +#include "../hspsmanager/group/bld.inf" +#include "../hspsodt/group/bld.inf" +#include "../hspsresource/group/bld.inf" +#include "../hspsresult/group/bld.inf" +#include "../homescreen_settings_api/group/bld.inf" +#ifdef _HSPS_AUTOINSTALL_TEST_THEMES_ +#include "../internal/testthemes/group/bld.inf" +#endif + + +PRJ_PLATFORMS +DEFAULT + +ARMV5 WINSCW + +PRJ_EXPORTS + +//200159c9.txt z:/private/10202be9/200159c9.txt + +../rom/hsps.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hsps.iby) + +#ifdef _HSPS_AUTOINSTALL_TEST_THEMES_ +../rom/hspstestconfigurations.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hspstestconfigurations.iby) +#endif + + +// Generic configuration interface for component cenrep settings +../conf/hsps.confml APP_LAYER_CONFML(hsps.confml) +../conf/hsps_200159c9.crml APP_LAYER_CRML(hsps_200159c9.crml) + + +// Exports for SAPI impl +../inc/hspsdomattribute.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomattribute.h) +../inc/mhspsdomlistitem.h MW_LAYER_PLATFORM_EXPORT_PATH(mhspsdomlistitem.h) +../inc/hspsdomlist.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomlist.h) +../inc/hspsdomdepthiterator.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomdepthiterator.h) +../inc/hspsdomnode.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomnode.h) +../inc/hspsdomdocument.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdomdocument.h) +../inc/hspsresource.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsresource.h) +../inc/mhspsdomiterator.h MW_LAYER_PLATFORM_EXPORT_PATH(mhspsdomiterator.h) +../inc/hspsthememanagement.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsthememanagement.h) +../inc/hspsclient.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsclient.h) +../inc/hspsrequestclient.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsrequestclient.h) +../inc/hspsodt.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsodt.h) +../inc/hspsclientsession.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsclientsession.h) +../inc/hspsresult.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsresult.h) +../inc/hspsreqnotifparam.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsreqnotifparam.h) +../inc/hspsdefinitionrepository.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsdefinitionrepository.h) + +PRJ_MMPFILES diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/bwins/hspluginsettings.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/bwins/hspluginsettings.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +EXPORTS + ?NewLC@CObjectMap@HSPluginSettingsIf@@SAPAV12@XZ @ 1 NONAME ; class HSPluginSettingsIf::CObjectMap * HSPluginSettingsIf::CObjectMap::NewLC(void) + ?NewLC@CPluginMap@HSPluginSettingsIf@@SAPAV12@XZ @ 2 NONAME ; class HSPluginSettingsIf::CPluginMap * HSPluginSettingsIf::CPluginMap::NewLC(void) + ?SetPluginUidL@CPluginMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 3 NONAME ; class HSPluginSettingsIf::CPluginMap & HSPluginSettingsIf::CPluginMap::SetPluginUidL(class TDesC8 const &) + ?NewL@CItemMap@HSPluginSettingsIf@@SAPAV12@XZ @ 4 NONAME ; class HSPluginSettingsIf::CItemMap * HSPluginSettingsIf::CItemMap::NewL(void) + ?NewLC@CHomescreenSettings@HSPluginSettingsIf@@SAPAV12@ABVTDesC8@@0PAVMHomeScreenSettingsObserver@2@@Z @ 5 NONAME ; class HSPluginSettingsIf::CHomescreenSettings * HSPluginSettingsIf::CHomescreenSettings::NewLC(class TDesC8 const &, class TDesC8 const &, class HSPluginSettingsIf::MHomeScreenSettingsObserver *) + ?Name@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 6 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Name(void) const + ??1CItemMap@HSPluginSettingsIf@@UAE@XZ @ 7 NONAME ; HSPluginSettingsIf::CItemMap::~CItemMap(void) + ?NewLC@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 8 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewLC(void) + ?AddObjectMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCObjectMap@2@@Z @ 9 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddObjectMapL(class HSPluginSettingsIf::CObjectMap *) + ?Value@CPropertyMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 10 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPropertyMap::Value(void) const + ?PluginInfo@CHspsConfiguration@HSPluginSettingsIf@@QAEAAVCPluginInfo@2@XZ @ 11 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CHspsConfiguration::PluginInfo(void) + ?ItemName@CItemMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 12 NONAME ; class TDesC8 const & HSPluginSettingsIf::CItemMap::ItemName(void) const + ?Settings@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@XZ @ 13 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::Settings(void) + ??1CPluginInfo@HSPluginSettingsIf@@UAE@XZ @ 14 NONAME ; HSPluginSettingsIf::CPluginInfo::~CPluginInfo(void) + ?ItemId@CItemMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 15 NONAME ; class TDesC8 const & HSPluginSettingsIf::CItemMap::ItemId(void) const + ?SetConfigurationStateL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 16 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetConfigurationStateL(class TDesC8 const &) + ?NewLC@CPluginInfo@HSPluginSettingsIf@@SAPAV12@XZ @ 17 NONAME ; class HSPluginSettingsIf::CPluginInfo * HSPluginSettingsIf::CPluginInfo::NewLC(void) + ?AddPropertyMapL@CItemMap@HSPluginSettingsIf@@QAEAAV12@PAVCPropertyMap@2@@Z @ 18 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::AddPropertyMapL(class HSPluginSettingsIf::CPropertyMap *) + ?ConfigurationState@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 19 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::ConfigurationState(void) const + ?AddPluginMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCPluginMap@2@@Z @ 20 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddPluginMapL(class HSPluginSettingsIf::CPluginMap *) + ?PluginUid@CPluginMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 21 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginMap::PluginUid(void) const + ?PluginId@CPluginMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 22 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginMap::PluginId(void) const + ?SetMediaTypeL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 23 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetMediaTypeL(class TDesC8 const &) + ?NewL@CHspsConfiguration@HSPluginSettingsIf@@SAPAV12@XZ @ 24 NONAME ; class HSPluginSettingsIf::CHspsConfiguration * HSPluginSettingsIf::CHspsConfiguration::NewL(void) + ?GetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@AAV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@@Z @ 25 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::GetSettingsL(class TDesC8 const &, class RPointerArray &) + ?NewLC@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 26 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewLC(void) + ?NameL@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 27 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::NameL(void) const + ?SetItemNameL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 28 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemNameL(class TDesC8 const &) + ?SetUidL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 29 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetUidL(class TDesC8 const &) + ?Properties@CItemMap@HSPluginSettingsIf@@QBEAAV?$RPointerArray@VCPropertyMap@HSPluginSettingsIf@@@@XZ @ 30 NONAME ; class RPointerArray & HSPluginSettingsIf::CItemMap::Properties(void) const + ?NewL@CPropertyMap@HSPluginSettingsIf@@SAPAV12@XZ @ 31 NONAME ; class HSPluginSettingsIf::CPropertyMap * HSPluginSettingsIf::CPropertyMap::NewL(void) + ?Type@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 32 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Type(void) const + ??1CPluginMap@HSPluginSettingsIf@@UAE@XZ @ 33 NONAME ; HSPluginSettingsIf::CPluginMap::~CPluginMap(void) + ?MediaType@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 34 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::MediaType(void) const + ?SetPluginIdL@CPluginMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 35 NONAME ; class HSPluginSettingsIf::CPluginMap & HSPluginSettingsIf::CPluginMap::SetPluginIdL(class TDesC8 const &) + ?Resources@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCObjectMap@HSPluginSettingsIf@@@@XZ @ 36 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::Resources(void) + ?Path@CObjectMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 37 NONAME ; class TDesC8 const & HSPluginSettingsIf::CObjectMap::Path(void) const + ?SetSettingsL@CHomescreenSettings@HSPluginSettingsIf@@UAEHABVTDesC8@@ABV?$RPointerArray@VCItemMap@HSPluginSettingsIf@@@@H@Z @ 38 NONAME ; int HSPluginSettingsIf::CHomescreenSettings::SetSettingsL(class TDesC8 const &, class RPointerArray const &, int) + ?Name@CPropertyMap@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 39 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPropertyMap::Name(void) const + ?NewL@CObjectMap@HSPluginSettingsIf@@SAPAV12@XZ @ 40 NONAME ; class HSPluginSettingsIf::CObjectMap * HSPluginSettingsIf::CObjectMap::NewL(void) + ?NewL@CPluginMap@HSPluginSettingsIf@@SAPAV12@XZ @ 41 NONAME ; class HSPluginSettingsIf::CPluginMap * HSPluginSettingsIf::CPluginMap::NewL(void) + ?SetPathL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 42 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetPathL(class TDesC8 const &) + ?PluginMaps@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV?$RPointerArray@VCPluginMap@HSPluginSettingsIf@@@@XZ @ 43 NONAME ; class RPointerArray & HSPluginSettingsIf::CHspsConfiguration::PluginMaps(void) + ?NewL@CHomescreenSettings@HSPluginSettingsIf@@SAPAV12@ABVTDesC8@@0PAVMHomeScreenSettingsObserver@2@@Z @ 44 NONAME ; class HSPluginSettingsIf::CHomescreenSettings * HSPluginSettingsIf::CHomescreenSettings::NewL(class TDesC8 const &, class TDesC8 const &, class HSPluginSettingsIf::MHomeScreenSettingsObserver *) + ??1CPropertyMap@HSPluginSettingsIf@@UAE@XZ @ 45 NONAME ; HSPluginSettingsIf::CPropertyMap::~CPropertyMap(void) + ?SetInterfaceL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 46 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetInterfaceL(class TDesC8 const &) + ?ConfId@CHspsConfiguration@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 47 NONAME ; class TDesC8 const & HSPluginSettingsIf::CHspsConfiguration::ConfId(void) const + ?Uid@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 48 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Uid(void) const + ?SetValueL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 49 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetValueL(class TDesC8 const &) + ?Interface@CPluginInfo@HSPluginSettingsIf@@QBEABVTDesC8@@XZ @ 50 NONAME ; class TDesC8 const & HSPluginSettingsIf::CPluginInfo::Interface(void) const + ?SetTypeL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 51 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetTypeL(class TDesC8 const &) + ??1CHomescreenSettings@HSPluginSettingsIf@@UAE@XZ @ 52 NONAME ; HSPluginSettingsIf::CHomescreenSettings::~CHomescreenSettings(void) + ?SetNameL@CPluginInfo@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 53 NONAME ; class HSPluginSettingsIf::CPluginInfo & HSPluginSettingsIf::CPluginInfo::SetNameL(class TDesC8 const &) + ?NewL@CPluginInfo@HSPluginSettingsIf@@SAPAV12@XZ @ 54 NONAME ; class HSPluginSettingsIf::CPluginInfo * HSPluginSettingsIf::CPluginInfo::NewL(void) + ?SetItemIdL@CItemMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 55 NONAME ; class HSPluginSettingsIf::CItemMap & HSPluginSettingsIf::CItemMap::SetItemIdL(class TDesC8 const &) + ?NewLC@CItemMap@HSPluginSettingsIf@@SAPAV12@XZ @ 56 NONAME ; class HSPluginSettingsIf::CItemMap * HSPluginSettingsIf::CItemMap::NewLC(void) + ?AddItemMapL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@PAVCItemMap@2@@Z @ 57 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::AddItemMapL(class HSPluginSettingsIf::CItemMap *) + ??1CHspsConfiguration@HSPluginSettingsIf@@UAE@XZ @ 58 NONAME ; HSPluginSettingsIf::CHspsConfiguration::~CHspsConfiguration(void) + ?SetConfIdL@CHspsConfiguration@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 59 NONAME ; class HSPluginSettingsIf::CHspsConfiguration & HSPluginSettingsIf::CHspsConfiguration::SetConfIdL(class TDesC8 const &) + ?SetNameL@CPropertyMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 60 NONAME ; class HSPluginSettingsIf::CPropertyMap & HSPluginSettingsIf::CPropertyMap::SetNameL(class TDesC8 const &) + ?SetNameL@CObjectMap@HSPluginSettingsIf@@QAEAAV12@ABVTDesC8@@@Z @ 61 NONAME ; class HSPluginSettingsIf::CObjectMap & HSPluginSettingsIf::CObjectMap::SetNameL(class TDesC8 const &) + ??1CObjectMap@HSPluginSettingsIf@@UAE@XZ @ 62 NONAME ; HSPluginSettingsIf::CObjectMap::~CObjectMap(void) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/eabi/hspluginsettings.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/eabi/hspluginsettings.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +EXPORTS + _ZN18HSPluginSettingsIf10CObjectMap13SetMediaTypeLERK6TDesC8 @ 1 NONAME + _ZN18HSPluginSettingsIf10CObjectMap4NewLEv @ 2 NONAME + _ZN18HSPluginSettingsIf10CObjectMap5NewLCEv @ 3 NONAME + _ZN18HSPluginSettingsIf10CObjectMap8SetNameLERK6TDesC8 @ 4 NONAME + _ZN18HSPluginSettingsIf10CObjectMap8SetPathLERK6TDesC8 @ 5 NONAME + _ZN18HSPluginSettingsIf10CObjectMapD0Ev @ 6 NONAME + _ZN18HSPluginSettingsIf10CObjectMapD1Ev @ 7 NONAME + _ZN18HSPluginSettingsIf10CObjectMapD2Ev @ 8 NONAME + _ZN18HSPluginSettingsIf10CPluginMap12SetPluginIdLERK6TDesC8 @ 9 NONAME + _ZN18HSPluginSettingsIf10CPluginMap13SetPluginUidLERK6TDesC8 @ 10 NONAME + _ZN18HSPluginSettingsIf10CPluginMap4NewLEv @ 11 NONAME + _ZN18HSPluginSettingsIf10CPluginMap5NewLCEv @ 12 NONAME + _ZN18HSPluginSettingsIf10CPluginMapD0Ev @ 13 NONAME + _ZN18HSPluginSettingsIf10CPluginMapD1Ev @ 14 NONAME + _ZN18HSPluginSettingsIf10CPluginMapD2Ev @ 15 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo13SetInterfaceLERK6TDesC8 @ 16 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo22SetConfigurationStateLERK6TDesC8 @ 17 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo4NewLEv @ 18 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo5NewLCEv @ 19 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo7SetUidLERK6TDesC8 @ 20 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo8SetNameLERK6TDesC8 @ 21 NONAME + _ZN18HSPluginSettingsIf11CPluginInfo8SetTypeLERK6TDesC8 @ 22 NONAME + _ZN18HSPluginSettingsIf11CPluginInfoD0Ev @ 23 NONAME + _ZN18HSPluginSettingsIf11CPluginInfoD1Ev @ 24 NONAME + _ZN18HSPluginSettingsIf11CPluginInfoD2Ev @ 25 NONAME + _ZN18HSPluginSettingsIf12CPropertyMap4NewLEv @ 26 NONAME + _ZN18HSPluginSettingsIf12CPropertyMap5NewLCEv @ 27 NONAME + _ZN18HSPluginSettingsIf12CPropertyMap8SetNameLERK6TDesC8 @ 28 NONAME + _ZN18HSPluginSettingsIf12CPropertyMap9SetValueLERK6TDesC8 @ 29 NONAME + _ZN18HSPluginSettingsIf12CPropertyMapD0Ev @ 30 NONAME + _ZN18HSPluginSettingsIf12CPropertyMapD1Ev @ 31 NONAME + _ZN18HSPluginSettingsIf12CPropertyMapD2Ev @ 32 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration10PluginInfoEv @ 33 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration10PluginMapsEv @ 34 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration10SetConfIdLERK6TDesC8 @ 35 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration11AddItemMapLEPNS_8CItemMapE @ 36 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration13AddObjectMapLEPNS_10CObjectMapE @ 37 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration13AddPluginMapLEPNS_10CPluginMapE @ 38 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration4NewLEv @ 39 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration5NewLCEv @ 40 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration8SettingsEv @ 41 NONAME + _ZN18HSPluginSettingsIf18CHspsConfiguration9ResourcesEv @ 42 NONAME + _ZN18HSPluginSettingsIf18CHspsConfigurationD0Ev @ 43 NONAME + _ZN18HSPluginSettingsIf18CHspsConfigurationD1Ev @ 44 NONAME + _ZN18HSPluginSettingsIf18CHspsConfigurationD2Ev @ 45 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 46 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 47 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings4NewLERK6TDesC8S3_PNS_27MHomeScreenSettingsObserverE @ 48 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettings5NewLCERK6TDesC8S3_PNS_27MHomeScreenSettingsObserverE @ 49 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettingsD0Ev @ 50 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettingsD1Ev @ 51 NONAME + _ZN18HSPluginSettingsIf19CHomescreenSettingsD2Ev @ 52 NONAME + _ZN18HSPluginSettingsIf8CItemMap10SetItemIdLERK6TDesC8 @ 53 NONAME + _ZN18HSPluginSettingsIf8CItemMap12SetItemNameLERK6TDesC8 @ 54 NONAME + _ZN18HSPluginSettingsIf8CItemMap15AddPropertyMapLEPNS_12CPropertyMapE @ 55 NONAME + _ZN18HSPluginSettingsIf8CItemMap4NewLEv @ 56 NONAME + _ZN18HSPluginSettingsIf8CItemMap5NewLCEv @ 57 NONAME + _ZN18HSPluginSettingsIf8CItemMapD0Ev @ 58 NONAME + _ZN18HSPluginSettingsIf8CItemMapD1Ev @ 59 NONAME + _ZN18HSPluginSettingsIf8CItemMapD2Ev @ 60 NONAME + _ZNK18HSPluginSettingsIf10CObjectMap4PathEv @ 61 NONAME + _ZNK18HSPluginSettingsIf10CObjectMap5NameLEv @ 62 NONAME + _ZNK18HSPluginSettingsIf10CObjectMap9MediaTypeEv @ 63 NONAME + _ZNK18HSPluginSettingsIf10CPluginMap8PluginIdEv @ 64 NONAME + _ZNK18HSPluginSettingsIf10CPluginMap9PluginUidEv @ 65 NONAME + _ZNK18HSPluginSettingsIf11CPluginInfo18ConfigurationStateEv @ 66 NONAME + _ZNK18HSPluginSettingsIf11CPluginInfo3UidEv @ 67 NONAME + _ZNK18HSPluginSettingsIf11CPluginInfo4NameEv @ 68 NONAME + _ZNK18HSPluginSettingsIf11CPluginInfo4TypeEv @ 69 NONAME + _ZNK18HSPluginSettingsIf11CPluginInfo9InterfaceEv @ 70 NONAME + _ZNK18HSPluginSettingsIf12CPropertyMap4NameEv @ 71 NONAME + _ZNK18HSPluginSettingsIf12CPropertyMap5ValueEv @ 72 NONAME + _ZNK18HSPluginSettingsIf18CHspsConfiguration6ConfIdEv @ 73 NONAME + _ZNK18HSPluginSettingsIf8CItemMap10PropertiesEv @ 74 NONAME + _ZNK18HSPluginSettingsIf8CItemMap6ItemIdEv @ 75 NONAME + _ZNK18HSPluginSettingsIf8CItemMap8ItemNameEv @ 76 NONAME + _ZTIN18HSPluginSettingsIf10CObjectMapE @ 77 NONAME + _ZTIN18HSPluginSettingsIf10CPluginMapE @ 78 NONAME + _ZTIN18HSPluginSettingsIf11CPluginInfoE @ 79 NONAME + _ZTIN18HSPluginSettingsIf12CPropertyMapE @ 80 NONAME + _ZTIN18HSPluginSettingsIf18CHspsConfigurationE @ 81 NONAME + _ZTIN18HSPluginSettingsIf19CHomescreenSettingsE @ 82 NONAME + _ZTIN18HSPluginSettingsIf8CItemMapE @ 83 NONAME + _ZTVN18HSPluginSettingsIf10CObjectMapE @ 84 NONAME + _ZTVN18HSPluginSettingsIf10CPluginMapE @ 85 NONAME + _ZTVN18HSPluginSettingsIf11CPluginInfoE @ 86 NONAME + _ZTVN18HSPluginSettingsIf12CPropertyMapE @ 87 NONAME + _ZTVN18HSPluginSettingsIf18CHspsConfigurationE @ 88 NONAME + _ZTVN18HSPluginSettingsIf19CHomescreenSettingsE @ 89 NONAME + _ZTVN18HSPluginSettingsIf8CItemMapE @ 90 NONAME + _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12GetSettingsLERK6TDesC8R13RPointerArrayINS_8CItemMapEE @ 91 NONAME + _ZThn8_N18HSPluginSettingsIf19CHomescreenSettings12SetSettingsLERK6TDesC8RK13RPointerArrayINS_8CItemMapEEi @ 92 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Item id, name and properties +* +*/ +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/hspluginsettings.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hspluginsettings.iby) + +PRJ_MMPFILES +hspluginsettings.mmp diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/group/hspluginsettings.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/group/hspluginsettings.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* 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: project file +* +*/ + +#include + +TARGET hspluginsettings.dll +TARGETTYPE dll +UID 0x20022FE0 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE hspluginsettings.cpp +SOURCE hspsconfiguration.cpp +SOURCE itemmap.cpp +SOURCE objectmap.cpp +SOURCE plugininfo.cpp +SOURCE pluginmap.cpp +SOURCE propertymap.cpp + + + +nostrictdef + +LIBRARY euser.lib +LIBRARY liwservicehandler.lib +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/inc/hspsconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/inc/hspsconfiguration.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,155 @@ +/* +* 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: Hsps configuration message +* +*/ + + +#ifndef C_CHSPSCONFIGURATION_H +#define C_CHSPSCONFIGURATION_H + + + +#include + + +namespace HSPluginSettingsIf{ + + +class CPluginMap; +class CItemMap; +class CObjectMap; +class CPluginInfo; + +/** + * Hsps configuration message + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine + * @since S60 v5.0 + */ +class CHspsConfiguration : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CHspsConfiguration* NewL(); + IMPORT_C static CHspsConfiguration* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CHspsConfiguration(); + + /** + * Set configuration id + * + * @param aId configuration id + */ + IMPORT_C CHspsConfiguration& SetConfIdL(const TDesC8& aId); + + /** + * Get configuration id + * + * @return Configuration id or KNullDesC8 + */ + IMPORT_C const TDesC8& ConfId()const; + + /** + * Get plugin info + * + * @return Reference to plugin info + */ + IMPORT_C CPluginInfo& PluginInfo(); + + /** + * Append plugin map into plugin map array + * + * @param aPluginMap Plugin map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddPluginMapL(CPluginMap* aPluginMap); + + /** + * Get plugin maps in a array + * + * @return Reference to plugin map array + */ + IMPORT_C RPointerArray& PluginMaps(); + + /** + * Append item map into settings array map + * + * @param aItemMap Item map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddItemMapL(CItemMap* aItemMap); + + /** + * Get settings array. Contains item maps + * + * @return Reference to settings array + */ + IMPORT_C RPointerArray& Settings(); + + /** + * Append object map into resources array map + * + * @param aObjectMap Object map. Takes ownership + */ + IMPORT_C CHspsConfiguration& AddObjectMapL(CObjectMap* aObjectMap); + + /** + * Get resource array. Contains object maps + * + * @return Reference to resource array + */ + IMPORT_C RPointerArray& Resources(); +private: + + CHspsConfiguration(); + + void ConstructL(); +private: // data + + /** + * Own. Configuration id + */ + HBufC8* iId; + /** + * Own. Plugin info + */ + CPluginInfo* iPluginInfo; + /** + * Own. Plugins + */ + RPointerArray iPlugins; + /** + * Own. Settings + */ + RPointerArray iSettings; + /** + * Own. Resources + */ + RPointerArray iResources; + }; + +} + +#endif // C_CHSPSCONFIGURATION_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/inc/objectmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/inc/objectmap.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: Presents object map as name, path and mediatype data +* +*/ + + + +#ifndef C_COBJECTMAP_H +#define C_COBJECTMAP_H + + +#include + +namespace HSPluginSettingsIf{ + + +/** + * Presents object map as name, path and mediatype data + * + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CObjectMap : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CObjectMap* NewL(); + IMPORT_C static CObjectMap* NewLC(); + + + /** + * Destructor. + */ + IMPORT_C virtual ~CObjectMap(); + + /** + * Set object name + * + * @param aName object name + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetNameL( const TDesC8& aName ); + + /** + * Get object name + * + * @return Reference to name or KNullDesC8 + */ + IMPORT_C const TDesC8& NameL()const; + + /** + * Set object path + * + * @param aPath object path + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetPathL( const TDesC8& aPath ); + + /** + * Get object path + * + * @return Reference to path or KNullDesC8 + */ + IMPORT_C const TDesC8& Path()const; + + /** + * Set object media type + * + * @param aMediaType object media type + * @return Reference to this object + */ + IMPORT_C CObjectMap& SetMediaTypeL( const TDesC8& aMediaType ); + + /** + * Get object media type + * + * @return Reference to media type or KNullDesC8 + */ + IMPORT_C const TDesC8& MediaType()const; + + +private: + CObjectMap(); + + void ConstructL(); + +private: // data + + /** + * Own. Object name + */ + HBufC8* iName; + + /** + * Own. Object path + */ + HBufC8* iPath; + + /** + * Own. Object mediatype + */ + HBufC8* iMediaType; + }; + +} +#endif // C_COBJECTMAP_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/inc/plugininfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/inc/plugininfo.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* +* 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: Presents plugin info using states uid, interface, type and name +* +*/ + + + +#ifndef C_CPLUGININFO_H +#define C_CPLUGININFO_H + + +#include + +namespace HSPluginSettingsIf{ + + +/** + * Presents plugin info using states uid, interface, type and name + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPluginInfo : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPluginInfo* NewL(); + IMPORT_C static CPluginInfo* NewLC(); + + + /** + * Destructor. + */ + IMPORT_C virtual ~CPluginInfo(); + + /** + * Set configuration uid + * + * @param aUid configuration uid + */ + IMPORT_C CPluginInfo& SetUidL(const TDesC8& aUid); + + /** + * Get configuration uid + * + * @return configuration uid or KNullDesC8 + */ + IMPORT_C const TDesC8& Uid()const; + + /** + * Set configuration type + * + * @param aType configuration type + */ + IMPORT_C CPluginInfo& SetTypeL(const TDesC8& aType); + + /** + * Get configuration type + * + * @return configuration type or KNullDesC8 + */ + IMPORT_C const TDesC8& Type()const; + + /** + * Set configuration interface + * + * @param aInterface configuration interface + */ + IMPORT_C CPluginInfo& SetInterfaceL(const TDesC8& aInterface); + + /** + * Get configuration interface + * + * @return configuration interface or KNullDesC8 + */ + IMPORT_C const TDesC8& Interface()const; + + /** + * Set configuration name + * + * @param aName configuration name + */ + IMPORT_C CPluginInfo& SetNameL(const TDesC8& aName); + + /** + * Get configuration name + * + * @return configuration name or KNullDesC8 + */ + IMPORT_C const TDesC8& Name()const; + + /** + * Set configuration state + * + * @param aConfigurationState configuration state + */ + IMPORT_C CPluginInfo& SetConfigurationStateL( + const TDesC8& aConfigurationState); + + /** + * Get configuration state + * + * @return configuration state or KNullDesC8 + */ + IMPORT_C const TDesC8& ConfigurationState()const; + +private: + + CPluginInfo(); + + void ConstructL(); + + +private: // data + + /** + * Own. Plugin uid + */ + HBufC8* iUid; + + /** + * Own. Plugin interface + */ + HBufC8* iInterface; + + /** + * Own. Plugin type + */ + HBufC8* iType; + + /** + * Own. Plugin name + */ + HBufC8* iName; + + /** + * Own. Plugin configuration state + */ + HBufC8* iConfigurationState; + }; +} + +#endif // C_CPLUGININFO_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/inc/pluginmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/inc/pluginmap.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,108 @@ +/* +* 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: contains id and uid +* +*/ + + + +#ifndef C_CPLUGINMAP_H +#define C_CPLUGINMAP_H + + +#include + + +namespace HSPluginSettingsIf{ + +/** + * Presents plugin map i.e id and uid + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPluginMap : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CPluginMap* NewL(); + IMPORT_C static CPluginMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CPluginMap(); + + /** + * Set plugin id + * + * @param aPluginId plugin id + * @return Reference to this object + */ + IMPORT_C CPluginMap& SetPluginIdL(const TDesC8& aPluginId); + + /** + * Get plugin id + * + * @return Reference to plugin id or KNullDesC8 + */ + IMPORT_C const TDesC8& PluginId()const; + + /** + * Set plugin uid + * + * @param aPluginId plugin uid + * @return Reference to this object + */ + IMPORT_C CPluginMap& SetPluginUidL(const TDesC8& aPluginUid); + + /** + * Get plugin uid + * + * @return Reference to plugin uid or KNullDesC8 + */ + IMPORT_C const TDesC8& PluginUid()const; + +private: + + CPluginMap(); + + void ConstructL(); + + +private: // data + + /** + * Own. Plugin id. + */ + HBufC8* iPluginId; + + /** + * Own. Plugin uid. + */ + HBufC8* iPluginUid; + }; + +} + +#endif // C_CPLUGINMAP_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/rom/hspluginsettings.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/rom/hspluginsettings.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 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: Image description file for project Homescreen Settings API +* +*/ + + +#ifndef HSPLUGINSETTINGS_IBY +#define HSPLUGINSETTINGS_IBY + +file=ABI_DIR\BUILD_DIR\hspluginsettings.dll SHARED_LIB_DIR\hspluginsettings.dll + +#endif // HSPLUGINSETTINGS_IBY diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/hspluginsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/hspluginsettings.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,689 @@ +/* +* 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: Encapsulates hsps liw service +* +*/ + + + +#include +#include +#include + +#include +#include "hspsconfiguration.h" +//#include "pluginmap.h" +#include "itemmap.h" +#include "propertymap.h" +//#include "objectmap.h" +//#include "plugininfo.h" +#include +#include + +_LIT8( KHSPS, "Service.HSPS" ); +_LIT8( KHSPSConfigurationIf, "IConfiguration" ); + + + +_LIT8( KHSPSCommandGetPluginConf, "GetPluginConf" ); +_LIT8( KHSPSSetPluginSettings, "SetPluginSettings" ); +_LIT8( KPluginConfKey, "pluginConf" ); + +_LIT8( KOutKeyStatus ,"status"); +_LIT8( KHspsAppUid, "appUid" ); +_LIT8( KKeyPluginId, "pluginId" ); + +_LIT8( KKeyStoringParams, "storingParams" ); + + +_LIT8( KKeyStorePluginRefence, "storePluginConf" ); +_LIT8( KKeyStoreAppConf, "storeAppConf" ); + +_LIT8( KKeyItemId, "itemId" ); +_LIT8( KKeyName, "name" ); +_LIT8( KKeyValue, "value" ); +_LIT8( KKeyProperties, "properties" ); +_LIT8( KKeySettings, "settings" ); + +_LIT8( KRequestNotification, "RequestNotification" ); + + +_LIT8( KSettingsChanged, "PluginSettingsChanged" ); +namespace HSPluginSettingsIf{ + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CHomescreenSettings::CHomescreenSettings(MHomeScreenSettingsObserver* aObserver, const TDesC8& aPluginId ) + : iObserver( aObserver ), iPluginId( aPluginId ) + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHomescreenSettings::ConstructL( const TDesC8& aAppUid ) + { + // Attach to HSPS: + iServiceHandler = CLiwServiceHandler::NewL(); + + iHspsService = CLiwCriteriaItem::NewL( 1, KHSPSConfigurationIf, KHSPS ); + iHspsService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + RCriteriaArray interestList; + interestList.AppendL( iHspsService ); + iServiceHandler->AttachL( interestList ); + interestList.Reset(); + + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam appUid; + TLiwVariant uidVar; + uidVar.Set( aAppUid ); + appUid.SetNameAndValueL( KHspsAppUid, uidVar ); + appUid.PushL(); + inParamList.AppendL( appUid ); + CleanupStack::Pop(); + appUid.Reset(); + + iServiceHandler->ExecuteServiceCmdL( *iHspsService,inParamList,outParamList ); + inParamList.Reset(); + TInt pos = 0; + outParamList.FindFirst( pos, KHSPSConfigurationIf ); + if( pos != KErrNotFound ) + { + iHspsInterface = outParamList[ pos ].Value().AsInterface(); + outParamList.Reset(); + } + else + { + outParamList.Reset(); + User::Leave( KErrNotFound ); + } + + inParamList.Reset(); + outParamList.Reset(); + + if( iObserver ) + { + iTransactionId = -1; + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptASyncronous, + this ); + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = outParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + TInt retval; + retval = outParam->Value().AsTInt32(); + if(retval == KErrNone ) + { + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("TransactionID") ); + if( outParam ) + { + retval = outParam->Value().AsTInt32(); + iTransactionId = retval; + } + } + + } + + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHomescreenSettings* CHomescreenSettings::NewL( + const TDesC8& aAppUid, + const TDesC8& aPluginId, + MHomeScreenSettingsObserver* aObserver) + { + CHomescreenSettings* self = CHomescreenSettings::NewLC(aAppUid, aPluginId, aObserver); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHomescreenSettings* CHomescreenSettings::NewLC( + const TDesC8& aAppUid, + const TDesC8& aPluginId, + MHomeScreenSettingsObserver* aObserver) + { + CHomescreenSettings* self = new( ELeave ) CHomescreenSettings( aObserver, aPluginId ); + CleanupStack::PushL( self ); + self->ConstructL(aAppUid); + return self; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHomescreenSettings::~CHomescreenSettings() + { + if( iHspsInterface ) + { + // Close interface + iHspsInterface->Close(); + } + + if( iServiceHandler && iHspsService ) + { + // Detach services from the handler + RCriteriaArray interestList; + TRAP_IGNORE( interestList.AppendL( iHspsService ) ); + TRAP_IGNORE( iServiceHandler->DetachL( interestList ) ); + interestList.Reset(); + } + + delete iHspsService; + delete iServiceHandler; + } + + + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CHomescreenSettings::SetPluginSettingsL( + const TDesC8& aPluginId, + const RPointerArray& aSettings, + const TDesC8& aStoringParam ) + { + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam pluginIdParam; + pluginIdParam.SetNameAndValueL( KKeyPluginId, TLiwVariant(aPluginId) ); + pluginIdParam.PushL(); + inParamList.AppendL( pluginIdParam ); + CleanupStack::Pop( &pluginIdParam ); + pluginIdParam.Reset(); + + CLiwDefaultList* itemMapList = CLiwDefaultList::NewLC(); + for( int i = 0; i < aSettings.Count(); i++ ) + { + CItemMap* itemMap = aSettings[i]; + + CLiwDefaultMap* inItemMap = CLiwDefaultMap::NewLC(); + FillMapFromItemL(*inItemMap,*itemMap); + itemMapList->AppendL( TLiwVariant(inItemMap) ); + CleanupStack::Pop(inItemMap); + inItemMap->Close(); + } + + TLiwGenericParam settingsParam; + settingsParam.SetNameAndValueL( KKeySettings, TLiwVariant(itemMapList) ); + settingsParam.PushL(); + inParamList.AppendL( settingsParam ); + CleanupStack::Pop( &settingsParam ); + settingsParam.Reset(); + + TLiwGenericParam storingParams; + storingParams.SetNameAndValueL( KKeyStoringParams, TLiwVariant(aStoringParam) ); + storingParams.PushL(); + inParamList.AppendL( storingParams ); + CleanupStack::Pop( &storingParams ); + storingParams.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSSetPluginSettings, + inParamList, + outParamList ); + + CleanupStack::PopAndDestroy( itemMapList ); + + inParamList.Reset(); + + + // check success + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, KOutKeyStatus ); + TInt status(KErrGeneral); + + if ( outParam ) + { + status = outParam->Value().AsTInt32(); + } + outParamList.Reset(); + return status; + } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHomescreenSettings::SetSettingsL( + const TDesC8& aPluginId, + const RPointerArray& aSettings, + const TBool aStoringParams) + { + TInt error = KErrNone; + + if( aStoringParams ) + { + error = SetPluginSettingsL(aPluginId, aSettings, KKeyStorePluginRefence()); + } + else + { + error = SetPluginSettingsL(aPluginId, aSettings, KKeyStoreAppConf()); + } + + return error; + } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHomescreenSettings::GetSettingsL( + const TDesC8& aPluginId, + RPointerArray& aSettings) + { + TInt error = KErrNone; + CHspsConfiguration* configuration = CHspsConfiguration::NewLC(); + + // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + TLiwGenericParam pluginIdParam; + pluginIdParam.SetNameAndValueL( KKeyPluginId, TLiwVariant(aPluginId) ); + pluginIdParam.PushL(); + inParamList.AppendL( pluginIdParam ); + CleanupStack::Pop( &pluginIdParam ); + pluginIdParam.Reset(); + + + iHspsInterface->ExecuteCmdL( KHSPSCommandGetPluginConf, + inParamList, + outParamList ); + + inParamList.Reset(); + + TInt index(0); + const TLiwGenericParam* conf = outParamList.FindFirst(index,KPluginConfKey); + + if(conf) + { + const CLiwMap* confMap = conf->Value().AsMap(); + // 2: Process Configuration map + if(confMap) + { + TLiwVariant tempVariant; + tempVariant.PushL(); + + if( confMap->FindL( _L8("settings"), tempVariant )) + { + const CLiwList* settings_list( tempVariant.AsList() ); + if( settings_list ) + { + aSettings.Reset(); + ProcessConfigurationSettingsL(*settings_list,*configuration); + RPointerArray& settings = configuration->Settings(); + CItemMap* itemMapIn(0); + CPropertyMap* readProperty(0); + CPropertyMap* propertyIn(0); + + for( TInt i = 0; i < settings.Count(); i++ ) + { + CItemMap* readItem = settings[i]; + itemMapIn = CItemMap::NewLC(); + itemMapIn->SetItemIdL(readItem->ItemId()); + const TDesC8& itemName = readItem->ItemName(); + itemMapIn->SetItemNameL(itemName); + + RPointerArray& readProperties = readItem->Properties(); + + for( TInt j=0; j < readProperties.Count(); j++ ) + { + readProperty = readProperties[j]; + propertyIn = CPropertyMap::NewLC(); + propertyIn->SetNameL(readProperty->Name()); + propertyIn->SetValueL(readProperty->Value()); + // Dispatching is based on item name + itemMapIn->AddPropertyMapL(propertyIn); + CleanupStack::Pop(propertyIn); + } + + aSettings.AppendL(itemMapIn); + + CleanupStack::Pop(itemMapIn); + } + } + else + { + error=KErrNotFound; + } + } + else + { + error= KErrNotFound; + } + + + CleanupStack::Pop(&tempVariant); + tempVariant.Reset(); + } + } + + outParamList.Reset(); + CleanupStack::PopAndDestroy(configuration); + + return error; + } + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHomescreenSettings::ProcessConfigurationSettingsL( + const CLiwList& aItemList, + CHspsConfiguration& aTarget) + { + TLiwVariant itemMapVariant; + itemMapVariant.PushL(); + for( int i=0;iFindL( _L8("itemId"),itemVariant) ) + { + item->SetItemIdL( itemVariant.AsData() ); + } + if( itemMap->FindL( _L8("name"),itemVariant) ) + { + item->SetItemNameL( itemVariant.AsData() ); + } + if( itemMap->FindL( _L8("properties"),itemVariant) ) + { + const CLiwList* properties( itemVariant.AsList() ); + if(properties) + { + ProcessConfItemPropertiesL(*properties,*item); + } + } + + aTarget.AddItemMapL(item); + CleanupStack::Pop(item); + } + CleanupStack::Pop(&itemVariant); + itemVariant.Reset(); + } + + } + CleanupStack::Pop(&itemMapVariant); + itemMapVariant.Reset(); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHomescreenSettings::ProcessConfItemPropertiesL( + const CLiwList& aPropertyMapList, + CItemMap& aItemMap) + { + TLiwVariant propertyMapVariant; + propertyMapVariant.PushL(); + for( int i=0;iFindL( _L8("name"),propertyVariant ) ) + { + property->SetNameL( propertyVariant.AsData() ); + } + if( propertyMap->FindL( _L8("value"),propertyVariant ) ) + { + property->SetValueL( propertyVariant.AsData() ); + } + aItemMap.AddPropertyMapL(property); + CleanupStack::Pop(property); + } + CleanupStack::Pop(&propertyVariant); + propertyVariant.Reset(); + } + + } + CleanupStack::Pop(&propertyMapVariant); + propertyMapVariant.Reset(); + } + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHomescreenSettings::FillMapFromItemL( CLiwDefaultMap& aMap, const CItemMap& aItemMap ) + { + aMap.InsertL( KKeyItemId, TLiwVariant(aItemMap.ItemId()) ); + aMap.InsertL( KKeyName, TLiwVariant(aItemMap.ItemName()) ); + + CLiwDefaultList* inPropertyMapList = CLiwDefaultList::NewLC(); + FillMapFromPropertiesL(*inPropertyMapList,aItemMap.Properties()); + aMap.InsertL( KKeyProperties, TLiwVariant(inPropertyMapList) ); + CleanupStack::Pop(inPropertyMapList); + inPropertyMapList->Close(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHomescreenSettings::FillMapFromPropertiesL( + CLiwDefaultList& aInPropertyMapList, + const RPointerArray& aProperties ) + { + + for(int i=0; iInsertL( KKeyName, TLiwVariant(aProperties[i]->Name()) ); + inPropertyMap->InsertL( KKeyValue, TLiwVariant(aProperties[i]->Value()) ); + aInPropertyMapList.AppendL(inPropertyMap); + CleanupStack::Pop(inPropertyMap); + inPropertyMap->Close(); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CHomescreenSettings::HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + TInt retval( KErrNone ); + + if( iObserver && iTransactionId == aCmdId ) + { + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = aEventParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + retval = outParam->Value().AsTInt32(); + } + else + { + pos = 0; + + retval = KErrNotFound; + + outParam = aEventParamList.FindFirst( pos, _L8("notification") ); + + if( !outParam ) + { + // should never happen, but change status back to KErrNotFound + return retval; + } + + HBufC8* event( NULL ); + HBufC8* pluginUid( NULL ); + HBufC8* pluginName( NULL ); + TInt pushCount( 0 ); + + TLiwVariant variant; + variant.PushL(); + pushCount++; + + variant = outParam->Value(); + + const CLiwMap* notifMap( variant.AsMap() ); + + if ( notifMap->FindL( _L8("event"), variant ) ) + { + event = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if ( event->Des().Compare( KSettingsChanged ) == 0 ) + { + if( notifMap->FindL( _L8("name"), variant ) ) + { + pluginName = variant.AsData().AllocLC(); + pushCount++; + } + + variant.Reset(); + + if( notifMap->FindL( _L8("pluginUid"), variant ) ) + { + pluginUid = variant.AsData().AllocLC(); + pushCount++; + } + + + variant.Reset(); + + if( notifMap->FindL( _L8("pluginIds"), variant ) ) + { + const CLiwList* pluginIdList( variant.AsList() ); + + variant.Reset(); + + TInt count( pluginIdList->Count() ); + + retval = KErrNone; + + for( TInt i = 0; i < count && retval == KErrNone; i++ ) + { + pluginIdList->AtL( i, variant ); + HBufC8* pluginId( NULL ); + pluginId = variant.AsData().AllocLC(); + + if( pluginId->Des().Compare(iPluginId)== 0 ) + { + retval = iObserver->SettingsChangedL( + ( event ) ? *event : KNullDesC8(), + ( pluginName ) ? *pluginName : KNullDesC8(), + ( pluginUid ) ? *pluginUid : KNullDesC8(), + ( pluginId ) ? * pluginId : KNullDesC8() ); + } + CleanupStack::PopAndDestroy( pluginId ); + + variant.Reset(); + + } + + } + + } + + CleanupStack::PopAndDestroy( pushCount ); + } + } + + if( retval != KErrNone && aEventId != KLiwEventInProgress) + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + inParamList.Reset(); + outParamList.Reset(); + //cancel old notification request + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptCancel, + this ); + + inParamList.Reset(); + outParamList.Reset(); + //request notification again + iTransactionId = -1; + iHspsInterface->ExecuteCmdL( KRequestNotification, + inParamList, + outParamList, + KLiwOptASyncronous, + this ); + + const TLiwGenericParam* outParam( NULL ); + + TInt pos( 0 ); + outParam = outParamList.FindFirst( pos, _L8("status") ); + + if ( outParam ) + { + TInt retval; + retval = outParam->Value().AsTInt32(); + + if(retval == KErrNone ) + { + pos = 0; + outParam = outParamList.FindFirst( pos, _L8("TransactionID") ); + + if( outParam ) + { + retval = outParam->Value().AsTInt32(); + iTransactionId = retval; + } + } + } + + } + + + return retval; + } + +} +//End of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/hspsconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/hspsconfiguration.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,166 @@ +/* +* 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: Hsps configuration message +* +*/ + + +#include "hspsconfiguration.h" +#include "pluginmap.h" +#include "objectmap.h" +#include "itemmap.h" +#include "plugininfo.h" + +namespace HSPluginSettingsIf{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CHspsConfiguration::CHspsConfiguration() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CHspsConfiguration::ConstructL() + { + iPluginInfo = CPluginInfo::NewL(); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsConfiguration::NewL() + { + CHspsConfiguration* self = CHspsConfiguration::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration* CHspsConfiguration::NewLC() + { + CHspsConfiguration* self = new( ELeave ) CHspsConfiguration; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration::~CHspsConfiguration() + { + delete iId; + delete iPluginInfo; + iPlugins.ResetAndDestroy(); + iSettings.ResetAndDestroy(); + iResources.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::SetConfIdL(const TDesC8& aId) + { + delete iId; + iId = NULL; + iId = aId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CHspsConfiguration::ConfId()const + { + if(iId) + { + return *iId; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CHspsConfiguration::PluginInfo() + { + return *iPluginInfo; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddPluginMapL(CPluginMap* aPluginMap) + { + iPlugins.AppendL(aPluginMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::PluginMaps() + { + return iPlugins; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddItemMapL(CItemMap* aItemMap) + { + iSettings.AppendL(aItemMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::Settings() + { + return iSettings; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfiguration& CHspsConfiguration::AddObjectMapL(CObjectMap* aObjectMap) + { + iResources.AppendL(aObjectMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CHspsConfiguration::Resources() + { + return iResources; + } + +} // namespace end + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/itemmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/itemmap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Item id, name and properties +* +*/ + + + +#include +#include + +namespace HSPluginSettingsIf{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CItemMap::CItemMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CItemMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap* CItemMap::NewL() + { + CItemMap* self = CItemMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap* CItemMap::NewLC() + { + CItemMap* self = new( ELeave ) CItemMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap::~CItemMap() + { + delete iItemId; + delete iItemName; + iProperties.ResetAndDestroy(); + } + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::SetItemIdL(const TDesC8& aItemId ) + { + delete iItemId; + iItemId = NULL; + iItemId = aItemId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CItemMap::ItemId()const + { + if(iItemId) + { + return *iItemId; + } + else + { + return KNullDesC8; + } + + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::SetItemNameL(const TDesC8& aItemName ) + { + delete iItemName; + iItemName = NULL; + iItemName = aItemName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CItemMap::ItemName()const + { + if(iItemName) + { + return *iItemName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CItemMap& CItemMap::AddPropertyMapL(CPropertyMap* aPropertyMap ) + { + iProperties.AppendL(aPropertyMap); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C RPointerArray& CItemMap::Properties()const + { + return iProperties; + } +} + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/objectmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/objectmap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,154 @@ +/* +* 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: Presents object map as name, path and mediatype data +* +*/ + + + +#include "objectmap.h" + +namespace HSPluginSettingsIf{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CObjectMap::CObjectMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CObjectMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap* CObjectMap::NewL() + { + CObjectMap* self = CObjectMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap* CObjectMap::NewLC() + { + CObjectMap* self = new( ELeave ) CObjectMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap::~CObjectMap() + { + delete iName; + delete iPath; + delete iMediaType; + } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::NameL()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetPathL( const TDesC8& aPath ) + { + delete iPath; + iPath = NULL; + iPath = aPath.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::Path()const + { + if(iPath) + { + return *iPath; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CObjectMap& CObjectMap::SetMediaTypeL( const TDesC8& aMediaType ) + { + delete iMediaType; + iMediaType = NULL; + iMediaType = aMediaType.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CObjectMap::MediaType()const + { + if(iMediaType) + { + return *iMediaType; + } + else + { + return KNullDesC8; + } + } + + +} + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/plugininfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/plugininfo.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,210 @@ +/* +* 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: Presents plugin info using states uid, interface, type and name +* +*/ + + + +#include "plugininfo.h" + +namespace HSPluginSettingsIf{ + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPluginInfo::CPluginInfo() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPluginInfo::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo* CPluginInfo::NewL() + { + CPluginInfo* self = CPluginInfo::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo* CPluginInfo::NewLC() + { + CPluginInfo* self = new( ELeave ) CPluginInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo::~CPluginInfo() + { + delete iUid; + delete iType; + delete iInterface; + delete iName; + delete iConfigurationState; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetUidL(const TDesC8& aUid) + { + delete iUid; + iUid = NULL; + iUid = aUid.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Uid()const + { + if(iUid) + { + return *iUid; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetTypeL(const TDesC8& aType) + { + delete iType; + iType = NULL; + iType = aType.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Type()const + { + if(iType) + { + return *iType; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetInterfaceL( + const TDesC8& aInterface) + { + delete iInterface; + iInterface = NULL; + iInterface = aInterface.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Interface()const + { + if(iInterface) + { + return *iInterface; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetNameL(const TDesC8& aName) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::Name()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginInfo& CPluginInfo::SetConfigurationStateL( + const TDesC8& aConfigurationState) + { + delete iConfigurationState; + iConfigurationState = NULL; + + iConfigurationState = aConfigurationState.AllocL(); + + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginInfo::ConfigurationState()const + { + if(iConfigurationState) + { + return *iConfigurationState; + } + else + { + return KNullDesC8; + } + } +} diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/pluginmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/pluginmap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* 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: contains id and uid +* +*/ + + +#include "pluginmap.h" + +namespace HSPluginSettingsIf{ + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPluginMap::CPluginMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPluginMap::ConstructL() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap* CPluginMap::NewL() + { + CPluginMap* self = CPluginMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap* CPluginMap::NewLC() + { + CPluginMap* self = new( ELeave ) CPluginMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap::~CPluginMap() + { + delete iPluginId; + delete iPluginUid; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetPluginIdL(const TDesC8& aPluginId) + { + delete iPluginId; + iPluginId = NULL; + iPluginId = aPluginId.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginMap::PluginId()const + { + if(iPluginId) + { + return *iPluginId; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPluginMap& CPluginMap::SetPluginUidL(const TDesC8& aPluginUid) + { + delete iPluginUid; + iPluginUid = NULL; + iPluginUid = aPluginUid.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPluginMap::PluginUid()const + { + if(iPluginUid) + { + return *iPluginUid; + } + else + { + return KNullDesC8; + } + } +} diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/homescreen_settings_api/src/propertymap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/homescreen_settings_api/src/propertymap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Encapsulates name and value +* +*/ + + + +#include + +namespace HSPluginSettingsIf{ + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CPropertyMap::CPropertyMap() + { + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CPropertyMap::ConstructL() + { + + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap* CPropertyMap::NewL() + { + CPropertyMap* self = CPropertyMap::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap* CPropertyMap::NewLC() + { + CPropertyMap* self = new( ELeave ) CPropertyMap; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap::~CPropertyMap() + { + delete iName; + delete iValue; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap& CPropertyMap::SetNameL( const TDesC8& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPropertyMap::Name()const + { + if(iName) + { + return *iName; + } + else + { + return KNullDesC8; + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C CPropertyMap& CPropertyMap::SetValueL( const TDesC8& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + return *this; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CPropertyMap::Value()const + { + if(iValue) + { + return *iValue; + } + else + { + return KNullDesC8; + } + } + +} diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,20 @@ +/* +* 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: Build file for definition engine +* +*/ + +#include "../hspsdefinitionengineinterface/group/bld.inf" +#include "../hspsdefinitionengine/group/bld.inf" +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* 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: Build file +* +*/ + + +PRJ_PLATFORMS + +ARMV5 WINSCW + +PRJ_EXPORTS + +PRJ_MMPFILES +hspsdefinitionengine.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/group/hspsdefinitionengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/group/hspsdefinitionengine.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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: mmp file +* +*/ + + +#include + +TARGET hspsdefinitionengine.dll +TARGETTYPE PLUGIN +// ECom Dll recognition UID followed by the unique UID for this dll +UID 0x10009D8D 0x200159BA +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hspsdefinitionengine.cpp +SOURCE hspsxmlhandler.cpp +SOURCE hspsdtdentity.cpp +SOURCE hspslocaleparser.cpp +SOURCE hspsdefinitionengineproxy.cpp + + +START RESOURCE 200159ba.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET hspsdefinitionengine.rsc +#endif +END + + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/libc +SYSTEMINCLUDE /epoc32/include/xml + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY xmlframework.lib +LIBRARY flogger.lib +LIBRARY hspsodt.lib +LIBRARY hspsdomdocument.lib +LIBRARY charconv.lib +LIBRARY hspsdefinitionengineinterface.lib +LIBRARY ecom.lib + +LANG SC + + + + + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdefinitionengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdefinitionengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,107 @@ +/* +* 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: Main class for this component +* +*/ + + + +#ifndef C_hspsDEFINITIONENGINE_H +#define C_hspsDEFINITIONENGINE_H + +// INCLUDES +#include +#include "hspsdefinitionengineinterface.h" + + +// CONSTANTS +const TInt KErrXmlParsing = -32270; +const TInt KErrRefBuilding = -32272; + +// FORWARD DECLARATIONS +class RFs; +class ChspsXMLHandler; +class ChspsODT; + +/** +* Main class for this component +* @ingroup group_hspsdefinitionengine +* @lib hspsdefinitionengine.lib +* @since Series 60 5.0 +*/ +class ChspsDefinitionEngine : public ChspsDefinitionEngineInterface + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsDefinitionEngine* NewL(); + + /** + * Destructor. + */ + ~ChspsDefinitionEngine(); + + public: // New functions + + /** + * Parses the given XML file. Inserts all nodes to DOM tree, + * assignes all properties to the nodes + * @since Series 60 3.1 + * @param aFsSession: file server session + * @param aXMLFileName: XML file to parse + * @param ahspsOdt: ODT structure, which contains the DomDocument + * @return: Error code + */ + virtual ChspsDefinitionEngineInterface::TError CreateDOM( + RFs& aFsSession, + const TDesC& aXMLFileName, + ChspsODT& ahspsOdt ); + + /** + * Parses the given DTD file. Replaces all entity referencies + * in the skeleton DOM tree. Returns Localized DOM if it was successfull + * @since Series 60 3.1 + * @param aFsSession: file server session + * @param aDTDFileName: Input DTD file for a certain language + * @param ahspsOdt: Input/Output ODT structure, which contains the DomDocument. + */ + virtual void ApplyLanguageL( + RFs& aFsSession, + const TDesC& aDTDFileName, + ChspsODT& ahspsOdt ); + + private: + + /** + * C++ default constructor. + */ + ChspsDefinitionEngine(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // Owned + ChspsXMLHandler* ihspsXMLHandler; + + }; + +#endif // C_hspsDEFINITIONENGINE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdefinitionengine.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdefinitionengine.rh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2002-2004 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: DefinitionEngine +* +*/ + + +#ifndef hspsDEFINITIONENGINE_RH_H +#define hspsDEFINITIONENGINE_RH_H + +// CONSTANTS +// implementation interface uid +#define KhspsDefinitionEngineIId 0x200159C7 //0x10281F08 + +//implementation uid +#define KhspsDefinitionEngineImplUid 0x200159C8 //0x10281F09 + +#endif + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdtdentity.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsdtdentity.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* 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: Entity reference data class +* +*/ + + + +#ifndef C_hspsDTDENTITY_H +#define C_hspsDTDENTITY_H + +// INCLUDES +#include + + +// CLASS DECLARATION + +/** +* Class represent dtd entity. +* @ingroup group_hspsdefinitionengine +* @lib hspsdefinitionengine.lib +* @since Series 60 3.1 +*/ +class ChspsDtdEntity : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsDtdEntity* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsDtdEntity(); + + public: // New functions + + /** + * Set entity reference. + * @since Series 60 3.1 + * @param aEntity Entity reference name + */ + void SetEntityL( const TDesC8& aEntity ); + + /** + * Get the name of the entity reference. + * @since Series 60 3.1 + * @return Reference to entity. + */ + const TDesC8& Entity(); + + /** + * Set entity's value. + * @since Series 60 3.1 + * @param aValue Entity's value + */ + void SetValueL( const TDesC8& aValue ); + + /** + * Get the value of the entity reference. + * @since Series 60 3.1 + * @return Reference to value. + */ + const TDesC8& Value(); + + private: + + /** + * C++ default constructor. + */ + ChspsDtdEntity(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: // Data + // Entity reference + HBufC8* iEntity; + // Entity reference value + HBufC8* iValue; + + }; + +#endif // C_hspsDTDENTITY_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspslocaleparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspslocaleparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,87 @@ +/* +* 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: Locale parsing and applying languages +* +*/ + + + +#ifndef C_hspsLOCALEPARSER_H +#define C_hspsLOCALEPARSER_H + +// INCLUDES +#include + + +// FORWARD DECLARATIONS +class RFs; +class ChspsDomDocument; +class ChspsDtdEntity; +// CLASS DECLARATION + +/** +* Locale parsing and applying languages +* @ingroup group_hspsdefinitionengine +* @lib hspsdefinitionengine.lib +* @since Series 60 3.1 +*/ +class ChspsLocaleParser : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsLocaleParser* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsLocaleParser(); + + public: // New functions + + /** + * Applies locale references to a skeleton dom + * @since Series 60 3.1 + * @param aFs: An open file server session + * @param aFile: Dtd file to be parsed + * @param aLocalizedDom: On return Dom containing replaced entity references + */ + void ApplyDtdToDomL( + RFs& aFsSession, + const TDesC& aFile, + ChspsDomDocument& aLocalizedDom ); + + + private: + + /** + * C++ default constructor. + */ + ChspsLocaleParser(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + //Array holds parsed entity references + RPointerArray iEntityReferences; + }; + +#endif // C_hspsLOCALEPARSER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsxmlhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/inc/hspsxmlhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,233 @@ +/* +* 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: Main class for XML parsing +* +*/ + + + +#ifndef C_hspsXMLHANDLER_H +#define C_hspsXMLHANDLER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class RFs; +class ChspsDomDocument; +class ChspsDomNode; + +using namespace Xml; +/** +* Main class for XML parsing +* @ingroup group_hspsdefinitionengine +* @lib hspsdefinitionengine.lib +* @since Series 60 3.1 +*/ +class ChspsXMLHandler : public CBase, public MContentHandler + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsXMLHandler* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsXMLHandler(); + + public: // New functions + + /** + * Parses the given XML file, creates nodes and attributes and inserting + * them to aDomDocument + * @since Series 60 3.1 + * @param aFsSession: session to use for accessing the files + * @param aFileName: name of XML file + * @param aDomDocument: reference to an empty DOM + */ + void ParseXmlDocL( RFs& aFsSession, const TDesC& aFileName,ChspsDomDocument& aDomDocument); + + public: // Functions from MXMLContentHandler + + /** + * This method is a callback to indicate the start of the document. + * @since Series 60 3.1 + * @param aDocParam Specifies the various parameters of the document. + * aDocParam.iCharacterSetName The character encoding of the document. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode); + + + /** + * This method is a callback to indicate the end of the document. + * @since Series 60 3.1 + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnEndDocumentL(TInt aErrorCode); + + + /** + * This method is a callback to indicate an element has been parsed. + * @since Series 60 3.1 + * @param aElement is a handle to the element's details. + * @param aAttributes contains the attributes for the element. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode); + + + /** + * This method is a callback to indicate the end of the element has been reached. + * @since Series 60 3.1 + * @param aElement is a handle to the element's details. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode); + + + /** + * This method is a callback that sends the content of the element. + * Not all the content may be returned in one go. The data may be sent in chunks. + * When an OnEndElementL is received this means there is no more content to be sent. + * @since Series 60 3.1 + * @param aBytes is the raw content data for the element. + * The client is responsible for converting the data to the + * required character set if necessary. + * In some instances the content may be binary and must not be converted. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnContentL(const TDesC8& aBytes, TInt aErrorCode); + + + /** + * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. + * This method is always called before the corresponding OnStartElementL method. + * @since Series 60 3.1 + * @param aPrefix is the Namespace prefix being declared. + * @param aUri is the Namespace URI the prefix is mapped to. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode); + + + /** + * This method is a notification of the end of the scope of a prefix-URI mapping. + * This method is called after the corresponding DoEndElementL method. + * @since Series 60 3.1 + * @param aPrefix is the Namespace prefix that was mapped. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode); + + + /** + * This method is a notification of ignorable whitespace in element content. + * @since Series 60 3.1 + * @param aBytes are the ignored bytes from the document being parsed. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode); + + + /** + * This method is a notification of a skipped entity. If the parser encounters an + * external entity it does not need to expand it - it can return the entity as aName + * for the client to deal with. + * @since Series 60 3.1 + * @param aName is the name of the skipped entity. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnSkippedEntityL(const RString& aName, TInt aErrorCode); + + + /** + * This method is a receive notification of a processing instruction. + * @since Series 60 3.1 + * @param aTarget is the processing instruction target. + * @param aData is the processing instruction data. If empty none was supplied. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData,TInt aErrorCode); + + + /** + * This method indicates an error has occurred. + * @since Series 60 3.1 + * @param aError is the error code + */ + void OnError(TInt aErrorCode); + + + /** + * This method obtains the interface matching the specified uid. + * @since Series 60 3.1 + * @param aUid the uid identifying the required interface. + * @return 0 if no interface matching the uid is found. + * Otherwise, the this pointer cast to that interface. + */ + TAny* GetExtendedInterface(const TInt32 aUid); + + private: + + /** + * C++ default constructor. + */ + ChspsXMLHandler(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // Pointer to Symbian parser, owned + Xml::CParser* iXmlParser; + + // Pointer to DOM, not owned + ChspsDomDocument* iDomDocument; + + // Pointer to the parent node + ChspsDomNode* iParentNode; + + // Counter and ID at the same time + TInt iCurrentNodeId; + + // Node stack with all the unfinished nodes + RPointerArray* iNodeStack; + + // Variable to store value got from OnError() + TInt iError; + + }; + +#endif // C_hspsXMLHANDLER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/200159ba.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/200159ba.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 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: +* +*/ +// 200159BA.RSS //old uid 10207480.RSS +// +#include +#include "hspsdefinitionengine.rh" + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = 0x200159BA; //old uid 10207480; +interfaces = + { + INTERFACE_INFO + { + interface_uid = KhspsDefinitionEngineIId; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KhspsDefinitionEngineImplUid; + version_no = 1; + display_name = "hspsdefinitionengine plugin"; + default_data = "hspsdefinitionengine"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdefinitionengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdefinitionengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,241 @@ +/* +* 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: Main class for this component +* +*/ + + + +// INCLUDE FILES +#include "hspsdefinitionengine.h" +#include "hspsxmlhandler.h" +#include "hspsodt.h" +#include "hspslocaleparser.h" +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsdomattribute.h" +#include "hspsdomlist.h" +#include "hspsdomdepthiterator.h" +#include "hspsdefinitionengineinterface.h" + +#include + + + + +//CONSTANT DEFINITIONS +_LIT8(KRef, "ref"); +_LIT8(KId, "id"); + +// ============================ LOCAL FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// DoBuildRefNodesL Find referred node and build subtree if any. +// ----------------------------------------------------------------------------- +// +static void DoBuildRefNodesL( ChspsDomDocument& aDom, ChspsDomNode& aNode ) + { + ChspsDomAttribute* refAttr = + static_cast( aNode.AttributeList().FindByName( KRef ) ); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *aDom.RootNode() ); + CleanupStack::PushL( iter ); + + ChspsDomNode* node = iter->First(); + TBool found( EFalse ); + + + while ( node && !found ) + { + ChspsDomAttribute* attr = + static_cast( node->AttributeList().FindByName( KId ) ); + if ( refAttr && attr ) + { + + if ( refAttr->Value().Compare( attr->Value() ) == 0 && + aNode.Name().Compare( node->Name() ) == 0 && + aNode.Namespace().Compare( node->Namespace() ) == 0 ) + { + //If referred node is a referrer parent leave because of illegal structure + ChspsDomNode* parent = aNode.Parent(); + while ( parent ) + { + if ( node == parent ) + { + User::Leave( KErrArgument ); + } + parent = parent->Parent(); + } + + //reference to self is also forbidden + if ( node == &aNode ) + { + User::Leave( KErrArgument ); + } + + //Build a sub-tree aggregation of ref nodes if any + TInt childCount( node->ChildNodes().Length() ); + ChspsDomNode* refNode = NULL; + ChspsDomNode* referredNode = NULL; + for ( TInt i=0; i( node->ChildNodes().Item( i ) ); + refNode = referredNode->CreateRefNodeL(); + CleanupStack::PushL( refNode ); + aNode.AddChildL( refNode ); + CleanupStack::Pop( refNode ); + } + found = ETrue; + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + +// ----------------------------------------------------------------------------- +// BuildRefNodesL Goes through the DOM and creates a ref node to match referred +// sub-tree if any. +// ----------------------------------------------------------------------------- +// +static void BuildRefNodesL( ChspsDomDocument& aDom ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *aDom.RootNode() ); + CleanupStack::PushL( iter ); + + ChspsDomNode* node = iter->First(); + ChspsDomNode* current = node; + while ( node ) + { + // Iterator need to continue iterating previous context, + // not from added content. If current node is a ref node, it can only + // have siblings before referred sub tree is created. + current = node; + node = iter->NextL(); + + if ( current->IsRefNode() ) + { + DoBuildRefNodesL( aDom, *current ); + } + } + CleanupStack::PopAndDestroy( iter ); + } +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngine::ChspsDefinitionEngine +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDefinitionEngine::ChspsDefinitionEngine() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngine::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDefinitionEngine::ConstructL() + { + ihspsXMLHandler = ChspsXMLHandler::NewL(); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngine::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsDefinitionEngine* ChspsDefinitionEngine::NewL() + { + ChspsDefinitionEngine* self = new( ELeave ) ChspsDefinitionEngine; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +ChspsDefinitionEngine::~ChspsDefinitionEngine() + { + delete ihspsXMLHandler; + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngine::CreateDOM +// Parse the given XML file, insert all nodes to DOM tree, +// assign all properties to the nodes +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ChspsDefinitionEngineInterface::TError ChspsDefinitionEngine::CreateDOM( + RFs& aFsSession, + const TDesC& aXMLFileName, + ChspsODT& ahspsOdt ) + { + ChspsDomDocument& dom = ahspsOdt.DomDocument(); + ChspsDefinitionEngineInterface::TError errCode; + errCode.iDefEngError = KErrNone; + errCode.iSubComponentError = KErrNone; + + TRAPD( err,ihspsXMLHandler->ParseXmlDocL( aFsSession, aXMLFileName, dom ) ); + + if ( err != KErrNone ) + { + + errCode.iDefEngError = KErrXmlParsing; + errCode.iSubComponentError = err; + return errCode; + } + + TRAP( err, BuildRefNodesL( dom ) ); + if ( err != KErrNone ) + { + errCode.iDefEngError = KErrRefBuilding; + errCode.iSubComponentError = err; + return errCode; + } + + return errCode; + + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngine::ApplyLanguageL +// Parse the given XML file, insert all nodes to DOM tree, +// assign all properties to the nodes +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsDefinitionEngine::ApplyLanguageL( + RFs& aFsSession, + const TDesC& aDTDFileName, + ChspsODT& ahspsOdt ) + { + ChspsLocaleParser* localeParser = ChspsLocaleParser::NewL(); + CleanupStack::PushL( localeParser ); + localeParser->ApplyDtdToDomL( aFsSession, aDTDFileName, ahspsOdt.DomDocument() ); + CleanupStack::PopAndDestroy( localeParser ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdefinitionengineproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdefinitionengineproxy.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: ECom plugins implementation proxy +* +*/ + + +// INCLUDE FILES +#include "hspsdefinitionengine.h" +#include "hspsdefinitionengine.rh" +#include +#include +#include + +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +const TImplementationProxy ImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( KhspsDefinitionEngineImplUid, ChspsDefinitionEngine::NewL) +#else + {KhspsDefinitionEngineImplUid, ChspsDefinitionEngine::NewL} +#endif + }; + +// Function used to return an instance of the proxy table. +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdtdentity.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsdtdentity.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Entity reference data class +* +*/ + + + +// INCLUDE FILES +#include "hspsdtdentity.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::ChspsDtdEntity +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDtdEntity::ChspsDtdEntity() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDtdEntity::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsDtdEntity* ChspsDtdEntity::NewL() + { + ChspsDtdEntity* self = new( ELeave ) ChspsDtdEntity; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +ChspsDtdEntity::~ChspsDtdEntity() + { + delete iEntity; + delete iValue; + } + + +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::SetEntityL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsDtdEntity::SetEntityL( const TDesC8& aEntity ) + { + delete iEntity; + iEntity = NULL; + iEntity = aEntity.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::Entity +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC8& ChspsDtdEntity::Entity() + { + if ( iEntity ) + { + return *iEntity; + } + else + { + return KNullDesC8; + } + } +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::SetValueL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsDtdEntity::SetValueL( const TDesC8& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + } +// ----------------------------------------------------------------------------- +// ChspsDtdEntity::Value +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +const TDesC8& ChspsDtdEntity::Value() + { + if ( iValue ) + { + return *iValue; + } + else + { + return KNullDesC8; + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspslocaleparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspslocaleparser.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,504 @@ +/* +* 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: Locale parsing and applying languages +* +*/ + + + +// INCLUDE FILES +#include "hspslocaleparser.h" +#include "hspsdtdentity.h" +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsdomattribute.h" +#include "hspsdomdepthiterator.h" +#include "hspsdomlist.h" + +#include + + +// LOCAL CONSTANTS AND MACROS + + +_LIT8(KEntityStart, ""); + +_LIT8(KAmpersandLitRef,"&"); +_LIT8(KAmpersandCharRef, "&"); +_LIT8(KAmpersandLit, "&"); + +_LIT8(KUnderscore, "_"); + +_LIT8(KQuotaLitRef,"""); +_LIT8(KQuotaCharRef,"""); +_LIT8(KQuotaLit,"\""); + +_LIT8(KAposLitRef,"'"); +_LIT8(KAposCharRef,"'"); +_LIT8(KAposLit,"\'"); + + +_LIT8(KPercentRef, "%"); +_LIT8(KPercentLit, "%"); + + +// ============================= LOCAL FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// SeekWSSequence() Seek end or start of white space sequence. +// Returns: Offset. +// ----------------------------------------------------------------------------- +// +static TInt SeekWSSequence(TPtr8 aPtr, TBool aStart) + { + TInt wsIndex( 0 ); + TInt len( aPtr.Length() ); + for ( ; wsIndex KErrNotFound ) + { + aPtr.Replace( pos,KLtLitRef().Length(), KLtLit ); + } + + while ( (pos = aPtr.Find( KLtCharRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KLtCharRef().Length(), KLtLit ); + } + //Replace all gt + while ( (pos = aPtr.Find( KGtLitRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KGtLitRef().Length(), KGtLit ); + } + + while ( (pos = aPtr.Find( KGtCharRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KGtCharRef().Length(), KGtLit ); + } + //Replace all ampersands + while ( (pos = aPtr.Find( KAmpersandLitRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KAmpersandLitRef().Length(), KAmpersandLit ); + } + while ( (pos = aPtr.Find( KAmpersandCharRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KAmpersandCharRef().Length(), KAmpersandLit ); + } + + //Replace all quotas + while ( (pos = aPtr.Find( KQuotaLitRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KQuotaLitRef().Length(), KQuotaLit ); + } + while ( (pos = aPtr.Find( KQuotaCharRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KQuotaCharRef().Length(), KQuotaLit ); + } + + //Replace all apos + while ( (pos = aPtr.Find( KAposLitRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KAposLitRef().Length(), KAposLit ); + } + while ( (pos = aPtr.Find( KAposCharRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KAposCharRef().Length(), KAposLit ); + } + //Replace all percents + while ( (pos = aPtr.Find( KPercentRef ) ) > KErrNotFound ) + { + aPtr.Replace( pos,KPercentRef().Length(), KPercentLit ); + } + + + } +// ----------------------------------------------------------------------------- +// ParseL Parses the DTD file. +// +// Returns: On return aEntityReferences contains parsed entityreferences with +// values. +// ----------------------------------------------------------------------------- +// +static void ParseL( + RFile& aFile, + RPointerArray& aEntityReferences ) + { + const TChar KQuotation = '"'; + const TChar KSingleQuotation = '\''; + + TInt fileSize( 0 ); + aFile.Size( fileSize ); + if ( !fileSize ) + { + return; + } + HBufC8* buf = HBufC8::NewLC( fileSize ); + TPtr8 p( buf->Des() ); + + if ( aFile.Read( p ) == KErrNone ) + { + // Now we have read file into buffer + // syntax is + // Do until end of file + // Find first token SetEntityL( p.Left(use) ); + // Consume reference name + p.Delete(0,use); + // Consume following white spaces + consume = SeekWSSequence(p,EFalse); + p.Delete(0,consume); + // Read everythig between "" or '' + TBool quatation( KQuotation == p[0] ); + TBool singleQuatation( KSingleQuotation == p[0] ); + if ( quatation || singleQuatation ) + { + p.Delete(0,1); + TInt len( p.Length() ); + TInt i(0); + for(; iDes() ); + ReplaceCharacterReferences( tmpP ); + entity->SetValueL( tmpP ); + CleanupStack::PopAndDestroy( tmp ); + aEntityReferences.AppendL( entity ); + CleanupStack::Pop( entity ); + p.Delete(0,i); + } + else + { + CleanupStack::PopAndDestroy( entity ); + } + pos = p.FindF(KEntityStart); + } + + } + CleanupStack::PopAndDestroy(buf); + + } + +// ----------------------------------------------------------------------------- +// FindAndReplaceEntitiesL Finds entity reference from the input string +// and replaces found entity references with entity values. +// Entity reference starts with &-mark and ends with semicolon ';' +// e.g &menu_app_str; +// +// Returns: HBufC8: Caller has the ownership. Length is 0, if there are no +// enties replaced +// ----------------------------------------------------------------------------- +// + +static HBufC8* FindAndReplaceEntitiesL( + const TDesC8& aValue, + RPointerArray& aEntityReferences ) //Array holding parsed entities + { + TChar entityRef('&'); + TChar semicolon(';'); + + HBufC8* replaced = KNullDesC8().AllocL(); + + TInt localeCount( aEntityReferences.Count() ); + + if ( aValue.Length() <= 0 ) + { + return replaced; + } + + TLex8 lex( aValue ); + while ( lex.Peek() ) + { + TChar ch( lex.Get() ); + if ( ch == entityRef ) //Entity token start found + { + lex.Mark(); + lex.SkipCharacters(); + TPtrC8 p( lex.MarkedToken() ); + if ( p.LocateReverse( semicolon ) != KErrNotFound ) //Token ends with semicolon + { + // We found a reference in skeleton, lets find the same ref in the list + TBool found( EFalse ); + for ( TInt j=0; jEntity(); + const TDesC8& entityVal = dtdEntity->Value(); + + if( entity.CompareC( entityRef ) == 0 ) + { + // We have the ref-value pair + CleanupStack::PushL( replaced ); + replaced = + replaced->ReAllocL(replaced->Length() + entityVal.Length() ); + replaced->Des().Append( entityVal ); + CleanupStack::Pop(1); + found = ETrue; + } + }//End for + }// End entity token end + }//End entity token start found + else + { + lex.UnGet(); + lex.Mark(); + lex.SkipCharacters(); //Token must start with '&' + lex.SkipSpace(); + TPtrC8 token( lex.MarkedToken() ); + CleanupStack::PushL( replaced ); + replaced = replaced->ReAllocL(replaced->Length() + token.Length() ); + replaced->Des().Append( token ); + CleanupStack::Pop(1); + } + }//End while + + return replaced; + } + +static void AddAttributeDescL( + ChspsDomNode& aNode, + const TDesC8& aAttrName, + const TDesC8& aValue ) + { + ChspsDomList& attrList = aNode.AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(aAttrName) ); + if ( attr ) + { + // Replace value of the attribute + attr->SetValueL( aValue ); + } + else + { + // Add an attribute + ChspsDomAttribute* attr = ChspsDomAttribute::NewL( aAttrName, aNode.StringPool() ); + CleanupStack::PushL( attr ); + attr->SetValueL( aValue ); + ChspsDomList& attrList = aNode.AttributeList(); + attrList.AddItemL( attr ); //takes ownership + CleanupStack::Pop( attr ); + } + } + +// ----------------------------------------------------------------------------- +// ApplyListToDomL Seek if node has any entity references. Replace entity +// with value if there are any. +// +// Returns: On return node containing localized strings. +// ----------------------------------------------------------------------------- +// +static void ApplyListToNodeL( + ChspsDomNode& aNode, //Node to match + RPointerArray& aEntityReferences ) //Array holding parsed entities + { + HBufC8* replaced = NULL; + ChspsDomAttribute* attr = NULL; + ChspsDomList& attrList = aNode.AttributeList(); + TInt count( attrList.Length() ); + + const TDesC8& name = aNode.Name(); + + // Loop node's attributes + for ( TInt i=0; i( attrList.Item(i) ); + + const TDesC8& value = attr->Value(); + + // Check whether the attribute value matches an entity + replaced = FindAndReplaceEntitiesL( value, aEntityReferences ); + CleanupStack::PushL( replaced ); + if( replaced->Length() ) + { + TPtrC8 entityName = attr->Name(); + const TInt indicatorLength = KUnderscore().Length(); + if ( entityName.Length() > indicatorLength && entityName.Left(indicatorLength) == KUnderscore ) + { + // Name of the variant attribute is formed by removal of the 1st "_" character + TPtrC8 variantName = entityName.Mid(indicatorLength); + + // Add the variant attribute or update it's exisitng value + AddAttributeDescL( + aNode, + variantName, + *replaced ); + } + } + CleanupStack::PopAndDestroy( replaced ); + replaced = NULL; + } + + const TDesC8& pcData = aNode.PCData(); + replaced = FindAndReplaceEntitiesL( pcData, aEntityReferences ); + CleanupStack::PushL( replaced ); + if( replaced->Length() ) + { + aNode.SetPCDataL( *replaced ); + } + CleanupStack::PopAndDestroy( replaced ); + replaced = NULL; + } + +// ----------------------------------------------------------------------------- +// ApplyListToDomL Traverse the DOM and apply entity reference values to node. +// +// Returns: On return DOM containing localized strings. +// ----------------------------------------------------------------------------- +// +static void ApplyListToDomL( + ChspsDomDocument& aLocalizedDom, //DOM to be localized + RPointerArray& aEntityReferences )//Array holding parsed entities + { + ChspsDomNode* root = aLocalizedDom.RootNode(); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *root ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + while ( node ) + { + ApplyListToNodeL( *node, aEntityReferences ); + node = iter->NextL(); + } + + CleanupStack::PopAndDestroy( iter ); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsLocaleParser::ChspsLocaleParser +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsLocaleParser::ChspsLocaleParser() + { + } + +// ----------------------------------------------------------------------------- +// - ChspsLocaleParser::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsLocaleParser::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ChspsLocaleParser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsLocaleParser* ChspsLocaleParser::NewL() + { + ChspsLocaleParser* self = new( ELeave ) ChspsLocaleParser; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +ChspsLocaleParser::~ChspsLocaleParser() + { + iEntityReferences.ResetAndDestroy(); + } + + +// ----------------------------------------------------------------------------- +// ChspsLocaleParser::ApplyDtdToDomL +// Applies locale references to a skeleton dom +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsLocaleParser::ApplyDtdToDomL( + RFs& aFsSession, + const TDesC& aFileName, + ChspsDomDocument& aLocalizedDom ) + { + RFile infile; + User::LeaveIfError( infile.Open(aFsSession, aFileName, EFileRead) ); + CleanupClosePushL( infile ); + + ParseL( infile, iEntityReferences ); + if( iEntityReferences.Count() ) + { + ApplyListToDomL( aLocalizedDom, iEntityReferences ); + iEntityReferences.ResetAndDestroy(); + } + + CleanupStack::PopAndDestroy(&infile); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsxmlhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengine/src/hspsxmlhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,318 @@ +/* +* 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: Main class for XML parsing +* +*/ + + + +// INCLUDE FILES +#include "hspsxmlhandler.h" + +#include "hspsdomattribute.h" +#include "hspsdomlist.h" +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsdomstringpool.h" + +#include +#include + + +// LOCAL CONSTANTS AND MACROS +_LIT8(KXmlMimeType,"text/xml"); +_LIT8(KVariant,"libxml2"); + +_LIT8(KAnd,"&"); +_LIT8(KSemicolon, ";" ); +_LIT8(KRefAttr, "ref"); + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::ChspsXMLHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsXMLHandler::ChspsXMLHandler() + { + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::ConstructL() + { + MContentHandler* contentHandler = this; + + CMatchData* matchData = CMatchData::NewL(); + CleanupStack::PushL(matchData); + matchData->SetMimeTypeL(KXmlMimeType); + matchData->SetVariantL(KVariant); + + iXmlParser = Xml::CParser::NewL( *matchData, *contentHandler ); + iXmlParser->EnableFeature( EReplaceIntEntityFromExtSubsetByRef ); + iNodeStack = new (ELeave)RPointerArray; + CleanupStack::PopAndDestroy(matchData); + + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsXMLHandler* ChspsXMLHandler::NewL() + { + ChspsXMLHandler* self = new( ELeave ) ChspsXMLHandler(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +ChspsXMLHandler::~ChspsXMLHandler() + { + delete iXmlParser; + if ( iNodeStack ) + { + iNodeStack->Close(); + delete iNodeStack; + } + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::ParseXmlDocL +// Parses the given XML file, creates nodes and attributes and inserting +// them to aDomDocument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::ParseXmlDocL( + RFs& aFsSession, + const TDesC& aFileName, + ChspsDomDocument& aDomDocument ) + { + iError = KErrNone; + iDomDocument = &aDomDocument; + Xml::ParseL(*iXmlParser, aFsSession, aFileName ); + User::LeaveIfError( iError ); + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnStartDocumentL +// This method is a callback to indicate the start of the document +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnStartDocumentL(const RDocumentParameters& /*aDocParam*/, TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnEndDocumentL +// This method is a callback to indicate the end of the document +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnEndDocumentL(TInt /*aErrorCode*/) + { + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnStartElementL +// This method is a callback to indicate the start of an element +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void ChspsXMLHandler::OnStartElementL( + const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt /*aErrorCode*/) + { + const TDesC8& localName = aElement.LocalName().DesC(); + const TDesC8& uri = aElement.Uri().DesC(); + + ChspsDomNode* currentNode = iDomDocument->CreateElementNSL( localName, uri ); + CleanupStack::PushL( currentNode ); + + // set hierarchy + if ( iParentNode ) + { + iParentNode->AddChildL( currentNode ); + } + else + { + iDomDocument->SetRootNode( currentNode ); + iParentNode = currentNode; // root node + } + CleanupStack::Pop( currentNode ); //Now parent or document has a ownership of the new node + + currentNode->SetNodeId( iCurrentNodeId++ ); + // "Push" parent for this node into stack. When an end element for this node is encountered, + // "Pop" parent node from stack. + iNodeStack->AppendL( iParentNode ); + iParentNode = currentNode; //Current node will be a parent for a new element + + + // add attributes + TInt attrCount( aAttributes.Count() ); + TBool refSet ( EFalse ); + for( TInt i=0; iSetRefNode(); + refSet = ETrue; + } + ChspsDomStringPool& stringPool = currentNode->StringPool(); + ChspsDomAttribute* newAttr = ChspsDomAttribute::NewL( attrNameDes8, stringPool ); + CleanupStack::PushL( newAttr ); + newAttr->SetValueL( attValueDes8 ); + currentNode->AttributeList().AddItemL( newAttr ); //takes ownership + CleanupStack::Pop( newAttr ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnEndElementL +// This method is a callback to indicate the end of an element +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnEndElementL(const RTagInfo& /*aElement*/, TInt /*aErrorCode*/) + { + // const TDesC8& localName = aElement.LocalName().DesC(); + TInt stackCount( iNodeStack->Count() ); + if ( stackCount > 0) + { + iParentNode = (*iNodeStack)[ stackCount-1 ]; + iNodeStack->Remove( stackCount-1 ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnContentL +// This method is a callback that sends the content of the element. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnContentL(const TDesC8& aBytes, TInt aErrorCode) + { +#ifdef _DEBUG + const TDesC8& currentNodeName = iParentNode->Name(); + TContentType type = iParentNode->ContentType(); +#endif + if ( aErrorCode == KErrNone && iParentNode->ContentType() == EPCData ) + { + //iParentNode holds the current node + iParentNode->AppendPCDataL( aBytes ); + } + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnStartPrefixMappingL( +// This method is a notification of the beginning of the scope of a prefix-URI mapping. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnStartPrefixMappingL( + const RString& /*aPrefix*/, + const RString& /*aUri*/, + TInt /*aErrorCode*/) + { + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnEndPrefixMappingL +// This method is a notification of the end of the scope of a prefix-URI mapping. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt /*aErrorCode*/) + { + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnIgnorableWhiteSpaceL +// This method is a notification of ignorable whitespace in element content. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/) + { + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnProcessingInstructionL +// This method is a receive notification of a processing instruction. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnProcessingInstructionL( + const TDesC8& /*aTarget*/, + const TDesC8& /*aData*/, + TInt /*aErrorCode*/) + { + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnSkippedEntityL +// This method is a notification of a skipped entity. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnSkippedEntityL(const RString& aName, TInt aErrorCode) + { +#ifdef _DEBUG + const TDesC8& currentNodeName = iParentNode->Name(); + const TDesC8& entity = aName.DesC(); + TContentType type = iParentNode->ContentType(); +#endif + if ( aErrorCode == KErrNone && iParentNode->ContentType() == EPCData ) + { + //iParentNode holds the current node + iParentNode->AppendPCDataL( KAnd ); + iParentNode->AppendPCDataL( aName.DesC() ); + iParentNode->AppendPCDataL( KSemicolon ); + } + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::OnError +// This method indicates an error has occurred. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsXMLHandler::OnError(TInt aErrorCode) + { + iError = aErrorCode; + } +// ----------------------------------------------------------------------------- +// ChspsXMLHandler::GetExtendedInterface +// This method obtains the interface matching the specified uid. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TAny* ChspsXMLHandler::GetExtendedInterface(const TInt32 /*aUid*/) + { + return NULL; + } + + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/bwins/hspsdefinitionengineinterfaceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/bwins/hspsdefinitionengineinterfaceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ??1ChspsDefinitionEngineInterface@@UAE@XZ @ 1 NONAME ; ChspsDefinitionEngineInterface::~ChspsDefinitionEngineInterface(void) + ?NewL@ChspsDefinitionEngineInterface@@SAPAV1@ABVTDesC8@@@Z @ 2 NONAME ; class ChspsDefinitionEngineInterface * ChspsDefinitionEngineInterface::NewL(class TDesC8 const &) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/eabi/hspsdefinitionengineinterfaceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/eabi/hspsdefinitionengineinterfaceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _ZN30ChspsDefinitionEngineInterface4NewLERK6TDesC8 @ 1 NONAME + _ZN30ChspsDefinitionEngineInterfaceD0Ev @ 2 NONAME + _ZN30ChspsDefinitionEngineInterfaceD1Ev @ 3 NONAME + _ZN30ChspsDefinitionEngineInterfaceD2Ev @ 4 NONAME + _ZTI30ChspsDefinitionEngineInterface @ 5 NONAME ; ## + _ZTV30ChspsDefinitionEngineInterface @ 6 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* 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: Bld.inf file for EcomElementProxy module +* +*/ + + +#include + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES +hspsdefinitionengineinterface.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/group/hspsdefinitionengineinterface.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/group/hspsdefinitionengineinterface.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: Project makefile for hspsdefinitionengineinterface +* +*/ + + +#include + +TARGET hspsdefinitionengineinterface.dll +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE dll +// Dll recognition UID followed by the unique UID for this dll +UID 0x1000008d 0x200159B9// old: 10207481 +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hspsdefinitionengineinterface.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../hspsdefinitionengine/inc +USERINCLUDE ../../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY charconv.lib +LIBRARY hspsodt.lib + +LANG SC + +START WINS + +END + +START MARM + +END + + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/src/hspsdefinitionengineinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdefinitionengine/hspsdefinitionengineinterface/src/hspsdefinitionengineinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Interface for accessing definitionengine +* +*/ + + +// INCLUDE FILES +#include "hspsdefinitionengineinterface.h" +#include "hspsdefinitionengine.rh" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngineInterface::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDefinitionEngineInterface* ChspsDefinitionEngineInterface::NewL( + const TDesC8& aPluginId ) + { + TUid interfaceUid = {KhspsDefinitionEngineIId}; + TEComResolverParams resolverParams; + resolverParams.SetDataType( aPluginId ); + resolverParams.SetWildcardMatch( ETrue ); + + TAny * ecom = NULL; + +#ifdef _DEBUG + TRAPD( + err, + ecom = REComSession::CreateImplementationL( + interfaceUid, + _FOFF(ChspsDefinitionEngineInterface, iDtorKey), + NULL, + resolverParams ) + ); + + if( err != KErrNone ) + { + REComSession::FinalClose(); + User::Leave( err ); + } +#else + + ecom = REComSession::CreateImplementationL( + interfaceUid, + _FOFF(ChspsDefinitionEngineInterface, iDtorKey), + NULL, + resolverParams ); +#endif + + ChspsDefinitionEngineInterface* element = + reinterpret_cast(ecom); + + return element; + + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionEngineInterface::Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDefinitionEngineInterface::~ChspsDefinitionEngineInterface() + { + REComSession::DestroyedImplementation(iDtorKey); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/bwins/hspsdomdocumentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/bwins/hspsdomdocumentu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,74 @@ +EXPORTS + ??1ChspsDomAttribute@@UAE@XZ @ 1 NONAME ; ChspsDomAttribute::~ChspsDomAttribute(void) + ??1ChspsDomDepthIterator@@UAE@XZ @ 2 NONAME ; ChspsDomDepthIterator::~ChspsDomDepthIterator(void) + ??1ChspsDomDocument@@UAE@XZ @ 3 NONAME ; ChspsDomDocument::~ChspsDomDocument(void) + ?AddChildL@ChspsDomNode@@QAEXPAV1@@Z @ 4 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *) + ?AddChildL@ChspsDomNode@@QAEXPAV1@H@Z @ 5 NONAME ; void ChspsDomNode::AddChildL(class ChspsDomNode *, int) + ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 6 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *) + ?AddItemL@ChspsDomList@@QAEXPAVMhspsDomListItem@@H@Z @ 7 NONAME ; void ChspsDomList::AddItemL(class MhspsDomListItem *, int) + ?AddStringL@ChspsDomStringPool@@QAEHABVTDesC8@@@Z @ 8 NONAME ; int ChspsDomStringPool::AddStringL(class TDesC8 const &) + ?AppendPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 9 NONAME ; void ChspsDomNode::AppendPCDataL(class TDesC8 const &) + ?AttributeList@ChspsDomNode@@QBEAAVChspsDomList@@XZ @ 10 NONAME ; class ChspsDomList & ChspsDomNode::AttributeList(void) const + ?AttributeValue@ChspsDomNode@@QBEABVTDesC8@@ABV2@@Z @ 11 NONAME ; class TDesC8 const & ChspsDomNode::AttributeValue(class TDesC8 const &) const + ?ChildNodes@ChspsDomNode@@QAEAAVChspsDomList@@XZ @ 12 NONAME ; class ChspsDomList & ChspsDomNode::ChildNodes(void) + ?CloneL@ChspsDomAttribute@@QAEPAV1@XZ @ 13 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::CloneL(void) + ?CloneL@ChspsDomDocument@@QAEPAV1@XZ @ 14 NONAME ; class ChspsDomDocument * ChspsDomDocument::CloneL(void) + ?CloneL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@@Z @ 15 NONAME ; class ChspsDomNode * ChspsDomNode::CloneL(class ChspsDomStringPool &) + ?CloneWithoutKidsL@ChspsDomNode@@QAEPAV1@AAVChspsDomStringPool@@@Z @ 16 NONAME ; class ChspsDomNode * ChspsDomNode::CloneWithoutKidsL(class ChspsDomStringPool &) + ?ContentType@ChspsDomNode@@QAEABW4TContentType@@XZ @ 17 NONAME ; enum TContentType const & ChspsDomNode::ContentType(void) + ?CreateElementNSL@ChspsDomDocument@@QAEPAVChspsDomNode@@ABVTDesC8@@0@Z @ 18 NONAME ; class ChspsDomNode * ChspsDomDocument::CreateElementNSL(class TDesC8 const &, class TDesC8 const &) + ?CreateRefNodeL@ChspsDomNode@@QAEPAV1@XZ @ 19 NONAME ; class ChspsDomNode * ChspsDomNode::CreateRefNodeL(void) + ?DeleteAttributeList@ChspsDomNode@@QAEXXZ @ 20 NONAME ; void ChspsDomNode::DeleteAttributeList(void) + ?DeleteChild@ChspsDomNode@@QAEXPAV1@@Z @ 21 NONAME ; void ChspsDomNode::DeleteChild(class ChspsDomNode *) + ?DeleteItem@ChspsDomList@@QAEXH@Z @ 22 NONAME ; void ChspsDomList::DeleteItem(int) + ?DeleteItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 23 NONAME ; void ChspsDomList::DeleteItem(class MhspsDomListItem *) + ?DescendantCount@ChspsDomNode@@QBEHXZ @ 24 NONAME ; int ChspsDomNode::DescendantCount(void) const + ?DomNodeCount@ChspsDomDocument@@QBEHXZ @ 25 NONAME ; int ChspsDomDocument::DomNodeCount(void) const + ?ExternalizeL@ChspsDomDocument@@QBEXAAVRWriteStream@@@Z @ 26 NONAME ; void ChspsDomDocument::ExternalizeL(class RWriteStream &) const + ?FindByName@ChspsDomList@@QAEPAVMhspsDomListItem@@ABVTDesC8@@@Z @ 27 NONAME ; class MhspsDomListItem * ChspsDomList::FindByName(class TDesC8 const &) + ?First@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 28 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::First(void) + ?First@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 29 NONAME ; class MhspsDomListItem * ChspsDomList::First(void) + ?InternalizeL@ChspsDomDocument@@QAEXAAVRReadStream@@@Z @ 30 NONAME ; void ChspsDomDocument::InternalizeL(class RReadStream &) + ?IsRefNode@ChspsDomNode@@QBEHXZ @ 31 NONAME ; int ChspsDomNode::IsRefNode(void) const + ?Item@ChspsDomList@@QBEPAVMhspsDomListItem@@H@Z @ 32 NONAME ; class MhspsDomListItem * ChspsDomList::Item(int) const + ?ItemIndex@ChspsDomList@@QBEHABVMhspsDomListItem@@@Z @ 33 NONAME ; int ChspsDomList::ItemIndex(class MhspsDomListItem const &) const + ?ItemIndex@ChspsDomNode@@QBEHABVMhspsDomListItem@@@Z @ 34 NONAME ; int ChspsDomNode::ItemIndex(class MhspsDomListItem const &) const + ?Last@ChspsDomList@@QAEPAVMhspsDomListItem@@XZ @ 35 NONAME ; class MhspsDomListItem * ChspsDomList::Last(void) + ?LastNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 36 NONAME ; class ChspsDomNode * ChspsDomDocument::LastNode(void) const + ?LayoutNode@ChspsDomNode@@QAEPAVChspsNode@@XZ @ 37 NONAME ; class ChspsNode * ChspsDomNode::LayoutNode(void) + ?Length@ChspsDomList@@QBEHXZ @ 38 NONAME ; int ChspsDomList::Length(void) const + ?MarshallL@ChspsDomDocument@@QAEPAVHBufC8@@XZ @ 39 NONAME ; class HBufC8 * ChspsDomDocument::MarshallL(void) + ?Name@ChspsDomAttribute@@UAEABVTDesC8@@XZ @ 40 NONAME ; class TDesC8 const & ChspsDomAttribute::Name(void) + ?Name@ChspsDomNode@@UAEABVTDesC8@@XZ @ 41 NONAME ; class TDesC8 const & ChspsDomNode::Name(void) + ?NameStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 42 NONAME ; short ChspsDomAttribute::NameStringPoolIndex(void) const + ?Namespace@ChspsDomNode@@QAEABVTDesC8@@XZ @ 43 NONAME ; class TDesC8 const & ChspsDomNode::Namespace(void) + ?NewL@ChspsDomAttribute@@SAPAV1@ABVTDesC8@@AAVChspsDomStringPool@@@Z @ 44 NONAME ; class ChspsDomAttribute * ChspsDomAttribute::NewL(class TDesC8 const &, class ChspsDomStringPool &) + ?NewL@ChspsDomDepthIterator@@SAPAV1@AAVChspsDomNode@@@Z @ 45 NONAME ; class ChspsDomDepthIterator * ChspsDomDepthIterator::NewL(class ChspsDomNode &) + ?NewL@ChspsDomDocument@@SAPAV1@AAVRReadStream@@@Z @ 46 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class RReadStream &) + ?NewL@ChspsDomDocument@@SAPAV1@PBVHBufC8@@@Z @ 47 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(class HBufC8 const *) + ?NewL@ChspsDomDocument@@SAPAV1@XZ @ 48 NONAME ; class ChspsDomDocument * ChspsDomDocument::NewL(void) + ?NextL@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@XZ @ 49 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextL(void) + ?NextSibling@ChspsDomDepthIterator@@UAEPAVChspsDomNode@@AAV2@@Z @ 50 NONAME ; class ChspsDomNode * ChspsDomDepthIterator::NextSibling(class ChspsDomNode &) + ?NodeId@ChspsDomNode@@QBEHXZ @ 51 NONAME ; int ChspsDomNode::NodeId(void) const + ?PCData@ChspsDomNode@@QAEABVTDesC8@@XZ @ 52 NONAME ; class TDesC8 const & ChspsDomNode::PCData(void) + ?Parent@ChspsDomNode@@QBEPAV1@XZ @ 53 NONAME ; class ChspsDomNode * ChspsDomNode::Parent(void) const + ?RemoveItem@ChspsDomList@@QAEXH@Z @ 54 NONAME ; void ChspsDomList::RemoveItem(int) + ?RemoveItem@ChspsDomList@@QAEXPAVMhspsDomListItem@@@Z @ 55 NONAME ; void ChspsDomList::RemoveItem(class MhspsDomListItem *) + ?ReplaceChildL@ChspsDomNode@@QAEXPAV1@0@Z @ 56 NONAME ; void ChspsDomNode::ReplaceChildL(class ChspsDomNode *, class ChspsDomNode *) + ?Reset@ChspsDomList@@QAEXXZ @ 57 NONAME ; void ChspsDomList::Reset(void) + ?RootNode@ChspsDomDocument@@QBEPAVChspsDomNode@@XZ @ 58 NONAME ; class ChspsDomNode * ChspsDomDocument::RootNode(void) const + ?SetContentType@ChspsDomNode@@QAEXABW4TContentType@@@Z @ 59 NONAME ; void ChspsDomNode::SetContentType(enum TContentType const &) + ?SetLayoutNode@ChspsDomNode@@QAEXPAVChspsNode@@@Z @ 60 NONAME ; void ChspsDomNode::SetLayoutNode(class ChspsNode *) + ?SetNodeId@ChspsDomNode@@QAEXH@Z @ 61 NONAME ; void ChspsDomNode::SetNodeId(int) + ?SetPCDataL@ChspsDomNode@@QAEXABVTDesC8@@@Z @ 62 NONAME ; void ChspsDomNode::SetPCDataL(class TDesC8 const &) + ?SetParent@ChspsDomNode@@QAEXPAV1@@Z @ 63 NONAME ; void ChspsDomNode::SetParent(class ChspsDomNode *) + ?SetRefNode@ChspsDomNode@@QAEXH@Z @ 64 NONAME ; void ChspsDomNode::SetRefNode(int) + ?SetRootNode@ChspsDomDocument@@QAEXPAVChspsDomNode@@@Z @ 65 NONAME ; void ChspsDomDocument::SetRootNode(class ChspsDomNode *) + ?SetValueL@ChspsDomAttribute@@QAEXABVTDesC8@@@Z @ 66 NONAME ; void ChspsDomAttribute::SetValueL(class TDesC8 const &) + ?Size@ChspsDomDocument@@QBEHXZ @ 67 NONAME ; int ChspsDomDocument::Size(void) const + ?StringPool@ChspsDomDocument@@QBEAAVChspsDomStringPool@@XZ @ 68 NONAME ; class ChspsDomStringPool & ChspsDomDocument::StringPool(void) const + ?StringPool@ChspsDomList@@QBEAAVChspsDomStringPool@@XZ @ 69 NONAME ; class ChspsDomStringPool & ChspsDomList::StringPool(void) const + ?StringPool@ChspsDomNode@@QBEAAVChspsDomStringPool@@XZ @ 70 NONAME ; class ChspsDomStringPool & ChspsDomNode::StringPool(void) const + ?Value@ChspsDomAttribute@@QAEABVTDesC8@@XZ @ 71 NONAME ; class TDesC8 const & ChspsDomAttribute::Value(void) + ?ValueStringPoolIndex@ChspsDomAttribute@@QBEFXZ @ 72 NONAME ; short ChspsDomAttribute::ValueStringPoolIndex(void) const + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/eabi/hspsdomdocumentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/eabi/hspsdomdocumentu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +EXPORTS + _ZN12ChspsDomList10DeleteItemEP16MhspsDomListItem @ 1 NONAME + _ZN12ChspsDomList10DeleteItemEi @ 2 NONAME + _ZN12ChspsDomList10FindByNameERK6TDesC8 @ 3 NONAME + _ZN12ChspsDomList10RemoveItemEP16MhspsDomListItem @ 4 NONAME + _ZN12ChspsDomList10RemoveItemEi @ 5 NONAME + _ZN12ChspsDomList4LastEv @ 6 NONAME + _ZN12ChspsDomList5FirstEv @ 7 NONAME + _ZN12ChspsDomList5ResetEv @ 8 NONAME + _ZN12ChspsDomList8AddItemLEP16MhspsDomListItem @ 9 NONAME + _ZN12ChspsDomList8AddItemLEP16MhspsDomListItemi @ 10 NONAME + _ZN12ChspsDomNode10ChildNodesEv @ 11 NONAME + _ZN12ChspsDomNode10LayoutNodeEv @ 12 NONAME + _ZN12ChspsDomNode10SetPCDataLERK6TDesC8 @ 13 NONAME + _ZN12ChspsDomNode10SetRefNodeEi @ 14 NONAME + _ZN12ChspsDomNode11ContentTypeEv @ 15 NONAME + _ZN12ChspsDomNode11DeleteChildEPS_ @ 16 NONAME + _ZN12ChspsDomNode13AppendPCDataLERK6TDesC8 @ 17 NONAME + _ZN12ChspsDomNode13ReplaceChildLEPS_S0_ @ 18 NONAME + _ZN12ChspsDomNode13SetLayoutNodeEP9ChspsNode @ 19 NONAME + _ZN12ChspsDomNode14CreateRefNodeLEv @ 20 NONAME + _ZN12ChspsDomNode14SetContentTypeERK12TContentType @ 21 NONAME + _ZN12ChspsDomNode17CloneWithoutKidsLER18ChspsDomStringPool @ 22 NONAME + _ZN12ChspsDomNode19DeleteAttributeListEv @ 23 NONAME + _ZN12ChspsDomNode4NameEv @ 24 NONAME + _ZN12ChspsDomNode6CloneLER18ChspsDomStringPool @ 25 NONAME + _ZN12ChspsDomNode6PCDataEv @ 26 NONAME + _ZN12ChspsDomNode9AddChildLEPS_ @ 27 NONAME + _ZN12ChspsDomNode9AddChildLEPS_i @ 28 NONAME + _ZN12ChspsDomNode9NamespaceEv @ 29 NONAME + _ZN12ChspsDomNode9SetNodeIdEi @ 30 NONAME + _ZN12ChspsDomNode9SetParentEPS_ @ 31 NONAME + _ZN16ChspsDomDocument11SetRootNodeEP12ChspsDomNode @ 32 NONAME + _ZN16ChspsDomDocument12InternalizeLER11RReadStream @ 33 NONAME + _ZN16ChspsDomDocument16CreateElementNSLERK6TDesC8S2_ @ 34 NONAME + _ZN16ChspsDomDocument4NewLEPK6HBufC8 @ 35 NONAME + _ZN16ChspsDomDocument4NewLER11RReadStream @ 36 NONAME + _ZN16ChspsDomDocument4NewLEv @ 37 NONAME + _ZN16ChspsDomDocument6CloneLEv @ 38 NONAME + _ZN16ChspsDomDocument9MarshallLEv @ 39 NONAME + _ZN16ChspsDomDocumentD0Ev @ 40 NONAME + _ZN16ChspsDomDocumentD1Ev @ 41 NONAME + _ZN16ChspsDomDocumentD2Ev @ 42 NONAME + _ZN17ChspsDomAttribute4NameEv @ 43 NONAME + _ZN17ChspsDomAttribute4NewLERK6TDesC8R18ChspsDomStringPool @ 44 NONAME + _ZN17ChspsDomAttribute5ValueEv @ 45 NONAME + _ZN17ChspsDomAttribute6CloneLEv @ 46 NONAME + _ZN17ChspsDomAttribute9SetValueLERK6TDesC8 @ 47 NONAME + _ZN17ChspsDomAttributeD0Ev @ 48 NONAME + _ZN17ChspsDomAttributeD1Ev @ 49 NONAME + _ZN17ChspsDomAttributeD2Ev @ 50 NONAME + _ZN18ChspsDomStringPool10AddStringLERK6TDesC8 @ 51 NONAME + _ZN21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 52 NONAME + _ZN21ChspsDomDepthIterator4NewLER12ChspsDomNode @ 53 NONAME + _ZN21ChspsDomDepthIterator5FirstEv @ 54 NONAME + _ZN21ChspsDomDepthIterator5NextLEv @ 55 NONAME + _ZN21ChspsDomDepthIteratorD0Ev @ 56 NONAME + _ZN21ChspsDomDepthIteratorD1Ev @ 57 NONAME + _ZN21ChspsDomDepthIteratorD2Ev @ 58 NONAME + _ZNK12ChspsDomList10StringPoolEv @ 59 NONAME + _ZNK12ChspsDomList4ItemEi @ 60 NONAME + _ZNK12ChspsDomList6LengthEv @ 61 NONAME + _ZNK12ChspsDomList9ItemIndexERK16MhspsDomListItem @ 62 NONAME + _ZNK12ChspsDomNode10StringPoolEv @ 63 NONAME + _ZNK12ChspsDomNode13AttributeListEv @ 64 NONAME + _ZNK12ChspsDomNode14AttributeValueERK6TDesC8 @ 65 NONAME + _ZNK12ChspsDomNode15DescendantCountEv @ 66 NONAME + _ZNK12ChspsDomNode6NodeIdEv @ 67 NONAME + _ZNK12ChspsDomNode6ParentEv @ 68 NONAME + _ZNK12ChspsDomNode9IsRefNodeEv @ 69 NONAME + _ZNK12ChspsDomNode9ItemIndexERK16MhspsDomListItem @ 70 NONAME + _ZNK16ChspsDomDocument10StringPoolEv @ 71 NONAME + _ZNK16ChspsDomDocument12DomNodeCountEv @ 72 NONAME + _ZNK16ChspsDomDocument12ExternalizeLER12RWriteStream @ 73 NONAME + _ZNK16ChspsDomDocument4SizeEv @ 74 NONAME + _ZNK16ChspsDomDocument8LastNodeEv @ 75 NONAME + _ZNK16ChspsDomDocument8RootNodeEv @ 76 NONAME + _ZNK17ChspsDomAttribute19NameStringPoolIndexEv @ 77 NONAME + _ZNK17ChspsDomAttribute20ValueStringPoolIndexEv @ 78 NONAME + _ZTI12ChspsDomList @ 79 NONAME ; ## + _ZTI12ChspsDomNode @ 80 NONAME ; ## + _ZTI16ChspsDomDocument @ 81 NONAME ; ## + _ZTI17ChspsDomAttribute @ 82 NONAME ; ## + _ZTI18ChspsDomStringPool @ 83 NONAME ; ## + _ZTI21ChspsDomDepthIterator @ 84 NONAME ; ## + _ZTV12ChspsDomList @ 85 NONAME ; ## + _ZTV12ChspsDomNode @ 86 NONAME ; ## + _ZTV16ChspsDomDocument @ 87 NONAME ; ## + _ZTV17ChspsDomAttribute @ 88 NONAME ; ## + _ZTV18ChspsDomStringPool @ 89 NONAME ; ## + _ZTV21ChspsDomDepthIterator @ 90 NONAME ; ## + _ZThn4_N12ChspsDomNode4NameEv @ 91 NONAME ; ## + _ZThn4_N17ChspsDomAttribute4NameEv @ 92 NONAME ; ## + _ZThn4_N17ChspsDomAttributeD0Ev @ 93 NONAME ; ## + _ZThn4_N17ChspsDomAttributeD1Ev @ 94 NONAME ; ## + _ZThn4_N21ChspsDomDepthIterator11NextSiblingER12ChspsDomNode @ 95 NONAME ; ## + _ZThn4_N21ChspsDomDepthIterator5FirstEv @ 96 NONAME ; ## + _ZThn4_N21ChspsDomDepthIterator5NextLEv @ 97 NONAME ; ## + _ZThn4_N21ChspsDomDepthIteratorD0Ev @ 98 NONAME ; ## + _ZThn4_N21ChspsDomDepthIteratorD1Ev @ 99 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2002-2004 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: bld.inf for hspsDomDocument.dll +* +*/ + + +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_EXPORTS + +PRJ_MMPFILES +hspsdomdocument.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/group/hspsdomdocument.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/group/hspsdomdocument.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-2004 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: Project .mmp file +* +*/ + + +#include + +TARGET hspsdomdocument.dll +CAPABILITY CAP_GENERAL_DLL +TARGETTYPE dll +UID 0x1000008d 0x200159BB //old uid 10207392 +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE hspsdomdocument.cpp +SOURCE hspsdomnode.cpp +SOURCE hspsdomattribute.cpp +SOURCE hspsdomlist.cpp +SOURCE hspsdomdepthiterator.cpp +SOURCE hspsdomstringpool.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY gdi.lib + + + +LANG SC + +START WINS + +END + +START MARM + +END diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,207 @@ +/* +* 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: Represent single xmluiml attribute +* +*/ + + + +// INCLUDE FILES +#include "hspsdomattribute.h" +#include "hspsdomstringpool.h" + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::ChspsDomAttribute +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDomAttribute::ChspsDomAttribute( ChspsDomStringPool& aStringPool ): + iStringPool( aStringPool ), + iNameRef( KErrNotFound ), + iValueRef( KErrNotFound ) + { + } + + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomAttribute::ConstructL( const TDesC8& aName ) + { + iNameRef = iStringPool.AddStringL( aName ); + } +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomAttribute* ChspsDomAttribute::NewL( + const TDesC8& aName, + ChspsDomStringPool& aStringPool ) + { + ChspsDomAttribute* self = new( ELeave ) ChspsDomAttribute( aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL( aName ); + CleanupStack::Pop( self ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomAttribute* ChspsDomAttribute::NewL( + RReadStream& aStream, + ChspsDomStringPool& aStringPool ) + { + ChspsDomAttribute* self = new( ELeave ) ChspsDomAttribute( aStringPool ); + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::~ChspsDomAttribute +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomAttribute::~ChspsDomAttribute() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomAttribute* ChspsDomAttribute::CloneL() + { + ChspsDomAttribute* clone = new (ELeave)ChspsDomAttribute( iStringPool ); + clone->iNameRef = iNameRef; + clone->iValueRef = iValueRef; + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::CloneL +// ----------------------------------------------------------------------------- +// +ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool ) + { + const TDesC8& name = iStringPool.String( iNameRef ); + + ChspsDomAttribute* clone = ChspsDomAttribute::NewL( name, aStringPool ); + CleanupStack::PushL( clone ); + if ( iValueRef > KErrNotFound ) + { + const TDesC8& value = iStringPool.String( iValueRef ); + clone->SetValueL( value ); + } + CleanupStack::Pop( clone ); + return clone; + + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::Name +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomAttribute::Name() + { + return iStringPool.String( iNameRef ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::NameStringPoolIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 ChspsDomAttribute::NameStringPoolIndex()const + { + return iNameRef; + } +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::Value +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomAttribute::Value() + { + if ( iValueRef > KErrNotFound ) + { + return iStringPool.String( iValueRef ); + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::ValueStringPoolIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt16 ChspsDomAttribute::ValueStringPoolIndex()const + { + return iValueRef; + } +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::SetValueL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomAttribute::SetValueL( const TDesC8& aValue ) + { + iValueRef = iStringPool.AddStringL( aValue ); + } + + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::Size +// ----------------------------------------------------------------------------- +// +TInt ChspsDomAttribute::Size() const + { + TInt size( 0 ); + + size += sizeof(TInt16); // iNameRef + + size += sizeof(TInt16); // iValueRef + + return size; + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::ExternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomAttribute::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt16L( iNameRef ); + aStream.WriteInt16L( iValueRef ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomAttribute::InternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomAttribute::InternalizeL( RReadStream& aStream ) + { + iNameRef = aStream.ReadInt16L(); + iValueRef = aStream.ReadInt16L(); + } +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/src/hspsdomdepthiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomdepthiterator.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,190 @@ +/* +* 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: Depth iterator walks the dom tree using depth first principle. +* +*/ + + + +// INCLUDE FILES +#include "hspsdomdepthiterator.h" +#include "hspsdomlist.h" +#include "hspsdomnode.h" + +// ============================ LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::ChspsDomDepthIterator +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDomDepthIterator::ChspsDomDepthIterator( ChspsDomNode& aRootNode ): + iFirst(&aRootNode), iCurrent(&aRootNode) + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomDepthIterator::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDepthIterator* ChspsDomDepthIterator::NewL( ChspsDomNode& aRootNode ) + { + ChspsDomDepthIterator* self = new( ELeave ) ChspsDomDepthIterator( aRootNode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +EXPORT_C ChspsDomDepthIterator::~ChspsDomDepthIterator() + { + iDepthLevel.Close(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::First +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomDepthIterator::First() + { + return iFirst; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::Next +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomDepthIterator::NextL() + { + ChspsDomNode* sibling = NULL; + ChspsDomNode* firstChild = NULL; + + //Initialise iCurrent if the whole tree has been walked through + if (!iCurrent) + { + iCurrent = iFirst; + } + + firstChild = static_cast( iCurrent->ChildNodes().First() ); + + // Current node has childs left + if (firstChild) + { + //Keep count of depth level + PushL( *iCurrent ); + iCurrent = firstChild; + } + else //If current node has siblings left + { + sibling = NextSibling(*iCurrent); + if(sibling) + { + iCurrent = sibling; + } + else //Current node don't have any childs or siblings left + { + // Reverse the tree by moving up in hierarchy + // Move up one level in hierarchy and check if siblings exists or we are in a + // root level + TBool stop( EFalse ); + while( !stop && iDepthLevel.Count() ) + { + iCurrent = Pop(); //Reach the previous level + sibling = NextSibling( *iCurrent ); //Check if siblings exist + if ( sibling && iDepthLevel.Count() ) + { + iCurrent = sibling; + stop = ETrue; + } + else //We didn't find any siblings + { + iCurrent = NULL; + } + } + } + } + return iCurrent; + } + +// ----------------------------------------------------------------------------- +// NextSibling Find next sibling. +// Returns NULL if there is no siblings left or there is no parent i.e this is a +// root node +// Returns: ChspsDomNode* Pointer to the node or NULL +// +// ----------------------------------------------------------------------------- +// + +EXPORT_C ChspsDomNode* ChspsDomDepthIterator::NextSibling( ChspsDomNode& aNode ) + { + ChspsDomNode* left = NULL; + ChspsDomNode* parent = aNode.Parent(); + if ( parent ) + { + ChspsDomList& nodeList = parent->ChildNodes(); + TInt currentIndex( nodeList.ItemIndex( aNode ) ); + TInt nextIndex( ++currentIndex ); + TInt length( nodeList.Length() ); + if ( nextIndex < length ) + { + left = static_cast( nodeList.Item( nextIndex ) ); + } + } + return left; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::PushL +// ----------------------------------------------------------------------------- +// +void ChspsDomDepthIterator::PushL( ChspsDomNode& aNode ) + { + iDepthLevel.AppendL( &aNode ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomDepthIterator::Pop +// ----------------------------------------------------------------------------- +// +ChspsDomNode* ChspsDomDepthIterator::Pop() + { + ChspsDomNode* pop = NULL; + TInt count( iDepthLevel.Count() ); + if ( count ) + { + pop = iDepthLevel[ count-1 ]; + iDepthLevel.Remove( count-1 ); + } + return pop; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/src/hspsdomdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomdocument.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,280 @@ +/* +* 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: Represents the entire xmluiml specific xml and css data. +* +*/ + + + +// INCLUDE FILES +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsdomlist.h" +#include "hspsdomstringpool.h" +#include + + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// ChspsDomDocument::CloneL() +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDocument* ChspsDomDocument::CloneL() + { + ChspsDomDocument* clone = new (ELeave) ChspsDomDocument; + CleanupStack::PushL( clone ); + + clone->iDomStringPool = iDomStringPool->CloneL(); + if ( iRootNode ) + { + clone->iRootNode = iRootNode->CloneL( *clone->iDomStringPool ); + } + + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::CreateElementNSL +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomDocument::CreateElementNSL( + const TDesC8& aName, + const TDesC8& aNamespace ) + { + return ChspsDomNode::NewL( aName, aNamespace, *iDomStringPool ); + } +// ----------------------------------------------------------------------------- +// ChspsDomDocument::ChspsDomDocument +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDomDocument::ChspsDomDocument() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomDocument::ConstructL() + { + iDomStringPool = ChspsDomStringPool::NewL(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDocument* ChspsDomDocument::NewL() + { + ChspsDomDocument* self = new( ELeave ) ChspsDomDocument; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } +// ----------------------------------------------------------------------------- +// ChspsDomDocument::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDocument* ChspsDomDocument::NewL( + RReadStream& aStream ) + { + ChspsDomDocument* self = new( ELeave ) ChspsDomDocument; + + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } +// ----------------------------------------------------------------------------- +// ChspsDomDocument::NewL +// Constructs ChspsDomDocument from streamed HBufC8. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDocument* ChspsDomDocument::NewL( + const HBufC8* aBufStream ) + { + RDesReadStream readStream( *aBufStream ); + CleanupClosePushL( readStream ); + ChspsDomDocument* self = ChspsDomDocument::NewL( readStream ); + CleanupStack::PopAndDestroy( &readStream ); + return self; + } + +// Destructor +EXPORT_C ChspsDomDocument::~ChspsDomDocument() + { + if ( iRootNode ) + { + delete iRootNode; + } + + if ( iDomStringPool ) + { + delete iDomStringPool; + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::DomNodeCount +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomDocument::DomNodeCount() const + { + TInt count( 0 ); + if ( iRootNode ) + { + count = iRootNode->DescendantCount(); + } + return count; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::ExternalizeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomDocument::ExternalizeL( RWriteStream& aStream ) const + { + aStream << *iDomStringPool; + + if ( iRootNode ) + { + aStream.WriteInt8L( ETrue ); //Root node exist + aStream << *iRootNode; + } + else + { + aStream.WriteInt8L( EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::InternalizeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomDocument::InternalizeL( RReadStream& aStream ) + { + if(iDomStringPool) + { + delete iDomStringPool; + iDomStringPool = NULL; + } + iDomStringPool = ChspsDomStringPool::NewL( aStream ); + + if ( iRootNode ) + { + delete iRootNode; + iRootNode = NULL; + } + + TBool rootNodeExist( aStream.ReadInt8L() ); + if ( rootNodeExist ) + { + iRootNode = ChspsDomNode::NewL( aStream, *iDomStringPool ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::SetRootNode +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomDocument::SetRootNode( ChspsDomNode* aRootNode ) + { + iRootNode = aRootNode; + iRootNode->SetParent( NULL ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::RootNode +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomDocument::RootNode() const + { + return iRootNode; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::LastNode +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomDocument::LastNode() const + { + ChspsDomNode* last = NULL; + if ( iRootNode ) + { + last = iRootNode; + ChspsDomNode* tmp = iRootNode; + while( tmp ) + { + last = tmp; + tmp = static_cast( last->ChildNodes().Last() ); + } + } + return last; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::Size +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomDocument::Size() const + { + TInt size( 1 ); //Root node information takes one byte + size += iDomStringPool->Size(); + + if ( iRootNode ) + { + + size += iRootNode->Size(); + } + + return size; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::MarshallL +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* ChspsDomDocument::MarshallL() + { + TInt dataLength = Size(); + HBufC8* writeBuf = HBufC8::NewLC( dataLength ); + TPtr8 p( writeBuf->Des() ); + RDesWriteStream writeStream( p ); //stream over the buffer + CleanupClosePushL( writeStream ); + writeStream << *this; //Stream object + CleanupStack::PopAndDestroy( &writeStream ); + CleanupStack::Pop( writeBuf ); + return writeBuf; + } + +// ----------------------------------------------------------------------------- +// ChspsDomDocument::StringPool +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomStringPool& ChspsDomDocument::StringPool() const + { + return *iDomStringPool; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/src/hspsdomlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomlist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,358 @@ +/* +* 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: List class to hold ChspsDomList objects. +* +*/ + + + +// INCLUDE FILES +#include "hspsdomlist.h" +#include "hspsdomnode.h" +#include "hspsdomattribute.h" +#include "hspsdomstringpool.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDomList::ChspsDomList +// C++ parameter constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDomList::ChspsDomList( TListType aListType, ChspsDomStringPool& aStringPool ): + iListType( aListType ), + iList( 1 ), + iStringPool( aStringPool ) + { + } +// ----------------------------------------------------------------------------- +// ChspsDomList::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomList::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomList* ChspsDomList::NewL( TListType aListType, ChspsDomStringPool& aStringPool ) + { + ChspsDomList* self = new( ELeave ) ChspsDomList( aListType, aStringPool ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } +// ----------------------------------------------------------------------------- +// ChspsDomList::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomList* ChspsDomList::NewL( + RReadStream& aStream, + ChspsDomStringPool& aStringPool ) + { + ChspsDomList* self = new( ELeave ) ChspsDomList( ENodeList, aStringPool ); + + CleanupStack::PushL( self ); + + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } + +// Destructor +ChspsDomList::~ChspsDomList() + { + iList.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::Reset +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::Reset() + { + iList.Reset(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::AddItemL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::AddItemL( MhspsDomListItem* aItem ) + { + iList.AppendL( aItem ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::AddItemL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::AddItemL( MhspsDomListItem* aItem, TInt aIndex ) + { + iList.InsertL( aItem, aIndex ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::RemoveItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::RemoveItem( TInt aIndex ) + { + iList.Remove( aIndex); + iList.Compress(); + } +// ----------------------------------------------------------------------------- +// ChspsDomList::DeleteItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::DeleteItem( TInt aIndex ) + { + delete iList[ aIndex ]; + iList.Remove( aIndex); + iList.Compress(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::RemoveItem +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomList::RemoveItem( MhspsDomListItem* aItem ) + { + MhspsDomListItem* tmp = NULL; + TInt count( iList.Count() ); + TBool stop( EFalse ); + for ( TInt i=0; iName() ) == 0 ) + { + return tmp; + } + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// ChspsDomList::ItemIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomList::ItemIndex( const MhspsDomListItem& aItem ) const + { + + MhspsDomListItem* tmp = NULL; + TInt count( iList.Count() ); + for ( TInt i=0; iSize(); + } + return size; + } +// ----------------------------------------------------------------------------- +// ChspsDomList::ExternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomList::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt8L( iListType ); + + + TInt count( iList.Count() ); + aStream.WriteInt32L( count ); + + + for ( TInt i=0; i( aStream.ReadInt8L() ); + + TInt count ( aStream.ReadInt32L() ); + for ( TInt i=0; iConstructL( aName, aNS ); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomNode* ChspsDomNode::NewL( RReadStream& aStream, ChspsDomStringPool& aStringPool ) + { + ChspsDomNode* self = new( ELeave ) ChspsDomNode( aStringPool ); + + CleanupStack::PushL( self ); + + aStream >> *self; + CleanupStack::Pop( self ); + + return self; + } + +// Destructor +ChspsDomNode::~ChspsDomNode() + { + delete iChildList; + delete iAttributeList; + + delete iPCData; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::CloneL +// Clones this node and it's child nodes. This is a recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomNode::CloneL( ChspsDomStringPool& aStringPool ) + { + const TDesC8& name = iStringPool.String( iNameRef ); + const TDesC8& ns = iStringPool.String( iNSRef ); + + ChspsDomNode* clone = ChspsDomNode::NewL( name, ns, aStringPool ); + CleanupStack::PushL( clone ); + if ( iPCData ) + { + clone->AppendPCDataL( *iPCData ); + } + clone->iNodeId = iNodeId; + clone->iRefNode = iRefNode; + + TInt childCount( iChildList->Length() ); + + for ( TInt i=0; i( iChildList->Item(i) )->CloneL( aStringPool ); + CleanupStack::PushL( childClone ); + childClone->iParentNode = clone; + clone->iChildList->AddItemL( childClone ); + CleanupStack::Pop( childClone ); + } + + TInt attrCount( iAttributeList->Length() ); + for ( TInt j=0; j( iAttributeList->Item(j) )->CloneL( aStringPool ); + CleanupStack::PushL( attrClone ); + clone->iAttributeList->AddItemL( attrClone ); + CleanupStack::Pop( attrClone ); + } + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::CloneWithoutKidsL +// Clones only this node. This is a recursive function. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomNode::CloneWithoutKidsL( ChspsDomStringPool& aStringPool ) + { + const TDesC8& name = iStringPool.String( iNameRef ); + const TDesC8& ns = iStringPool.String( iNSRef ); + + ChspsDomNode* clone = ChspsDomNode::NewL( name, ns, aStringPool ); + CleanupStack::PushL( clone ); + if ( iPCData ) + { + clone->AppendPCDataL( *iPCData ); + } + clone->iNodeId = iNodeId; + clone->iRefNode = iRefNode; + + TInt attrCount( iAttributeList->Length() ); + for ( TInt j=0; j( iAttributeList->Item(j) )->CloneL( aStringPool ); + CleanupStack::PushL( attrClone ); + clone->iAttributeList->AddItemL( attrClone ); + CleanupStack::Pop( attrClone ); + } + + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::CreateRefNodeL +// Recursive function to create referer nodes. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomNode::CreateRefNodeL() + { + const TDesC8& name = iStringPool.String( iNameRef ); + const TDesC8& ns = iStringPool.String( iNSRef ); + + ChspsDomNode* ref = ChspsDomNode::NewL( name, ns, iStringPool ); + CleanupStack::PushL( ref ); + + ref->iRefNode = ETrue; + + TInt childCount( iChildList->Length() ); + + for ( TInt i=0; i( iChildList->Item(i) )->CreateRefNodeL(); + CleanupStack::PushL( childRef ); + childRef->iParentNode = ref; + ref->iChildList->AddItemL( childRef ); + CleanupStack::Pop( childRef ); + } + + ChspsDomAttribute* attr = NULL; + if ( !iRefNode ) + { + attr = static_cast( iAttributeList->FindByName( KIdAttr ) ); + } + else + { + attr = static_cast( iAttributeList->FindByName( KRefAttr ) ); + } + + if ( attr ) + { + ChspsDomAttribute* newAttr = ChspsDomAttribute::NewL( KRefAttr, iStringPool ); + CleanupStack::PushL( newAttr ); + newAttr->SetValueL( attr->Value() ); + ref->iAttributeList->AddItemL( newAttr ); + CleanupStack::Pop( newAttr ); + } + else + { + //referred node don't have an id or ref, thats not ok. + User::Leave(KErrArgument); + } + + CleanupStack::Pop( ref ); + return ref; + } + + +// ----------------------------------------------------------------------------- +// ChspsDomNode::Name +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomNode::Name() + { + return iStringPool.String( iNameRef ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::Namespace +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomNode::Namespace() + { + return iStringPool.String( iNSRef ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::AttributeList +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomList& ChspsDomNode::AttributeList() const + { + return *iAttributeList; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetParent +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetParent( ChspsDomNode* aParent ) + { + iParentNode = aParent; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::Parent +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomNode* ChspsDomNode::Parent()const + { + return iParentNode; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::AddChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::AddChildL( ChspsDomNode* aNode ) + { + aNode->SetParent( this ); + iChildList->AddItemL( aNode ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::AddChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::AddChildL( ChspsDomNode* aNode, TInt aIndex ) + { + aNode->SetParent( this ); + iChildList->AddItemL( aNode, aIndex ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::DeleteChild +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::DeleteChild( ChspsDomNode* aNode ) + { + iChildList->DeleteItem( aNode ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::ReplaceChildL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::ReplaceChildL( + ChspsDomNode* aNode, + ChspsDomNode* aNewNode ) + { + ChspsDomNode* swapChild = NULL; + ChspsDomList& childList = aNode->ChildNodes(); + TInt childCount( childList.Length() ); + for ( TInt i=0; i( childList.Item(i) ); + aNewNode->AddChildL( swapChild ); //Let the new node adopt the child + //cannot remove it during iterating childlist + //childList.RemoveItem( swapChild ); //Remove it from the orginal parent + } + iChildList->DeleteItem( aNode ); // Delete the old child + + aNewNode->SetParent( this ); //Set new child + iChildList->AddItemL( aNewNode ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::ChildNodes +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomList& ChspsDomNode::ChildNodes() + { + return *iChildList; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetNodeId +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetNodeId( const TInt aNodeId ) + { + iNodeId = aNodeId; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::NodeId +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomNode::NodeId() const + { + return iNodeId; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::ItemIndex +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomNode::ItemIndex( const MhspsDomListItem& aItem )const + { + return iChildList->ItemIndex( aItem ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::AppendPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::AppendPCDataL( const TDesC8& aPCData ) + { + if ( iPCData ) + { + iPCData = iPCData->ReAllocL( iPCData->Length() + aPCData.Length() ); + iPCData->Des().Append( aPCData ); + } + else + { + iPCData = aPCData.AllocL(); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsDomNode::PCData +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomNode::PCData() + { + if ( iPCData ) + { + return *iPCData; + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetPCDataL +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetPCDataL( const TDesC8& aPCData ) + { + if ( iPCData ) + { + delete iPCData; + iPCData = NULL; + } + iPCData = aPCData.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::ContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C const TContentType& ChspsDomNode::ContentType() + { + return iContentType; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetContentType( const TContentType& aContentType ) + { + iContentType = aContentType; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::StringPool +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomStringPool& ChspsDomNode::StringPool() const + { + return iStringPool; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetRefNode +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetRefNode( TBool aRefNode ) + { + iRefNode = aRefNode; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::IsRefNode +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool ChspsDomNode::IsRefNode() const + { + return iRefNode; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::Size +// ----------------------------------------------------------------------------- +// +TInt ChspsDomNode::Size() const + { + TInt size( 0 ); + + size += sizeof( TInt16 ); //iNameRef + size += sizeof( TInt16 ); //iNSRef + size += sizeof( TBool ); //iRefNode + if ( iPCData ) + { + size += sizeof( TInt8 ); + size += sizeof( TInt16 ); + size += iPCData->Size(); + size++; + } + else + { + size += sizeof( TInt8 ); + } + + size += sizeof( TInt32 ); //For nodeId + size += iAttributeList->Size(); + + size += iChildList->Size(); + + return size; + } +// ----------------------------------------------------------------------------- +// ChspsDomNode::ExternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomNode::ExternalizeL( RWriteStream& aStream ) const + { + + aStream.WriteInt16L( iNameRef ); + aStream.WriteInt16L( iNSRef ); + aStream.WriteInt8L( iRefNode ); + + if ( iPCData ) + { + aStream.WriteInt8L( ETrue ); + aStream.WriteInt16L( iPCData->Length() ); + aStream << *iPCData; + } + else + { + aStream.WriteInt8L( EFalse ); + } + + aStream.WriteInt32L( iNodeId ); + aStream << *iChildList; + aStream << *iAttributeList; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::InternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomNode::InternalizeL( RReadStream& aStream ) + { + iNameRef = aStream.ReadInt16L(); + iNSRef = aStream.ReadInt16L(); + iRefNode = aStream.ReadInt8L(); + + TInt len( 0 ); + TBool exist( aStream.ReadInt8L() ); + if ( exist ) + { + len = aStream.ReadInt16L(); + delete iPCData; + iPCData = NULL; + iPCData = HBufC8::NewL( aStream, len ); + } + + iNodeId = aStream.ReadInt32L(); + + iChildList = ChspsDomList::NewL( aStream, iStringPool ); + TInt count( iChildList->Length() ); + for( TInt i=0; i( iChildList->Item( i ) ); + if ( node ) + { + node->SetParent( this ); + } + else + { + User::Leave( KErrArgument ); + } + } + + iAttributeList = ChspsDomList::NewL( aStream, iStringPool ); + } + + + +// ----------------------------------------------------------------------------- +// ChspsDomNode::DescendantCount +// Recursive counting function +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomNode::DescendantCount() const + { + TInt count( 1 ); //Node itself + + TInt length( iChildList->Length() ); + for ( TInt i=0; i( iChildList->Item( i ) )->DescendantCount(); + } + + return count; + } + + +// ----------------------------------------------------------------------------- +// ChspsDomNode::DeleteAttributeList +// Deletes the attribute list +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::DeleteAttributeList() + { + delete iAttributeList; + iAttributeList = NULL; + + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::AttributeValue +// Returns value of "name" attribute +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& ChspsDomNode::AttributeValue(const TDesC8& aAttribute) const + { + ChspsDomAttribute* attribute = + static_cast(iAttributeList->FindByName(aAttribute)); + if(attribute) + { + return attribute->Value(); + } + else + { + return KNullDesC8; + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::SetLayoutNode +// Sets pointer to associated layout node +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDomNode::SetLayoutNode(ChspsNode* aNode) + { + iLayoutNode = aNode; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::LayoutNode +// Gets pointer to associated layout node +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsNode* ChspsDomNode::LayoutNode() + { + return iLayoutNode; + } +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsdom/src/hspsdomstringpool.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsdom/src/hspsdomstringpool.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,212 @@ +/* +* 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: Represent string pool for dom strings +* +*/ + + + +// INCLUDE FILES +#include "hspsdomstringpool.h" + + +// ============================ LOCAL FUNCTIONS ================================ +// ----------------------------------------------------------------------------- +// Adds string to string pool. If string doesn't appear yet, it is added to +// the string pool and index to pool is returned. +// @param aString String to add +// @param aArray A pool which holds strings +// @return Index to string pool +// ----------------------------------------------------------------------------- +// +LOCAL_C TInt AddToStringPoolL( const TDesC8& aString, RPointerArray& aArray ) + { + TBool found( EFalse ); + TInt index( 0 ); + + TInt count( aArray.Count() ); + for (; index < count && !found; ) + { + if ( aArray[ index ]->Des().Compare( aString ) == 0 ) + { + found = ETrue; + } + else + { + index++; + } + } + if ( !found ) + { + HBufC8* tmp = aString.AllocLC(); + aArray.AppendL( tmp ); + CleanupStack::Pop( tmp ); + index = aArray.Count()-1; //Last item + } + return index; + } +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::ChspsDomStringPool +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDomStringPool::ChspsDomStringPool() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDomStringPool::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomStringPool* ChspsDomStringPool::NewL() + { + ChspsDomStringPool* self = new( ELeave ) ChspsDomStringPool; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::NewL +// Two-phased stream constructor. +// ----------------------------------------------------------------------------- +// +ChspsDomStringPool* ChspsDomStringPool::NewL( RReadStream& aStream ) + { + ChspsDomStringPool* self = new( ELeave ) ChspsDomStringPool; + CleanupStack::PushL( self ); + aStream >> *self; + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::~ChspsDomStringPool +// Destructor +// ----------------------------------------------------------------------------- +// +ChspsDomStringPool::~ChspsDomStringPool() + { + iStringPool.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::CloneL +// ----------------------------------------------------------------------------- +// +ChspsDomStringPool* ChspsDomStringPool::CloneL() + { + ChspsDomStringPool* clone = ChspsDomStringPool::NewL(); + CleanupStack::PushL( clone ); + + TInt count( iStringPool.Count() ); + for ( TInt i=0; iDes().AllocLC(); + clone->iStringPool.AppendL( tmp ); + CleanupStack::Pop( tmp ); + } + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::AddStringL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDomStringPool::AddStringL( const TDesC8& aString ) + { + return AddToStringPoolL( aString, iStringPool ); + } + +// ----------------------------------------------------------------------------- +// ChspsDomNode::String +// ----------------------------------------------------------------------------- +// +const TDesC8& ChspsDomStringPool::String( const TInt aStringRef ) + { + return (*iStringPool[ aStringRef ]); + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::Size +// ----------------------------------------------------------------------------- +// +TInt ChspsDomStringPool::Size() const + { + TInt size( 0 ); + + TInt count( iStringPool.Count() ); + for ( TInt i=0; iSize(); //Buffer sixe in bytes + } + return size; + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::ExternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomStringPool::ExternalizeL( RWriteStream& aStream ) const + { + TInt count( iStringPool.Count() ); + aStream.WriteInt16L( count ); + + for ( TInt i=0; iLength() ); + aStream << *iStringPool[i]; + } + } + +// ----------------------------------------------------------------------------- +// ChspsDomStringPool::InternalizeL +// ----------------------------------------------------------------------------- +// +void ChspsDomStringPool::InternalizeL( RReadStream& aStream ) + { + TInt len(0); + TInt16 count ( aStream.ReadInt16L() ); + + for ( TInt i=0; i &) + ?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVTDes8@@@Z @ 2 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class TDes8 &) + ?hspsCancelGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 3 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelGetListHeaders(void) + ?hspsSetConfState@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHW4ThspsConfigurationState@@W4ThspsConfStateChangeFilter@@@Z @ 4 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetConfState(int, int, enum ThspsConfigurationState, enum ThspsConfStateChangeFilter) + ?hspsRemovePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 5 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemovePlugin(int, int) + ?hspsInstallNextPhaseL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@AAVTDes8@@@Z @ 6 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL(class TDes8 &) + ?GethspsResult@ChspsClient@@QAEXAAVChspsResult@@@Z @ 7 NONAME ; void ChspsClient::GethspsResult(class ChspsResult &) + ?NewLC@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 8 NONAME ; class ChspsClient * ChspsClient::NewLC(class MhspsThemeManagementServiceObserver &) + ?hspsInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@AAVChspsODT@@@Z @ 9 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(class TDesC16 const &, class ChspsODT &) + ?hspsGetHeaders@ChspsClient@@QAEHABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 10 NONAME ; int ChspsClient::hspsGetHeaders(class ChspsODT const &, class CArrayPtrFlat &) + ?hspsReinstallConf@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 11 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf(int, int) + ?hspsRestoreDefault@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 12 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(class ChspsODT const &, class ChspsODT &) + ?hspsReplacePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHH@Z @ 13 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin(int, int, int) + ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV3@@Z @ 14 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class ChspsODT const &, class ChspsODT &) + ?hspsPluginUpdateL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 15 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL(class ChspsODT const &) + ?hspsInstallNextPhaseL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@AAVChspsODT@@@Z @ 16 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL(class ChspsODT &) + ?hspsAddPlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHHHAAH@Z @ 17 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsAddPlugin(int, int, int, int, int &) + ?hspsSetPluginSettings@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@HAAVChspsDomDocument@@H@Z @ 18 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetPluginSettings(class ChspsODT const &, int, class ChspsDomDocument &, int) + ?NewL@ChspsClient@@SAPAV1@AAVMhspsThemeManagementServiceObserver@@@Z @ 19 NONAME ; class ChspsClient * ChspsClient::NewL(class MhspsThemeManagementServiceObserver &) + ?SetLogBus@ChspsClient@@QAEXPAX@Z @ 20 NONAME ; void ChspsClient::SetLogBus(void *) + ?hspsSetActivePlugin@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 21 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin(int, int) + ?hspsCancelInstallTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 22 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme(void) + ?hspsGetNextHeader@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 23 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader(void) + ?hspsSetActiveTheme@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC8@@AAVTDes8@@@Z @ 24 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(class TDesC8 const &, class TDes8 &) + ?hspsGetPluginOdtL@ChspsClient@@QAE?AW4ThspsServiceCompletedMessage@@HHPAVChspsODT@@@Z @ 25 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL(int, int, class ChspsODT *) + ?hspsRestoreActiveAppConf@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HH@Z @ 26 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf(int, int) + ?hspsMovePluginsL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@HHABV?$CArrayFixFlat@H@@@Z @ 27 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL(int, int, class CArrayFixFlat const &) + ?hspsGetListHeaders@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@AAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 28 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(class ChspsODT const &, class CArrayPtrFlat &) + ?hspsRemoveThemeL@ChspsClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVChspsODT@@@Z @ 29 NONAME ; enum ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(class ChspsODT const &) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/bwins/hspsrequestclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/bwins/hspsrequestclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,10 @@ +EXPORTS + ?GethspsResult@ChspsRequestClient@@QAEXAAVChspsResult@@@Z @ 1 NONAME ; void ChspsRequestClient::GethspsResult(class ChspsResult &) + ?NewL@ChspsRequestClient@@SAPAV1@AAVMhspsClientRequestServiceObserver@@@Z @ 2 NONAME ; class ChspsRequestClient * ChspsRequestClient::NewL(class MhspsClientRequestServiceObserver &) + ?NewLC@ChspsRequestClient@@SAPAV1@AAVMhspsClientRequestServiceObserver@@@Z @ 3 NONAME ; class ChspsRequestClient * ChspsRequestClient::NewLC(class MhspsClientRequestServiceObserver &) + ?hspsAccessResourceFile@ChspsRequestClient@@UAE?AW4ThspsServiceCompletedMessage@@ABVTDesC16@@ABUThspsConfiguration@@AAVRFile@@@Z @ 4 NONAME ; enum ThspsServiceCompletedMessage ChspsRequestClient::hspsAccessResourceFile(class TDesC16 const &, struct ThspsConfiguration const &, class RFile &) + ?hspsCancelGetODTUpdate@ChspsRequestClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 5 NONAME ; enum ThspsServiceCompletedMessage ChspsRequestClient::hspsCancelGetODTUpdate(void) + ?hspsGetODT@ChspsRequestClient@@UAE?AW4ThspsServiceCompletedMessage@@HAAVChspsODT@@@Z @ 6 NONAME ; enum ThspsServiceCompletedMessage ChspsRequestClient::hspsGetODT(int, class ChspsODT &) + ?hspsGetODTUpdate@ChspsRequestClient@@UAE?AW4ThspsServiceCompletedMessage@@XZ @ 7 NONAME ; enum ThspsServiceCompletedMessage ChspsRequestClient::hspsGetODTUpdate(void) + ?SetLogBus@ChspsRequestClient@@QAEXPAX@Z @ 8 NONAME ; void ChspsRequestClient::SetLogBus(void *) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/client/hspsclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1288 @@ +/* +* 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: Client-side API implementation of Installation and Maintenence +* Services of Application Management Service APIs. +* See hspsThemeManagement.h. +* +* +*/ + + +#include + +#include "hsps_builds_cfg.hrh" + +#include "hspsclient.h" +#include "hspsodt.h" +#include "hspsresult.h" +#include "hspspluginidlist.h" +#include "hspsdomdocument.h" + +#include +#include + +#ifdef HSPS_LOG_ACTIVE +#include +#endif + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// ChspsClient::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C ChspsClient* ChspsClient::NewL( MhspsThemeManagementServiceObserver& aObserver ) + { + ChspsClient* self = NewLC( aObserver ); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C ChspsClient* ChspsClient::NewLC( MhspsThemeManagementServiceObserver& aObserver ) + { + ChspsClient* self = new ( ELeave ) ChspsClient( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsClient::ConstructL() + { + User::LeaveIfError( iSession.Connect() ); + iOdt = ChspsODT::NewL(); + iResult = ChspsResult::NewL(); + } + +// ----------------------------------------------------------------------------- +// ChspsClient::ChspsClient() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +ChspsClient::ChspsClient( MhspsThemeManagementServiceObserver& aObserver) +: CActive( EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + iCancelRequestMessage = (ThspsServiceRequestMessage)KErrNone; + iODTMode = EFalse; + iSubscription = EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::~ChspsClient() +// Destructor. +// ----------------------------------------------------------------------------- +// +ChspsClient::~ChspsClient() + { + Cancel(); // Causes call to DoCancel() + iSession.Close(); + delete iOdt; + delete iSearchMaskData; + delete iSetMaskData; + delete iResult; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsInstallTheme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(const TDesC& aManifestFileName, + ChspsODT& aHeader) + { + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + TBuf8 headerData; + TInt errorCode = KErrNone; + iODTMode = ETrue; + ret = (ThspsServiceCompletedMessage) iSession.InstallTheme( iResultData, aManifestFileName, + headerData ); + UpdatehspsResult( iResultData ); + if ( ret == EhspsInstallThemeSuccess || ret == EhspsInstallPhaseSuccess ) + { + + TRAP( errorCode, aHeader.UnMarshalHeaderL(headerData) ); + if ( errorCode ) + { + ret = EhspsInstallThemeFailed; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsInstallTheme(): - failed, bad headerdata returned, system error %d." ), + errorCode ); + } +#endif + + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsInstallTheme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsInstallTheme(const TDesC& /*aManifestFileName*/ + , TDes8& /*aHeaderData*/) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsInstallNextPhaseL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL( ChspsODT& aHeader ) + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + iResult->ResetData(); + if ( !IsActive() ) + { + iODTMode = ETrue; + iCancelRequestMessage = EhspsCancelInstallTheme; + iHeader = &aHeader; + iStatus = KRequestPending; + SetActive(); + iSession.InstallNextPhase( iResultData, iHeaderData, iStatus ); + ret = EhspsServiceRequestSheduled; + } + else + { + ret = EhspsServiceRequestError; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsInstallNextPhaseL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsInstallNextPhaseL( TDes8& /*aHeaderData*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsCancelInstallTheme() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsCancelInstallTheme() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + iResult->ResetData(); + if ( IsActive() ) + { + Cancel(); + ret = EhspsServiceRequestCanceled; + } + else + { + ret = EhspsServiceRequestError; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsReinstallConf +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsReinstallConf( + TInt aAppUid, + TInt aConfUid ) + { + ThspsServiceCompletedMessage ret = EhspsReinstallConfFailed; + + ThspsParamReinstallConf params; + params.appUid = aAppUid; + params.confUId = aConfUid; + + ret = ( ThspsServiceCompletedMessage )iSession.ReinstallConf( iResultData, params ); + + UpdatehspsResult( iResultData ); + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsGetListHeaders +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders( const ChspsODT& aSearchMask, + CArrayPtrFlat& aHeaderList ) + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + TBuf8 headerData; + TInt errorCode = 0; + iHeaderList = &aHeaderList; + if (iSearchMaskData) + { + delete iSearchMaskData; + iSearchMaskData = NULL; + } + TRAP(errorCode, iSearchMaskData = aSearchMask.MarshalHeaderL()); + if (errorCode) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + iODTMode = ETrue; + if ( IsActive() ) + { + // cancel previous subscription first + hspsCancelGetListHeaders(); + } + ret = (ThspsServiceCompletedMessage)iSession.GetListHeaders(iResultData, + iSearchMaskData->Des(),headerData ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsGetListHeaders(): - theme query sent for RootUid %d." ), + aSearchMask.RootUid() ); + } +#endif + + UpdatehspsResult( iResultData ); + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsGetListHeaders +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetListHeaders(const TDesC8& /*aSearchMaskData*/, + CArrayPtrSeg& /*aHeaderDataList*/) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsGetNextHeader() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetNextHeader() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + iResult->ResetData(); + if ( !IsActive() ) + { + iCancelRequestMessage = EhspsCancelGetListHeaders; + iStatus = KRequestPending; + SetActive(); + iSession.GetNextHeader( iResultData, iHeaderData, iStatus ); + iSubscription = ETrue; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsGetNextHeader(): - themes subscribed." ) ); + } +#endif + + ret = EhspsServiceRequestSheduled; + } + else + { + ret = EhspsServiceRequestError; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsCancelGetListHeaders() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsCancelGetListHeaders() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + iResult->ResetData(); + if ( IsActive() ) + { + iSubscription = EFalse; + Cancel(); + ret = EhspsServiceRequestCanceled; + } + else + { + ret = EhspsServiceRequestError; + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetActiveTheme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(const ChspsODT& aSetMask, + ChspsODT& aHeader) + { + TInt errorCode = 0; + ThspsServiceCompletedMessage ret = EhspsSetActiveThemeFailed; + TBuf8 headerData; + if (iSetMaskData) + { + delete iSetMaskData; + iSetMaskData = NULL; + } + TRAP( errorCode, iSetMaskData = aSetMask.MarshalHeaderL() ); + if ( errorCode ) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsSetActiveTheme(): - requested for: AppUid = %d, ThemeUid = %d." ), + aSetMask.RootUid(), + aSetMask.ThemeUid() ); + } +#endif + + ret = (ThspsServiceCompletedMessage)iSession.SetActiveTheme( iResultData, + iSetMaskData->Des(), headerData ); + if (ret == EhspsSetActiveThemeSuccess) + { + TRAP(errorCode, aHeader.UnMarshalHeaderL(headerData)); + if ( errorCode ) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsSetActiveTheme(): - failed, bad ODT returned, system error %d." ), + errorCode ); + } +#endif + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::hspsSetActiveTheme(): - activated for AppUid = %d, ThemeUid = %d." ), + aHeader.RootUid(), + aHeader.ThemeUid() ); + } +#endif + + UpdatehspsResult( iResultData ); + } + } + else + { + UpdatehspsResult( iResultData ); + } + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsRestoreDefault +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsRestoreDefault(const ChspsODT& aSetMask, + ChspsODT& aHeader) + { + TInt errorCode = 0; + ThspsServiceCompletedMessage ret = EhspsRestoreDefaultFailed; + TBuf8 headerData; + if ( iSetMaskData ) + { + delete iSetMaskData; + iSetMaskData = NULL; + } + + TRAP( errorCode, iSetMaskData = aSetMask.MarshalHeaderL() ); + if ( errorCode ) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + ret = ( ThspsServiceCompletedMessage )iSession.RestoreDefault( iResultData, + iSetMaskData->Des(), headerData ); + if ( ret == EhspsRestoreDefaultSuccess ) + { + TRAP( errorCode, aHeader.UnMarshalHeaderL( headerData ) ); + if ( errorCode ) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + UpdatehspsResult( iResultData ); + } + } + else + { + UpdatehspsResult( iResultData ); + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetRemoveThemeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsRemoveThemeL(const ChspsODT& aSetMask) + { + TInt errorCode = 0; + ThspsServiceCompletedMessage ret = EhspsRemoveThemeFailed; + if (iSetMaskData) + { + delete iSetMaskData; + iSetMaskData = NULL; + } + TRAP(errorCode, iSetMaskData = aSetMask.MarshalHeaderL()); + if (errorCode) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + ret = (ThspsServiceCompletedMessage)iSession.RemoveTheme(iResultData, iSetMaskData->Des()); + UpdatehspsResult( iResultData ); + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetActiveTheme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsSetActiveTheme(const TDesC8& /*aSetMaskData*/ + , TDes8& /*aHeaderData*/) + { + return EhspsServiceNotSupported; + } + + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::GethspsResultL +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsClient::GethspsResult(ChspsResult& aResult) + { + aResult.iSystemError = iResult->iSystemError; + aResult.iXuikonError = iResult->iXuikonError; + aResult.iIntValue1 = iResult->iIntValue1; + aResult.iIntValue2 = iResult->iIntValue2; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsGetHeaders +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsClient::hspsGetHeaders( const ChspsODT& aSearchMask, + CArrayPtrFlat& aHeaderList ) + { + iHeaderList = &aHeaderList; + // Convert search mask ODT to binary stream + if (iSearchMaskData) + { + delete iSearchMaskData; + iSearchMaskData = NULL; + } + TRAPD( err, iSearchMaskData = aSearchMask.MarshalHeaderL() ); + + if ( err == KErrNone ) + { + // Get the header count + ThspsServiceCompletedMessage ret = + ( ThspsServiceCompletedMessage )iSession.GetListHeaders( + iResultData, + iSearchMaskData->Des(), + iHeaderData ); + + if ( ret == EhspsGetListHeadersSuccess ) + { + // Header count > 0 + UpdatehspsResult( iResultData ); + TInt headerCount = iResult->iIntValue1; + // Get headers + for ( TInt i = 0; + i < headerCount && err == KErrNone; + i++ ) + { + ret = ( ThspsServiceCompletedMessage )iSession.GetNextHeader( + iResultData, + iHeaderData ); + if ( ret == EhspsGetListHeadersUpdate ) + { + TRAP( err, AppendHeaderListL( iHeaderData) ); + } + else + { + // Request failed + err = KErrGeneral; + } + } + } + else if ( ret == EhspsGetListHeadersEmpty ) + { + // Empty header list + err = KErrNotFound; + } + else + { + // Header count request failed + err = KErrGeneral; + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsAddPlugin +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsAddPlugin( + const TInt aAppUid, + const TInt aConfId, + const TInt aPluginUid, + const TInt aPosition, + TInt& aAddedPluginId ) + { + ThspsServiceCompletedMessage ret = EhspsAddPluginFailed; + + if ( aAppUid > 0 && aPluginUid > 0 ) + { + ThpsParamAddPlugin params; + params.appUid = aAppUid; + params.configurationId = aConfId; + params.pluginUid = aPluginUid; + params.positionIndex = aPosition; + + // Try adding the plugin configuration + ret = ( ThspsServiceCompletedMessage )iSession.AddPlugin( iResultData, params, aAddedPluginId ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsRemovePlugin +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsRemovePlugin( + const TInt aAppUid, + const TInt aPluginId ) + { + ThspsServiceCompletedMessage ret = EhspsRemovePluginFailed; + + if ( aAppUid > 0 && aPluginId > 0 ) + { + ThpsParamRemovePlugin params; + params.appUid = aAppUid; + params.pluginId = aPluginId; + + // Try removing the plugin configuration instance + ret = ( ThspsServiceCompletedMessage )iSession.RemovePlugin( iResultData, params ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetActivePlugin +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsSetActivePlugin( const TInt aAppUid, + const TInt aPluginId ) + { + ThspsServiceCompletedMessage ret = EhspsSetActivePluginFailed; + + if( aPluginId > 0 ) + { + ThpsParamSetActivePlugin params; + params.appUid = aAppUid; + params.pluginId = aPluginId; + + // Try activation. + ret = ( ThspsServiceCompletedMessage )iSession.SetActivePlugin( iResultData, params ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsReplacePlugin +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsReplacePlugin( + const TInt aAppUid, + const TInt aPluginId, + const TInt aConfUid ) + { + ThspsServiceCompletedMessage ret = EhspsReplacePluginFailed; + + if ( aPluginId > 0 && aConfUid > 0 ) + { + ThspsParamReplacePlugin params; + params.appUid = aAppUid; + params.pluginId = aPluginId; + params.confUid = aConfUid; + + // Try adding the plugin configuration + ret = ( ThspsServiceCompletedMessage )iSession.ReplacePlugin( iResultData, params ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetPluginSettings +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsSetPluginSettings( + const ChspsODT& aHeader, + const TInt aPluginId, + ChspsDomDocument& aDom, + const TBool aPluginStoringStatus ) + { + ThspsServiceCompletedMessage ret = EhspsSetPluginSettingsFailed; + + TInt errorCode = 0; + TBuf8 searchMaskData; + HBufC8* temp = NULL; + HBufC8* tempDom = NULL; + + TRAP( errorCode, temp = aHeader.MarshalHeaderL() ); + TRAP( errorCode, tempDom = aDom.MarshallL() ); + + if( errorCode ) + { + ret = EhspsServiceRequestError; + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + searchMaskData = temp->Des(); + TPtr8 tempDomPtr = tempDom->Des(); + + ThspsParamSetPluginSettings params; + params.pluginId = aPluginId; + params.storingStatus = aPluginStoringStatus; + + + // Try set settings of the plugin Id given in params + ret = ( ThspsServiceCompletedMessage )iSession.SetPluginSettings( iResultData, searchMaskData, params, tempDomPtr ); + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + delete tempDom; + delete temp; + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsGetPluginDomL +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsGetPluginOdtL( + const TInt aAppUid, + const TInt aPluginUid, + ChspsODT* aPluginOdt ) + { + ThspsServiceCompletedMessage ret = EhspsGetPluginOdtFailed; + + if ( aAppUid > 0 && aPluginUid > 0 ) + { + ThspsParamGetPluginOdt params; + params.appUid = aAppUid; + params.pluginUid = aPluginUid; + TPath odtPath; + + ret = ( ThspsServiceCompletedMessage )iSession.GetPluginOdt( iResultData, params, odtPath ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + + if( ret == EhspsGetPluginOdtSuccess ) + { + // Streaming odt from file + TInt success = StreamOdtL( odtPath, aAppUid, aPluginOdt ); + + if( success != KErrNone ) + { + ret = EhspsGetPluginOdtFailed; + } + } + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsMovePluginsL +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsMovePluginsL( + const TInt aAppUid, + const TInt aConfId, + const CArrayFixFlat& aPluginIdList ) + { + ThspsServiceCompletedMessage ret = EhspsMovePluginsFailed; + + if ( aAppUid > 0 && aConfId > 0 && aPluginIdList.Count() ) + { + ThpsParamMovePlugins params; + params.appUid = aAppUid; + params.configurationId = aConfId; + + // Setup an array that can be externalized + const TInt KGranularity = 6; + ChspsPluginIdList* idArray = new ( ELeave )ChspsPluginIdList( KGranularity ); + CleanupStack::PushL( idArray ); + for( TInt idIndex=0; idIndex < aPluginIdList.Count(); idIndex++ ) + { + idArray->AppendL( aPluginIdList.At(idIndex) ); + } + + // Externalize array into the params.pluginIdBuf descriptor + RDesWriteStream writeBuf( params.pluginIdsBuf ); + CleanupClosePushL( writeBuf ); + TRAPD( errorCode, idArray->ExternalizeL( writeBuf ) ); + CleanupStack::PopAndDestroy( &writeBuf ); + + if ( !errorCode ) + { + // Try updating of the plugins list + ret = ( ThspsServiceCompletedMessage )iSession.MovePlugins( iResultData, params ); + + // Get error codes from the server op. + UpdatehspsResult( iResultData ); + } + + CleanupStack::PopAndDestroy( idArray ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsSetConfState +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsSetConfState( + const TInt aAppUid, + const TInt aConfId, + const ThspsConfigurationState aState, + const ThspsConfStateChangeFilter aFilter ) + { + ThspsServiceCompletedMessage ret = EhspsSetConfStateFailed; + + ThspsParamSetConfState params; + params.appUid = aAppUid; + params.confId = aConfId; + params.state = aState; + params.filter = aFilter; + + ret = ( ThspsServiceCompletedMessage )iSession.SetConfState( iResultData, params ); + + UpdatehspsResult( iResultData ); + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::hspsRestoreActiveAppConf +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsRestoreActiveAppConf( + const TInt aAppUid, + const TInt aConfUid ) + { + ThspsServiceCompletedMessage ret = EhspsRestoreActiveAppConfFailed; + + ThspsParamRestoreActiveAppConf params; + params.appUid = aAppUid; + params.confUid = aConfUid; + + ret = ( ThspsServiceCompletedMessage )iSession.RestoreActiveAppConf( iResultData, params ); + + UpdatehspsResult( iResultData ); + + return ret; + } +// ----------------------------------------------------------------------------- +// ChspsClient::hspsPluginUpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsClient::hspsPluginUpdateL( + const ChspsODT& /*aPluginUid*/ ) + { + return EhspsUpdatePluginFailed; + } + +// ----------------------------------------------------------------------------- +// ChspsClient::SetLogBus +// Set log bus. +// ----------------------------------------------------------------------------- +#ifdef HSPS_LOG_ACTIVE +EXPORT_C void ChspsClient::SetLogBus( void* aLogBus ) + { + iLogBus = (ChspsLogBus*)aLogBus; + } +#else +EXPORT_C void ChspsClient::SetLogBus( void* /*aLogBus*/ ) + { + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsClient::UpdatehspsResult +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClient::UpdatehspsResult( TDesC8& aResultData ) + { + TInt errorCode = KErrNone; + if( aResultData.Length() ) + { + RDesReadStream readBuf(iResultData); + TRAP( errorCode, iResult->InternalizeL( readBuf ) ); + readBuf.Close(); + if( errorCode ) + { + iResult->ResetData(); + } + } + else + { + iResult->ResetData(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsClient::AppendHeaderListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClient::AppendHeaderListL( TDesC8& aHeaderData ) + { + ChspsODT* header = ChspsODT::NewL(); + CleanupStack::PushL( header ); + header->UnMarshalHeaderL( aHeaderData ); + iHeaderList->AppendL( header ); + CleanupStack::Pop( header ); + } + +// ----------------------------------------------------------------------------- +// ChspsClient::RunError +// From CActive. Called when error occurred in asynchronous request +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsClient::RunError( TInt aError ) + { + iResult->iSystemError = aError; + iResult->iXuikonError = aError; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// ChspsClient::RunL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClient::RunL() + { + TInt errorCode = KErrNone; + switch ( iStatus.Int() ) + { + // the server has completed the request, signalled the client + // thread and the clients active scheduler runs the active object. + // Now do something with it + case EhspsInstallThemeSuccess: + // the request was successful and installation is completed + if ( iODTMode ) + { + TRAP( errorCode, iHeader->UnMarshalHeaderL(iHeaderData) ); + if ( errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage(EhspsInstallThemeSuccess); + } + } + else + { + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage(EhspsInstallThemeSuccess); + } + + break; + + case EhspsInstallPhaseSuccess: + // the request was successful + if ( iODTMode ) + { + TRAP( errorCode, iHeader->UnMarshalHeaderL(iHeaderData)); + if ( errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage(EhspsInstallPhaseSuccess); + // send request to install next phase + hspsInstallNextPhaseL( *iHeader ); + } + } + else + { + UpdatehspsResult( iResultData ); + // send request to install next phase + iObserver.HandlehspsClientMessage(EhspsInstallPhaseSuccess); + hspsInstallNextPhaseL(iHeaderData); + } + break; + + case EhspsInstallThemeFailed: + // the request was unsuccessful + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsInstallThemeFailed ); + break ; + + case EhspsGetListHeadersUpdate: + if (iODTMode) + { + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->UnMarshalHeaderL(iHeaderData); + iHeaderList->AppendL(odt); + CleanupStack::Pop( odt ); + // inform observer + if (errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::RunL(): - a theme header received. AppUid = %d, ThemeUid = %d." ), + odt->RootUid(), + odt->ThemeUid() ); + } +#endif + + iObserver.HandlehspsClientMessage( EhspsGetListHeadersUpdate ); + + // request next + hspsGetNextHeader(); + } + } + else + { + HBufC8* hd = iHeaderData.AllocL(); + CleanupStack::PushL( hd ); + iHeaderDataList->AppendL(hd); + CleanupStack::Pop( hd ); + + // inform observer + if (errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsGetListHeadersUpdateData ); + // request next + hspsGetNextHeader(); + } + } + break; + + case EhspsGetListHeadersRestart: + // header list has changed radically + // resetting the list and start filling it again + if (iODTMode) + { + // resetting and start filling the header list again + iHeaderList->ResetAndDestroy(); + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->UnMarshalHeaderL(iHeaderData); + iHeaderList->AppendL(odt); + CleanupStack::Pop( odt ); + + // inform observer + if (errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::RunL(): - list restarted." ) ); + } +#endif + + iObserver.HandlehspsClientMessage( EhspsGetListHeadersRestart ); + // request next + hspsGetNextHeader(); + } + } + else + { + // resetting and starting filling the header data list again + iHeaderDataList->Reset(); + HBufC8* hd = iHeaderData.AllocL(); + CleanupStack::PushL( hd ); + iHeaderDataList->AppendL(hd); + CleanupStack::Pop( hd ); + + // inform observer + if ( errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + else + { + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsGetListHeadersRestartData ); + // request next + hspsGetNextHeader(); + } + } + break; + + case EhspsGetListHeadersEmpty: + // header list is empty + UpdatehspsResult( iResultData ); + if (iODTMode) + { + // resetting and start filling the header list again + iHeaderList->ResetAndDestroy(); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClient::RunL(): - list empty." ) ); + } +#endif + + // inform observer + iObserver.HandlehspsClientMessage(EhspsGetListHeadersEmpty); + } + else + { + iHeaderDataList->Reset(); + // inform observer + iObserver.HandlehspsClientMessage(EhspsGetListHeadersEmpty); + } + // requesting possible update + hspsGetNextHeader(); + break; + + case EhspsGetListHeadersFailed: + // service failure occurred + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage(EhspsGetListHeadersFailed); + break; + + case EhspsServiceRequestCanceled: + // the request was canceled + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsServiceRequestCanceled ); + break; + + case EhspsServiceNotSupported: + // the request was canceled + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsServiceNotSupported ); + break; + + default: + UpdatehspsResult( iResultData ); + iObserver.HandlehspsClientMessage( EhspsServiceRequestError ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsClient::DoCancel() +// Cancels any outstanding operation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClient::DoCancel() + { + iSession.CancelRequest( (TInt) iCancelRequestMessage, iResultData ); + } + +// ----------------------------------------------------------------------------- +// ChspsClient::StreamOdtL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsClient::StreamOdtL( TDes& aPath, const TInt aAppUid, ChspsODT* aOdt ) + { + TInt errorCode = KErrNotFound; + RFile odtfile; + ThspsConfiguration conf; + conf.rootUid = aAppUid; + // conf.themeUid is not needed in AccessResourceFile() + TInt fileSubSessionHandle; + + // get fs handle + TInt fileServerHandle = iSession.AccessResourceFile( + iResultData, + conf, + aPath, + fileSubSessionHandle ); + + // If we got valid handles + if ( fileServerHandle > 0 && fileSubSessionHandle > 0 ) + { + // Adopt the file + errorCode = odtfile.AdoptFromServer( fileServerHandle, fileSubSessionHandle ); + } + + if ( errorCode != KErrNone ) + { + // Failure + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + else + { + // Success + UpdatehspsResult( iResultData ); + + CleanupClosePushL( odtfile ); + + // set stream on file + CFileStore* store = CDirectFileStore::FromLC( odtfile ); + RStoreReadStream instream; + CleanupClosePushL( instream ); + + instream.OpenLC( *store, store->Root() ); + + // stream in the ODT + instream >> *aOdt; + + TInt count = aOdt->DomDocument().DomNodeCount(); + + // Destroy the stream object and close the instream + #ifdef _DEBUG + CleanupStack::PopAndDestroy( 2, &instream ); + + // Destroy the direct file store object (closes the file) + CleanupStack::PopAndDestroy( store ); + CleanupStack::PopAndDestroy(); // odtfile + #else + CleanupStack::PopAndDestroy(4); + #endif + + errorCode = KErrNone; + } + + + return errorCode; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,473 @@ +/* +* 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: Implementaion of ChspsClientSession class. +* For details, see hspsClientSession.h. +* +* +*/ + + +#include +#include "hsps_builds_cfg.hrh" +#include "hspsthememanagement.h" +#include "hspsthemeserver.h" +#include "hspsclientsession.h" + +// Standard server startup code +static TInt StartServer() + { + const TUidType serverUid(KNullUid,KNullUid,KhspsThemeServerUid3); + // ------------------------------------------------------------------------ + // EPOC and EKA2 just create a new server process. Simultaneous + // launching of two such processes should be detected when the second one + // attempts to create the server object, failing with KErrAlreadyExists. + // ------------------------------------------------------------------------ + RProcess server; + TInt r=server.Create(KhspsThemeServerName,KNullDesC); + if (r!=KErrNone) + { +#ifdef _hsps_DEBUG_ + RDebug::Print(_L("hspsClientSession: server start failed %d"),r); +#endif + return r; + } + TRequestStatus stat; + server.Rendezvous(stat); + if (stat!=KRequestPending) + { + server.Kill(0); // abort startup + } + else + { + server.Resume(); // logon OK - start the server + } + + User::WaitForRequest(stat); // wait for start or death + // ------------------------------------------------------------------------ + // we can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + /// + r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int(); + server.Close(); + return r; + } + + +// ----------------------------------------------------------------------------- +// RhspsClientSession::Connect +// This is the standard retry pattern for server connection +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::Connect() + { + TVersion ver = TVersion(KhspsThemeServerMajorVersionNumber,KhspsThemeServerMinorVersionNumber, + KhspsThemeServerBuildVersionNumber); + TInt retry=2; + for (;;) + { + TInt r=CreateSession(KhspsThemeServerName, ver, KDefaultMessageSlots); + + if (r!=KErrNotFound && r!=KErrServerTerminated) + { + return r; + } + + if (--retry==0) + { + return r; + } + + r=StartServer(); + if (r!=KErrNone && r!=KErrAlreadyExists) + { + return r; + } + } + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::Close() +// Closes the session +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RhspsClientSession::Close() + { + RSessionBase::Close(); + } + + +// ---------------------------------------------------------------------------------------- +// Client Server functions follow +// ---------------------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// RhspsClientSession::InstallTheme +// Installation service +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::InstallTheme(TDes8& aResultData, const TDesC& aManifestFileName, + TDes8& aHeaderData) + { + aHeaderData.Zero(); + aResultData.Zero(); + return SendReceive(EhspsInstallTheme,TIpcArgs(&aResultData, &aManifestFileName, &aHeaderData)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::InstallNextPhase +// Calls for the next phase of the installation +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RhspsClientSession::InstallNextPhase(TDes8& aResultData, TDes8& aHeaderData, + TRequestStatus& aStatus) + { + aHeaderData.Zero(); + aResultData.Zero(); + TIpcArgs args; + args.Set(0, &aResultData ); + args.Set(1, &KNullDesC8); + args.Set(2, &aHeaderData); + SendReceive(EhspsInstallNextPhase, args, aStatus); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetListHeaders +// Maintenance service, header listing +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData, + TDes8& aHeaderData) + { + aHeaderData.Zero(); + aResultData.Zero(); + return SendReceive(EhspsGetListHeaders, TIpcArgs(&aResultData, &aSearchMaskData, &aHeaderData)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetNextHeader +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RhspsClientSession::GetNextHeader(TDes8& aResultData, TDes8& aHeaderData, + TRequestStatus& aStatus) + { + aHeaderData.Zero(); + aResultData.Zero(); + TIpcArgs args; + args.Set(0, &aResultData ); + args.Set(1, &KNullDesC8); + args.Set(2, &aHeaderData); + SendReceive(EhspsGetNextHeader, args, aStatus); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::SetActiveTheme +// Theme activation +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::SetActiveTheme(TDes8& aResultData, const TDesC8& aSetMaskData, + TDes8& aHeaderData) + { + aHeaderData.Zero(); + aResultData.Zero(); + return SendReceive(EhspsSetActiveTheme, TIpcArgs(&aResultData, &aSetMaskData, &aHeaderData)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::RestoreDefault +// Restore defaults +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::RestoreDefault(TDes8& aResultData, const TDesC8& aSetMaskData, + TDes8& aHeaderData) + { + aHeaderData.Zero(); + aResultData.Zero(); + return SendReceive( EhspsRestoreDefault, TIpcArgs(&aResultData, &aSetMaskData, &aHeaderData) ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::RemoveTheme +// Theme removal +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::RemoveTheme(TDes8& aResultData, const TDesC8& aSetMaskData) + { + aResultData.Zero(); + return SendReceive(EhspsRemoveTheme, TIpcArgs(&aResultData, &aSetMaskData)); + } + +/* Client Request service */ +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetODT +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::GetODT( + TDes8& aResultData, + const ThspsConfiguration& aConfiguration, + const TDesC8& aRequestData, + TDes& aODTPath) + { + // Setup packaged input for the service + TPckgC packagedStruct(aConfiguration); + + aResultData.Zero(); + aODTPath.Zero(); + return SendReceive(EhspsGetODT,TIpcArgs(&aResultData, &packagedStruct, &aRequestData, &aODTPath )); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetODTUpdate +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RhspsClientSession::GetODTUpdate(TDes8& aResultData, + TDes8& aRequestNotifyData, + TDes8& aHeaderData, + TRequestStatus& aStatus) + { + aHeaderData.Zero(); + aResultData.Zero(); + aRequestNotifyData.Zero(); + TIpcArgs args; + args.Set(0, &aResultData ); + args.Set(1, &aRequestNotifyData); + args.Set(2, &aHeaderData); + + SendReceive(EhspsGetODTUpdate, args, aStatus); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::AccessResourceFile +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::AccessResourceFile(TDes8& aResultData, + const ThspsConfiguration& aConfiguration, const TDesC& aFileName, TInt& aFileHandle) + { + // Setup packaged input for the service + TPckgC packagedStruct(aConfiguration); + + // Setup packaged output from the service + TPckgBuf packagedFileHandle(0); + + aResultData.Zero(); + + //IPC slots and contents: + //#0 (unused?) + //#1 uids in a struct + //#2 the file name to open + //#3 the handle to the RFile that will be filled in by the server + + //The return value contains the handle to the RFs that can be used to access the file + TInt fileServerHandle = SendReceive( + EhspsAccessResourceFile, + TIpcArgs(&aResultData, &packagedStruct, &aFileName, &packagedFileHandle) + ); + + // Set received file handle + aFileHandle=packagedFileHandle(); + + return fileServerHandle; + } +// ----------------------------------------------------------------------------- +// RhspsClientSession::CopyResourceFiles +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::CopyResourceFiles( TDes8& aResultData, TDesC& aODTPath, + TDesC& aDestinationPath ) + { + aResultData.Zero(); + return SendReceive( EhspsCopyResources, TIpcArgs( &aResultData, &aODTPath, &aDestinationPath )); + } + +/* Generic functions */ +// ----------------------------------------------------------------------------- +// RhspsClientSession::CancelRequest +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RhspsClientSession::CancelRequest(TInt aCancelRequestMessage, + TDes8& aResultData, TInt aAppUid ) + { + aResultData.Zero(); + SendReceive(aCancelRequestMessage, TIpcArgs(&aResultData, aAppUid )); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetNextHeader +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::GetNextHeader( TDes8& aResultData, TDes8& aHeaderData ) + { + aHeaderData.Zero(); + aResultData.Zero(); + TIpcArgs args; + args.Set( 0, &aResultData ); + args.Set( 1, &KNullDesC8 ); + args.Set( 2, &aHeaderData ); + return SendReceive( EhspsGetNextHeader, args ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::AddPlugin +// Adds a plugin configuration into the defined application configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::AddPlugin( TDes8& aResultData, const ThpsParamAddPlugin& aParams, TInt& aNewPluginId ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + TPckg idDes( aNewPluginId ); + return SendReceive(EhspsAddPlugin, TIpcArgs(&aResultData, &packagedStruct, &idDes)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::RemovePlugin +// Removes a plugin configuration from the defined application configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::RemovePlugin( TDes8& aResultData, + const ThpsParamRemovePlugin& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + return SendReceive(EhspsRemovePlugin, TIpcArgs(&aResultData, &packagedStruct)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::SetActivePlugin +// Set plugin configuration active. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::SetActivePlugin( TDes8& aResultData, + const ThpsParamSetActivePlugin& aParams ) + { + + aResultData.Zero(); + TPckgC packagedStruct( aParams ); + return SendReceive( EhspsSetActivePlugin, TIpcArgs( &aResultData, &packagedStruct ) ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::ReplacePlugin +// Replaces a plugin configuration in the active application configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::ReplacePlugin( + TDes8& aResultData, + const ThspsParamReplacePlugin& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + return SendReceive(EhspsReplacePlugin, TIpcArgs(&aResultData, &packagedStruct)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::GetPluginOdt +// Returns odt path accoring given uid +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::GetPluginOdt( TDes8& aResultData, + const ThspsParamGetPluginOdt& aParams, + TDes& aOdtPath ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + return SendReceive( EhspsGetPluginOdt, TIpcArgs(&aResultData, &packagedStruct, &aOdtPath) ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::SetPluginSettings +// Personalizes settings in a plugin configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::SetPluginSettings( TDes8& aResultData, + TDes8& aSearchMaskData, + ThspsParamSetPluginSettings aParams, + TDes8& aDomData ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + return SendReceive(EhspsSetPluginSettings, TIpcArgs( &aResultData, &aSearchMaskData, &packagedStruct, &aDomData )); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::MovePlugins +// Updates plugin positions within a configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::MovePlugins( TDes8& aResultData, const ThpsParamMovePlugins& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct(aParams); + return SendReceive(EhspsMovePlugins, TIpcArgs(&aResultData, &packagedStruct)); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::SetConfState +// Updates configuration state +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::SetConfState( + TDes8& aResultData, + const ThspsParamSetConfState& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct( aParams ); + return SendReceive( EhspsSetConfState, TIpcArgs( &aResultData, &packagedStruct ) ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::ReinstallConf +// Updates configuration state +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::ReinstallConf( + TDes8& aResultData, + const ThspsParamReinstallConf& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct( aParams ); + return SendReceive( EhspsReinstallConf, TIpcArgs( &aResultData, &packagedStruct ) ); + } + +// ----------------------------------------------------------------------------- +// RhspsClientSession::RestoreActiveAppConf +// Restores active application configuration +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RhspsClientSession::RestoreActiveAppConf( + TDes8& aResultData, + const ThspsParamRestoreActiveAppConf& aParams ) + { + aResultData.Zero(); + TPckgC packagedStruct( aParams ); + return SendReceive( EhspsRestoreActiveAppConf, TIpcArgs( &aResultData, &packagedStruct ) ); + } + +// end of file + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/client/hspsrequestclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/client/hspsrequestclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,599 @@ +/* +* 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: Client-side API implementation of Client Request Services of +* hsps Application Management Service APIs. +* For details, see hspsThemeManagement.h. +* +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "hspsrequestclient.h" +#include "hspsodt.h" +#include "hspsresource.h" +#include "hspsresult.h" +#include "hspsreqnotifparam.h" +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsdomdepthiterator.h" +#include "hsps_builds_cfg.hrh" +#ifdef _hsps_PERFORMANCE_TEST_ +#include "hspstimemon.h" +#endif + +#ifdef HSPS_LOG_ACTIVE +#include +#endif + +_LIT( KPrivateFolderPrefix, "c:\\private\\" ); +_LIT( KDoubleBackSlash, "\\" ); + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C ChspsRequestClient* ChspsRequestClient::NewL( MhspsClientRequestServiceObserver& aObserver ) + { + ChspsRequestClient* self = NewLC( aObserver ); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +EXPORT_C ChspsRequestClient* ChspsRequestClient::NewLC( MhspsClientRequestServiceObserver& aObserver ) + { +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("ChspsRequestClient::NewLC(): - initialising..") ); +#endif//_hsps_PERFORMANCE_TEST_ + ChspsRequestClient* self = new ( ELeave ) ChspsRequestClient( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("CLIENT: - ChspsRequestClient::NewLC(): - done.") ); +#endif//_hsps_PERFORMANCE_TEST_ + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::ConstructL() + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsRequestClient::ConstructL(): - connecting to hspsThemeServer .." ) ); + } +#endif + + User::LeaveIfError( iSession.Connect() ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsRequestClient::ConstructL(): - connected." ) ); + } +#endif + + iODTValid = EFalse; + iResult = ChspsResult::NewL(); + iReqNotifParams = ChspsRequestNotificationParams::NewL(); + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::ChspsRequestClient() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +ChspsRequestClient::ChspsRequestClient( MhspsClientRequestServiceObserver& aObserver) + : CActive( EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::~ChspsRequestClient() +// Destructor. +// ----------------------------------------------------------------------------- +// +ChspsRequestClient::~ChspsRequestClient() + { + Cancel(); // Causes call to DoCancel() + iSession.Close(); + delete iElement; + delete iResult; + delete iReqNotifParams; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::hspsGetODT() +// Sends a request to the server for getting ODT for application. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsRequestClient::hspsGetODT(TInt aAppUid, ChspsODT& aODT) + { + ThspsServiceCompletedMessage ret = EhspsGetODTFailed; + + iODTValid = EFalse; + + // Cancel any possibly outstanding requests + // hspsCancelGetODTUpdate(); + + + // Input validation + if ( aAppUid > 0 ) + { + + // Trying to find a theme configuration with the specified application uid, + // active theme is not known yet (fetched from cenrep at server side) + ThspsConfiguration configuration; + configuration.rootUid = aAppUid; + configuration.themeUid = 0; + configuration.type = EhspsAppConfiguration; + + // Retrieve the application configuration + TRAPD( err, CallGetOdtInFileL( configuration, aODT ) ); + if ( !err ) + { + ret = EhspsGetODTSuccess; + } + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::hspsGetODTUpdate() +// Sends a request to the server +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsRequestClient::hspsGetODTUpdate() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + + iResult->ResetData(); + iReqNotifParams->ResetData(); + + if ( !IsActive() && iODTValid ) + { + iStatus = KRequestPending; + SetActive(); + + + iSession.GetODTUpdate( iResultData, iReqNotifData, iHeaderData, iStatus ); + +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("ChspsRequestClient::hspsGetODTUpdate(): - theme changes subscribed.") ); +#endif//_hsps_PERFORMANCE_TEST_ + ret = EhspsServiceRequestSheduled; + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + if ( iODTValid ) + { + iLogBus->LogText( _L( "ChspsRequestClient::hspsGetODTUpdate(): - error, theme is not valid." ) ); + } + else + { + iLogBus->LogText( _L( "ChspsRequestClient::hspsGetODTUpdate(): - error, allready subscribed." ) ); + } + } +#endif + ret = EhspsServiceRequestError; + } + + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::hspsCancelGetODTUpdate() +// Sends a cancel request to the server ... +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + +EXPORT_C ThspsServiceCompletedMessage ChspsRequestClient::hspsCancelGetODTUpdate() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestCanceled; + iResult->ResetData(); + iReqNotifParams->ResetData(); + if ( IsActive() ) + { + Cancel(); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsRequestClient::hspsCancelGetODTUpdate(): - subscription cancelled." ) ); + } +#endif + + ret = EhspsServiceRequestCanceled; + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::hspsAccessResourceFile() +// Sends a request to the server to get access to a resource file +// Access a private file in the hspsThemeServer private area +// This function cooperates with the server to get a file handle +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsServiceCompletedMessage ChspsRequestClient::hspsAccessResourceFile( + const TDesC& aResourceFileName, + const ThspsConfiguration& aConfiguration, + RFile& aFile ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( + _L( "ChspsRequestClient::hspsAccessResourceFile(): - %S." ), + &aResourceFileName + ); + } +#endif + + // Get the file handle and fileserver handle for the file we want from the server + TInt fileSubSessionHandle; + TInt fileServerHandle = iSession.AccessResourceFile( + iResultData, + aConfiguration, + aResourceFileName, + fileSubSessionHandle); + + // If we got valid handles + TInt errorCode = KErrNotFound; + if ( fileServerHandle > 0 && fileSubSessionHandle > 0 ) + { + // Adopt the file + errorCode = aFile.AdoptFromServer( fileServerHandle, fileSubSessionHandle ); + } + + ThspsServiceCompletedMessage ret = EhspsServiceRequestError; + if ( !errorCode ) + { + // Success + UpdatehspsResult(); + ret = EhspsAccessResourceFileSuccess; + } + else + { + // Failure + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::GethspsResultL +// Fetch latest result data on service request return. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsRequestClient::GethspsResult(ChspsResult& aResult) + { + aResult.iSystemError = iResult->iSystemError; + aResult.iXuikonError = iResult->iXuikonError; + aResult.iIntValue1 = iResult->iIntValue1; + aResult.iIntValue2 = iResult->iIntValue2; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::SetLogBus +// Set log bus. +// ----------------------------------------------------------------------------- +#ifdef HSPS_LOG_ACTIVE +EXPORT_C void ChspsRequestClient::SetLogBus( void* aLogBus ) + { + iLogBus = (ChspsLogBus*)aLogBus; + } +#else +EXPORT_C void ChspsRequestClient::SetLogBus( void* /*aLogBus*/ ) + { + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::UpdatehspsResultL +// Constructs hspsResult-object from return data. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::UpdatehspsResult() + { + TInt errorCode = KErrNone; + if ( iResultData.Length() ) + { + RDesReadStream readBuf( iResultData ); + TRAP( errorCode, iResult->InternalizeL( readBuf ) ); + readBuf.Close(); + if ( errorCode ) + { + iResult->ResetData(); + } + } + else + { + iResult->ResetData(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::UpdatehspsResultL +// Constructs hspsResult-object from return data. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::UpdatehspsReqNotifParams() + { + TInt errorCode = KErrNone; + if ( iReqNotifData.Length() ) + { + RDesReadStream readBuf(iReqNotifData); + TRAP (errorCode, iReqNotifParams->InternalizeL(readBuf)); + readBuf.Close(); + if ( errorCode ) + { + iReqNotifParams->ResetData(); + } + } + else + { + iReqNotifParams->ResetData(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::CallGetOdtInFileL() +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::CallGetOdtInFileL( + const ThspsConfiguration& aConfiguration, + ChspsODT& aODT ) + { + iODT = &aODT; + HBufC8* requestData = aODT.MarshalHeaderL(); + CleanupStack::PushL(requestData); + + TFileName odtPath; + ThspsServiceCompletedMessage ret = (ThspsServiceCompletedMessage) iSession.GetODT( + iResultData, + aConfiguration, + requestData->Des(), + odtPath ); + + CleanupStack::Pop(requestData); + delete requestData; + + if ( ret != EhspsGetODTSuccess ) + { + User::Leave( EhspsGetODTFailed ); + } + + // Constructs or resets iResult -object from iResultData data + UpdatehspsResult(); + + iODTValid = ETrue; + + // Get a handle to the file object + RFile odtfile; + ret = hspsAccessResourceFile( odtPath, aConfiguration, odtfile ); + if ( ret != EhspsAccessResourceFileSuccess ) + { + User::Leave( EhspsAccessResourceFileFailed ); + } + CleanupClosePushL( odtfile ); + + // set stream on file + CFileStore* store = CDirectFileStore::FromLC( odtfile ); + RStoreReadStream instream; + CleanupClosePushL( instream ); + + // stream in the ODT + instream.OpenLC( *store, store->Root() ); + instream >> aODT; + + CleanupStack::PopAndDestroy( 2, &instream ); // stream object and instream + CleanupStack::PopAndDestroy( 2, &odtfile ); // store, odtfile + + // copy resources if found + if( aODT.ResourceCount() ) + { + /* c:\\private\\"application uid"\\resources\\ */ + TPath destinationPath( KPrivateFolderPrefix ); + destinationPath.AppendNum( aODT.RootUid(), EHex ); // application uid + destinationPath.Append( KDoubleBackSlash ); + + // Copy resource files + ret = (ThspsServiceCompletedMessage)iSession.CopyResourceFiles( + iResultData, + odtPath, + destinationPath ); + if( ret != EhspsResourceCopySuccess ) + { + User::Leave( EhspsResourceCopyFailed ); + } + } + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::RunError +// From CActive. Called when error occurred in asynchronous request +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsRequestClient::RunError( TInt aError ) + { + iResult->iSystemError = aError; + iResult->iXuikonError = aError; + TRAPD( err, iObserver.HandlehspsRequestClientMessageL( EhspsServiceRequestError, *iReqNotifParams) ) ; + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::RunL() +// Invoked to handle responses from the server. +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::RunL() + { + switch ( iStatus.Int() ) + { + case EhspsGetODTUpdateSuccess: + { + // server informs that the update process has completed successfully + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateSuccess, *iReqNotifParams); + } + break; + + case EhspsGetODTUpdateFailed: + { + // server informs that the update process has failed + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateFailed, *iReqNotifParams); + } + break; + + case EhspsGetODTUpdateStatus: + { + // server ask to reload the theme, possible activation lost or other change in status +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsRequestClient::RunL(): - EhspsGetODTUpdateStatus received." ) ); + } +#endif + + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateStatus, *iReqNotifParams); + } + break; + + case EhspsGetODTUpdateHot: + case EhspsSetActivePluginSuccess: + { + // hot update, new theme available on server, reload +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsRequestClient::RunL(): - EhspsGetODTUpdateHot received." ) ); + } +#endif + + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateHot, *iReqNotifParams); + } + break; + + case EhspsGetODTUpdateEmpty: + { + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // no update available + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateEmpty, *iReqNotifParams); + } + break ; + + case EhspsServiceRequestCanceled: + // the request was canceled + // flow through + case EhspsServiceNotSupported: + { + // the request was not supported + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + iObserver.HandlehspsRequestClientMessageL(EhspsServiceRequestCanceled, *iReqNotifParams); + } + break; + case EhspsSettingsUpdated: + { + // server informs that the update process has completed successfully + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsSettingsUpdated, *iReqNotifParams); + } + break; + case EhspsSetPluginSettingsSuccess: + case EhspsAddPluginSuccess: + case EhspsReplacePluginSuccess: + case EhspsRemovePluginSuccess: + { + // server informs that the update process has completed successfully + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + // inform observer + iObserver.HandlehspsRequestClientMessageL(EhspsGetODTUpdateHot, *iReqNotifParams); + } + break; + default: + { + UpdatehspsResult(); + UpdatehspsReqNotifParams(); + iObserver.HandlehspsRequestClientMessageL(EhspsServiceRequestError, *iReqNotifParams); + } + } + } + + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::DoCancel() +// Cancels any outstanding operation. +// ----------------------------------------------------------------------------- +// +void ChspsRequestClient::DoCancel() + { + // rootUid (application or interface uid) is not used at the server side, thus passed as zero + const TInt rootUid = 0; + iSession.CancelRequest( (TInt) EhspsCancelGetODTUpdate, iResultData, rootUid ); + iResult->ResetData(); + iReqNotifParams->ResetData(); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientsessionu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +EXPORTS + _ZN18RhspsClientSession11MovePluginsER5TDes8RK20ThpsParamMovePlugins @ 1 NONAME + _ZN18RhspsClientSession11RemoveThemeER5TDes8RK6TDesC8 @ 2 NONAME + _ZN18RhspsClientSession12GetODTUpdateER5TDes8S1_S1_R14TRequestStatus @ 3 NONAME + _ZN18RhspsClientSession12GetPluginOdtER5TDes8RK22ThspsParamGetPluginOdtR6TDes16 @ 4 NONAME + _ZN18RhspsClientSession12InstallThemeER5TDes8RK7TDesC16S1_ @ 5 NONAME + _ZN18RhspsClientSession12RemovePluginER5TDes8RK21ThpsParamRemovePlugin @ 6 NONAME + _ZN18RhspsClientSession12SetConfStateER5TDes8RK22ThspsParamSetConfState @ 7 NONAME + _ZN18RhspsClientSession13CancelRequestEiR5TDes8i @ 8 NONAME + _ZN18RhspsClientSession13GetNextHeaderER5TDes8S1_ @ 9 NONAME + _ZN18RhspsClientSession13GetNextHeaderER5TDes8S1_R14TRequestStatus @ 10 NONAME + _ZN18RhspsClientSession13ReinstallConfER5TDes8RK23ThspsParamReinstallConf @ 11 NONAME + _ZN18RhspsClientSession13ReplacePluginER5TDes8RK23ThspsParamReplacePlugin @ 12 NONAME + _ZN18RhspsClientSession14GetListHeadersER5TDes8RK6TDesC8S1_ @ 13 NONAME + _ZN18RhspsClientSession14RestoreDefaultER5TDes8RK6TDesC8S1_ @ 14 NONAME + _ZN18RhspsClientSession14SetActiveThemeER5TDes8RK6TDesC8S1_ @ 15 NONAME + _ZN18RhspsClientSession15SetActivePluginER5TDes8RK24ThpsParamSetActivePlugin @ 16 NONAME + _ZN18RhspsClientSession16InstallNextPhaseER5TDes8S1_R14TRequestStatus @ 17 NONAME + _ZN18RhspsClientSession17CopyResourceFilesER5TDes8R7TDesC16S3_ @ 18 NONAME + _ZN18RhspsClientSession17SetPluginSettingsER5TDes8S1_27ThspsParamSetPluginSettingsS1_ @ 19 NONAME + _ZN18RhspsClientSession18AccessResourceFileER5TDes8RK18ThspsConfigurationRK7TDesC16Ri @ 20 NONAME + _ZN18RhspsClientSession20RestoreActiveAppConfER5TDes8RK30ThspsParamRestoreActiveAppConf @ 21 NONAME + _ZN18RhspsClientSession5CloseEv @ 22 NONAME + _ZN18RhspsClientSession6GetODTER5TDes8RK18ThspsConfigurationRK6TDesC8R6TDes16 @ 23 NONAME + _ZN18RhspsClientSession7ConnectEv @ 24 NONAME + _ZN18RhspsClientSession9AddPluginER5TDes8RK18ThpsParamAddPluginRi @ 25 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +EXPORTS + _ZN11ChspsClient13GethspsResultER11ChspsResult @ 1 NONAME + _ZN11ChspsClient13hspsAddPluginEiiiiRi @ 2 NONAME + _ZN11ChspsClient14hspsGetHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 3 NONAME + _ZN11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 4 NONAME + _ZN11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 5 NONAME + _ZN11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 6 NONAME + _ZN11ChspsClient16hspsRemovePluginEii @ 7 NONAME + _ZN11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 8 NONAME + _ZN11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 9 NONAME + _ZN11ChspsClient17hspsGetNextHeaderEv @ 10 NONAME + _ZN11ChspsClient17hspsGetPluginOdtLEiiP8ChspsODT @ 11 NONAME + _ZN11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 12 NONAME + _ZN11ChspsClient17hspsReinstallConfEii @ 13 NONAME + _ZN11ChspsClient17hspsReplacePluginEiii @ 14 NONAME + _ZN11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 15 NONAME + _ZN11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 16 NONAME + _ZN11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 17 NONAME + _ZN11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 18 NONAME + _ZN11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 19 NONAME + _ZN11ChspsClient19hspsSetActivePluginEii @ 20 NONAME + _ZN11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 21 NONAME + _ZN11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 22 NONAME + _ZN11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 23 NONAME + _ZN11ChspsClient22hspsCancelInstallThemeEv @ 24 NONAME + _ZN11ChspsClient24hspsCancelGetListHeadersEv @ 25 NONAME + _ZN11ChspsClient24hspsRestoreActiveAppConfEii @ 26 NONAME + _ZN11ChspsClient4NewLER35MhspsThemeManagementServiceObserver @ 27 NONAME + _ZN11ChspsClient5NewLCER35MhspsThemeManagementServiceObserver @ 28 NONAME + _ZN11ChspsClient9SetLogBusEPv @ 29 NONAME + _ZTI11ChspsClient @ 30 NONAME + _ZTV11ChspsClient @ 31 NONAME + _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R5TDes8 @ 32 NONAME + _ZThn28_N11ChspsClient16hspsInstallThemeERK7TDesC16R8ChspsODT @ 33 NONAME + _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER5TDes8 @ 34 NONAME + _ZThn28_N11ChspsClient21hspsInstallNextPhaseLER8ChspsODT @ 35 NONAME + _ZThn28_N11ChspsClient22hspsCancelInstallThemeEv @ 36 NONAME + _ZThn32_N11ChspsClient13hspsAddPluginEiiiiRi @ 37 NONAME + _ZThn32_N11ChspsClient16hspsMovePluginsLEiiRK13CArrayFixFlatIiE @ 38 NONAME + _ZThn32_N11ChspsClient16hspsRemovePluginEii @ 39 NONAME + _ZThn32_N11ChspsClient16hspsRemoveThemeLERK8ChspsODT @ 40 NONAME + _ZThn32_N11ChspsClient16hspsSetConfStateEii23ThspsConfigurationState26ThspsConfStateChangeFilter @ 41 NONAME + _ZThn32_N11ChspsClient17hspsGetNextHeaderEv @ 42 NONAME + _ZThn32_N11ChspsClient17hspsPluginUpdateLERK8ChspsODT @ 43 NONAME + _ZThn32_N11ChspsClient17hspsReplacePluginEiii @ 44 NONAME + _ZThn32_N11ChspsClient18hspsGetListHeadersERK6TDesC8R12CArrayPtrSegI6HBufC8E @ 45 NONAME + _ZThn32_N11ChspsClient18hspsGetListHeadersERK8ChspsODTR13CArrayPtrFlatIS0_E @ 46 NONAME + _ZThn32_N11ChspsClient18hspsRestoreDefaultERK8ChspsODTRS0_ @ 47 NONAME + _ZThn32_N11ChspsClient18hspsSetActiveThemeERK6TDesC8R5TDes8 @ 48 NONAME + _ZThn32_N11ChspsClient18hspsSetActiveThemeERK8ChspsODTRS0_ @ 49 NONAME + _ZThn32_N11ChspsClient19hspsSetActivePluginEii @ 50 NONAME + _ZThn32_N11ChspsClient21hspsSetPluginSettingsERK8ChspsODTiR16ChspsDomDocumenti @ 51 NONAME + _ZThn32_N11ChspsClient24hspsCancelGetListHeadersEv @ 52 NONAME + _ZThn32_N11ChspsClient24hspsRestoreActiveAppConfEii @ 53 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/eabi/hspsrequestclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/eabi/hspsrequestclientu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,16 @@ +EXPORTS + _ZN18ChspsRequestClient10hspsGetODTEiR8ChspsODT @ 1 NONAME + _ZN18ChspsRequestClient13GethspsResultER11ChspsResult @ 2 NONAME + _ZN18ChspsRequestClient16hspsGetODTUpdateEv @ 3 NONAME + _ZN18ChspsRequestClient22hspsAccessResourceFileERK7TDesC16RK18ThspsConfigurationR5RFile @ 4 NONAME + _ZN18ChspsRequestClient22hspsCancelGetODTUpdateEv @ 5 NONAME + _ZN18ChspsRequestClient4NewLER33MhspsClientRequestServiceObserver @ 6 NONAME + _ZN18ChspsRequestClient5NewLCER33MhspsClientRequestServiceObserver @ 7 NONAME + _ZTI18ChspsRequestClient @ 8 NONAME ; ## + _ZTV18ChspsRequestClient @ 9 NONAME ; ## + _ZThn28_N18ChspsRequestClient10hspsGetODTEiR8ChspsODT @ 10 NONAME ; ## + _ZThn28_N18ChspsRequestClient16hspsGetODTUpdateEv @ 11 NONAME ; ## + _ZThn28_N18ChspsRequestClient22hspsAccessResourceFileERK7TDesC16RK18ThspsConfigurationR5RFile @ 12 NONAME ; ## + _ZThn28_N18ChspsRequestClient22hspsCancelGetODTUpdateEv @ 13 NONAME ; ## + _ZN18ChspsRequestClient9SetLogBusEPv @ 14 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/backup_registration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2003 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: This file provides the information required for building the +* whole of a UI Manager +* +*/ + + +#include + + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS + +// Backup registration +backup_registration.xml /epoc32/data/z/private/200159c0/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/udeb/z/private/200159c0/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/urel/z/private/200159c0/backup_registration.xml + +PRJ_MMPFILES +hspsclientsession.mmp +hspsclient.mmp +hspsrequestclient.mmp +hspsthemeserver.mmp + +#include "../tools/bld.inf" + +//PRJ_TESTMMPFILES +// diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/hspsclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/hspsclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: hspsClient API build configuration +* +*/ + + +#include +#include "../../inc/hsps_log_cfg.hrh" + +TARGET hspsclient.dll +TARGETTYPE dll + +UID 0x1000008d 0x200159BD + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../client +SOURCE hspsclient.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LANG SC + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY hspsclientsession.lib +LIBRARY hspsodt.lib +LIBRARY hspsresult.lib +LIBRARY hspsdomdocument.lib efsrv.lib diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/hspsclientsession.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/hspsclientsession.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2003 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: Build configuration of low-level client side library for hspsThemeServer.exe +* +*/ + + +#include + +TARGET hspsclientsession.dll +TARGETTYPE dll + +UID 0x1000008d 0x200159BE //old uid 10207256 + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../client +SOURCE hspsclientsession.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/connect + +LANG SC + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY hspsodt.lib diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/hspsrequestclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/hspsrequestclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* 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: hspsRequestClient API build configuration +* +*/ + + +#include +#include "../../inc/hsps_log_cfg.hrh" + +TARGET hspsrequestclient.dll +TARGETTYPE dll + +UID 0x1000008d 0x200159BF //old uid 10207257 // hspsrequesthandler.dll UID + +CAPABILITY CAP_CLIENT_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../client +SOURCE hspsrequestclient.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LANG SC + +LIBRARY hal.lib // monitoring memory etc. +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY hspsclientsession.lib +LIBRARY hspsodt.lib +LIBRARY hspsresource.lib +LIBRARY hspsresult.lib +LIBRARY hspsdomdocument.lib +LIBRARY efsrv.lib diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/group/hspsthemeserver.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* 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: Makefile of hspsThemeServer +* +*/ + + +#include +#include "../../inc/hsps_builds_cfg.hrh" +#include "../../inc/hsps_log_cfg.hrh" + +TARGET hspsthemeserver.exe + +targettype exe + +UID 0x1000008d 0x200159C0 +CAPABILITY ALL -tcb -DRM +VENDORID VID_DEFAULT +SECUREID 0x200159C0 + +epocheapsize 0x1000 0x400000 // 4KB - 4 MB +EPOCSTACKSIZE 0x5000 + +SOURCEPATH ../src +SOURCE hspsthemeserver.cpp +SOURCE hspsthemeserversession.cpp +SOURCE hspsinstallationhandler.cpp +SOURCE hspsmaintenancehandler.cpp +SOURCE hspsclientrequesthandler.cpp +SOURCE hspssecurityenforcer.cpp +SOURCE hspsfilechangelistener.cpp +SOURCE hspscenreplistener.cpp +#ifndef __DISABLE_SISX_INSTALLATION_ +SOURCE hspsautoinstaller.cpp +#endif //__DISABLE_SISX_INSTALLATION_ +#ifdef _hsps_EMULATOR_SUPPORT_ +SOURCE hspsfilechangelisteneremu.cpp +#endif //_hsps_EMULATOR_SUPPORT_ +SOURCE hspsserverutil.cpp +SOURCE hspsrominstaller.cpp +SOURCE hspsbrobserver.cpp +SOURCE hspsbrhandler.cpp +SOURCE hspsinstaller.cpp +#if defined(WINSCW) || defined(__WINS__) +SOURCE hspsfamilylistener.cpp +#endif + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/xml +SYSTEMINCLUDE /epoc32/include/connect + +LIBRARY hal.lib // monitoring memory etc. +LIBRARY euser.lib // CBase etc. +LIBRARY efsrv.lib // file manager +LIBRARY bafl.lib // descriptors +LIBRARY estor.lib // streamstores +LIBRARY centralrepository.lib +LIBRARY apmime.lib // MIME-support +LIBRARY xmlframework.lib +LIBRARY charconv.lib // utf-unicode +LIBRARY sysutil.lib // sysutil:: +LIBRARY hspsdefrep.lib +LIBRARY hspsodt.lib +LIBRARY hspsresource.lib +LIBRARY hspsresult.lib +LIBRARY hspsdomdocument.lib +LIBRARY hspsdefinitionengineinterface.lib +LIBRARY ecom.lib // definition engine +#ifdef _hsps_DEBUG_ +LIBRARY flogger.lib +#endif // _hsps_DEBUG_ +LIBRARY sysversioninfo.lib +LIBRARY abclient.lib +#if defined(WINSCW) || defined(__WINS__) +LIBRARY ws32.lib // RWsSession +LIBRARY featmgr.lib // FeatureManager +#endif // defined(WINSCW) + +LANG SC + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsautoinstaller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsautoinstaller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,171 @@ +/* +* 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: AutoInstaller installs theme from given location. It is intended +* to be used by hspsThemeServer directly. AutoInstaller is initiated +* when FileChangeListener finds installable theme source on given +* location. Theme source is set during the SISX-package +* exctraction. AutoInstaller is deployed by calling its function +* InstallThemeL with manifest-file of the installable theme source set. +* AutoInstaller deploys hspsInstallationHandler. hspsInstallationHandler +* is asynchronous object, there for AutoInstaller is asynchronous object +* as well capable to deploy asynchronous installation. +* When installation ends, AutoInstaller calls its observer with +* ThspsServiceCompletedMessage-type parameter. Observer is given on +* initialising of AutoInstaller and it is allways ChspsThemeServer-type. +* AutoInstaller have functions to get ODT-header of successfully installed +* theme and ChspsResult-typed object expressing errors in unsuccessful cases. +* +*/ + + +#ifndef __hspsAUTOINSTALLER_H__ +#define __hspsAUTOINSTALLER_H__ + +#include +#include "hspsthememanagement.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif +class ChspsODT; +class ChspsResult; +class ChspsThemeServer; +class ChspsMaintenanceHandler; +class ChspsInstallationHandler; + +/** +* @ingroup group_hspsserver +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsAutoInstaller : public CActive + { + public: // Constructors and destructors + /** + * NewL. + * Two-phased constructor. + * Creates a ChspsAutoInstaller object using two phase construction, + * and return a pointer to the created object. + * @param aObserver The object to be used to handle updates from the server. + * @return A pointer to the created instance of ChspsAutoInstaller. + */ + static ChspsAutoInstaller* NewL( ChspsThemeServer& aThemeServer ); + + /** + * NewLC. + * Two-phased constructor. + * Creates a ChspsClinet object using two phase construction, + * and return a pointer to the created object. + * @param aObserver The object to be used to handle updates from the server. + * @return a pointer to the created instance of ChspsAutoInstaller. + */ + static ChspsAutoInstaller* NewLC( ChspsThemeServer& aThemeServer ); + + /** + * ~ChspsAutoInstaller. + * Destructor. + * Destroys the object and release all memory objects. + */ + virtual ~ChspsAutoInstaller(); + + public: // New functions + + /** + * UnInstallThemeL + * @since S60 3.2 + * @param aPathFile a path_*.dat file which describes the theme to be uninstalled + */ + void UnInstallThemeL( const TDesC& aPathFile ); + + /** + * InstallTheme + * @since S60 3.1 + * @param aManifestFileName is a name of the manifest file of theme source to be installed. + */ + TInt InstallThemeL( const TDesC& aManifestFileName ); + + /** + * GethspsResultL + * @since S60 3.1 + * @param aResult is a ChspsResult object containing additional information of the result of query. + */ + ChspsResult& hspsResult(); + +#ifdef HSPS_LOG_ACTIVE + /** + * Set log bus. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + protected: // Functions from base classes + + /** + * From CActive, RunL. + * Callback function. + * Invoked to handle responses from the server. + */ + void RunL(); + + /** + * From CActive, DoCancel. + * Cancels any outstanding operation. + */ + void DoCancel(); + + /** + * From CActive Called when asynchronous request has failed + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + private: // Constructors and destructors + + /** + * ChspsAutoInstaller. + * Performs the first phase of two phase construction. + * @param aObserver The object to be used to handle updates from the server. + */ + ChspsAutoInstaller( ChspsThemeServer& aThemeServer ); + + /** + * ConstructL. + * Performs the second phase construction of a ChspsAutoInstaller object. + */ + void ConstructL(); + + + private: // Members + + + private: // Data + + TBuf8 iHeaderData; + ChspsThemeServer& iThemeServer; + ChspsResult* iResult; + ChspsInstallationHandler* iInstallationHandler; + ChspsMaintenanceHandler* iMaintenanceHandler; +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. Not owned. + */ + ChspsLogBus* iLogBus; +#endif + + }; + + +#endif //__hspsAUTOINSTALLER_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsbrhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsbrhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,138 @@ +/* +* 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: Defination of class CHSPSBRHandler +* +*/ + + +#ifndef C_CHSPSBRHANDLER_H +#define C_CHSPSBRHANDLER_H + +#include +#include +#include + +class ChspsThemeServer; + +/** +* @ingroup group_hspsserver +* Provides implementation to HSPS backup handler +* +**/ +NONSHARABLE_CLASS( CHSPSBRHandler ) : public CBase, public conn::MActiveBackupDataClient + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CHSPSBRHandler* NewL( ChspsThemeServer& aServer ); + + /** + * Destructor. + */ + virtual ~CHSPSBRHandler(); + + + public: // New functions + + public: // // Functions from base classes + + /** + From MActiveBackupDataClient + */ + void AllSnapshotsSuppliedL(); + + /** + From MActiveBackupDataClient + */ + void ReceiveSnapshotDataL( TDriveNumber aDrive, TDesC8& aBuffer, TBool aLastSection ); + + /** + From MActiveBackupDataClient + */ + TUint GetExpectedDataSize( TDriveNumber aDrive ); + + /** + From MActiveBackupDataClient + */ + void GetSnapshotDataL( TDriveNumber aDrive, TPtr8& aBuffer, TBool& aFinished ); + + /** + From MActiveBackupDataClient + */ + void InitialiseGetBackupDataL( TDriveNumber aDrive ); + + /** + From MActiveBackupDataClient + */ + void GetBackupDataSectionL( TPtr8& aBuffer, TBool& aFinished ); + + /** + From MActiveBackupDataClient + */ + void InitialiseRestoreBaseDataL( TDriveNumber aDrive ); + + /** + From MActiveBackupDataClient + */ + void RestoreBaseDataSectionL( TDesC8& aBuffer, TBool aFinished ); + + /** + From MActiveBackupDataClient + */ + void InitialiseRestoreIncrementDataL( TDriveNumber aDrive ); + + /** + From MActiveBackupDataClient + */ + void RestoreIncrementDataSectionL( TDesC8& aBuffer, TBool aFinished ); + + /** + From MActiveBackupDataClient + */ + void RestoreComplete( TDriveNumber aDrive ); + + /** + From MActiveBackupDataClient + */ + void TerminateMultiStageOperation(); + + /** + From MActiveBackupDataClient + */ + TUint GetDataChecksum( TDriveNumber aDrive ); + + private: + + /** + * C++ default constructor. + */ + CHSPSBRHandler( ChspsThemeServer& aServer ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: // Data + + // Listening server reference + ChspsThemeServer& iServer; + + }; + +#endif // C_CHSPSBRHANDLER_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsbrobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsbrobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Defination of class CHSPSBRObserver +* +*/ + + +#ifndef C_CHSPSBROBSERVER_H +#define C_CHSPSBROBSERVER_H + +#include +#include + +class ChspsThemeServer; + +/** +* @ingroup group_hspsserver +* Provides implementation to HSPS backup event listener +* +**/ +NONSHARABLE_CLASS( CHSPSBRObserver ) : public CActive + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aServer Reference to listening server + * @return pointer to CHSPSBRObserver object + */ + static CHSPSBRObserver* NewL( ChspsThemeServer& aServer ); + + /** + * Destructor. + */ + virtual ~CHSPSBRObserver(); + + + public: // New functions + /** + * Starts listening of backup events + */ + void Start(); + + public: // Functions from base classes + + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + */ + void DoCancel(); + + /** + * From CActive + * @param aError error code + */ + TInt RunError( TInt aError ); + + + private: + + /** + * C++ default constructor. + * @param aServer Reference to listening server + */ + CHSPSBRObserver( ChspsThemeServer& aServer ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: // Data + + // Listening server reference + ChspsThemeServer& iServer; + + // To receive backup events + RProperty iProperty; + + }; + +#endif // C_CHSPSBROBSERVER_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspscenreplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspscenreplistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2002-2004,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: CenRepListener listens to given Central Repository setting id and notifies its +* observer if there is any change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsCenRepObserver-interface. +* CenRepListener is asynchronous object that deploys a client-side handle +* on Central Repository Server. CenRepListener is intended to be used by any object +* that wants listen Central Repository changes. +* +* +*/ + + +#ifndef __ChspsCENREPLISTENER_H__ +#define __ChspsCENREPLISTENER_H__ + +#include + +class CRepository; + +/** +* @ingroup group_hspsserver +* MhspsCenRepObserver is used to listen to the changes in the Central Repository. +* +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class MhspsCenRepObserver + { + public: + virtual void HandleCenRepChangeL( const TUint32 aId ) = 0; + }; + +/** +* @ingroup group_hspsserver +* ChspsCenRepListener is used to listen to the changes in the Central Repository. +* +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsCenRepListener : public CActive + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsCenRepListener* NewL( + MhspsCenRepObserver& aObserver, + const TUid& aRepositoryUid ); + /** + * ~ChspsCenRepListener + * Destructor. + */ + virtual ~ChspsCenRepListener(); + + public: + + /** + * Setup + * Sets up the Central Repository change listener for setting aId. + * @since S60 3.1 + * @return void + */ + void Setup( TUint32 aId ); + + /** + * SetupAll + * Sets up the Central Repository change listener for all settings. + * @since S60 3.1 + * @return void + */ + void SetupAll(); + + protected: // Functions from base classes + + /** + * From CActive Called when asynchronous request has completed + * RunL + * @since S60 3.1 + */ + void RunL(); + + /** + * DoCancel + * From CActive Called when asynchronous request was cancelled + * @since S60 3.1 + */ + void DoCancel(); + + private: + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * ChspsCenRepListener + * C++ default constructor. + */ + ChspsCenRepListener( MhspsCenRepObserver& aObserver, + const TUid& aRepositoryUid ); + + private: // Data + + // Observer which is called when RunL occurs + MhspsCenRepObserver& iObserver; + // Pointer to Central Repository + CRepository* iRepository; + // Uid of the accessed Central Repository + TUid iRepositoryUid; + }; + + +#endif // __ChspsCENREPLISTENER_H__ + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsclientrequesthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsclientrequesthandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,454 @@ +/* +* 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: ChspsClientRequestHandler is a server-side implementation for +* retrieving configurations from the HSPS's Definition Repository. +* Configurations are binary presentations of a manifest, XML and +* resource files - actually, instances of the hspsODT class. +* Due to perfomance aspects, instead of the binary files, a file +* handle is returned over the IPC channel, and on client side, +* the handle is then used for internalizing the requested +* configuration. +* +* +*/ + + +#ifndef __hspsCLIENTREQUESTHANDLER_H__ +#define __hspsCLIENTREQUESTHANDLER_H__ + +#include + +#include "hspscenreplistener.h" +#include "hspsreqnotifparam.h" + +class MhspsClientRequestService; +class ChspsSecurityEnforcer; +class CRepository; +class ChspsODT; +class ChspsFileAccess; +class ChspsResource; +class ChspsThemeServer; +class ChspsResult; +class ChspsRequestNotifcationParams; + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +/** +* +* Class ChspsClientRequestHandler. ChspsClientRequestHandler performs all Xuikon Client Request Service +* related functionality of Xuikon Theme Mangement Service APIs. +* Xuikon Client Request Service API is intended to serve Rendering Engines with Application Themes +* and their associated resources. ChspsClientRequestHandler will provide access to +* Xuikon's Application Theme database maintained by Xuikon Definition Repository. +* Definition Repository maintains Application Themes in ChspsODT-objects. +* Themes can have resources like bitmaps etc. Resources can be accessed through this API also. +* Every individual resource has corresponding ChspsResource-object. hspsResource-object is delivered +* to the client side in a resource list which is associated to the theme. +* Resource list is included in ODT as well as DOM-document which contains UI-definition. +* There can be only one theme activated for a specific application at one time. +* The information of activation of themes is stored in Symbian Central Repository -object. +* The Central Repository is requested on every theme request that Rendering Engine commences. +* +* Class inheritance: +* ================== +* ChspsClientRequestHandler derives CTimer for active timer functionality. It implements +* MhspsClientRequestService-interface for Xuikon Client Request Service API functionality, +* and MhspsDefinitionRepositoryObserver for listening to the definition repository events. +* +* Functionality: +* ============== +* To initiate theme usage, Rendering Engine must call hspsGetODT(). +* +* hspsGetODT() returns one of the following codes: +* - EhspsGetODTSuccess. Theme was received successfully. Client can start its rendering. +* - EhspsGetODTFailed. Theme was not received. Check Additional Return Code in hspsResult-object +* for the exact reason. Theme load can fail for e.g. for missing rights. +* - EhspsGetODTLowMemoryStrategy. Possible memory low to create chunk. Client should +* implement some low memory strategy. In version 3.1, +* the low-memory stategy is use direct file handle in +* accessing ODT. System can be configured to use +* low-memory strategy only. +* +* After receiving the theme, Rendering Engine may subscribe the theme related events. +* These events may concern the changes of the theme status (meaning that some other theme is +* activated), or that the theme is updated. In both cases, client should reload the theme and do +* the rendering again. To act as a subscriber of these events, client must implement the interface +* MhspsClientRequestServiceObserver. Subscription is applied by calling hspsGetODTUpdate(). +* This function returns immediately one of the following codes: +* - EhspsGetODTUpdateSuccess - The subscription of the theme updates and/or status changes was + successful. The cient must start observe the server events. +* - EhspsGetODTUpdateFailed - The subscription of the theme updates and status changes was failed. +* +* Once success-response was received, the observation of the Client Request Service events can +* return one of the following codes: +* +* - EhspsGetODTUpdateStatus - Theme status was changed. Client must reset rendering and request theme +* again. +* - EhspsGetODTUpdateHot - Theme was updated. Client should reload the theme and then do the +* rendering again. +* +* Rendering Engine can get information of the theme resources through the ChspsResource-objects +* delivered on the resource list in ODT. When ChspsODT-object's DOM-document has a reference to +* some resource-URL, the access method to the resource can be found in ChspsResource-object. +* When access-method is resolved, client should call hspsAccessResourceFile() function with resource +* file path and empty RFile-handle. In successful cases, valid file handle to the associated +* resource file is returned. +* This functionality is arranged by the means of Symbian 9.0 EKA2 Kernel's support for Platform +* Security Concept. The return code can be one of the following: +* - EhspsAccessResourceFileSuccess - request to get access to a theme resource file was successful. +* - EhspsAccessResourceFileFailed - request to get access to a theme resource file was unsuccessful +* possible in due to a security fault. +* +* Client Request Service functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. +* +* @ingroup group_hspsserversession +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsClientRequestHandler : public CBase, + public MhspsClientRequestService, + public MhspsDefinitionRepositoryObserver, + public MhspsCenRepObserver + + { + public: // Constructors and destructor + /** + * NewL + * + * @since S60 5.0 + */ + static ChspsClientRequestHandler* NewL( ChspsThemeServer& aThemeServer ); + /** + * NewLC + * + * @since S60 5.0 + */ + static ChspsClientRequestHandler* NewLC( ChspsThemeServer& aThemeServer ); + + /** + * ~ChspsClientRequestHandler + * Destructor. + */ + ~ChspsClientRequestHandler(); + + public: // New functions + /** + * ServiceGetOdtL + * + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceGetOdtL(const RMessage2& aMessage); + /** + * ServiceGetOdtUpdateL + * + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceGetOdtUpdateL(const RMessage2& aMessage); + /** + * ServiceAccessResourceFileL + * + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceAccessResourceFileL(const RMessage2& aMessage); + + /** + * Finnishes installation of application configurations + * @since S60 5.0 + * @param aAppODT is an ODT instance of an application configuration + */ + void HandlePluginReferencesL( + ChspsODT& aAppODT ); + +#ifdef HSPS_LOG_ACTIVE + /** + * SetLogBus + * + * @since S60 5.0 + * @param aLogBus Log bus to be set. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + public: // From MhspsClientRequestService + + /** + * From MhspsClientRequestService hspsGetODT + * @since S60 3.1 + * @param aAppUid is the UID of the application for which the theme is requested for. + * @param aODT is an empty ChspsODT-object in where the theme is expected to be placed when + * the call returns. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsGetODT(TInt aAppUid, ChspsODT& aODT); + + /** + * From MhspsClientRequestService hspsGetODT + * @since S60 3.1 + * @param aAppUid is the UID of the application for which the theme is requested for. + * @param aODT is an empty ChspsODT-object in where the theme is expected to be placed when + * the call returns. + * @param aResourceList is an empty list-object able to contain ChspsResource-objects. + * On return of the call, every resource object on the list will describe a resource + * belonging to the theme in hand. + * @return ThspsServiceCompletedMessage expressing the result of the call. + * + * DEPRECATED + */ + ThspsServiceCompletedMessage hspsGetODT(TInt aAppUid, ChspsODT& aODT, + CArrayPtrSeg& aResourceList); + + /** + * From MhspsClientRequestService hspsGetODTUpdate + * @since S60 3.1 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsGetODTUpdate(); + + /** + * From MhspsClientRequestService hspsCancelGetODTUpdate + * @since S60 3.1 + * @return ThspsServiceCompletedMessage telling the result of the call. + */ + ThspsServiceCompletedMessage hspsCancelGetODTUpdate(); + + /** + * From MhspsClientRequestService hspsAccessResourceFile + * @since S60 3.1 + * @param aResourceFileName is the path for resource file to requested. Resource file name is + * given in every ChspsResource-object listed on the resource list. + * @param aFile is an empty RFile object which a valid file handle to the resourec file will + * be placed on return. + * The file access is arranged by means of Symbian 9.0 EKA2 Platform Security file + * handle sharing concept. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsAccessResourceFile( + const TDesC& /*aResourceFileName*/, + const ThspsConfiguration& /*aConfiguration*/, + RFile& /*aFile*/ ); + + public: // from MhspsDefinitioRepositoryObserver + + TBool HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ); + + public: // from MhspsCenRepObserver + + void HandleCenRepChangeL( const TUint32 aId ); + + protected: + /** + * ChspsClientRequestHandler + * C++ default constructor. + * @since S60 5.0 + */ + ChspsClientRequestHandler( ChspsThemeServer& aThemeServer ); + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private + * @since S60 5.0 + */ + void ConstructL(); + + private: + + /** + * RestoreDefaultL + * + * @since S60 3.1 + */ + void RestoreDefaultL( ChspsODT& aOdt ); + + /** + * CallGetODTPathL + * + * @since S60 5.0 + */ + void CallGetODTPathL( ChspsODT& aSearchMask, TDes& aODTPath ); + + /** + * CompleteRequest + * + * @since S60 5.0 + */ + void CompleteRequestL(const ThspsServiceCompletedMessage aReturnMessage, + RMessagePtr2& aMessagePtr, const TDesC8& aHeaderData = KNullDesC8 ); + + /** + * RestoreValidThemeL + * Restores operator/licensee default theme + * @since S60 3.1 + * @param aCorruptedOdt Odt which failed to render + */ + void RestoreValidThemeL(ChspsODT& aCorruptedOdt); + + /** + * HandleDefinitionRespositoryEventL + * + * @since S60 5.0 + */ + + TBool HandleDefinitionRespositoryEventL( ThspsRepositoryInfo aRepositoryInfo ); + + /** + * Finds plug-in references from the provided application configuration and append + * XML document with plug-ins specific XML. + * Applies to plug-in configurations of type "application configuration" only. + * @param aAppODT is an ODT instance of an application configuration + */ + void AppendPluginConfigurationsL( + ChspsODT& aAppODT ); + + /** + * Appends missing plugin with a dummy configuration where status="Error" + * @since S60 5.0 + * @param aAppDom is a DOM of an application configuration + * @param aMissingPluginNode is a plug-in node which was not found from the Plugin Repository + * @param aPluginUid is an UID of the missing plugin + */ + void AddErrorConfigurationL( + ChspsDomDocument& aAppDom, + ChspsDomNode& aMissingPluginNode, + const TInt aPluginUid ); + + /** + * Prepare given ChspsRequestNotificationParams for sending. + * + * @since S60 5.0 + * @param aInfo Info to build params from. + * @param aMessage Completed message. + */ + void PrepareAndCompleteRequestL( const ThspsRepositoryInfo& aInfo, + const ThspsServiceCompletedMessage& aMessage ); + + /** + * Finds plug-in's initial settings from the provided root configuration and modify + * plugin specific settings with these initial settings. + * + * @since S60 5.0 + * @param aAppODT is an ODT instance of an application configuration + * @return KErNone if succeed + */ + TInt AppendInitialSettingsL( ChspsODT& aAppODT ); + + /** + * Parse initial settings items. + * + * @since S60 5.0 + * @param aInitialSettingsNode Initial settings node to be parsed(source node). + * @param aSettingsNode Actual settings node(target node) where to initial settings needs to be copied. + * @return KErNone if succeed + */ + TInt ParseInitialSettingsItemsL( ChspsDomNode& aInitialSettingsNode,ChspsDomNode& aSettingsNode); + + /** + * Handling initial settings property nodes. + * + * @since S60 5.0 + * @param aPropertyNode Initial settings property node(property source node). + * @param aNode Target node. + * @return KErNone if succeed + */ + TInt HandlePropertyNodeL( ChspsDomNode& aPropertyNode,ChspsDomNode& aNode ); + + /** + * Handling attributes. + * + * @since S60 5.0 + * @param aAttrName Attribute name. + * @param aAttrValue Attribute value. + * @param aNode Target property node. + * @return KErNone if succeed. + */ + TInt HandlePropertyAttributesL(const TDesC8& aAttrName, + const TDesC8& aAttrValue, + ChspsDomNode& aNode ); + + /** + * Finds a root node for liw structure from dom document by identifier + * + * @since S60 5.0 + * @param aNodeIdentifier An Tag. + * @param aNodeIdentifier An Identifier. + * @param aNode A Dom Node where the node is searched from. + * @return Result node. + */ + ChspsDomNode& FindRootNodeByIdentifierL( const TDesC8& aNodeTag, + const TDesC8& aNodeIdentifier, + ChspsDomNode& aNode ); + + protected: // Functions from base classes + + + private: // Data + // the next member variables should be used in asynchronous message handling only + RMessagePtr2 iMessagePtr; + TFileName iODTPath; + + // tells to restore default in repeated theme load cases + TBool iRestoreDefault; + ChspsResult* iResult; + TBuf8 iResultData; + ChspsRequestNotificationParams* iReqNotifParams; + TBuf8 iReqNotifData; + HBufC8* iRequestData; + + // Index of the requested function + ThspsServiceRequestMessage iRequestMessage; + + ThspsServiceCompletedMessage iCompletedMessage; + TTime iLastHeaderListUpdateTime; + TTime iLastSuccessThemeLoadTime; + // application or interface uid + TUint iRootUid; + // theme uid from the most recent request + TUint iActiveThemeUid; + TUint iSecureId; + ChspsODT* iOdt; + RFs iFs; + TInt iThemeLoadRepeatCount; + // ownership of the next objects is held by ChspsThemeServer + ChspsThemeServer& iThemeServer; + // Reference to central repository + CRepository& iCentralRepository; + // Pointer to Central Repository Listener + ChspsCenRepListener* iCenRepListener; + // Reference to definition repository + ChspsDefinitionRepository& iDefinitionRepository; + // Reference to security enforcer + ChspsSecurityEnforcer& iSecurityEnforcer; + // header list cache + CArrayPtrSeg& iHeaderListCache; + // Reserved pointer for future extension + TAny* iReserved; + +#ifdef HSPS_LOG_ACTIVE + // Log bus to be used. Not owned. + ChspsLogBus* iLogBus; +#endif + }; + +#endif //__hspsCLIENTREQUESTHANDLER_H__ + +// end of file + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsconfiguration.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* 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: Defines the XML elements and values of a configuration file. +* +*/ + + +#ifndef HSPSCONFIGURATION_H_ +#define HSPSCONFIGURATION_H_ + +// Xmluiml element +_LIT8( KXmlUimlElement, "xmluiml" ); // Root element +_LIT8( KXmlUimlAttrXmlns, "xmlns"); // Not required or used in HSPS + +// Configuration element +_LIT8( KConfigurationElement, "configuration" ); +_LIT8( KConfigurationAttrId, "id" ); // Unique id for the configuration elements +_LIT8( KConfigurationAttrType, "type" ); // root/view/widget/template +_LIT8( KConfigurationAttrInterface, "interface" ); // Uid of Xuikon technology +_LIT8( KConfigurationAttrUid, "uid" ); // Globally unique uid, identifies specific configuration +_LIT8( KConfigurationAttrName, "name" ); // Localized name of the configuration +_LIT8( KConfigurationAttrNameEntity, "_name" ); // Logical string id of the Name attribute (DTD entity) +_LIT8( KConfigurationAttrState, "state" ); // State of the configuration +_LIT8( KConfigurationAttrVersion, "version" ); // Configuration version +_LIT8( KConfigurationAttrMultiInstance, "multiinstance" ); // Multiinstance flag +_LIT8( KConfigurationAttrDesc, "desc" ); // Localized description +_LIT8( KConfigurationAttrDescEntity, "_desc" ); // Logical string id of the Description attr (DTD entity) +_LIT8( KConfigurationAttrMaxChild, "max_child" ); // Maximum child count + + +// Configuration element type attribute values +_LIT8( KConfTypeApp, "application" ); // Application configuration +_LIT8( KConfTypeView, "view" ); // View configuration +_LIT8( KConfTypeWidget, "widget" ); // Widget configuration +_LIT8( KConfTypeTemplate, "template" ); // Template configuration + +// Configuration element state attribute values +_LIT8( KConfStateNotConfirmed, "NotConfirmed" ); // Not confirmed state +_LIT8( KConfStateWaitForConfirmation, "WaitForConfirmation" );// Wait for confirmation state +_LIT8( KConfStateConfirmed, "Confirmed" ); // Confirmed state +_LIT8( KConfStateError, "Error" ); // Error state + +// Control element +_LIT8( KControlElement, "control" ); +_LIT8( KControlAttrName, "name" ); // Localized name of the configuration +_LIT8( KControlAttrNameEntity, "_name" ); // DTD entity, used to localize the name attribute from DTD files + +// Plugins element +_LIT8( KPluginsElement, "plugins" ); + +// Plugin element +_LIT8( KPluginElement, "plugin" ); +_LIT8( KPluginAttrId, "id" ); // Unique id for the plugin elements +_LIT8( KPluginAttrUid, "uid" ); // Globally unique uid, identifies specific configuration +_LIT8( KPluginAttrInterface, "interface" ); // uid of AI3/etc +_LIT8( KPluginAttrName, "name" ); // Localized name of the plugin +_LIT8( KPluginAttrNameEntity, "_name" ); // DTD entity, used to localize the name attribute from DTD files +_LIT8( KPluginAttrActive, "active" ); // Plugin active state + +// Plugin element active state attribute values. +_LIT8( KPluginActiveStateNotActive, "0" ); // Not active +_LIT8( KPluginActiveStateActive, "1" ); // Active + +// Settings element +_LIT8( KSettingsElement, "settings" ); +_LIT8( KInitialSettingsElement, "initial_settings"); + +// Item +_LIT8( KItemElement, "item" ); // +_LIT8( KItemAttrId, "id" ); // Name of the attributes container +_LIT8( KItemAttrName, "name" ); // Localized name +_LIT8( KItemAttrNameEntity, "_name" ); // DTD entity, used to localize the name attribute from DTD files + +// Property +_LIT8( KPropertyElement, "property" ); +_LIT8( KPropertyAttrName, "name" ); // Property name +_LIT8( KPropertyAttrValue, "value" ); // Property value + +// Resources +_LIT8( KResourcesElement, "resources" ); + +// Object +_LIT8( KObjectElement, "object" ); +_LIT8( KObjectAttrFilename, "name" ); +_LIT8( KObjectAttrMediatype, "mediatype" ); +_LIT8( KObjectAttrPath, "path" ); +_LIT8( KObjectAttrTag, "tag" ); + +// Tags for resource objects +_LIT8( KObjectAttrTagLogo, "logo"); +_LIT8( KObjectAttrTagPreview, "preview"); + +#endif /*HSPSCONFIGURATION_H_*/ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsfamilylistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2002-2004,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: CenRepListener listens to given Central Repository setting id and notifies its +* observer if there is any change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsCenRepObserver-interface. +* CenRepListener is asynchronous object that deploys a client-side handle +* on Central Repository Server. CenRepListener is intended to be used by any object +* that wants listen Central Repository changes. +* +* +*/ + +#ifndef HSPSFAMILYLISTENER_H_ +#define HSPSFAMILYLISTENER_H_ + +#include +#include + +#include "hspsthememanagement.h" + + +/** + * @ingroup group_hspsserver + * HandleFamilyChangeL. + * Handles notifications related to resolution/orientation changes. + * Clients are requested to reload UIs with a resolution specific widget set. + * Executable on emulator environment only! + * @lib hspsThemeServer.exe + * @since S60 5.0 + * @param aNewFamily An id for retrieving the new application configuration + * @return True if the event was handled properly + */ +class MhspsFamilyObserver + { + public: + virtual TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ) = 0; + }; + +/** +* @ingroup group_hspsserver +* ChspsFamilyListener is used to listen to the changes in UI's resolution and orientation. +* Used on emulator environment only. +* +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsFamilyListener : public CActive + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsFamilyListener* NewL( + MhspsFamilyObserver& aObserver ); + + /** + * ~ChspsFamilyListener + * Destructor. + */ + virtual ~ChspsFamilyListener(); + + /** + * Retrieves family type from a string + * @since S60 5.0 + */ + static ThspsFamily GetFamilyType( + const TDesC8& aFamilyString ); + + /** + * Retrieves family type from the current resolution. + * @since S60 5.0 + * @return Family id + */ + ThspsFamily GetFamilyType(); + + protected: // Functions from base classes + + /** + * From CActive Called when asynchronous request has completed + * RunL + * @since S60 5.0 + */ + void RunL(); + + /** + * DoCancel + * From CActive Called when asynchronous request was cancelled + * @since S60 5.0 + */ + void DoCancel(); + + /** + * RunError + * Handles a leave occurring in the request completion event handler RunL(). + * @since S60 5.0 + */ + TInt RunError(TInt aError); + + private: + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * ChspsCenRepListener + * C++ default constructor. + */ + ChspsFamilyListener( + MhspsFamilyObserver& aObserver ); + + /** + * Start listener. + */ + void Queue(); + + /** + * Retrieves used display code. + */ + void GetFamilyString( + TDes8& aFamily ); + + private: // Data + + // Observer which is called when RunL occurs + MhspsFamilyObserver& iObserver; + + // Window server session. + RWsSession iWsSession; + + // Client-side handle to a server-side window group. + RWindowGroup iWindowGroup; + + CWsScreenDevice* iScreenDevice; + + TUint32 iActiveFamily; + + TBool iFeatureManagerLoaded; + + }; + +#endif /* HSPSFAMILYLISTENER_H_ */ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsfilechangelistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsfilechangelistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,197 @@ +/* +* 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: FileChangeListener listens to given file folder and notifies it observer +* if there is any file change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsFileChangeObserver-interface. +* FileChangeListener is asynchronous object that deploys Symbian RFs client-side +* handle on File Manager. FileChangeListener is intended to be used by any object +* that wants listen Symbian file system events. +* +* +*/ + + +#ifndef __ChspsFILECHANGELISTENER_H__ +#define __ChspsFILECHANGELISTENER_H__ + +#include +#include + +#include "hsps_builds_cfg.hrh" +#ifdef _hsps_EMULATOR_SUPPORT_ +#include "hspsfilechangelisteneremu.h" +#endif + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif +class RFs; + +enum TListenerType +{ + TListenerNone, + TImportDirListener, + TRepositoryListener, +}; + +/** +* @ingroup group_hspsserver +* MhspsFileChangeObserver is interface definition to be implemented by change events observers. +*/ +class MhspsFileChangeObserver + { + public: + virtual void HandleFileSystemChange() = 0; + virtual void HandleRepositoryChange() = 0; + }; + + +/** +* +* @ingroup group_hspsserver +* FileChangeListener listens to given file folder and notifies it observer +* if there is any file change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsFileChangeObserver-interface. +* FileChangeListener is asynchronous object that deploys Symbian RFs client-side +* handle on File Manager. FileChangeListener is intended to be used by any object +* that wants listen Symbian file system events +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsFileChangeListener +: public CActive +#ifdef _hsps_EMULATOR_SUPPORT_ +,public MhspsEmuFileChangeObserver +#endif + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsFileChangeListener* NewL( RFs& aFs, + MhspsFileChangeObserver& aObserver, + TNotifyType aNotifyType, + const TDesC& aPath, + TListenerType aListenerType ); + /** + * ~ChspsFileChangeListener + * Destructor. + */ + virtual ~ChspsFileChangeListener(); + + public: + + /** + * Setup + * Sets up the file change listener. + * @since S60 3.1 + * @return void + */ + void Setup(); +#ifdef _hsps_EMULATOR_SUPPORT_ + /** + * Setup + * Sets up the file change listener. + * @since S60 3.1 + * @return void + */ + void HandleEmuFileSystemChange(); +#endif + + /** + * Set log bus to be used. + * @param aLogBus Log bus to be used. + * @return void + */ +#ifdef HSPS_LOG_ACTIVE + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + protected: // Functions from base classes + + /** + * From CActive Called when asynchronous request has completed + * RunL + * @since S60 3.1 + */ + void RunL(); + + /** + * From CActive Called when asynchronous request has failed + * RunError + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + /** + * DoCancel + * From CActive Called when asynchronous request was cancelled + * @since S60 3.1 + */ + void DoCancel(); + + private: + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC& aFullPath ); + + /** + * ChspsFileChangeListener + * C++ default constructor. + */ + ChspsFileChangeListener( RFs& aFs, + MhspsFileChangeObserver& aObserver, + TNotifyType aNotifyType, + TListenerType aListenerType ); + /** + * Informs observer + * InformObserver + * @since S60 3.1 + */ + void InformObserver(); + + private: // Data + + // Ref: Reference to opened File System session + RFs& iFs; + + // Ref: This object is called when RunL occurs + MhspsFileChangeObserver& iObserver; + + // Type of the notify, entry or disk. + TNotifyType iNotifyType; + + // Full path of folder from where notification is needed + TFileName iFullPath; + TListenerType iListenerType; + +#ifdef HSPS_LOG_ACTIVE + // Log bus. Not owned. + ChspsLogBus* iLogBus; +#endif + +#ifdef _hsps_EMULATOR_SUPPORT_ + ChspsFileChangeListenerEmu* iFileChange; +#endif + }; + + +#endif // __ChspsFILECHANGELISTENER_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsfilechangelisteneremu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsfilechangelisteneremu.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2002-2004 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: ChspsFileChangeListenerEmu listens to given file folder and notifies it observer +* if there is any file change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsEmuFileChangeObserver-interface. +* FileChangeListener is intended to be used by any object that wants listen Windows file system events +* like file drag/drop events. +* This listener works only in emulator environment. +* +* +*/ + + +#ifndef __CFILECHANGEEMU_H__ +#define __CFILECHANGEEMU_H__ + +#include "hsps_builds_cfg.hrh" + +#ifdef _hsps_EMULATOR_SUPPORT_ + +#include +#include +#include + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +const TInt KFileSystemPollingTime = 5000000; +const TInt KFilelistGranularity = 10; + +enum TEmuNotifyType + { + /** + Any change + */ + EEmuNotifyAll=0x01, + }; + +enum TStateType + { + EEmuStateIdle, + EEmuStateRunning + }; + + +/** +* MhspsFileChangeObserver is interface definition to be implemented by change events observers. +*/ +class MhspsEmuFileChangeObserver + { + public: + virtual void HandleEmuFileSystemChange() = 0; + }; + +/** +* +* +* @lib hspsThemeServer.exe +* @since S60 3.1 +*/ +class ChspsFileChangeListenerEmu +: public CTimer + { + public: // Constructors and destructor + + /** + * NewL + * Two-phased constructor. + */ + static ChspsFileChangeListenerEmu* NewL( RFs& aFs, + MhspsEmuFileChangeObserver& aObserver, + TEmuNotifyType aNotifyType, + const TDesC& aPath); + /** + * ~ChspsFileChangeListenerEmu + * Destructor. + */ + virtual ~ChspsFileChangeListenerEmu(); + + public: + + /** + * Setup + * Starts file change listener. + * @since S60 3.1 + * @return void + */ + void StartL(); + /** + * Stop + * Stops file change listener. + * @since S60 3.1 + * @return void + */ + void Stop(); + + /** + * Set log bus to be used. + * @param aLogBus Log bus to be used. + * @return void + */ +#ifdef HSPS_LOG_ACTIVE + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + protected: // Functions from base classes + + /** + * From CActive Called when asynchronous request has completed + * RunL + * @since S60 3.1 + */ + void RunL(); + + /** + * From CActive Called when asynchronous request has failed + * RunError + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + /** + * From CActive, DoCancel. + * Cancels any outstanding operation. + */ + void DoCancel(); + + private: + + /** + * ConstructL + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC& aFullPath ); + + /** + * ChspsFileChangeListenerEmu + * C++ default constructor. + */ + ChspsFileChangeListenerEmu( RFs& aFs, + MhspsEmuFileChangeObserver& aObserver, + TEmuNotifyType aNotifyType); + /** + * + * InformObserver + * Informs observer of file change + * @since S60 3.1 + */ + void InformObserver(); + /** + * + * RetrieveFileList + * Retrieves current filelist from filesystem + * @since S60 3.1 + * @param aFileList Destination array for fetched filelist + * @param aPath Source path to read files from + */ + void RetrieveFileListL(CDesCArraySeg& aFileList,const TDesC& aPath); + /** + * + * CompareFiles + * Compares given filelist to filelist in memory + * @since S60 3.1 + * @param aFileList Filelist to use comparing against filelist in memory + */ + TBool CompareFilesL(CDesCArraySeg& aFileList); + /** + * + * StoreFileList + * Stores filelist to memory + * @since S60 3.1 + * @param aFileList filelist to store to memeory + */ + void StoreFileListL(CDesCArraySeg& aFileList); + + + private: // Data + // Reference to opened File System session + RFs& iFs; + + // This object is called when RunL occurs + MhspsEmuFileChangeObserver& iObserver; + + // Type of the notify + TEmuNotifyType iNotifyType; + + // Full path of folder from where notification is needed + TFileName iFullPath; + + // Last updated list of files in filesyste + CDesCArraySeg *iFileList; + + // stores the current state of the listener + TStateType iState; + +#ifdef HSPS_LOG_ACTIVE + // Log bus. Not owned. + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //_hsps_EMULATOR_SUPPORT_ + +#endif // __CFILECHANGEEMU_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,804 @@ +/* +* 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: +* +* Installation Handler. +* +* +* ChspsInstallatioHandler is a server-side implementation of HSPS Configuration +* Management Services. +* The Installation Service is intended to serve the HSPS SAPI client only. +* +* Services: +* 1) reads installation instructions from a manifest-file +* 2) parses and updates xml configuration into a binary representation (ODT's DOM) +* 3) stores various resources, localized and common, into Plug-in Repository +* (a.k.a. Definition Repository) +* +* When installation is successful, Installation Handler utilizes HSPS Definition +* Repository to store the results. All resources are stored on Definition Repository +* and their related information is stored on the list of ChspsResource-objects +* - a resource list. This list of ChspsResource-objects is called Resource List. +* For more information, see hspsResource documentation. +* +* On theme updates, Installation Handler deploys ChspsSecurityEnforcer to control +* update rights. For more information, see ChspsSecurityEnforcer documentation +* and ChspsInstallatioHandler documentation +* +* +*/ + + + +#ifndef __hspsINSTALLATIONHANDLER_H__ +#define __hspsINSTALLATIONHANDLER_H__ + +#include +#include + +#include "hspsthememanagement.h" +#include "hspsresource.h" +#include "hspsresult.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif +class CRepository; +class ChspsThemeServer; +class ChspsDefinitionRepository; +class ChspsDefinitionEngineInterface; +class ChspsODT; +class ChspsDomNode; +class ChspsDomStringPool; +class ChspsSecurityEnforcer; +class ChspsResource; +class ChspsDomList; + +using namespace Xml; + +#if defined(WINSCW) || defined(__WINS__) +const ThspsFamily KDefaultFamily = EhspsFamilyQhd_tch; +#endif + +enum TInstallationMode + { + EAsynchronousObject, + EServiceHandler + }; + +/** +* Class ChspsInstallationHandler. +* ChspsInstallationHandler performs all theme installation related functionality for hspsThemeServer. +* +* Class inheritance: +* ================== +* ChspsInstallationHandler implements MhspsInstallationService from HSPS Theme Management Service +* and MContentHandler for XML-parsing of manifest file. For more information, see the architecture +* description in the beginning of this file. +* +* Functionality: +* ============== +* ChspsInstallationHandler offer high- and low-level API-functionality. High-level and low-level +* calls are diffrentiated by their parametrization. High-level parametrization is directed to the +* be used by applications which need human readable data and offer a user interface. Low-level +* parametrization is directed to the machine-originated requestors like OTA Push or DM (Device +* Management) sub-systems where data is not needed to understand semanticly. +* Processing the installation task can be synchronous or asynchronous. Synchronous mode is +* applied everytime an installation is initiated. Application Theme may include resources. +* Importing these resources to the target device may need conversions. Such resources like some +* audio files etc., can be imported directly, however, most of the image-resources must be fitted +* for the target device because target screen device's color depth and/or pixel density varies. +* In this case, the needed conversions will be executed asynchronously. Asynchronous installation +* is executed in phases - resource by resource. Client application must initiate asynchronous mode +* by calling hspsInstallNextPhaseL() after testing that the synchronous call hspsInstallTheme() +* has returned EhspsInstallPhaseSuccess return code. This means that there are resources to convert +* asynchronoulsly. The rest of the asynchronous installation phases will be executed automatically, +* however, installation can be interrupted by calling hspsCancelInstallTheme() at any time. +* If installation is canceled, installation handler initiates roll-back functionality removing +* inconsistent installation. +* Installation Service uses specific manifest-file format to get informed about the xml, css, dtd, +* and resource files to be installed. Resource files might be locale-specific or generic as well. +* HSPS Definition Repository takes care of saving everything on their appropriate places in the +* target device. Repository, i.e. theme storage, is loacted on hspsThemeServer's private-folder. +* The storage is organized by the information contained in ODT-header. +* Locales are instructed in manifest file also. Manifest file's file-extension must be .dat, but +* actually, the file-name can be whatever, however, when low-level parametrization is used, the +* name must be "manifest.dat" and it must be the last file extracted from the installation package. +* For more information of manifest-file format, see "HSPS Manifest File User Guide.doc". +* +* Installation functions can return one of the following ThspsServiceCompletedMessage-codes: +* - EhspsInstallThemeSuccess, +* - EhspsInstallPhaseSuccess, or +* - EhspsInstallThemeFailed. +* +* Client application must implement MhspsThemeManagementServiceObserver-interface and listen the +* messages mentionaed. Let it be emphasised that both synchronous and asynchronous calls can return +* the codes above. Installation functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. +* +* @ingroup group_hspsserversession +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsInstallationHandler : public CBase, + public MhspsInstallationService, + public MContentHandler + { + public: + + public: + /** + * Two-phased constructor. + */ + static ChspsInstallationHandler* NewL( ChspsThemeServer& aThemeServer ); + static ChspsInstallationHandler* NewLC( ChspsThemeServer& aThemeServer ); + + /** + * Destructor. + */ + ~ChspsInstallationHandler(); + + public: // New functions + + /** + * ServiceInstallThemeL + * Starts the actual installation in ChspsInstallationHandler. + * @since S60 5.0 + * @param aMessage Message from client + */ + void ServiceInstallThemeL( + const RMessage2& aMessage); + + /** + * ServiceInstallNextPhaseL + * Starts subsequent installation phases. + * @since S60 5.0 + * @param aMessage Message from client + */ + void ServiceInstallNextPhaseL( + const RMessage2& aMessage); + + /** + * hspsInstallNextPhase + * @since S60 5.0 + * This is server-side only function. + * @param aHeaderData will return ODT-header of the latest installation phase in serialized + * (i.e. marshalled) + * data mode. This follows the low-level parametrization schema. + * @param aRequestStatus will return the status of the asynchronous request returned by + * installer. + * @return TInthspsServiceCompletedMessage expressing the result of the call. + */ + void hspsInstallNextPhaseL( + TDes8& aHeaderData, + TRequestStatus& aRequestStatus ); + + /** + * CheckAutoInstallationValidityL + * Checks if auto installation of a theme is permitted + * @since S60 5.0 + * This is server-side only function. + * @return TBool ETrue if auto installation can proceed. + */ + TBool CheckAutoInstallationValidityL(); + +#ifdef HSPS_LOG_ACTIVE + /** + * Set log bus. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + /** + * Disables "configuration was installed" notifications + * @since S60 5.0 + */ + void DisableNotifications(); + + public: // Functions from base classes + + /** + * From MhspsInstallationService hspsInstallTheme + * + * @since S60 5.0 + * @param aManifestFileName is the full path to the installation script file - a manifest + * file. + * @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the newly + * installed theme will be returned if the request is successful. The use of + * ChspsODT-type parameter follows the high-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + inline ThspsServiceCompletedMessage hspsInstallTheme( + const TDesC& /*aManifestFileName*/, + ChspsODT& /*aHeader*/ ); + + /** + * From MhspsInstallationService hspsInstallTheme + * + * @since S60 5.0 + * @param aManifestFileName is full path of the installation script file - a manifest file + * @param aHeaderData will return ODT-header of the newly installed theme in serialized + * (i.e. marshalled) + * data mode. This follows the low-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsInstallTheme( + const TDesC& aManifestFileName, + TDes8& aHeaderData ); + + /** + * From MhspsInstallationService hspsInstallNextPhaseL + * + * @since S60 5.0 + * @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the latest + * installation phase completed if the request was successful. The use of ChspsODT-type + * parameter follow the high-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + inline ThspsServiceCompletedMessage hspsInstallNextPhaseL( + ChspsODT& /*aHeader*/ ); + + /** + * From MhspsInstallationService hspsInstallNextPhaseL + * + * @since S60 5.0 + * @param aHeaderData will return ODT-header of the latest installation phase in + * serialized (i.e. marshalled) data mode. This follows the low-level + * parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsInstallNextPhaseL( + TDes8& aHeaderData ); + + /** + * From MhspsInstallationService hspsCancelInstallTheme + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsCancelInstallTheme(); + + //From MContentHandler + + /** + * OnStartDocumentL + * @since S60 5.0 + * This method is a callback to indicate the start of the document. + * @param aDocParam Specifies the various parameters of the document. + * @arg aDocParam.iCharacterSetName The character encoding of the document. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnStartDocumentL( + const RDocumentParameters& aDocParam, + TInt aErrorCode); + + /** + * OnEndDocumentL + * @since S60 5.0 + * This method is a callback to indicate the end of the document. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnEndDocumentL( + TInt aErrorCode); + + /** + * OnStartElementL + * @since S60 5.0 + * This method is a callback to indicate an element has been parsed. + * @param aElement is a handle to the element's details. + * @param aAttributes contains the attributes for the element. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnStartElementL( + const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt aErrorCode); + + /** + * OnEndElementL + * @since S60 5.0 + * This method is a callback to indicate the end of the element has been reached. + * @param aElement is a handle to the element's details. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnEndElementL( + const RTagInfo& aElement, + TInt aErrorCode); + + /** + * OnContentL + * @since S60 5.0 + * This method is a callback that sends the content of the element. + * Not all the content may be returned in one go. The data may be sent in chunks. + * When an OnEndElementL is received this means there is no more content to be sent. + * @param aBytes is the raw content data for the element. + * The client is responsible for converting the data to the + * required character set if necessary. + * In some instances the content may be binary and must not be converted. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + void OnContentL( + const TDesC8& aBytes, + TInt aErrorCode); + + /** + * OnStartPrefixMappingL + * @since S60 5.0 + * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping. + * This method is always called before the corresponding OnStartElementL method. + * @param aPrefix is the Namespace prefix being declared. + * @param aUri is the Namespace URI the prefix is mapped to. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnStartPrefixMappingL( + const RString& aPrefix, + const RString& aUri, + TInt aErrorCode); + + /** + * OnEndPrefixMappingL + * @since S60 5.0 + * This method is a notification of the end of the scope of a prefix-URI mapping. + * This method is called after the corresponding DoEndElementL method. + * @param aPrefix is the Namespace prefix that was mapped. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnEndPrefixMappingL( + const RString& aPrefix, + TInt aErrorCode); + + /** + * OnIgnorableWhiteSpaceL + * @since S60 5.0 + * This method is a notification of ignorable whitespace in element content. + * @param aBytes are the ignored bytes from the document being parsed. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnIgnorableWhiteSpaceL( + const TDesC8& aBytes, + TInt aErrorCode); + + /** + * OnSkippedEntityL + * @since S60 5.0 + * This method is a notification of a skipped entity. If the parser encounters an + * external entity it does not need to expand it - it can return the entity as aName + * for the client to deal with. + * @param aName is the name of the skipped entity. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnSkippedEntityL( + const RString& aName, + TInt aErrorCode); + + /** + * OnProcessingInstructionL + * @since S60 5.0 + * This method is a receive notification of a processing instruction. + * @param aTarget is the processing instruction target. + * @param aData is the processing instruction data. If empty none was supplied. + * @param aErrorCode is the error code. + * If this is not KErrNone then special action may be required. + */ + inline void OnProcessingInstructionL( + const TDesC8& aTarget, + const TDesC8& aData, + TInt aErrorCode); + + /** + * OnError + * @since S60 5.0 + * This method indicates an error has occurred. + * @param aError is the error code + */ + inline void OnError( + TInt aErrorCode); + + /** + * GetExtendedInterface + * @since S60 5.0 + * This method obtains the interface matching the specified uid. + * @return 0 if no interface matching the uid is found. + * Otherwise, the this pointer cast to that interface. + * @param aUid the uid identifying the required interface. + */ + inline TAny* GetExtendedInterface( + const TInt32 aUid); + + protected: // New functions + + /** + * Rolls back the installation if it fails or is cancelled. + * @since S60 5.0 + * @param aOdt The ODT of the theme + */ + void RollBackL( ChspsODT& aOdt ); + + private: + /** + * C++ default constructor. + * @since S60 5.0 + */ + ChspsInstallationHandler( + ChspsThemeServer& aThemeServer ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since S60 5.0 + */ + void ConstructL(); + + /** + * CheckHeaderL + * Checks the header information and stores it to iOdt + * @since S60 5.0 + */ + void CheckHeaderL(); + + /** + * InstallOdtL + * Installs the theme skeleton + * @since S60 5.0 + */ + void InstallSkeletonL( + ThspsServiceCompletedMessage& aReturnMsg ); + + /** + * Adds parsed resource into a temporary resource list, from which the resources + * are applied to an ODT instance at later phase + * @since S60 5.0 + * @param aArray is either iResourceArray or iLocalizedResourceArray instance + * @param aFilename is full path and filename to the resource in an installation folder + * @param aLanguage is language of the resource (use ELangNone if it's a common resource) + * @param aResourceType is MIME type or NULL + * @param aMimetype (Optional) + * @param aTag (Optional) + */ + void AddResourceL( + CArrayPtrSeg& aArray, + const TPtrC aFilename, + const TLanguage aLanguage, + const ThspsResourceType aResourceType, + const TPtrC8 aMimetype, + const TPtrC8 aTag ); + + /** + * CleanupL + * Executes cleaning of the target folder prior to the installation process + * @since S60 5.0 + */ + void CleanupL( + const ChspsODT& aUpdateMask ); + + /** + * ImportPluginsL + * Imports plug-in DOMs referenced by application configuration, other + * configuration types are ignored. + * @since S60 5.0 + */ + void ImportPluginsL( ); + + /** + * ParseDocumentL + * Calls the definition engine to create the dom + * @since S60 5.0 + */ + void ParseDocumentL( + ChspsODT& aOdt ); + + /** + * CompleteRequestL + * Completes the request message + * @since S60 5.0 + */ + void CompleteRequestL(const ThspsServiceCompletedMessage aReturnMessage, + const TDesC8& aHeaderData = KNullDesC8 ); + + /** + * Send update notifications if necessary. + * @since S60 5.0 + */ + void NotifyOdtUpdatedL(); + + /** + * Get active application configurations. + * @since S60 5.0 + * @param aActiveAppConfs Target list for active application configurations. + */ + void GetActiveAppConfsL( CArrayPtrSeg& aActiveAppConfs ); + + /** + * SetODTAsResourceL + * Stores the given ODT as a resources on the resource list + * @since S60 5.0 + */ + void SetODTAsResourceL( + ChspsODT& aOdt ); + + /** + * ActivateThemeL + * Activates the installed theme. + * @since S60 5.0 + */ + void ActivateThemeL(); + + /** + * Parses given DOM document and appends it with a content from possible plugin DOMs. + * @since S60 5.0 + * @param aAppODT is the ODT which should be modified + */ + void AppendPluginConfigurationsL( + ChspsODT& aAppODT ); + + /** + * Resets memeber variables. + * Used by the autoinstaller when installation handler is created only once. + * @since S60 5.0 + */ + void ResetL(); + + /** + * Finds locale specific subdirectories and resources and appends those + * into the resource array + * @since S60 5.0 + * @param aPath is a directory where the locale specific subdirectories exits + */ + void AddLocalesL( + const TDesC& aPath ); + + /** + * Adds localized resources from the provided subdirectory + * @since S60 5.0 + * @param aLanguage is name of the subdirectory + * @param aPath is path to the subdirectory where the locale specific resources can be found + */ + void AddLocalizedResourcesL( + const TDesC& aPath, + const TLanguage aLanguage ); + + /** + * Returns a path if V2 directory structure is in use + * and if an interface uid is known. + * @return path to a Xuikon etc folder or an empty string + */ + TFileName GetInterfacePath(); + + /** + * Add DTD files from the HSPS folder. + */ + void AddHspsLocalesV2L( + const TDesC& aPath ); + + void AddLocalizedResourcesDTDV2L( + const TDesC& aPath, + const TLanguage aLanguage ); + + void AddInterfaceResourcesV2L( + const TDesC& aPath ); + + void AddLocalizedResourcesV2L( + const TDesC& aPath, + const TLanguage aLanguage ); + + /** + * Validates manifest contents and installs files into the Plug-in Repository. + * @since S60 5.0 + */ + void ValidateL(); + + /** + * Validates provided UID value. + * @param aUid Value to be checked + */ + void ApplyUidRangeTestsL( const TUint aUid ); + + /** + * Indicated whether installed plugin was instansiated + * in one or more application configurations. + * @since S60 5.0 + * @return ETrue if the plugin was in use + */ + TBool IsPluginUsedInAppConfsL(); + + /** + * Parser for the filelogo and filepreview elements in manifest files. + * If an icon was provided, it is added to an resource array for copying + * to client's private folder. Allocates heap for the result. + * Supported values: + * - skin( ):mif( ) + * - mif( ) + * - uid() + * - . + * @param aValue8 Value of the element + * @param aTag A tag for the file resource + * @param aResultString Fixed declaration with a valid path reference + */ + void ParseIconDeclarationL( + HBufC8& aValue8, + const TDesC8& aTag, + HBufC*& aResultString ); + + public: + + ChspsResult* iResult; + + private:// Data + + // Stores the current message being processed during asynchronous conversion + RMessagePtr2 iMessagePtr; + + // Result data + TBuf8 iResultData; + + // Maintains the phases in which the installation currently is + ThspsInstallationPhase iInstallationPhase; + + // Maintains the request status in asynchronous object installation mode + TRequestStatus* iRequestStatus; + + // Flag that indicates that the installation service is used as asynchronous object, + TInstallationMode iInstallationMode; + + // Pointer to definition engine + ChspsDefinitionEngineInterface* iDefEngine; + + // Pointer to xml parser + Xml::CParser* iXmlParser; + + // Pointer to ODT of the theme currently being installed + ChspsODT* iOdt; + + // Contains the ODT's header information in marshalled form + HBufC8* iHeaderData; + + // Contains all the resources of an ODT instance when installing has finished + CArrayPtrSeg* iResourceList; + + // Contains names of the resource files under the locale specific subdirectories + CArrayPtrSeg* iTempLocalizedResourceList; + + HBufC8* iMediaType; + + // Tag value from a resource file + HBufC8* iResourceTag; + + // True if parsing localized resources (assumes that elements are always in predefined order) + TBool iLocalized; + + // Holds the default language (applied if there is no DTD for the device language) + TLanguage iDefaultSpecification; + TBool iDefaultSpecificationSet; + + // Path to installation files + TPtrC iThemeFilePath; + + // Application or interface UID of the installed theme + TUint iRootUid; + + // Provider UID of the installed theme + TUint iProviderUid; + + // Theme UID of the installed theme + TUint iThemeUid; + + // Full name of the installed theme + HBufC* iThemeFullName; + + // Short name of the installed theme + HBufC8* iThemeShortName; + + // Version of the installed theme + HBufC8* iThemeVersion; + + // Description of the widget + HBufC8* iThemeDesc; + + // Version of the requested parser + HBufC* iPackageVersion; + + // Family mask for different resolutions and interfaces (vga, vga_tch, qhd_tch, etc) + TUint32 iFamilyMask; + + // Type of the installed application (for example "Hitchcock") + HBufC8* iApplicationType; + + // XML file name of the installed theme + HBufC* iXmlFile; + + // Name of the DTD file (same for each locale) + HBufC* iDtdFile; + + // Stores the content during parsing of the manifest file + HBufC8* iContent; + + // Handle to the file server session + RFs iFsSession; + + // Stores the resource during asynchronous conversion + ChspsResource* iResource; + + // Stores the configuration type + ThspsConfigurationType iConfigurationType; + + // Stores the theme status during installation + TUint32 iThemeStatus; + + // Flag that indicates a missing file during installation -> installation fails + TBool iFileNotFound; + + // Reference to Theme Server + ChspsThemeServer& iThemeServer; + + // Reference to definition repository + ChspsDefinitionRepository& iDefinitionRepository; + + // Reference to security enforcer + ChspsSecurityEnforcer& iSecurityEnforcer; + + // Reference to central repository + CRepository& iCentralRepository; + + // header list cache + CArrayPtrSeg& iHeaderListCache; + + // Set if the package being installed is supported by the server + TBool iPackageVerSupported; + + // Set if "EhspsODTAdded" -notifications should be blocked (e.g. ROM installations) + TBool iDisableNotifications; + + // Set if installation files are located in ROM + TBool iRomInstallation; + + // Set if widget mutliinstance flag + TInt32 iMultiInstance; + + // Set if the multiinstance element is present in the manifest.dat file + TBool iMultiInstanceFound; + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; +#endif + + /** + * Installation type. + */ + enum TInstallationType + { + EInstallationTypeNew = 0, // New installation. + EInstallationTypeUpdate // Update. + }; + + // Installation type for currently active installation. + TInstallationType iInstallationType; + }; + + #include "hspsinstallationhandler.inl" + +#endif //__hspsINSTALLATIONHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: ?Description +* +*/ + + +// ----------------------------------------------------------------------------- +// From MhspsInstallationService +// This method is not supported +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsInstallationHandler::hspsInstallTheme( + const TDesC& /*aManifestFileName*/, + ChspsODT& /*aHeader*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MhspsInstallationService +// This method is not supported +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsInstallationHandler::hspsInstallNextPhaseL( + ChspsODT& /*aHeader*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnStartDocumentL( + const RDocumentParameters& /*aDocParam*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnEndDocumentL( + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnError( + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnProcessingInstructionL( + const TDesC8& /*aTarget*/, + const TDesC8& /*aData*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnStartPrefixMappingL( + const RString& /*aPrefix*/, + const RString& /*aUri*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnEndPrefixMappingL( + const RString& /*aPrefix*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnIgnorableWhiteSpaceL( + const TDesC8& /*aBytes*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnSkippedEntityL( + const RString& /*aName*/, + TInt /*aErrorCode*/) + { + } + +// ----------------------------------------------------------------------------- +// From MContentHandler +// ----------------------------------------------------------------------------- +// +TAny* ChspsInstallationHandler::GetExtendedInterface( + const TInt32 /*aUid*/) + { + return NULL; + } \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsinstaller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstaller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Installs HSPS configurations. +* +* +*/ + + +#ifndef C_CHSPSINSTALLER_H +#define C_CHSPSINSTALLER_H + +#include +#include +#include "hspsthememanagement.h" + +class ChspsThemeServer; +class ChspsInstallationHandler; + +/** + * @ingroup group_hspsserver + * HSPS Installer + * @lib hspsThemeServer.exe + * @since S60 5.0 + */ +class CHSPSInstaller : public CActive + { + public: // Constructors and destructors + /** + * NewL. + * Two-phased constructor. + * Creates a CHSPSInstaller object using two phase construction, + * and return a pointer to the created object. + * @since S60 5.0 + * @param aServer is a reference to HSPS Theme Server + * @return A pointer to the created instance of CHSPSInstaller. + */ + static CHSPSInstaller* NewL( + ChspsThemeServer& aServer ); + + /** + * ~CHSPSInstaller. + * Destructor. + * Destroys the object and release all memory objects. + * @since S60 5.0 + */ + virtual ~CHSPSInstaller(); + + public: // New functions + + /** + * InstallConfigurationL + * Synchronous service for installing configurations from provided manifest files. + * @since S60 5.0 + * @param aFileName is name of the manifest file (full path) to be installed. + * @return ThspsServiceCompletedMessage error code + */ + ThspsServiceCompletedMessage InstallConfigurationL( + const TDesC& aFileName ); + + public: // Functions from base classes + + /** + * RunL. + * From CActive, callback function. + * Invoked to handle responses from the server. + * @since S60 5.0 + */ + void RunL(); + + /** + * DoCancel. + * From CActive, cancels any outstanding operation. + * @since S60 5.0 + */ + void DoCancel(); + + /** + * RunError. + * From CActive Called when asynchronous request has failed + * @since S60 5.0 + */ + TInt RunError( + TInt aError ); + + private: + + /** + * CHSPSInstaller. + * Performs the first phase of two phase construction. + * @since S60 5.0 + * @param aServer is a reference to the HSPS Theme Server + */ + CHSPSInstaller( + ChspsThemeServer& aServer ); + + /** + * ConstructL. + * Performs the second phase construction of a CHSPSInstaller object. + * @since S60 5.0 + */ + void ConstructL(); + + private: // Data + + // Reference to HSPS Theme Server + ChspsThemeServer& iServer; + + // Installation handler + ChspsInstallationHandler* iInstallationHandler; + + // Installation status + ThspsServiceCompletedMessage iRet; + + // Required by the installation process + TBuf8 iHeaderData; + + // Active scheduler nested wait loop + CActiveSchedulerWait* iLoop; + + }; + + +#endif // C_CHSPSINSTALLER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsmaintenancehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,834 @@ +/* +* 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: +* +* ChspsMaintenanceHandler is a server-side implementation of MhspsMaintenanceService API-definition of +* HSPS Theme Management Services. +* Theme Maintenance Service is intended to serve HSPS applications as well as S60 legacy +* applications - especially Personalisation Application - with Theme Maintenance Services. +* Theme maintenance can take place after a set of themes are installed by HSPS Theme +* Installation Service. Maintenance services includes theme listings, theme activation, +* theme removal, and default theme restoring functionality. +* +* Maintenance functions deploy Definition Repository and Symbian Central Repository. +* Definition Repository keeps Application Themes in save place and Central Repository keeps the +* information about which theme is active for what application. Information in Central Repository +* is stored in pairs of application UID and active theme UID. +* ChspsMaintenanceHandler utilizes ChspsODT class to exchange the information of Application Themes. +* DOM-document member of ChspsODT is not attached in theme maintenance operations, only the theme +* header. For more information, see HSPS Theme Management Service APIs documentation. +* +* +*/ + + +#ifndef __hspsMAINTENANCEHANDLER_H__ +#define __hspsMAINTENANCEHANDLER_H__ + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +class MhspsMaintenanceService; +class ChspsDefinitionRepository; +class ChspsSecurityEnforcer; +class ChspsODT; +class CRepository; +class ChspsThemeServer; +class ChspsThemeServerSession; +class ChspsResult; +class ChspsDomNode; + +/** +* Class ChspsMaintenanceHandler. +* ChspsMaintenanceHandler performs all theme maintenance related functionality for hspsThemeServer. +* Maintenance services includes theme listing, theme activation, theme removal and default theme +* restoring operations. +* +* Class inheritance: +* ================== +* ChspsMaintenanceHandler derives CTimer for active timer functionality. It implements +* MhspsMaintenanceService-interface from HSPS Theme Management Service APIs. +* For more information, see HSPS Theme Management Service API documentation. +* +* Functionality: +* ============== +* Maintenance functions are presented in high-level and low-level parametrization mode. +* This is the same approach that was introduced with HSPS Theme Installation Service +* - to support user-intefaces with human-readable high-level elements and on the other hand, +* machine-originated users with low-level data. +* Most of the maintenance functions are synchronous, only one is asynchronous; hspsGetNextHeader(). +* Others functions are straightforward to use but hspsGetListHeaders(). This will be explained next; synchronous +* call hspsGetListHeaders() initiates the theme header listing by passing search mask to HSPS +* Theme Server's Maintenance Service. This search mask is called a query. It also passes a list +* object in where maintenance service should append theme-header objects (type of ChspsODT-class +* without DOM-document) when one is retrieved asychronously. Search mask should be filled with +* proper parameters matching the need in hand. If no parameters are given, all headers of +* Application Themes available in Definition Repository will be delivered, otherwise, +* only sub-set of theme-headers will be delivered. +* After the query-call hspsGetListHeaders(), the delivering of the theme-headers is asynchronous. +* Asynchronous service must be initiated by calling hspsGetNextHeader() after checking that any +* theme matching on current query is found. This action is called a subscription. +* To receive theme listing, the client application must implement +* MhspsThemeManagementServiceObserver-interface and start to listen call-back messages. +* The headers matching on query will be delivered immediately. Query remains until +* hspsCancelGetListHeaders() is called by client. If a new Application Theme exist in repository, +* it will be delivered. As mentioned, when hspsGetListHeaders() returns, the return value must +* be checked. Return value could be one of the following: +* - EhspsGetListHeadersSuccess - there is at least one Application Theme available matching on +* query. Call first hspsGetNextHeader() to get the headers. Same call +* will set the subscribtion of new ones possible coming available +* later on. +* - EhspsGetListHeadersEmpty - there is no themes matching on the query available at the time, +* however, some might be exist later in due to installations. +* Client application should retain the subcription. +* - EhspsGetListHeadersFailed - service request failed in some reason. Possible reasons are for +* e.g. the missing rights to list headers queried. +* +* In the near future, there will be s.c. Additional Return Code Support feature available in +* HSPS. This code will express for e.g. the number of headers to be delivered or possible system +* error code in failed cases. +* +* By MhspsServiceObserver::HandlehspsServiceMessage() call-back function implementation, client +* application must listen the following ThspsServiceCompletedMessage-messages: +* - EhspsGetListHeadersUpdate - header list on the client side has a new object appended at the end +* of the list, +* - EhspsGetListHeadersRestart - header list on server side has changed so much that the client must +* empty the list printed on screen. New list will be delivered +* immediately. The subscription stands. +* - EhspsGetListHeadersEmpty - header list on server side is now empty. The client must empty +* the list on screen if printed. The subscription stands. +* - EhspsGetListHeadersFailed - operation has failed. Client should cancel request and restart, +* perhaps. +* +* Maintenanace functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. +* +* @ingroup group_hspsserversession +* @lib hspsThemeServer.exe +* @since S60 3.1 +*/ +class ChspsMaintenanceHandler : public CTimer, public MhspsMaintenanceService, + public MhspsDefinitionRepositoryObserver + { + public: // Constructors and destructor + /** + * NewL. + * Two-phased constructor. + * @since S60 5.0 + * @param aThemeServer Server instance + * @param aSecureId Identifies the client application which uses the handler + */ + static ChspsMaintenanceHandler* NewL( + ChspsThemeServer& aThemeServer, + const TUint aSecureId = 0 ); + + /** + * NewLC. + * Two-phased constructor. + * @since S60 5.0 + * @param aThemeServer Server instance + * @param aSecureId Identifies the client application which uses the handler + */ + static ChspsMaintenanceHandler* NewLC( + ChspsThemeServer& aThemeServer, + const TUint aSecureId = 0 ); + + /** + * Destructor. + */ + virtual ~ChspsMaintenanceHandler(); + + public: // New functions + + /** + * ServiceGetListHeadersL + * @since S60 3.1 + * @param aMessage contains the data received from the client + */ + void ServiceGetListHeadersL(const RMessage2& aMessage); + + /** + * ServiceGetNextHeaderL + * @since S60 3.1 + * @param aMessage contains the data received from the client + */ + void ServiceGetNextHeaderL(const RMessage2& aMessage); + + /** + * ServiceSetActiveThemeL + * @since S60 3.1 + * @param aMessage contains the data received from the client + */ + void ServiceSetActiveThemeL(const RMessage2& aMessage); + + /** + * ServiceRestoreDefaultL + * @since S60 3.1 + * @param aMessage contains the data received from the client + */ + void ServiceRestoreDefaultL(const RMessage2& aMessage); + + /** + * ServiceRemoveThemeL + * @since S60 3.1 + * @param aMessage contains the data received from the client + */ + void ServiceRemoveThemeL(const RMessage2& aMessage); + + /** + * ServiceAddPluginL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceAddPluginL(const RMessage2& aMessage); + + /** + * ServiceRemovePluginL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceRemovePluginL( const RMessage2& aMessage ); + + /** + * ServiceSetActivePluginL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceSetActivePluginL( const RMessage2& aMessage ); + + /** + * ServiceReplacePluginL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceReplacePluginL( const RMessage2& aMessage ); + + /** + * ServiceSetPluginSettingsL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceSetPluginSettingsL( const RMessage2& aMessage ); + + /* + * ServiceGetPluginOdtL + * @since S60 5.0 + * @param aMessage contains + */ + void ServiceGetPluginOdtL( const RMessage2& aMessage ); + + /** + * ServiceMovePluginsL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceMovePluginsL( const RMessage2& aMessage ); + + /** + * ServiceSetConfStateL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceSetConfStateL( const RMessage2& aMessage ); + + /** + * ServiceRestoreActiveAppConfL + * @since S60 5.0 + * @param aMessage contains the data received from the client + */ + void ServiceRestoreActiveAppConfL( const RMessage2& aMessage ); + +#ifdef HSPS_LOG_ACTIVE + /** + * Set log bus. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + /** + * SetServerSession. + * @since S60 5.0 + * @param @param aServerSession Pointer to owning server session + */ + void SetServerSession( ChspsThemeServerSession* aServerSession ); + + public: // Functions from base classes + + /** + * From MhspsMaintenanceService hspsGetListHeaders + * @since S60 3.1 + * @param aSearchMask is ChspsODT-object which attributes are filled to present search + * parameters for theme set queried by client. This parametrisation follows + * the high-level schema. + * @param aHeaderList is an list object able to carry ChspsODT-objects. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsGetListHeaders(const TDesC8& aSearchMaskData, + CArrayPtrSeg& aHeaderDataList); + + /** + * From MhspsMaintenanceService hspsGetNextHeader + * @since S60 3.1 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsGetNextHeader(); + + /** + * From MhspsMaintenanceService hspsCancelGetListHeaders + * @since S60 3.1 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsCancelGetListHeaders(); + + /** + * From MhspsMaintenanceService hspsSetActiveTheme + * @since S60 3.1 + * @param aSetMask represents parameters by which the new theme activation will be done. + There must be sufficient set of parameters presented, at least a theme UID. + * @param aOdt is an empty ODT-object which will contain the ODT of activated + * theme on the return of the call. This parametrisation follows the high-level + * schema. There must be sufficient set of parameters presented, at least a theme UID. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsSetActiveTheme( const ChspsODT& aSetMask, ChspsODT& aOdt ); + + /** + * From MhspsMaintenanceService hspsRestoreDefault + * @since S60 3.1 + * @param aSetMask is an ODT-header parametrized enough to express the theme to be made + * active. + * @param aHeader is an empty ODT-header object that will contain the header of the theme + * actually made active if the request was successful. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsRestoreDefault( const ChspsODT& aSetMask, ChspsODT& aHeader ); + + /** + * From MhspsMaintenanceService hspsRemoveThemeL + * @since S60 3.1 + * @param aSetMask is an ODT-header parametrized enough to express the theme to be removed. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsRemoveThemeL( const ChspsODT& aSetMask ); + + /** + * From MhspsMaintenanceService hspsGetListHeaders + * @since S60 3.1 + * @param aSearchMaskData is serialized ChspsODT-object. Before serializing, attributes + * in ChspsODT-object were filled to present a search parameters for theme set queried. + * Serialized data parametrisation follows the low-level schema. + * @param aHeaderList is an list object able to carry serialized ChspsODT-objects. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& /*aSearchMask*/ + , CArrayPtrFlat& /*aHeaderList*/); + + /** + * From MhspsMaintenanceService hspsSetActiveTheme + * @since S60 3.1 + * @param aSetMaskData is externalized version of ChspsODT-object presenting parameters by + * which the new theme activation will be done. There must be sufficient set of + * parameters presented, at least a theme UID. This parametrisation follows the + * low-level schema. + * @param aHeaderData is an empty description for externalized ODT-object data. + * When internalized, this object will contain the header of newly activated theme + * as a result of the call. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsSetActiveTheme(const TDesC8& /*aSetMaskData*/ + , TDes8& /*aHeaderData*/); + + /** + * From MhspsMaintenanceService hspsAddPlugin + * Not used - see ServiceAddPluginL instead which has a diffrent input + * @since S60 5.0 + */ + ThspsServiceCompletedMessage hspsAddPlugin( + const TInt /*aAppUid*/, + const TInt /*aParentPluginId*/, + const TInt /*aPluginUid*/, + const TInt /*aPosition*/, + TInt& /*aAddedPluginId*/ ); + + /** + * From MhspsMaintenanceService hspsRemovePlugin + * Not used - see ServiceRemovePluginL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsRemovePlugin( + const TInt /*aAppUid*/, + const TInt /*aPluginId*/ ); + + /** + * From MhspsMaintenanceService hspsSetActivePlugin + * Not used - see ServiceRemovePluginL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsSetActivePlugin( + const TInt aAppUid, + const TInt aPluginId + ); + + /** + * From MhspsMaintenanceService hspsReplacePlugin + * Not used - see ServiceReplacePluginL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsReplacePlugin( + const TInt /*aAppUid*/, + const TInt /*aPluginId*/, + const TInt /*aConfUid*/ ); + + /** + * From MhspsMaintenanceService hspsSetSettings + * Not used - see ServiceRemovePluginL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsSetPluginSettings( + const ChspsODT& /*aHeader*/, + const TInt /*aPluginId*/, + ChspsDomDocument& /*aDom*/, + const TBool /*aPluginStoringStatus*/); + + /** + * From MhspsMaintenanceService hspsMovePluginsL + * Not used - see ServiceMovePluginsL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsMovePluginsL( + const TInt /*aAppUid*/, + const TInt /*aConfId*/, + const CArrayFixFlat& /*aPluginIdList*/ ); + + TInt UpdatePluginListL( + ChspsODT& aAppODT, + const TInt aConfigurationId, + const CArrayFixFlat& aPluginIdList ); + + /** + * From MhspsMaintenanceService hspsSetConfState + * Not used - see ServiceSetConfStateL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsSetConfState( + const TInt /*aAppUid*/, + const TInt /*aConfId*/, + const ThspsConfigurationState /*aState*/, + const ThspsConfStateChangeFilter /*aFilter*/ ); + + /** + * From MhspsMaintenanceService hspsRestoreActiveAppConf + * Not used - see ServiceRestoreActiveAppConfL instead which has a diffrent input + */ + ThspsServiceCompletedMessage hspsRestoreActiveAppConf( + const TInt /*aAppUid*/, + const TInt /*aConfUid*/ ); + + /** + * Updates plugin configuration in all application configuration + * + * @since S60 5.0 + * @param apluginUid identifies the plugin configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + ThspsServiceCompletedMessage hspsPluginUpdateL( + const ChspsODT& aOdt ); + + + + public: // from MhspsDefinitioRepositoryObserver + + TBool HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ); + + protected: // Functions from base classes + + + ChspsMaintenanceHandler( ChspsThemeServer& aThemeServer, const TUint aSecureId ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * From CActive, RunL. + * Callback function. + * Invoked to handle responses from the server. + */ + void RunL(); + + /** + * From CActive, DoCancel. + * Cancels any outstanding operation. + */ + void DoCancel(); + + /** + * From CActive Called when asynchronous request has failed + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + + private: + /** + * C++ default constructor. + */ + void GetHeaderListL( CArrayPtrSeg& aHeaderDataList, const ChspsODT& aSearchMask ); + ThspsServiceCompletedMessage GetHeaderListUpdateL(); + void RestoredDefaultL( const ChspsODT& aSetMask, ChspsODT& aHeader ); + void RemoveThemeL( const ChspsODT& aSetMask ); + TBool CompareHeadersL(const TDesC8& aOldHeaderData, const TDesC8& aNewHeaderData); + TBool ComparePaths(const ChspsODT& aOldHeader, const ChspsODT& aNewHeader); + TBool FilterHeader(const ChspsODT& aMask, const ChspsODT& aHeader); + // Completes the request message + void CompleteRequest(const ThspsServiceCompletedMessage aReturnMessage, + RMessagePtr2& aMessagePtr, const TDesC8& aHeaderData = KNullDesC8 ); + + /** + * Finds last id value from the provided DOM. + * @since S60 5.0 + * @param aDom is the application configuration in XML format + * @param aLastUsedConfId is the largest used configurtion id + * @param aLastUsedPluginId is the largest used plugin id + */ + void GetUsedIdsL( + ChspsDomDocument& aDom, + TInt& aLastUsedConfId, + TInt& aLastUsedPluginId + ); + + /** + * Appends an application configuration with an instance of a plugin configuration. + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginODT is an ODT instance of the plugin configuration + * @param aConfigurationId is an id of the configuration being modified, identifies a plugins list + * @param aNewPosition is an index of the new position in the plugins list + * @param aLastConfId is a value of the last configuration id + * @param aLastPluginId is a value of the last plugin id + * @return KErrNone if the operation succeeded + */ + TInt AppendConfigurationL( + ChspsODT& aAppODT, + const ChspsODT& aPluginODT, + const TInt aConfigurationId, + const TInt aNewPosition, + TInt& aLastConfId, + TInt& aLastPluginId + ); + + /** + * Finds the plugins node of the provided plugin node. + * @since S60 5.0 + * @param aNode is the plugins node to be searched + * @return plugins node or NULL if the node couldn't be found + */ + ChspsDomNode* FindPluginsNode( + ChspsDomNode& aNode + ); + + /** + * Appends a plugins list with a new plugin configuration instance. + * @since S60 5.0 + * @param aAppODT is the application configuration being modified + * @param aPluginsNode is the plugins node where the new plugin instance should be added to + * @param aPluginODT is an ODT instance of the plugin configuration to be added + * @param aNewPosition is an index of the new position in the plugins list + * @param aNewPluginId is an id of the new plugin instance + * @return KErrNone if the operation succeeded + */ + TInt AppendPluginConfigurationL( + ChspsODT& aAppODT, + ChspsDomNode& aPluginsNode, + const ChspsODT& aPluginODT, + const TInt aNewPosition, + const TInt aNewPluginId + ); + + + /** + * Finds plugin nodes from the plugin configuration being added, + * appends referred configurations into the main plugin configuration, + * and updates the plugin nodes with unique id attribute values. + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginODT is an instance of the plugin configuration being added + * @param aLastConfId is a value of the last configuration id + * @param aLastPluginId is a value of the last plugin id + * @return KErrNone + */ + TInt HandlePluginReferencesL( + ChspsODT& aAppODT, + ChspsODT& aPluginODT, + TInt& aLastConfId, + TInt& aLastPluginId + ); + + /** + * Removes an plugin instance from the provided application configuration + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginId is an ID of the plugin instance to be removed + * @return KErrNone if succeeded + */ + TInt RemoveConfigurationL( + ChspsODT& aAppODT, + const TInt aPluginId ); + + /** + * Finds a plugin node with the provided id which is also a children of + * the provided plugins node + * @since S60 5.0 + * @param aPluginsNode is an instance of the plugins node + * @param aPluginId is an ID of the plugin instance to be found within the plugins node + * @return Pointer to the plugin node or NULL + */ + ChspsDomNode* FindChildPluginNode( + ChspsDomNode& aPluginsNode, + const TInt aPluginId ); + + /** + * Returns a count of plugin instances. + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginUid is an UID of the plugin instances to be found + * @param aInstanceCount is the return value + */ + void GetPluginInstanceCountL( + const ChspsODT& aAppODT, + const TInt aPluginUid, + TInt& aInstanceCount ); + + /** + * Removes plugin resources from the provided ODT + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginUid is an UID of the plugin instance + * @return KErrNone if succeeded + */ + TInt RemovePluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ); + + /** + * Adds plugin resouces to the provided ODT + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginUid is an UID of the plugin instance + */ + void AddPluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ); + + /** + * Sets Plugin settings + * @since S60 5.0 + * @param aOdt is an instance of the the application configuration + * @param aPluginId is an ID of the plugin instance to be found + * @param aDom is a Dom Document of the settings that is going to set/update + * @return KErrNone if succeeded + */ + TInt hspsSetPluginSettingsL( + ChspsODT& aOdt, + + TInt aPluginId, + ChspsDomDocument& aDom); + + /** + * Saves Plugin settings + * @since S60 5.0 + * @param aODT is an instance of the the plugin configuration + * @param aDom is a Dom Document of the settings that is going to saved + * @return KErrNone if succeeded + */ + TInt hspsSavePluginSettingsL( + ChspsODT& aOdt, + ChspsDomDocument& aDom ); + /** + * Finds a item node with the provided item id + * @since S60 5.0 + * @param aNodeIdentifier An Tag. + * @param aDomNode A Dom node where the target node is searched from. + * @return Result node. + */ + ChspsDomNode& FindNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ); + + /** + * Gets configuration node with the provided plugin id + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginId is an ID of the plugin instance to be found + * @param aPluginUid is an UID of the plugin instance + * @param aPluginname is a name of the plugin instance + * @return Error code + */ + TInt GetConfigurationNodeDataL( + ChspsODT& aAppODT, + const TInt aPluginId, + TInt& aPluginUid, + TDes& aPluginName ); + + /** + * Set configuration node state attribute value + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aConfId is an ID of the configuration node to be found + * @param aState is a new value of the configuration node state attribute + * @return void + */ + void SetConfStateL( + ChspsODT& aAppODT, + TInt aConfId, + ThspsConfigurationState aState, + ThspsConfStateChangeFilter aFilter ); + + /** + * Restores default configuration defined for the application + * @since S60 5.0 + * @param aHeader ODT header which defines the restored configuration + * @param aOdt restored application configuration + */ + void RestoreDefaultAppConfL( + ChspsODT*& aHeader, + ChspsODT& aOdt ); + + /** + * HandleDefinitionRespositoryEventL + * + * @since S60 5.0 + */ + + TBool HandleDefinitionRespositoryEventL( ThspsRepositoryInfo aRepositoryInfo ); + + /** + * RemovePluginFromAppConfs + * + * @since S60 5.0 + */ + void RemovePluginFromAppConfsL( + const ChspsODT& aOdt, + RArray& aNotificationParams); + + /** + * InvalidateUninstalledPluginInstancesL + * Removes uninstalled plugin instances from an inactive + * application configuration by changing them to error state. + * @since S60 5.2 + * @param aAppODT application configuration to be updated + * @param aPluginUid plugin to be uninstalled + * @param aPluginIds an array on plugin ids to be processed + * @return ETrue if the ODT was updated. + */ + TBool InvalidateUninstalledPluginInstancesL( + ChspsODT& aAppODT, + const TInt aPluginUid, + const RArray& aPluginIds ); + + /** + * UpdatePluginFromAppConfsL + * + * @since S60 5.0 + */ + void UpdatePluginFromAppConfsL( ChspsODT& aOdt, + RArray& aNotificationParams ); + /** + * UpdatePluginConfigurationL + * + * @since S60 5.0 + */ + + TInt UpdatePluginConfigurationL( + ChspsODT& aOdt, + ChspsODT& aPluginOdt, + RArray& aPluginIds ); + + /** + * Replaces plugin configuration in the provided + * application configuration + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginId is an id of the plugin to be replaced + * @param aPluginODT is an instance of the plugin configuration to be added + */ + TInt ReplaceConfigurationL( + ChspsODT& aAppODT, + const TInt aPluginId, + const ChspsODT& aPluginODT ); + + /** + * Returns position of a plugin in the plugins list + * @since S60 5.0 + * @param aPluginNode is a plugin to be found + * @return position of -1 + */ + TInt FindPluginPosition( + ChspsDomNode& aPluginNode ); + + /** + * Copies logo icons to Homescreen's private folder + * @since S60 5.1 + * @param aAppUid Identifies the client process + */ + void CopyIconsToHomescreenL( + const TUint aAppUid ); + + /** + * Appends missing plugin with a dummy configuration where status="Error" + * @since S60 5.0 + * @param aAppDom is a DOM of an application configuration + * @param aMissingPluginNode is a plug-in node which was not found from the Plugin Repository + * @param aPluginUid is an UID of the missing plugin + */ + void AddErrorConfigurationL( + ChspsDomDocument& aAppDom, + ChspsDomNode& aMissingPluginNode, + const TInt aPluginUid ); + + private: // Data + RMessagePtr2 iMessagePtr; + ChspsResult* iResult; + TBuf8 iResultData; + ThspsServiceRequestMessage iRequestMessage; + ThspsServiceCompletedMessage iCompletedMessage; + CArrayPtrSeg* iHeaderDataList; + TBool iSubscription; + TInt iDeliveryCount; + ChspsODT* iSearchMask; + ChspsODT* iSetMask; + TLanguage iLanguage; + + ChspsThemeServer& iThemeServer; + // Identifies the client application + TUint iSecureId; + // Reference to central repository + CRepository& iCentralRepository; + // Reference to definition repository + ChspsDefinitionRepository& iDefinitionRepository; + // Reference to security enforcer + ChspsSecurityEnforcer& iSecurityEnforcer; + CArrayPtrSeg& iHeaderListCache; + ChspsThemeServerSession* iServerSession; // Not owned. + CFileMan* iFileMan; +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //__hspsMAINTENANCEHANDLER_H__ +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsmanifest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsmanifest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,87 @@ +/* +* 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: Defines the XML elements and values of a manifest file. +* +*/ + + +#ifndef HSPSMANIFEST_H_ +#define HSPSMANIFEST_H_ + +// XML elements from the manifest.dat file +_LIT8(KPackage, "package"); + +// Attributes for KPackage +_LIT8(KPackageVersion, "version"); + +_LIT8(KFamily, "family"); +_LIT8(KConfigurationType, "type"); +_LIT8(KInterfaceUid, "interfaceuid"); +_LIT8(KProviderUid, "provideruid"); +_LIT8(KThemeUid, "configurationuid"); +_LIT8(KThemeStatus, "status"); +_LIT8(KThemeFullName, "fullname"); +_LIT8(KThemeShortName, "shortname"); +_LIT8(KThemeVersion, "version"); +_LIT8(KThemeDesc, "description"); +_LIT8(KFileLogo, "filelogo"); +_LIT8(KFilePreview, "filepreview"); +_LIT8(KFileXML, "filexml"); +_LIT8(KFileDTD, "filedtd"); +_LIT8(KLocalized, "localization"); +_LIT8(KFileResource, "fileresource"); +_LIT8(KMultiInstance, "multiinstance"); + +// Options for KFamily +_LIT8(KFamilyQvga, "qvga"); +_LIT8(KFamilyQvga2, "qvga2"); +_LIT8(KFamilyVga, "vga"); +_LIT8(KFamilyVga3, "vga3"); +_LIT8(KFamilyQhd, "qhd"); +_LIT8(KFamilyQhd_tch, "qhd_tch"); +_LIT8(KFamilyVga_tch, "vga_tch"); + +// Options for KConfigurationType +_LIT8(KManifestTypeApp, "application"); +_LIT8(KManifestTypeView, "view"); +_LIT8(KManifestTypeWidget, "widget"); +_LIT8(KManifestTypeTemplate, "template"); + +// Options for KThemeStatus +_LIT8(KStatusNone, "statusnone"); +_LIT8(KStatusLicenceeDefault, "statuslicenceedefault"); +_LIT8(KStatusLicenceeRestorable, "statuslicenceerestorable"); +_LIT8(KStatusOperatorDefault, "statusoperatordefault"); +_LIT8(KStatusUserDefault, "statususerdefault"); +_LIT8(KStatusMakeActive, "statusmakeactive"); +_LIT8(KStatusLocked, "statuslocked"); + +// Additional values for KMulitiInstance +_LIT8( KMultiInstanceUnlimited, "unlimited" ); +_LIT8( KMultiInstanceHidden, "hidden" ); +const TInt32 KMultiInstanceUnlimitedValue = -1; +const TInt32 KMultiInstanceHiddenValue = 0; +const TInt32 KMultiInstanceDefaultValue = 1; +const TInt32 KMultiInstanceMinimumCountValue = 0; +const TInt32 KMultiInstanceMaximumCountValue = 32767; + + + +// Attributes for KFileResource +_LIT8(KMediaType, "mediatype"); +_LIT8(KTag, "tag"); + +#endif /*HSPSMANIFEST_H_*/ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsrominstaller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,221 @@ +/* +* 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: Auto-installs configurations from ROM drive to the C drive. +* +* +*/ + + +#ifndef __hspsROMINSTALLER_H__ +#define __hspsROMINSTALLER_H__ + +#include +#include + +#include "hspsthememanagement.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif +class ChspsThemeServer; +class ChspsInstallationHandler; + + +/** + * @ingroup group_hspsserver + * ROM installer + * @lib hspsThemeServer.exe + * @since S60 5.0 + */ +class ChspsRomInstaller : public CActive + { + public: // Constructors and destructors + /** + * NewL. + * Two-phased constructor. + * Creates a ChspsRomInstaller object using two phase construction, + * and return a pointer to the created object. + * @since S60 5.0 + * @param aThemeServer is a reference to theme server instance + * @param aFsSession is a reference to file server instance + * @return A pointer to the created instance of ChspsRomInstaller. + */ + static ChspsRomInstaller* NewL( + ChspsThemeServer& aThemeServer, + RFs& aFsSession ); + + /** + * NewLC. + * Two-phased constructor. + * Creates a ChspsClinet object using two phase construction, + * and return a pointer to the created object. + * @since S60 5.0 + * @param aObserver The object to be used to handle updates from the server. + * @return a pointer to the created instance of ChspsRomInstaller. + */ + static ChspsRomInstaller* NewLC( + ChspsThemeServer& aThemeServer, + RFs& aFsSession ); + + /** + * ~ChspsRomInstaller. + * Destructor. + * Destroys the object and release all memory objects. + * @since S60 5.0 + */ + virtual ~ChspsRomInstaller(); + + public: // New functions + + /** + * Finds plugin_*.dat and app_*.dat files from Z\private\200159C0\install + * File names are stored into iImportsArrayV1 member array + * @since S60 5.0 + */ + void FindImportsV1L(); + + /** + * Imports. + * Returns a reference to the imports list, which is maintained by the class. + * Contents of the list is set in FindImportsL() function. + * @since S60 5.0 + * @return an array of *.DAT files which were found from the ROM drive. + */ + const RPointerArray& ImportsV1(); + + /** + * InstallTheme + * Synchronous service for installing configurations from provided manifest files. + * @since S60 5.0 + * @param aFileName is name of the manifest file to be installed. + * @return ThspsServiceCompletedMessage error code + */ + ThspsServiceCompletedMessage InstallThemeL( + const TDesC& aFileName ); + + /** + * ReinstallThemeL. + * Synchronous service for re-installing corrupted application configurations + * from an import (imports\app_*.dat file). + * @since S60 5.0 + * @param aAppUid is UID of an application + * @param aConfigurationUid is UID of a HSPS configuration + * @return ThspsServiceCompletedMessage error code + */ + ThspsServiceCompletedMessage ReinstallThemeL( + const TInt aAppUid, + const TInt aConfigurationUid ); + + /** + * Gets names of the folders which should be installed from Z\private\200159C0\install + * @since S60 5.0 + */ + void GetInstallationFoldersL( + RPointerArray& aFolders ); + +#ifdef HSPS_LOG_ACTIVE + /** + * Set log bus. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + protected: // Functions from base classes + + /** + * RunL. + * From CActive, callback function. + * Invoked to handle responses from the server. + * @since S60 5.0 + */ + void RunL(); + + /** + * DoCancel. + * From CActive, cancels any outstanding operation. + * @since S60 5.0 + */ + void DoCancel(); + + /** + * RunError. + * From CActive Called when asynchronous request has failed + * @since S60 5.0 + */ + TInt RunError( + TInt aError ); + + protected: + + /** + * ChspsRomInstaller. + * Performs the first phase of two phase construction. + * @since S60 5.0 + * @param aObserver The object to be used to handle updates from the server. + * @param aFsSession is a reference to file server instance + */ + ChspsRomInstaller( + ChspsThemeServer& aThemeServer, + RFs& aFsSession ); + + /** + * ConstructL. + * Performs the second phase construction of a ChspsRomInstaller object. + * @since S60 5.0 + */ + void ConstructL(); + + /** + * SetImportsFilterL. + * Finds specific imports ("plugin_*.dat"/"app_*.dat" files) from ROM drive's + * import folder. Search results are appended into iImportsArray member. + * @since S60 5.0 + * @param aFileFilter is a filter for finding the imports + * @param + * @return ETrue if files were found and added into the array + */ + TBool SetImportsFilterL( + const TDesC& aFileFilter ); + + private: // Data + + ChspsThemeServer& iThemeServer; + + // Required by the file copying process + RFs& iFsSession; + + // Installation handler + ChspsInstallationHandler* iInstallationHandler; + + // Required by the installation process + TBuf8 iHeaderData; + + // An array of found *.DAT files + RPointerArray iImportsArrayV1; + + // Results of the previous installation + ThspsServiceCompletedMessage iRet; + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. Not owned. + */ + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //__hspsROMINSTALLER_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspssecurityenforcer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspssecurityenforcer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef hspsSECURITYENFORCER_H +#define hspsSECURITYENFORCER_H + +#include + +#include "hsps_builds_cfg.hrh" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +class ChspsODT; +class ChspsDefinitionRepository; +class CRepository; + +/** +* ChspsSecurityEnforcer performs all security related functions in HSPS. +* These functions are the following: +* - control user access on service request, and +* - adjust user access in queries. +* +* Function are explained below: +* +* CheckAccessRightsL() +* -------------------- +* CheckAccessRightsL() function is called by CPolicyServer when hspsThemeServer +* receives user request. +* Access rights are hard-coded here for S60 5.0, however, in later versions +* support for dynamic configuration of access rights must atken care. +* This would be appropriate to solve together TARM-policy implementation. +* +* CheckQueryValidityL() +* ------------------- +* CheckQueryValidityL() function is called by hsps Theme Server's service handlers +* (ChspsInstallionHandler, ChspsMaintenanceHandler, and ChspsClientRequestHandler) for adjusting +* user request to match the access rights level that user actually have. +* This function is to be called immediately when actual ODT is known. +* In the istallation cases, ODT is known after manifest-file parsing. +* In the maintenanace cases, ODT is known immediately on query. +* In the theme usage cases, ODT is known when it application theme has retrieved from +* UI Definition Repository. +* For instance, if user is requesting the theme listing (message hspsGetListHeaders) with +* application UID set to 0 in query meaning that the query concerns all themes in storage. +* However, if user is not S60 Personalisation Application, the query must be restricted to +* the themes which belongs to the this particular client only. +* This solution follows the recilient server approach; when function is called, the user +* access rights are already checked by CheckUserAccessRightsL() function. In this sense, +* offering recilient service by adjusting user access insteads of denying it is reasonable +* resolution. +* @ingroup group_hspsserver +* @lib hspsThemeServer.exe +* @since S60 5.0 +*/ +class ChspsSecurityEnforcer: public CBase, public MhspsSecurityService + { + public: // Destructor + + static ChspsSecurityEnforcer* NewL( ChspsDefinitionRepository& aDefRep, CRepository& aCenRep ); + + /** + * Destructor. + */ + virtual ~ChspsSecurityEnforcer(); + + public: // Functions from base classes + + /** + * From MhspsSecurityService + * Checks if Licensee Default theme exists. This method is used if a theme that + * is either User or Operator Default is installed. + * @since S60 5.0 + * @param aODT ODT of the installed theme + * @return void + */ + void CheckIfLicenseeDefaultExistsL( const ChspsODT& aOdt ); + + /** + * From MhspsSecurityService CheckAccessRightsL + * @since S60 5.0 + * @param aMessage is the RMessage2 containing the client request data. + * Client's access rights in requesting a service of hsps Theme Server + * is to be checked. + * @return ETrue if request has passed the access rights check, otherwise returns EFalse. + */ + TBool CheckAccessRightsL( const RMessage2& aMessage ); + + TBool CheckThemeLockingL( const ChspsODT& aOdt ); + +#ifdef HSPS_LOG_ACTIVE + /** + * Set log bus. + */ + void SetLogBus( ChspsLogBus* aLogBus ); +#endif + + private: + /** + * ChspsSecurityEnforcer + * C++ default constructor + * @since S60 5.0 + */ + ChspsSecurityEnforcer( ChspsDefinitionRepository& aDefRep, CRepository& aCenRep ); + + /** + * ConstructL. + * By default Symbian 2nd phase constructor is private. + * @since S60 5.0 + */ + void ConstructL(); + + /** + * HandleAccessControlListL + * Parse UIDs from descriptor buffer aStrBuf to array of intergers. + */ + void HandleAccessControlListL(const TDesC8& aStrBuf, RArray& aArray); + + /** + * CheckAccessControlListL + * Checks whether aUid found in access control list. + * returns ETrue if uid is found + */ + TBool CheckAccessControlListL( TInt aUid ); + + private: + // Reference to definition repository + ChspsDefinitionRepository& iDefRep; + + // Reference to central repository + CRepository& iCentralRepository; + + // Access control list + RArray iAccessControlList; +#ifdef HSPS_LOG_ACTIVE + // Log bus. Not owned. + ChspsLogBus* iLogBus; +#endif + }; + +#endif // hspsSECURITYENFORCER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,552 @@ +/* +* 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: +* +* Utility for common code. +* +* +*/ + + +#ifndef __hspsSERVERUTIL_H__ +#define __hspsSERVERUTIL_H__ + +// Includes +#include +#include + +// Forward declarations. +class ChspsODT; +class ChspsDomNode; +class ChspsResource; + +// Constants. +#define RECURSION_DEPTH_INFINITE (-1) + +/** +* Class hspsAttribUtil. +* +* Static utility for maintainance and installation handlers. +* @ingroup group_hspsserver +* @lib hspsThemeServer.exe +*/ +class hspsServerUtil + { + public: // New methods. + /** + * Generates attributes for the Configuration element from manifest data + * @since S60 5.0 + * @param aOdt is an ODT instance to be updated + */ + static void GenerateConfigurationAttributesL( ChspsODT& aOdt ); + + /** + * Generates attributes for the Object element from manifest data + * @since S60 5.0 + * @param aOdt is an ODT instance to be updated + */ + static void GenerateObjectAttributesL( ChspsODT& aOdt ); + + /** + * Retrieves locale independent path which used by HSPS clients to access resources + * in their private application folders. + * @since S60 5.0 + * @param aResourceLanguage is the language of the resource + * @param aPath is the path to be unlocalized + */ + static void GetLocaleIndependentResourcePath( + const TLanguage& aResourceLanguage, + TFileName& aPath ); + + /** + * Retrieves relative path of a resource under the themes folder. + * @since S60 5.0 + * @param aSourceFile is the input file + * @param aRelativePath is the relative path + */ + static void GetRelativeResourcePath( + const TFileName& aSourceFile, + TPath& aRelativePath ); + + /** + * Creates a new attribute for the provided plugin node. + * @since S60 5.0 + * @param aPluginsNode is the plugins node that should be modified + * @param aAttrName is name of the attribute + * @param aValue is value of the attribute + * @param aFormat is requested value string format + * @return KErrNone + */ + static TInt AddAttributeNumericL( + ChspsDomNode& aNode, + const TDesC8& aAttrName, + const TInt aValue, + const TRadix aFormat = EDecimal ); + + /** + * Creates a new attribute for the provided plugin node. + * @since S60 5.0 + * @param aPluginsNode is the plugins node that should be modified + * @param aAttrName is name of the attribute + * @param aValue is value of the attribute + */ + static void AddAttributeDescL( + ChspsDomNode& aNode, + const TDesC8& aAttrName, + const TDesC8& aValue ); + + /** + * Finds a configuration node with the provided id attribute + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aConfigurationId is an unique identifier of the configuration node + * @return plugins node or NULL if the node couldn't be found + */ + static ChspsDomNode* FindConfigurationNodeL( + ChspsODT& aOdt, + const TInt aConfigurationId ); + + /** + * Finds a plugin node with the provided id + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aPluginId is an ID of the plugin instance to be found + * @return Pointer to the plugin node or NULL + */ + static ChspsDomNode* FindPluginNodeL( + ChspsODT& aOdt, + const TInt aPluginId ); + + /** + * Gets an attribute value of a configuration element. + * @since S60 5.0 + * @param aOdt is an ODT instance form which the name is fetched + * @param aAttr is the attribute to be found + * @return value of the name attribute in a configuration node + */ + static TPtrC8 FindConfigurationAttrL( + const ChspsODT& aOdt, + const TDesC8& aAttr ); + + /** + * Copies a file to a target path when neccessary. + * Target path is created if it's missing. + * File is copied if the target's size or date are different or + * if the file is missing. + * @since S60 5.0 + * @param aFs Reference to OPEN file server session handle. + * @param aFilemanager Referemce to file manager instance + * @param aTargetPath Path where the file should be copied to + * @param aFilename Path and name of the file to be copied + * @return error code + */ + static TInt CopyResourceFileL( + RFs& aFs, + CFileMan& aFilemanager, + const TPath& aTargetPath, + const TFileName& aSourceFile ); + + /** + * Checks: + * - Is there enough space for target file? + * - Do source and target files have same timestamp and size + * (if target file exists)? + * + * @param aSource Full path to source file. + * @param aTarget Full path to target file. + * @param aFs Reference to OPEN file server session handle. + * @return TBool ETrue if copy can continue, EFalse if copy not needed. + */ + static TBool ResourceCopyIsRelevantL( + const TDesC& aSource, + const TDesC& aTarget, + RFs& aFs ); + + /** + * Check configuration states + * @since S60 5.0 + * @param aOdt ODT instance to be checked + * @param aConfState Old state to be replaced + * @param aNextConfState New state + * @param aOdtUpdated ODT update status + */ + + static void UpdateConfigurationStateL( + ChspsODT& aOdt, + TDesC8& aConfState, + TDesC8& aNextConfState, + TBool& aOdtUpdated ); + + /** + * Check state of an application configuration + * @since S60 5.0 + * @param aOdt ODT instance to be checked + * @param aConfState Old state to be replaced + * @param aNextConfState New state + */ + static void UpdateAppConfigurationStateL( + ChspsODT& aAppOdt, + const TDesC8& aConfState, + const TDesC8& aNextConfState ); + + /** + * Finds a defined node with defined attribute value + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aAttrName is name of the attribute to be found + * @param aAttrValue is the value which the attribute should hold + */ + static ChspsDomNode* FindNodeByAttributeL( + ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue ); + + /** + * Retrieves all unique plugin uids from a configuration. + * @since S60 5.0 + * @param aOdt holds the configuration from which the plugins are searched from + * @param aPluginArray is an array of found plugin uids + */ + static void FindUniquePluginsL( + ChspsODT& aOdt, + RArray& aPluginArray ); + + + /** + * Converts a hex value string (0xXXXX) to TUint. + * + * @param aStr String containing hex value. + * @param aTrg Reference to target TUint. Will be modified only + * if conversion is successful. + * @return KErrNone if successfull. Otherwise related symbian error code. + */ + static TInt HexString2Uint( + const TDesC8& aStr, + TUint& aTrg ); + + /** + * Converts a decimal value string to TInt + * @param aStr String containing hex value + * @return corresponding TInt + */ + static TInt DecString2Int( + const TDesC8& aStr ); + + /** + * Returns a count of plugin instances. + * @since S60 5.0 + * @param aAppODT is an instance of the the application configuration + * @param aPluginUid is an UID of the plugin instances to be found + * @param aInstanceCount is the return value + */ + static void PluginInstanceCountL( + const ChspsODT& aAppODT, + const TInt aPluginUid, + TInt& aInstanceCount ); + /** + * Converts UID in DesC8 format into TUid format. + * @since S60 5.0 + * @param aStr is the descriptor value to be converted + * @return the converted uid value + */ + static TUid ConvertDescIntoUid( + const TDesC8& aStr ); + /** + * Finds a child node by tag + * @since S60 5.0 + * @param aNodeTag is the tag of the child node to be found + * @param aParentNode is the node whose child is searched + * @param aIndex is index that sets position where to start search + * @return pointer to child node + */ + + static ChspsDomNode* FindChildNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aParentNode, + TInt& aIndex ); + + /** + * Returns fixed name of ODT resources (e.g. clock.o0005 name converts into clock.o0000) + * @since S60 5.0 + * @param aNameAndExtension is resource name to be fixed + * @return fixed resource name + */ + static TFileName GetFixedOdtName( + const TDesC& aNameAndExtension ); + + /** + * Finds files from defined directory and its sub directories from + * C: drive, Z: drive or both. If the directory path contains a drive + * files are searched from that drive only. + * @since S60 5.0 + * @param aDirName is directory path where the files are searched + * @param aFileName is name of file to be searched + * @param aFiles is a list of found files (full path) + */ + static void FindFilesL( + const TDesC& aDirName, + const TDesC& aFileName, + RArray & aFiles ); + + /** + * Finds files from defined directory from C: drive, Z: drive or both. + * If the directory path contains a drive files are searched from that + * drive only. + * @since S60 5.0 + * @param aDirName is directory path where the files are searched + * @param aFileName is name of file to be searched + * @param aFiles is a list of found files (full path) + */ + static void FindFilesFromDirL( + const TDesC& aDirName, + const TDesC& aFileName, + RArray & aFiles ); + + /** + * Set node attribute value. Updated node is defined with + * node name, attribute name and attribute value + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aNodeName is name of updated node + * @param aAttrName is name of the attribute to be found + * @param aAttrValue is the value which the attribute should hold + * @param aSetAttrName is name of updated attribute + * @param aSetAttrValue is new value of updated attribute + */ + static void SetAttributeValueL( + const ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue, + const TDesC8& aSetAttrName, + const TDesC8& aSetAttrValue ); + + /** + * Get node attribute value. Node which attribute value is requested + * is defined with node name, attribute name and attribute value + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aNodeName is the name of node which attribute value is requested + * @param aAttrName is the name of the attribute which should be contained by the node + * @param aAttrValue is the requested value of the attribute + * @param aGetAttrName is the name of attribute which value is requested + * @param aGetAttrValue is the requested attribute value + */ + static void GetAttributeValueL( + const ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue, + const TDesC8& aGetAttrName, + TPtrC8& aGetAttrValue ); + + /** + * Checks resource files of defined configuration + * Function leaves if all resource files cannot be found + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aConfUid is configuration UID which resources are checked + */ + static void CheckResourceFilesL( + const ChspsODT& aOdt, + const TInt aConfUid ); + + /** + * Returns configuration's version string + * Function leaves if configuration cannot be found + * @since S60 5.0 + * @param aOdt is an instance of the ODT class + * @param aConfUid is configuration UID which version is requested + * @param aVersion is configuration version string + */ + static void CheckConfigurationVersionL( + ChspsODT& aOdt, + const TInt aConfUid, + const TDesC& aVersion ); + + /** + * Edit mode for EditNodeActivity method. + */ + enum TNodeEditMode + { + EActivateFirst = 0, // Activate first one on specific level only. + // Others will be deactivated. + + EDeactivateAll // Deactivate all. + }; + + /** + * Modify node's childs according to given edit mode. + * Recursive method. Modifies only nodes that are type plugin. + * + * @since S60 5.0 + * @param aRootNode Root node to start tree recursion. + * @param aEditMode Edit mode. Look for TNodeEditMode. + * @param aDepth Optional edit depth. e.g. If 1 then + * only one level of child nodes is processed. + * If not defined (or RECURSION_DEPTH_INFINITE + * used) then whole node tree from aRootNode + * forward will be processed. + */ + static void EditPluginNodeActivityL( ChspsDomNode* aRootNode, + const TNodeEditMode aEditMode, + TInt aDepth = RECURSION_DEPTH_INFINITE ); + + /** + * Get active plugin node. + * Not recursive method. Only one level from parent will be checked. + * + * @since S60 5.0 + * @param aParentNode Parent node. + * @return ChspsDomNode* Pointer to active plugin node. NULL if none found. + */ + static ChspsDomNode* GetActivePluginNode( ChspsDomNode* aParentNode ); + + /** + * Get plugin id of a node. + * + * @since S60 5.0 + * @param aNode Node. + * @return TInt Plugin id. + */ + static TInt GetPluginId( ChspsDomNode* aNode ); + + /** + * Get plugin uid of a node. + * + * @since S60 5.0 + * @param aNode Node. + * @return TUid Plugin uid. + */ + static TUid GetPluginUid( ChspsDomNode* aNode ); + + /** + * Gather plugin ids for specific plugin uid from given ODT. + * @since S60 5.0 + * @param aAppODT ODT to search plugin ids from. + * @param aPluginUid Plugin uid to be used as search keyword. + * @param aPluginIds Target array for plugin ids. + */ + static void GetPluginIdsByUidL( + const ChspsODT& aAppODT, + const TUid aPluginUid, + RArray& aPluginIds ); + + /** + * Finds a parent node with defined name and attribute + * for defined child node + * @since S60 5.0 + * @param aNode Child node + * @param aNodeName Name of parent node + * @param aAttrName Name of parent node attribute + * @param aAttrValue Value of parent node attribute + * @return pointer to parent node or + * NULL if defined parent node is not found + */ + static ChspsDomNode* GetParentNode( + const ChspsDomNode& aNode, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue ); + + /** + * Retrieves a filename from a file declaration. + * @since S60 5.1 + * @param aFileDeclaration "SKIN():MIF()", "MIF()", "UID()" or "file.ext" string + * @param aFilename Referred file name or NULL + * @return True if a file was referred from the declaration + */ + static TBool hspsServerUtil::IsFile( + const TDesC& aFileDeclaration, + TFileName& aFilename ); + + /** + * Resolve resource files that need to be copied. + * + * @since S60 5.1 + * + * @param aODT Configuration. + * @param aConfUid Plugin which is to be processed. + * @param aActiveLanguage Active language. + * @param aWidgetResources Target array. Will receive list + * of resources if any applicable. + * Ownership of given resources is not transferred! + */ + static void GetValidResourcesL( + ChspsODT& aODT, + const TInt aConfUid, + const TLanguage aActiveLanguage, + RPointerArray& aWidgetResources ); + + /** + * Check if there is enough space on given drive for resources included in ODT. + * + * @since S60 5.1 + * + * @param aODT Configuration. + * @param aActiveLanguage Active language. + * @param aFs Reference to open file server handle. + * @param aDriveNumber Drive number. Default EDriveC. + * @param aAdditionalDiskSpace Additional disk space added to disk (bytes) + * space requirement. Default 0. + * + * @return TInt System wide error code. KErrDiskFull + * if not enough space on C drive. + */ + static TInt EnoughDiskSpaceAvailableL( + ChspsODT& aODT, + const TLanguage aActiveLanguage, + RFs& aFs, + const TDriveNumber aDriveNumber = EDriveC, + const TInt aAdditionalDiskSpace = 0 ); + + /** + * Finds a node by tag + * @since S60 5.0 + * @param aNodeTag is the tag of the node to be found + * @param aDomNode is the root node where to search specific node + * @return pointer to node that is found + */ + static ChspsDomNode* FindNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ); + + private: + /** + * Internal method. Do not call directly! + * + * Modify node's childs according to given edit mode. + * Recursive method. Modifies only nodes that are type plugin. + * + * @since S60 5.0 + * @param aRootNode Root node to start tree recursion. + * @param aEditMode Edit mode. Look for TNodeEditMode. + * @param aDepth Edit depth. e.g. If 1 then + * only one level of child nodes is processed. + * If RECURSION_DEPTH_INFINITE used + * then whole node tree from aRootNode + * forward will be processed. + */ + static void _EditPluginNodeActivityL( ChspsDomNode* aRootNode, + const TNodeEditMode aEditMode, + TInt& aDepth ); + + /** + * Not for instanciation. Only static functionality provided. + */ + hspsServerUtil(); + }; + +#endif //__hspsSERVERUTIL_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1083 @@ +/* +* Copyright (c) 1020 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: HSPS server +* +* Architecture +* ************ +* ChspsThemeServer derives CPolicyServer when compiled on EKA2 based Symbian OS. +* ChspsThemeServer depends on the following classes: +* - ChspsInstallationHandler which implements MhspsInstallationHandler, +* - ChspsMaintenanceHandler which implements MhspsMaintenanceHandler, +* - ChspsClientRequestHandler which implements MhspsClientRequestHandler, +* - ChspsDefinitionRepository and ChspsODT from Xuikon, +* - ChspsFileChangeListener, +* - ChspsAutoInstaller, and +* - CRepository from Symbian. +* +* Functionality +* ************* +* When client connects to hspsThemeServer, the access rights are checked. +* If access is granted, a server session is created. Once connected, client may +* perform service requests as long as it is connected. Service requests are +* served by initiating appropriate service handlers. These service handlers are +* Symbian active objects, based on CActive-class. In using active ojects, it is +* possible to perform long-lasting service requests without blocking others +* clients getting served on-time. Active objects are also used to assist +* services to perform asynchronous operations internally, for e.g. when service +* is executing slow media conversions. Furthermore, some of these services are +* extended to implement timer-functionality, based on CTimer-class. +* These active timers are used to control different time-based server +* operations and initiate service-state refreshing functionality. +* hspsThemeServer contains auto-install feature that can install Application +* Theme on SISX-packet exctraction. +* +* +* Installation Handler +* ==================== +* ChspsInstallatioHandler-active object performs all installation related +* functionality. Installation concerns reading installation instructions from +* manifest-file, utilizind Xuikon Definition Engine to parse xml- and +* css-files, and apply style and localisation information defined in dtd-files +* into the DOM-document created. Installer also handles resources that theme +* may include. Some resource types may need conversions to fit on the target +* device's screen or audio device etc. In this case, the installer performs +* media conversions by its Media Converter. Conversions are asynchronous and +* they deploy MIME-types. For more information of media conversions, see +* ChspsMediaConverter documentation. When installation is successful, +* Installation Handler utilizes Xuikon Definition Repository to store the +* results. The resulted objects are for e.g. unlocalised and localised +* versions of application theme. Theme associated resources are also handled +* in unlocalised and localised versions. Resources are stored on repository +* and their related information is stored on the list of ChspsResource-objects +* - a resource list. This list of ChspsResource-objects is called Resource List. +* Definition Repository is located in hspsThemeServer private folder. +* Repository is organisized by theme header information. +* For more information, see hspsResource documentation. +* On theme updates, i.e. installation over previous one, Installation Handler +* deploys ChspsSecurityEnforcer to control theme update rights. +* For more information, see ChspsSecurityEnforcer documentation and +* ChspsInstallatioHandler documentation. +* +* Maintenance Handler +* =================== +* ChspsMaintenanceHandler-active timer performs all theme maintenance related +* functionality. Maintenance services includes theme listing, theme activation, +* theme removal and default theme restoring operations. Maintenance functions +* deploy Xuikon Definition Repository and Symbian Central Repository. +* Definition Repository maintains Application Themes in save place and Central +* Repository maintains the information about which theme is active for what +* application. Information in Central Repository is presented in pairs of +* application UID and active theme UID. +* For more information, see ChspsMaintenanceHandler documentation. +* +* Client Request Handler +* ====================== +* ChspsClientRequestHandler-active timer performs all request accesses from +* Rendering Engine. When request exists, the just right one application theme +* is delivered to client process using memory chunk passing. Resource List is +* delivered too. Client Request Handler uses Xuikon Definition Repository and +* Symbian Central Repository to get match theme on the request. Client Request +* Handler serves also resource accesses. In using file handle passing +* introduced by Symbian Platform Security concept, Client Request Service +* arranges a resource access to hspsThemeServer's private folder for the client +* process. RFile handle passing is used. +* For more information, see ChspsClientRequestHandler documentation. +* +* File Change Listener +* ================== +* ChspsFileChangeListener listens to given file folder and notifies its observer +* if there is any file change. Observer is given as a parameter on +* initialising the listener. Observer must implement MhspsFileChangeObserver-interface. +* FileChangeListener is asynchronous object that deploys Symbian RFs client-sideAutoInstaller +* handle on File Manager. FileChangeListener is intended to be used by any object +* that wants listen Symbian file system events. +* +* Auto Installer +* ============== +* ChspsAutoInstaller installs theme from given location. It is intended +* to be used by hspsThemeServer directly. AutoInstaller is initiated +* when FileChangeListener finds installable theme source on given +* location. Theme source is set during the SISX-package exctraction. +* AutoInstaller is deployed by calling its function InstallThemeL with manifest-file +* of the installable theme source set. +* AutoInstaller deploys ChspsInstallationHandler. ChspsInstallationHandler +* is asynchronous object, there for AutoInstaller is asynchronous object +* as well capable to deploy asynchronous installation. +* When installation ends, AutoInstaller calls its observer with +* ThspsServiceCompletedMessage-type parameter. Observer is given on +* initialising of AutoInstaller and it must be ChspsThemeServer-type. +* AutoInstaller have functions to get ODT-header of successfully installed +* theme and ChspsResult-typed object expressing errors in unsuccessful cases. +* +* Security Enforcer +* ================= +* ChspsSecurityEnforcer performs all security related functions in Xuikon +* Application Theme Management services. +* These functions are the following: +* - locking policy functionality, +* - style locking policy functionality, +* - control user access on service request, and +* - validate content of user queries. +* +* Performance accelerators +* ************************ +* +* HeaderListCache +* --------------- +* To speed up serving the theme request operations initiated by Rendering +* Engine in theme usage cases, hspsThemeServer maintains cache of the header +* information of the themes stored in Definition Repository. When installation +* occurs, cache is updated. First time the cache is updated when hspsThemeServer +* starts - server is started by system starter service. This quaranties +* that cache is up to date and hit will occur on the very first access. +* Cache is updated also by MaintenanceHandler and ClientRequestHandler on +* the cases where content of repository is affected. +* +* Pre-initialized objects +* ----------------------- +* hspsThemeServer speeds up the performance also by pre-initialized objects +* which it passes to ChspsClientRequestHandler when one is initiated on new +* Client Request Service server session. These objects are the following: +* - ChspsDefinitionRepository +* - CRepository for the KhspsThemeStatusRepositoryUid {0x10207342} +* +* +*/ + + +#ifndef __hspsTHEMESERVER_H__ +#define __hspsTHEMESERVER_H__ + +#include +#include + +#include "hspsfilechangelistener.h" +#include "hspscenreplistener.h" +#if defined(WINSCW) || defined(__WINS__) +#include "hspsfamilylistener.h" +#endif // defined(WINSCW) +#include "hspsthememanagement.h" +#include "hspsodt.h" +#include "hspsdefinitionrepository.h" +#include "hspsbrobserver.h" +#include "hspsbrhandler.h" + +#include "hsps_builds_cfg.hrh" + +/** hspsThemeServer name: */ +_LIT(KhspsThemeServerName,"hspsthemeserver"); + +/** Supported manifest version */ +_LIT(KhspsSupportedManifestVersion,"1.0"); + +/** hspsThemeServer Uid3 = SECUREID. */ +const TUid KhspsThemeServerUid3 = {0x200159C0}; //old uid 0x10207254}; + +/** +* KhspsThemeServerMajorVersionNumber, KhspsThemeServerMinorVersionNumber, +* and KhspsThemeServerBuildVersionNumber. +* These constants define a version to be given for creating a session +* with the hspsThemeServer. +*/ +const TUint KhspsThemeServerMajorVersionNumber=1; +const TUint KhspsThemeServerMinorVersionNumber=0; +const TUint KhspsThemeServerBuildVersionNumber=0; + +/* +* KDefaultMessageSlots. Number of hspsThemeServer message slots. +* Server slots allocation rules: 1 for synchronous request, 1 for each +* concurrent outstanding asynchronous requests and 1 for each cancellation +* => 3 in this case. +*/ +const TInt KDefaultMessageSlots = 3; + +// Forward declarations. +class ChspsDefinitionRepository; +class ChspsDefinitionEngineInterface; +class CRepository; +class ChspsSecurityEnforcer; +class ChspsRomInstaller; +class ChspsAutoInstaller; + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +// Keys for the Central Repository +const TInt KCenrepKeyLang = 100000001; // Device language from previous startup +const TInt KCenrepKeyPostRFS = 100000002; // Holds information whether the post RFS initializations have been done +const TInt KCenrepKeyCheckConf = 100000003; // Holds information whether the configuration states must be checked +const TInt KCenrepKeyAccessControlList = 100000004; // Holds information about security access control list + +const TInt KCenRepBufferSize = 255; // Control Access List length + +/* +* Server's policy. +*/ + +/* Total number of ranges */ +const TUint hspsThemeRangeCount = 4; + +/* Definition of the ranges of IPC numbers */ +const TInt hspsThemeRanges[hspsThemeRangeCount] = + { + EhspsInstallationBase, /* installation messages (0,1,2 ) */ + EhspsMaintenanceBase, /* maintenance messages (3,4,5,6,7,8) */ + EhspsClientRequestBase, /* client request messages (9,10,11,12,13) */ + EhspsNotSupported, /* and up; non implemented function end of range check ; ENotSupported */ + }; + +/* Policy to implement for each of the above ranges */ +const TUint8 hspsThemeElementsIndex[hspsThemeRangeCount] = + { + CPolicyServer::ECustomCheck, //applies to 0th range + CPolicyServer::ECustomCheck, //applies to 1st range + CPolicyServer::ECustomCheck, //applies to 2nd range + CPolicyServer::ENotSupported //applies to 3rd range (out of range IPC) + }; + +/* Specific capability checks */ +const CPolicyServer::TPolicyElement hspsThemeElements[] = + { + {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient}, + //policy "0"; fail call if ReadUserData not present + {_INIT_SECURITY_POLICY_C1(ECapabilityTCB), CPolicyServer::EFailClient} + //policy "1"; fail call if TCB not present + }; + +/* Package all the above together into a policy */ +const CPolicyServer::TPolicy hspsThemePolicy = + { + CPolicyServer::EAlwaysPass, /* specifies all connect attempts should pass */ + hspsThemeRangeCount, /* number of ranges */ + hspsThemeRanges, /* ranges array */ + hspsThemeElementsIndex, /* elements<->ranges index */ + hspsThemeElements, /* array of elements */ + }; + +// File filters related to imports folder +_LIT( KFilterAllImportsV1, "*.dat"); +_LIT( KFilterAllAppImportsV1, "app_*.dat"); +_LIT( KFilterAllPluginImportsV1, "plugin_*.dat"); +_LIT( KFilterAllImportsV2, "*.*"); + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ +/** + * MShutdownObserver + * Observer for automatic shutdown class. + * + * @since S60 5.0 + */ +class MShutdownObserver + { +public: + /** + * Notifies observer that shutdown is initiating. + * + * @since S60 5.0 + */ + virtual void ShutdownInitiating() = 0; + }; + +/** + * CShutdown. + * Auto shutdown class (standard pattern) + * + * @since S60 5.0 + */ +class CShutdown : public CTimer + { +public: + /** + * Create new shutdown timer. + * + * @since S60 5.0 + * @param aObserver Shutdown observer. + */ + static CShutdown* NewL( MShutdownObserver& aObserver ); + + /** + * Start shutdown timer. + * + * @since S60 5.0 + */ + void Start(); + +protected: + /** + * C++ constructor. + * + * @since S60 5.0 + * @param aObserver Shutdown observer. + */ + CShutdown( MShutdownObserver& aObserver ); + + /** + * Symbian 2nd phase constructor. + * + * @since S60 5.0 + */ + void ConstructL(); + +private: + /** + * From CActive. + */ + void RunL(); + +private: + // Shutdown delay. + enum { KhspsShutdownDelay = 2000000 }; + + // Shutdown observer. + MShutdownObserver& iObserver; + }; +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +// States of the auto installer +enum TAutoInstallerStates + { + EAutoInstallerStateIdle = 0, + EAutoInstallerStateInstall = 1, + EAutoInstallerUninstall = 2 + }; + +// Operations for header cache updates +enum ThspsCacheOperations + { + EhspsCacheAddHeader, + EhspsCacheRemoveHeader + }; + +// Backup states +enum ThspsBRStates + { + EhspsBRNormal = 0, + EhspsBRBackup, + EhspsBRRestore + }; + + +/** + * @ingroup group_hspsserver + * ChspsThemeServer. + * @since S60 5.0 + **/ +class ChspsThemeServer : public CPolicyServer, + public MhspsFileChangeObserver, + public MhspsDefinitionRepositoryObserver, + public MhspsCenRepObserver +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + , public MShutdownObserver +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ +#if defined(WINSCW) || defined(__WINS__) + , public MhspsFamilyObserver +#endif // defined(WINSCW) + + { +public: + + /** + * NewLC + * @since S60 3.1 + */ + static CServer2* NewLC(); + + /** + * AddSession + * @since S60 3.1 + */ + void AddSession(); + + /** + * DropSession + * @since S60 3.1 + */ + void DropSession(); + +public: // public functions + + /** + * UpdateHeaderListCacheL + * Re-scans the file system under the Plug-in Repository. + * Execution is slow and should be used only when absolutely required. + * Updates headerlist cache + * @since S60 5.0 + */ + void UpdateHeaderListCacheL(); + + /** + * Updates the header list cache based on the provided ODT information. + * Should be preferred over the previous API. + * @since S60 5.0 + * @param aOperation is an enumeration of the cache operations + * @param aRootUid is an UID of the application/interface + * @param aProviderUid is an UID of the provider + * @param aConfUid is an UID of the plug-in configuration + */ + TInt UpdateHeaderListCache( + ThspsCacheOperations aOperation, + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ); + + /** + * CleanupTemporaryFilesL + * Cleans temporary files + * @since S60 3.1 + */ + void CleanupTemporaryFilesL(TInt secureId = 0); + + /** + * IncreaseRequestClientCount + * Increases count of client requests + * @since S60 5.0 + */ + void IncreaseRequestClientCount(); + + /** + * DecreaseRequestClientCount + * Decreases count of client requests + * @since S60 5.0 + */ + void DecreaseRequestClientCount(); + + /** + * HandleAutoInstallerEvent + * Handles autoinstaller events + * @since S60 3.1 + */ + void HandleAutoInstallerEvent( ThspsServiceCompletedMessage aMsg ); + + /** + * DefinitionRepository + * @since S60 3.1 + */ + ChspsDefinitionRepository& DefinitionRepository(); + + /** + * SecurityEnforcer + * @since S60 3.1 + */ + ChspsSecurityEnforcer& SecurityEnforcer(); + + /** + * CentralRepository + * @since S60 3.1 + */ + CRepository& CentralRepository(); + + /** + * DeviceLanguage + * Returns device language + * @since S60 3.1 + */ + TLanguage DeviceLanguage(); + + /** + * HeaderListCache + * Returns headerlist cache + * @since S60 3.1 + */ + CArrayPtrSeg& HeaderListCache(); + + /** + * GetConfigurationL + * Retrieves a configuration with the provided UIDs. + * @since S60 5.0 + * @param aInterfaceUid An uid of the interface or application (e.g. AI3, Java etc), optional. + * @param aConfigurationUid An uid of the plugin configuration + * @param aRetrievedODT Retrieved configuration + * @return KErrNone if operation succeeded + */ + TInt GetConfigurationL( + const TInt aInterfaceUid, + const TInt aConfigurationUid, + ChspsODT& aRetrievedODT ); + + /** + * GetConfigurationHeaderL + * Retrieves a configuration header matching the search criteria + * @since S60 5.0 + * @param aSearchMask ODT header defining search criteria + * @param aConfHeader Found ODT header + * @param aPos Start/Found position + */ + void GetConfigurationHeader( + ChspsODT& aSearchMask, + ChspsODT*& aConfHeader, + TInt& aPos ); + + /** + * Localizes an ODT. + * Testing: change first two digits from \epoc32\RELEASE\WINSCW\udeb\ + * Z\resource\BootData\Languages.txt file and reboot the emulator. + * @since S60 5.0 + * @param aEngine is a service for replacing DTD entities in XML. + * @param aOdt is an ODT instance to be localized. + * @return ETrue if the ODT was successfully localized + */ + TBool LocalizeL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt ); + + /** + * Parses name of a manifest from the provided import's name. + * @since S60 5.0 + * @param aImportFile is a name of the import to be parsed + * @param aPath is a path from which the import should be found + * @return descriptor holding name of the manifest or NULL + */ + HBufC* GetManifestFromImportLC( + const TDesC& aImportFile, + const TDesC& aPath ); + + /** + * Check the installed configurations + * @param aAppUid Application UID which configurations are checked + * @since S60 5.0 + */ + void CheckConfigurationL( + const TInt aAppUid ); + + /** + * Reinstalls defined configuration + * @param aAppUid Application UID which configuration is reinstalled + * @param aConfUid Configuration UID of reinstalled configuration + * @since S60 5.0 + */ + void ReinstallConfL( + TInt aAppUid, + TInt aConfUid ); + + /** + * Handles received backup event + * @since S60 5.0 + * @param aEvent Backup event + */ + void HandleBREventL( TInt aEvent ); + + /** + * Prepares backup data for passive backup + * @since S60 5.0 + */ + void CreateBackupDataL(); + + + /** + * Check the installed plugin is used in some application configuration + * @since S60 5.0 + * @param aPluginUid Plugin UID of installed configuration + */ + TInt CheckInstalledPluginUsageL( const TInt aPluginUid ); + + /** + * Check if given plugin is in header cache. + * + * @since S60 5.0 + * @param aPluginUid Plugin UID to search from header cache. + */ + TBool PluginInHeaderCache( const TUid aPluginUid ); + + /** + * Cleanup server resources. This method is called when server is been + * shut down and active scheduler is still installed. + * + * @since S60 5.0 + */ + void Cleanup(); + + /** + * Activates provided application configuration. + * @param aSetMask Identifies an application configuration which is to be activated. + * @param aOdt Activated application configuration + */ + TInt ActivateThemeL( + const ChspsODT& aSetMask, + ChspsODT& aOdt ); + + /** + * Retrieves active application configuration from Central Repository. + * @since S60 5.0 + * @param aAppUid Identifies the application + * @param aOdt Contains currently active application configuration + */ + TInt GetActivateAppConfigurationL( + const TInt aAppUid, + ChspsODT& aOdt ); + + /** + * Gets family information from an active application configuration. + * @since S60 5.0 + * @param aAppUid Identifies the application + * @returns The active family + */ + TUint32 GetActiveFamilyL( + const TInt aAppUid ); + +public: // from MhspsFileChangeObserver + + /** + * HandleFileSystemChange + * Handles change of filesystem + * @since S60 3.1 + */ + void HandleFileSystemChange(); + + /** + * HandleRepositoryChange + * Handles change of repository + * @since S60 3.1 + */ + inline void HandleRepositoryChange() {}; + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ +public: // From MShutdownObserver + /** + * From MShutdownObserver. + */ + void ShutdownInitiating(); +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + + +public: // from MhspsDefinitioRepositoryObserver + + /** + * HandleDefinitionRespositoryEvent + * Handles change events received from definition repository + * @since S60 3.1 + */ + TBool HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ); + +public: // from MhspsCenRepObserver + + void HandleCenRepChangeL( const TUint32 aId ); + +#if defined(WINSCW) || defined(__WINS__) +public: // from MshspFamilyObserver + TBool HandleFamilyChangeL( const ThspsFamily aNewFamily ); +#endif // defined(WINSCW) + +private: + + /** + * ChspsThemeServer + * @since S60 3.1 + */ + ChspsThemeServer(); + + /** + * ~ChspsThemeServer + * @since S60 3.1 + */ + ~ChspsThemeServer(); + + /** + * ConstructL + * @since S60 3.1 + */ + void ConstructL(); + + /** + * NewSessionL + * @since S60 3.1 + */ + CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; + + /** + * ComparePaths + * @since S60 3.1 + */ + TBool ComparePaths(const ChspsODT& aOldHeader, const ChspsODT& aNewHeader); + + /** + * GetHeaderListL + * Gets current headerlist from filesystem + * @param aHeaderList Destination for read headerlists from filesystem + * @param aSearchMask SearchMask to use when reading headerlists from filesystem + * @since S60 3.1 + */ + void GetHeaderListL(CArrayPtrSeg& aHeaderList, const ChspsODT& aSearchMask ); + + /** + * CheckActiveThemesL + * Check active themes from the central repository and if needed open path info file for them + * @since S60 3.1 + */ + void CheckActiveThemesL(); + + //From CPolicyServer + /** + * CustomSecurityCheckL + * @since S60 3.1 + */ + CPolicyServer::TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction, + TSecurityInfo& aMissing); + + /** + * HandleFileSystemChangeL + * Does the actual filesystem change handling + * @since S60 3.2 + */ + void HandleFileSystemChangeL(); + + /** + * RunAutoInstaller + * Runs auto installer + * @since S60 5.0 + */ + TBool RunAutoInstaller( TAutoInstallerStates aState ); + + /** + * StopAutoInstaller + * Stops auto installer and does house keeping after installation + * @since S60 3.2 + */ + void StopAutoInstaller(); + + /** + * HandleThemeUpgrade; + * Handles the SIS theme upgrade + */ + void HandleThemeUpgradeL(); + + /** + * Checks whether the device language has been changed and updates + * configurations accordingly + */ + void HandleLanguageChangeL(); + + /** + * Localizes ODT files according to the device language. + * @since S60 5.0 + */ + void LocalizeConfigurationsL(); + + /** + * Localizes an application configuration with a device language. + * This function is used by the LocalizeL service. + * @since S60 5.0 + * @param aEngine is a service for replacing DTD entities in XML. + * @param aRequestedLanguage is the requsted language + * @return ETrue if all the application and plugin configurations were localized + */ + TBool LocalizeApplicationConfigurationL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt, + const TLanguage aRequestedLanguage ); + + /** + * Localizes a plugin configuration with a device language. + * This function is used by the LocalizeL service. + * @since S60 5.0 + * @param aEngine is a service for replacing DTD entities in XML. + * @param aRequestedLanguage is the requsted language + * @param aPluginUid is > 0 when LocalizeApplicationConfigurationL() is used + * @return ETrue if the plugin configuration was localized + */ + TBool LocalizePluginConfigurationL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt, + const TLanguage aRequestedLanguage, + TInt aPluginUid ); + + /** + * Handles installation of ROM based manifest files when a Restore Factory Settings (RFS) + * operation has been executed (controlled via the Central Repository). + * This function is executed at bootup when the server starts. + * @since S60 5.0 + */ + void HandleRomInstallationsL(); + + /** + * Executes installation of manifest files from the ROM drive. + * @since S60 5.0 + */ + void InstallManifestsFromRomDriveL(); + + /** + * V2 method for finding manifest files from Z\private\200159C0\install subfolders, + * these folders should have a "hsps" subfolder. + * Appends iManifestFiles array. + * @since S60 5.0 + * @param aPluginFolders holds names of the plugin folders which are V2 based + */ + void FindRomInstallationsV2L( + RPointerArray& aPluginFolders ); + + /** + * Initiates uninstallation of a manifest file located under the imports folder. + * @since S60 5.0 + * @param aFilelist is a list of dat files under the imports folder or NULL + */ + void UninstallImport( + const CDir* aFilelist ); + + /** + * Installs new configuration based on the information in imports name. + * @since S60 5.0 + * @param aFilelist is a list of dat files to be parsed under the imports folder + */ + void InstallImportsL( + const CDir& aFilelist ); + + /** + * Handles installation/uninstallation of imported configurations. + * A file filter controls which type of configurations are to be handled. + * @since S60 5.0 + * @param aFilePrefix is a prefix for finding either plugin or application configuration imports. + */ + void HandleConfigurationImportsL( + const TDesC& aFilePrefix ); + + /** + * + * @since S60 5.0 + * @param aAppUid is an UID of the application + */ + void UnlockSisxImportL( + const TUint32 aAppUid ); + + /** + * + * @since S60 5.0 + * @param aAppUid is an UID of the application + * @param aConfUid is an UID of the active configuration + */ + void LockSisxImportL( + const TUint32 aAppUid, + const TInt aConfUid ); + + /** + * GetDeviceLanguage + * @since S60 5.0 + */ + TLanguage GetDeviceLanguage(); + + /** + * Retrieves a list of headers matching a iCacheMask search mask. + * @since S60 5.0 + * @param aHeaderList is a list of headers found from the Plug-in Repository + * @return KErrNone if operation was successfull + */ + TInt DoUpdateHeaderListCache( + CArrayPtrSeg& aHeaderList ); + + + /** + * Adds specific header to the cache. + * An alternative to UpdateHeaderListCacheL API for updating the header + * cache with a minimum performance hit. + * @since S60 5.0 + * @param aRootUid is an UID of the application/interface + * @param aProviderUid is an UID of the provider + * @param aConfUid is an UID of the plug-in configuration + */ + void HeaderCacheAddL( + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ); + + /** + * Removes specific header from the cache. + * An alternative to UpdateHeaderListCacheL API for updating the header + * cache with a minimum performance hit. + * @since S60 5.0 + * @param aRootUid is an UID of the application/interface + * @param aProviderUid is an UID of the provider + * @param aConfUid is an UID of the plug-in configuration + */ + TInt HeaderCacheRemove( + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ); + + /** + * Handles backup events in EhspsBRNormal backup state + * @since S60 5.0 + * @param aEvent is a received backup event + */ + void HandleBRNormalStateL( + TInt aEvent ); + + /** + * Handles backup events in EhspsBRBackup backup state + * @since S60 5.0 + * @param aEvent is a received backup event + */ + void HandleBRBackupStateL( + TInt aEvent ); + + /** + * Handles backup events in EhspsBRRestore backup state + * @since S60 5.0 + * @param aEvent is a received backup event + */ + void HandleBRRestoreStateL( + TInt aEvent ); + + /** + * Creates active backup and restore handler + * @since S60 5.0 + * @param aEvent is a received backup event + */ + void CreateBRHandlerL( + TInt aEvent ); + + /** + * Deletes active backup and restore handler + * @since S60 5.0 + */ + void DeleteBRHandler(); + + /** + * Enables autoinstallations + * @since S60 5.0 + */ + void EnableAutoInstallationL(); + + /** + * Disable autoinstallations + * @since S60 5.0 + */ + void DisableAutoInstallation(); + + /** + * Installs restored configurations from backup/import folder + * @since S60 5.0 + */ + void RestoreImportedConfigurationsL(); + + /** + * Restores application configurations from backup/themes folder + * @since S60 5.0 + */ + void RestoreApplicationConfigurationsL(); + + /** + * Validates restored application configuration + * @since S60 5.0 + * @param aOdt is reference to application configuration to be validated + */ + void ValidateRestoredConfigurationL( + ChspsODT& aOdt ); + + /** + * Restore configuration + * @since S60 5.0 + * @param aOdt is reference to application configuration to be restored + */ + void RestoreConfigurationL( + ChspsODT& aOdt ); + +#if defined(WINSCW) || defined(__WINS__) + + /** + * Executed at startup to activate root configurations which were designed + * for the current resolution. + * @since S60 5.0 + */ + void ActivateRootConfigurationsL(); + +#endif // defined(WINSCW) + + +private: + TInt iSessionCount; + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + CShutdown* iShutdown; +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + + /* + * iRequestClientCount counts the number of RequestClientHandler instances + * when this number is 0, no resource file access exist and the temporary resource + * file instances can be removed safely + */ + TInt iRequestClientCount; + + // Contents of the header cache + CArrayPtrSeg* iHeaderListCache; + TBool iHeaderListPending; + + RFs iFsSession; + ChspsDefinitionRepository* iDefinitionRepository; + CRepository* iCentralRepository; + ChspsSecurityEnforcer* iSecurityEnforcer; + ChspsFileChangeListener* iFileChangeListener; + + // Active device language + TLanguage iDeviceLanguage; + + ChspsODT* iCacheMask; + + // Installation handler for ROM imports + ChspsRomInstaller* iRomInstaller; + + // Installation handler for SISX imports + ChspsAutoInstaller* iAutoInstaller; + + // Array of installable *.dat files under the imports folder + RPointerArray iInstallableSisxThemes; + + // Array of installed *.dat files under the imports folder + RPointerArray iInstalledSisxThemes; + + // Array of installable manifest files + RPointerArray iManifestFiles; + + // Index of a manifest in autoinstallation + TInt iCurrentManifestFile; + + // State of the SISX installer + TInt iAutoInstallerState; + + // Index of the theme to be removed + TInt iThemeIndexToRemove; + + // File locks for preventing uninstallation of active SISX configurations + RFile iFileAS; + RFile iFileAI; + RFile iFileLT; + + // Pointer to Central Repository Listener + ChspsCenRepListener* iCenRepListener; + + // Pointer to backup event listener + CHSPSBRObserver* iBRObserver; + + // Backup state + ThspsBRStates iBRState; + + // Active backup client + conn::CActiveBackupClient* iActiveBackupClient; + + // Backup handler + CHSPSBRHandler* iBRHandler; + + +#if defined(WINSCW) || defined(__WINS__) + // Listener for resolution and orientation changes + ChspsFamilyListener* iFamilyListener; +#endif // defined(WINSCW) + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; +#endif + }; + +#endif //__hspsTHEMESERVER_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,310 @@ +/* +* 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: HSPS server session +* +* +*/ + + +#ifndef __hspsTHEMESERVERSESSION_H__ +#define __hspsTHEMESERVERSESSION_H__ + +#include +#include + +#include "hsps_builds_cfg.hrh" + +// Forward declarations +class ChspsODT; +class ChspsInstallationHandler; +class ChspsMaintenanceHandler; +class ChspsClientRequestHandler; +class ChspsThemeServer; + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +/** + * @ingroup group_hspsserversession + * This class provides HSPS Server Session + */ +class ChspsThemeServerSession : public CSession2 + { +public: + + /** + * ChspsThemeServerSession + * @param aAppUid Application UID using this session + * @since S60 3.1 + */ + ChspsThemeServerSession( + const TInt aAppUid ); + + /** + * CreateL + * @since S60 3.1 + */ + void CreateL(); + + /** + * Shares RFs instance from session to handlers it owns. + * @return Reference to RFs instance + */ + RFs& FileSystem(); + +private: + + /** + * ~ChspsThemeServerSession + * @since S60 3.1 + */ + ~ChspsThemeServerSession(); + + /** + * Server + * @since S60 3.1 + */ + inline ChspsThemeServer& Server(); + + /** + * ServiceL, traps DoServiceL call and completes service + * requests when an error occures. + * @since S60 5.0 + */ + void ServiceL(const RMessage2& aMessage); + + /** + * Executes requested service. + * @since S60 5.0 + */ + void DoServiceL(const RMessage2& aMessage); + + /** + * ServiceError + * @since S60 3.1 + */ + void ServiceError(const RMessage2& aMessage,TInt aError); + + /* hspsInstallationService requests */ + /** + * InstallThemeL + * @since S60 3.1 + */ + void InstallThemeL(const RMessage2& aMessage); + + /** + * InstallNextPhaseL + * @since S60 3.1 + */ + void InstallNextPhaseL(const RMessage2& aMessage); + + /** + * CancelInstallThemeL + * @since S60 3.1 + */ + void CancelInstallThemeL(const RMessage2& aMessage); + + /** + * ReinstallConfL + * @since S60 5.0 + */ + void ReinstallConfL(const RMessage2& aMessage); + + /* hspsMaintenanceService requests */ + /** + * GetListHeadersL + * @since S60 3.1 + */ + void GetListHeadersL(const RMessage2& aMessage); + + /** + * GetNextHeaderL + * @since S60 3.1 + */ + void GetNextHeaderL(const RMessage2& aMessage); + + /** + * CancelGetListHeadersL + * @since S60 3.1 + */ + void CancelGetListHeadersL(const RMessage2& aMessage); + + /** + * SetActiveThemeL + * @since S60 3.1 + */ + void SetActiveThemeL(const RMessage2& aMessage); + + /** + * RestoreDefaultL + * @since S60 3.1 + */ + void RestoreDefaultL(const RMessage2& aMessage); + + /** + * RemoveThemeL + * @since S60 3.1 + */ + void RemoveThemeL(const RMessage2& aMessage); + + /** + * AddPluginL + * @since S60 5.0 + */ + void AddPluginL(const RMessage2& aMessage); + + /** + * RemovePluginL + * @since S60 5.0 + */ + void RemovePluginL(const RMessage2& aMessage); + + /** + * SetActivePluginL + * + * @since S60 5.0 + * @param aMessage IPC message data. + */ + void SetActivePluginL( const RMessage2& aMessage ); + + /** + * ReplacePluginL + * @since S60 5.0 + */ + void ReplacePluginL(const RMessage2& aMessage); + + /** + * SetPluginSettingsL + * @since S60 5.0 + */ + void SetPluginSettingsL(const RMessage2& aMessage); + + /** + * GetPluginOdtL + * @since S60 5.0 + */ + void GetPluginOdtL(const RMessage2& aMessage); + + /** + * MovePluginsL + * @since S60 5.0 + */ + void MovePluginsL(const RMessage2& aMessage); + + /** + * SetConfStateL + * @since S60 5.0 + */ + void SetConfStateL(const RMessage2& aMessage); + + /** + * RestoreActiveAppConfL + * @since S60 5.0 + */ + void RestoreActiveAppConfL(const RMessage2& aMessage); + + /**************************************** + * hspsClientRequestService requests + ****************************************/ + + /** + * GetOdtL + * @since S60 3.1 + */ + void GetOdtL(const RMessage2& aMessage); + + /** + * GetOdtUpdateL + * @since S60 3.1 + */ + void GetOdtUpdateL(const RMessage2& aMessage); + + /** + * CancelGetOdtUpdateL + * @since S60 3.1 + */ + void CancelGetOdtUpdateL(const RMessage2& aMessage); + + /** + * AccessResourceFileL + * @since S60 3.1 + */ + void AccessResourceFileL(const RMessage2& aMessage); + + /** + * Copies (overwrites) odt's resource files under private folder. + * Creates folder for each plug-in if needed. + * @since S60 5.0.1 + */ + void CopyResourceFilesL(const RMessage2& aMessage); + + + /** + * CreateMaintenanceHandlerL + * + * Creates a new maintenance handler if one does not already exist. + */ + void CreateMaintenanceHandlerL( const TUint aSecureId ); + + /** + * CreateClientRequestHandlerL + * + * Creates a new client request handler if one does not already exist. + */ + void CreateClientRequestHandlerL(); + + /** + * Finds unique widgets, configuration UIDs, from resource an array. + * @since S60 5.0.1 + * @param aAppODT is an instance of an application configuration ODT + * @param aUidArray holds found UIDs in an array + */ + void FindWidgetUidsL( + ChspsODT& aAppODT, + RArray& aUidArray ); + + /** + * Handles copying of widget resources to a destination folder. + * @since S60 5.0.1 + * @param aAppODT Application configuration + * @param aFilemanager File manager + * @param aConfUid Widget which is to be processed + * @param aDestination Target path where the files should be copied to + */ + TInt DoCopyResourceFilesL( + ChspsODT& aAppODT, + CFileMan& aFilemanager, + const TInt aConfUid, + const TDesC& aDestination ); + +private: + RFs iFs; + ChspsInstallationHandler* iInstallationHandler; + ChspsMaintenanceHandler* iMaintenanceHandler; + ChspsClientRequestHandler* iClientRequestHandler; + RMessagePtr2 iMessagePtr; + TBool iHoldingResources; + TInt iAppUid; + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //__hspsTHEMESERVERSESSION_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/inc/hspsuimanagererrorcodes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsuimanagererrorcodes.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2002-2004 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: Includes the error codes of UI Manager. +* +*/ + + +#ifndef __hspsUIMANAGERERRORCODES_H__ +#define __hspsUIMANAGERERRORCODES_H__ + +/** + * + * Error code definitions used in UI Manager + * + */ + + +// CONSTANTS +/** + * Wrong manifest file. + */ +const TInt KErrWrongManifestFile = -32274; + +/** + * Application UID element is not found from the manifest file. + */ +const TInt KErrAppUidDefinitionMissing = -32275; + +/** + * Provider UID element is not found from the manifest file. + */ +const TInt KErrProviderUidDefinitionMissing = -32276; + +/** + * Theme UID element is not found from the manifest file. + */ +const TInt KErrThemeUidDefinitionMissing = -32277; + +/** + * Parsing of the manifest file failed. + */ +const TInt KErrManifestFileCorrupted = -32278; + +/** + * Theme full name element not found from the manifest file. + */ +const TInt KErrThemeFullNameDefinitionMissing = -32279; + +/** + * Theme short name element not found from the manifest file. + */ +const TInt KErrThemeShortDefinitionNameMissing = -32280; + +/** + * Theme version element not found from the manifest file. + */ +const TInt KErrThemeVersionDefinitionMissing = -32281; + +/** + * The XML file name element not found from the manifest file. + */ +const TInt KErrXmlFileDefinitionMissing = -32282; + +/** + * The XML file not found. + */ +const TInt KErrXmlFileNotFound = -32283; + +/** + * The CSS file name element not found from the manifest file. + */ +const TInt KErrCssFileDefinitionMissing = -32284; + +/** + * The CSS file not found. + */ +const TInt KErrCssFileNotFound = -32285; + +/** + * The resource file not found. + */ +const TInt KErrResourceFileNotFound = -32286; + +/** + * The DTD file name element is not found from the main manifest file. + */ +const TInt KErrDtdFileNotFound = -32287; + +/** + * The application UID specified in the manifest file is not within + * the correct range (0x00000000 - 0xFFFFFFFF). + */ +const TInt KErrWrongAppUid = -32288; + +/** + * The installation is not allowed for some reason. + */ +const TInt KErrIllegalInstallation = -32289; + +/** + * The DAT file not found. + */ +const TInt KErrDatFileNotFound = -32290; + +/** + * The installation failed because there was a locked theme with + * the same identity on ROM. + */ +const TInt KErrThemeStatusLocked = -32291; + +/** + * The interface UID specified in the manifest file is not within + * the correct range (0x00000000 - 0xFFFFFFFF). + */ +const TInt KErrWrongIfUid = -32292; + +/** + * Unspecified Xuikon error. + */ +const TInt KErrOtherXuikonError = -322122; + + +#endif // __hspsUIMANAGERERRORCODES_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsautoinstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsautoinstaller.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,301 @@ +/* +* 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: Server side installation of SISX imports +* +*/ + + +#include "hsps_builds_cfg.hrh" + +#include + +#include "hspsthemeserver.h" +#include "hspsautoinstaller.h" +#include "hspsinstallationhandler.h" +#include "hspsmaintenancehandler.h" +#include "hspsuimanagererrorcodes.h" +#include "hspsodt.h" +#include "hspsresult.h" +#include "hspsthememanagement.h" + +_LIT( KThemeDirectory,"c:\\private\\200159c0\\themes\\"); +_LIT ( KDoubleBackSlash, "\\" ); + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +ChspsAutoInstaller* ChspsAutoInstaller::NewL( ChspsThemeServer& aThemeServer ) + { + ChspsAutoInstaller* self = NewLC( aThemeServer ); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +ChspsAutoInstaller* ChspsAutoInstaller::NewLC( ChspsThemeServer& aThemeServer ) + { + ChspsAutoInstaller* self = new ( ELeave ) ChspsAutoInstaller( aThemeServer ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsAutoInstaller::ConstructL() + { + iResult = ChspsResult::NewL(); + iInstallationHandler = ChspsInstallationHandler::NewL( iThemeServer ); + iMaintenanceHandler = ChspsMaintenanceHandler::NewL( iThemeServer ); + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::ChspsAutoInstaller() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +ChspsAutoInstaller::ChspsAutoInstaller( ChspsThemeServer& aThemeServer ) +: CActive( EPriorityStandard ), iThemeServer( aThemeServer ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::~ChspsAutoInstaller() +// Destructor. +// ----------------------------------------------------------------------------- +// +ChspsAutoInstaller::~ChspsAutoInstaller() + { + Cancel(); // Causes call to DoCancel() + delete iResult; + delete iInstallationHandler; + delete iMaintenanceHandler; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::UnInstallTheme +// Calls the ChspsMaintenanceHandler to remove theme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsAutoInstaller::UnInstallThemeL( const TDesC& aPathFile ) + { + // Strip app_/plugin_ prefix from the filename + TPtrC fixedName; + const TChar KCharUnderscore('_'); + TInt offset = aPathFile.Locate( KCharUnderscore ); + if( offset ) + { + TPtrC filePrefix( aPathFile.Left(offset+1) ); + fixedName.Set( aPathFile.Mid( filePrefix.Length() ) ); + } + if ( !fixedName.Length() ) + { + // TODO handle failure + iThemeServer.HandleAutoInstallerEvent( EhspsRemoveThemeFailed ); + return; + } + + TParsePtrC parsePtr( fixedName ); + TPtrC fileName( parsePtr.Name() ); + + HBufC* path = HBufC::NewLC( KMaxFileName ); + TPtr pathPtr( path->Des() ); + pathPtr.Append( KThemeDirectory ); + + // Generate a file path from the file name by replacing underscores with backslashes and + // by converting subdirectory names from hex format to int values + TLex lex( fileName ); + lex.Mark(); + while( !lex.Eos() ) + { + if( lex.Peek() == TChar( '_' ) ) + { + TPtrC token( lex.MarkedToken() ); + TLex tmp( token ); + + TInt64 val( 0 ); + tmp.Val( val, EHex ); + + pathPtr.AppendNum( val ); + lex.Inc(); + pathPtr.Append( KDoubleBackSlash ); + lex.Mark(); + } + else + { + lex.Inc(); + } + } + + // Last token is the theme version string + TPtrC token( lex.MarkedToken() ); + pathPtr.Append( token ); + pathPtr.Append( KDoubleBackSlash ); + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + + iThemeServer.DefinitionRepository().GetOdtHeaderL( pathPtr, ELangTest /* not used */, *odt ); + + ThspsServiceCompletedMessage ret = iMaintenanceHandler->hspsRemoveThemeL( *odt ); + + if( ret != EhspsRemoveThemeSuccess ) + { + // Use brute force to remove the theme. This should not happen + iThemeServer.DefinitionRepository().RemoveThemeL( *odt ); + } + + // It is success + iThemeServer.HandleAutoInstallerEvent( EhspsRemoveThemeSuccess ); + + CleanupStack::PopAndDestroy( 2, path ); // odt, path + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::InstallThemeL +// Calls the hspsInstallationHandlers hspsInstallTheme and hspsInstallNextPhase methods +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsAutoInstaller::InstallThemeL( const TDesC& aManifestFileName ) + { + ThspsServiceCompletedMessage ret = + iInstallationHandler->hspsInstallTheme( aManifestFileName, iHeaderData ); + + // without security check, EhspsInstallThemeSuccess is returned insteads of EhspsInstallPhaseSuccess +#ifndef __WINS__ + if ( !iInstallationHandler->CheckAutoInstallationValidityL() ) + { + iThemeServer.HandleAutoInstallerEvent( EhspsInstallThemeFailed ); + return KErrGeneral; + } +#endif + + if ( ret == EhspsInstallThemeSuccess && !IsActive() ) + { + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + } + else + { + if ( iInstallationHandler->iResult->iXuikonError == KErrXmlFileNotFound + || iInstallationHandler->iResult->iXuikonError == KErrCssFileNotFound + || iInstallationHandler->iResult->iXuikonError == KErrDtdFileNotFound + || iInstallationHandler->iResult->iXuikonError == KErrResourceFileNotFound ) + { + return KErrNotFound; + } + iThemeServer.HandleAutoInstallerEvent( EhspsInstallThemeFailed ); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::SetLogBus() +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsAutoInstaller::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + iInstallationHandler->SetLogBus( aLogBus ); + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsRequestClient::GethspsResultL +// Gets the installation result status +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ChspsResult& ChspsAutoInstaller::hspsResult() + { + return *iInstallationHandler->iResult; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::RunError +// From CActive. Called when error occurred in asynchronous request +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsAutoInstaller::RunError( TInt /*aError*/ ) + { + iThemeServer.HandleAutoInstallerEvent( EhspsServiceRequestError ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::RunL() +// From CActive. Called when asynchronous request is completed. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsAutoInstaller::RunL() + { + switch ( iStatus.Int() ) + { + case EhspsInstallThemeSuccess: + { + iThemeServer.HandleAutoInstallerEvent( EhspsInstallThemeSuccess ); + } + break; + + case EhspsInstallPhaseSuccess: + { + iThemeServer.HandleAutoInstallerEvent( EhspsInstallPhaseSuccess ); + // it cannot be active anymore in here, however.. + if ( !IsActive() ) + { + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + } + else + { + iThemeServer.HandleAutoInstallerEvent( EhspsInstallThemeFailed ); + } + } + break; + + default: + { + iThemeServer.HandleAutoInstallerEvent( (ThspsServiceCompletedMessage)iStatus.Int() ); + } + break; + } + } + +// ----------------------------------------------------------------------------- +// ChspsAutoInstaller::DoCancel() +// Cancels any outstanding operation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsAutoInstaller::DoCancel() + { + // nothing to do + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsbrhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsbrhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,219 @@ +/* +* 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: Implementation of CHSPSBRHandler class +* +*/ + + +#include "hspsbrhandler.h" +#include "hspsthemeserver.h" + + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// CHSPSBRHandler::CHSPSBRHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CHSPSBRHandler::CHSPSBRHandler( ChspsThemeServer& aServer ): + iServer( aServer ) + { + } + +// ----------------------------------------------------------------------------- +// CHSPSBRHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHSPSBRHandler::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CHSPSBRHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CHSPSBRHandler* CHSPSBRHandler::NewL( ChspsThemeServer& aServer ) + { + CHSPSBRHandler* self = new( ELeave ) CHSPSBRHandler( aServer ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CHSPSBRHandler::~CHSPSBRHandler() + { + } + +// --------------------------------------------------------- +// CHSPSBRHandler::AllSnapshotsSuppliedL +// --------------------------------------------------------- +// +void CHSPSBRHandler::AllSnapshotsSuppliedL() + { + // No implementation needed. Must not leave + } + +// --------------------------------------------------------- +// CHSPSBRHandler::ReceiveSnapshotDataL +// --------------------------------------------------------- +// +void CHSPSBRHandler::ReceiveSnapshotDataL( + TDriveNumber /* aDrive */, + TDesC8& /* aBuffer */, + TBool /* aLastSection */ ) + { + // No implementation needed + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------- +// CHSPSBRHandler::GetExpectedDataSize +// --------------------------------------------------------- +// +TUint CHSPSBRHandler::GetExpectedDataSize( + TDriveNumber /* aDrive */) + { + // No implementation needed + return 0; + } + +// --------------------------------------------------------- +// CHSPSBRHandler::GetSnapshotDataL +// --------------------------------------------------------- +// +void CHSPSBRHandler::GetSnapshotDataL( + TDriveNumber /* aDrive */, + TPtr8& /* aBuffer */, + TBool& /* aFinished */) + { + // No implementation needed + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------- +// CHSPSBRHandler::InitialiseGetBackupDataL +// --------------------------------------------------------- +// +void CHSPSBRHandler::InitialiseGetBackupDataL( + TDriveNumber aDrive ) + { + if( aDrive == EDriveC ) + { + // Prepare backup data for passive backup + iServer.CreateBackupDataL(); + } + } + +// --------------------------------------------------------- +// CHSPSBRHandler::GetBackupDataSectionL +// --------------------------------------------------------- +// +void CHSPSBRHandler::GetBackupDataSectionL( + TPtr8& /*aBuffer*/, + TBool& aFinished ) + { + // No data for active backup + aFinished = ETrue; + } + +// --------------------------------------------------------- +// CHSPSBRHandler::InitialiseRestoreBaseDataL +// --------------------------------------------------------- +// +void CHSPSBRHandler::InitialiseRestoreBaseDataL( + TDriveNumber /* aDrive */ ) + { + // No implementation needed + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------- +// CHSPSBRHandler::RestoreBaseDataSectionL +// Create the files where the restore is performed from +// --------------------------------------------------------- +// +void CHSPSBRHandler::RestoreBaseDataSectionL( + TDesC8& /*aBuffer*/, + TBool /*aFinished*/ ) + { + // No implementation needed + } + +// --------------------------------------------------------- +// CHSPSBRHandler::InitialiseRestoreIncrementDataL +// --------------------------------------------------------- +// +void CHSPSBRHandler::InitialiseRestoreIncrementDataL( + TDriveNumber /*aDrive*/ ) + { + // No implementation needed + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------- +// CHSPSBRHandler::RestoreIncrementDataSectionL +// --------------------------------------------------------- +// +void CHSPSBRHandler::RestoreIncrementDataSectionL( + TDesC8& /*aBuffer*/, + TBool /*aFinished*/ ) + { + // No implementation needed + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------- +// CHSPSBRHandler::RestoreComplete +// --------------------------------------------------------- +// +void CHSPSBRHandler::RestoreComplete( + TDriveNumber /*aDrive*/ ) + { + // No implementation needed + } + +// --------------------------------------------------------- +// CHSPSBRHandler::TerminateMultiStageOperation +// --------------------------------------------------------- +// +void CHSPSBRHandler::TerminateMultiStageOperation() + { + // No implementation needed + } + +// --------------------------------------------------------- +// CHSPSBRHandler::GetDataChecksum +// --------------------------------------------------------- +// +TUint CHSPSBRHandler::GetDataChecksum( + TDriveNumber /* aDrive */) + { + // No implementation needed + return 0; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsbrobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsbrobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,154 @@ +/* +* 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: Implementation of CHSPSBRObserver class +* +*/ + + +#include +#include "hspsbrobserver.h" +#include "hspsthemeserver.h" + + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::CHSPSBRObserver +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CHSPSBRObserver::CHSPSBRObserver( ChspsThemeServer& aServer ): + CActive(CActive::EPriorityStandard), + iServer( aServer ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHSPSBRObserver::ConstructL() + { + User::LeaveIfError( iProperty.Attach( + KUidSystemCategory, + conn::KUidBackupRestoreKey ) ); + } + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CHSPSBRObserver* CHSPSBRObserver::NewL( ChspsThemeServer& aServer ) + { + CHSPSBRObserver* self = new( ELeave ) CHSPSBRObserver( aServer ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CHSPSBRObserver::~CHSPSBRObserver() + { + Cancel(); + iProperty.Close(); + } + + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::Start +// Start the system agent to listen to the event +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CHSPSBRObserver::Start() + { + Cancel(); + iProperty.Subscribe( iStatus ); + SetActive(); + } + + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::RunError +// ----------------------------------------------------------------------------- +// +TInt CHSPSBRObserver::RunError(TInt aError) + { + if( aError != KErrCancel ) + { + Start(); + } + else + { + Cancel(); + iProperty.Close(); + } + return KErrNone; + }; + + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::RunL +// from CActive +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CHSPSBRObserver::RunL() + { + // Resubscribe before processing new value to prevent missing updates + TInt backupStatus = 0; + TInt err( iStatus.Int() ); + if ( err == KErrNone ) + { + Start(); + User::LeaveIfError( iProperty.Get( + KUidSystemCategory, + conn::KUidBackupRestoreKey, backupStatus ) ); + // Forward backup status to listening server + iServer.HandleBREventL( backupStatus ); + } + else if ( err != KErrCancel ) // Ignore all errors except cancel + { + Start(); + } + else // When cancel occurs, stop everything + { + User::Leave( KErrCancel ); + } + } + +// ----------------------------------------------------------------------------- +// CHSPSBRObserver::DoCancel +// From CActive +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CHSPSBRObserver::DoCancel() + { + iProperty.Cancel(); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspscenreplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspscenreplistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2002-2004 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: CenRepListener listens to given Central Repository setting id and notifies its +* observer if there is any change. +* +* +*/ + + +#include "hspscenreplistener.h" + +#include "hsps_builds_cfg.hrh" +#include +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsCenRepListener::ChspsCenRepListener +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsCenRepListener::ChspsCenRepListener( MhspsCenRepObserver& aObserver, + const TUid& aRepositoryUid ) : + CActive( EPriorityStandard ), + iObserver( aObserver ), + iRepositoryUid( aRepositoryUid ) + { + } + +// ----------------------------------------------------------------------------- +// ChspsCenRepListener::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsCenRepListener::ConstructL() + { + iRepository = CRepository::NewL( iRepositoryUid ); + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ChspsCenRepListener::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsCenRepListener* ChspsCenRepListener::NewL( MhspsCenRepObserver& aObserver, + const TUid& aRepositoryUid ) + { + ChspsCenRepListener* self = new(ELeave) ChspsCenRepListener( aObserver, + aRepositoryUid ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ------------------------------------------------------------------------------ +// ChspsCenRepListener::~ChspsCenRepListener +// +// ------------------------------------------------------------------------------ +// +ChspsCenRepListener::~ChspsCenRepListener() + { + Cancel(); + delete iRepository; + } + +// ----------------------------------------------------------------------------- +// ChspsCenRepListener::RunL +// From CActive. Called when asynchronous request is completed. +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsCenRepListener::RunL() + { + TUint32 status = static_cast( iStatus.Int() ); + iObserver.HandleCenRepChangeL( status ); + } + +// ----------------------------------------------------------------------------- +// ChspsCenRepListener::DoCancel +// From CActive. Called when asynchronous request is canceled +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsCenRepListener::DoCancel() + { + if( IsActive() ) + { + iRepository->NotifyCancelAll(); + } + } + +// ------------------------------------------------------------------------------ +// ChspsCenRepListener::Setup +// Sets up the listener to listen to changes in Central Repository setting aId +// (other items were commented in a header). +// ------------------------------------------------------------------------------ +// +void ChspsCenRepListener::Setup( TUint32 aId ) + { + if( !IsActive() ) + { + iRepository->NotifyRequest( aId, iStatus ); + iRepositoryUid.iUid = aId; + SetActive(); + } + } + +// ------------------------------------------------------------------------------ +// ChspsCenRepListener::SetupAll +// Sets up the listener to listen to changes in Central Repository for all settings +// (other items were commented in a header). +// ------------------------------------------------------------------------------ +// +void ChspsCenRepListener::SetupAll() + { + if( !IsActive() ) + { + TInt err = iRepository->NotifyRequest( 0x00000000,0x00000000, iStatus ); + SetActive(); + } + } + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsclientrequesthandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1568 @@ +/* +* 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: Retrieves configurations from the Definition Repository +* +*/ + + +#include "hsps_builds_cfg.hrh" + +#include +#include +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +#include "hspsresource.h" +#include "hspsdomdocument.h" +#include "hspsdomnode.h" +#include "hspsthememanagement.h" +#include "hspsdefinitionrepository.h" +#include "hspsodt.h" +#include "hspsresult.h" +#include "hspsreqnotifparam.h" +#ifdef _hsps_PERFORMANCE_TEST_ +#include "hspstimemon.h" +#endif +#include "hspsclientrequesthandler.h" +#include "hspsmaintenancehandler.h" +#include "hspssecurityenforcer.h" +#include "hspsthemeserver.h" +#include "hspscenreplistener.h" +#include "hspsserverutil.h" +#include "hspsdomattribute.h" +#include "hspsdomlist.h" +#include "hspsdomdepthiterator.h" +#include "hspsdomnode.h" +#include "hspsconfiguration.h" + + +_LIT(KSourcesSubFolder, "\\sources\\"); +_LIT(KLocalesSubFolder, "\\locales\\"); + + + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Callback function for removing repository lock if error occurs while repository is locked +// Returns: void +// ----------------------------------------------------------------------------- +// +LOCAL_C void UnlockRepository( TAny* aObject ) + { + ChspsDefinitionRepository* DefRep = reinterpret_cast( aObject ); + + if( DefRep->Locked() ) + { + DefRep->Unlock(); + } + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::ChspsClientRequestHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsClientRequestHandler::ChspsClientRequestHandler( ChspsThemeServer& aThemeServer ): + iThemeServer( aThemeServer ), + iCentralRepository( aThemeServer.CentralRepository() ), + iDefinitionRepository( aThemeServer.DefinitionRepository() ), + iSecurityEnforcer( aThemeServer.SecurityEnforcer() ), + iHeaderListCache (aThemeServer.HeaderListCache() ) + { + iLastSuccessThemeLoadTime = 0; + iRestoreDefault = EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsClientRequestHandler* ChspsClientRequestHandler::NewL( ChspsThemeServer& aThemeServer ) + { + ChspsClientRequestHandler* h = ChspsClientRequestHandler::NewLC( aThemeServer ); + CleanupStack::Pop(h); + return (h); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsClientRequestHandler* ChspsClientRequestHandler::NewLC( ChspsThemeServer& aThemeServer ) + { + ChspsClientRequestHandler* h = new (ELeave) ChspsClientRequestHandler( aThemeServer ); + CleanupStack::PushL(h); + h->ConstructL(); + return (h); + } + +// Destructor +ChspsClientRequestHandler::~ChspsClientRequestHandler() + { + delete iOdt; + delete iResult; + delete iReqNotifParams; + delete iRequestData; + iFs.Close(); + delete iCenRepListener; + iDefinitionRepository.UnregisterObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::ConstructL() + { + // call the base class ConstructL + User::LeaveIfError(iFs.Connect()); + iResult = ChspsResult::NewL(); + iReqNotifParams = ChspsRequestNotificationParams::NewL(); + iDefinitionRepository.RegisterObserverL( *this ); + iCenRepListener = NULL; + + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::ServiceGetOdtL +// Serves hspsRequestClient on hspsGetODT() service call. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::ServiceGetOdtL(const RMessage2& aMessage) + { + iThemeLoadRepeatCount = 0; + TInt errorCode = KErrNone; + RMessagePtr2 msgPtr = aMessage; + // Get configuration from IPC slot #1 + ThspsConfiguration configuration; + TPckg packagedStruct(configuration); + aMessage.ReadL(1, packagedStruct); + iRootUid = configuration.rootUid; + iSecureId = msgPtr.SecureId().iId; + iRequestMessage = (ThspsServiceRequestMessage) aMessage.Function(); + + // Get header data from IPC slot #2 + TBuf8 requestData; + msgPtr.ReadL( 2, requestData, 0 ); + ThspsServiceCompletedMessage ret = EhspsGetODTFailed; + + // resetting previous request objects + if ( iRequestData ) + { + delete iRequestData; + iRequestData = NULL; + } + + // constructing new data request objects + iRequestData = requestData.AllocL(); + + // reset previous ODT + if ( iOdt ) + { + delete iOdt; + iOdt = NULL; + } + + // constructing new ODT + iOdt = ChspsODT::NewL(); + iOdt->UnMarshalHeaderL( iRequestData->Des() ); + + TBool err = EFalse; + + if ( !iRootUid ) + { + err = ETrue; + iResult->iSystemError = KErrInUse; + CompleteRequestL( EhspsServiceRequestError, msgPtr ); + } + + if ( !err ) + { + // Get configuration: 1st attempt + ret = hspsGetODT(iRootUid, *iOdt ); + + // If fetching failed + if ( ret != EhspsGetODTSuccess ) + { + // If not restoring yet + if ( iRestoreDefault ) + { + // Restore a default configuration + TRAP( errorCode, RestoreDefaultL( *iOdt ) ); + if ( !errorCode ) + { + // 2nd attempt: try to fetch the default configuration + ret = hspsGetODT(iRootUid, *iOdt ); + if ( ret != EhspsGetODTSuccess ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetODTL(): - default theme for appuid %d is not available." ), + iOdt->RootUid() ); + } +#endif + CompleteRequestL( EhspsGetODTFailed, msgPtr ); + } + } // !errorCode + } // iRestoreDefault + } // !EhspsGetODTSuccess + + // If a configuration was found (either after the first attempt or after restoring the default configuration) + if ( ret == EhspsGetODTSuccess ) + { + // If an application configuration was fetched + if ( iOdt->ConfigurationType() == EhspsAppConfiguration ) + { + // Finnish installation of the application configuration + HandlePluginReferencesL( *iOdt ); + } + + // write ODT-file path back to the client for theme load + msgPtr.WriteL( 3, iODTPath, 0 ); + CompleteRequestL( ret, msgPtr ); + } // success + else + { + if ( !iHeaderListCache.Count() ) + { + // header list cache is empty. This may also occur when memory is full +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetODTL(): - theme cache is empty." ) ); + } +#endif + CompleteRequestL( EhspsGetODTFailed, msgPtr ); + } + else if ( iRestoreDefault ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetODTL(): - default theme cannot be restored." ) ); + } +#endif + CompleteRequestL( EhspsGetODTFailed, msgPtr ); + } + else if ( iDefinitionRepository.Locked() ) + { + // possible repository lock, wait for checking the theme availability after a while +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetODTL(): - theme repository is locked, trying again after reasonable time .." ) ); + } +#endif + CompleteRequestL( EhspsGetODTFailed, msgPtr ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetODTL(): - theme load failed." ) ); + } +#endif + CompleteRequestL( EhspsGetODTFailed, msgPtr ); + } + } // else (!EhspsGetODTSuccess) + } // !err + + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandlePluginReferencesL() +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::HandlePluginReferencesL( + ChspsODT& aAppODT ) + { + // Input validation + if ( aAppODT.ConfigurationType() != EhspsAppConfiguration ) + { + User::Leave( KErrGeneral ); + } + + // Assume that plugins need to be added + TBool addPlugins = ETrue; + + // Check whether the plugins needs to be added + ChspsDomDocument& appDom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *appDom.RootNode() ); + CleanupStack::PushL( iter ); + ChspsDomNode* prevNode = NULL; + ChspsDomNode* node = iter->First(); + TInt tempCount = 0; + while( node && prevNode != node && addPlugins ) + { + const TDesC8& name = node->Name(); + if ( name == KConfigurationElement ) + { + tempCount++; + if ( tempCount > 1 ) + { + addPlugins = EFalse; + } + } + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + // If plugin configurations need to be added + if ( addPlugins ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository was locked by another session?! + User::Leave( KErrAccessDenied ); + } + + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Go through the XML document, find all plugin nodes and append plugin specifc XML configurations + AppendPluginConfigurationsL( aAppODT ); + + //Append widget instance specific predefined settings + User::LeaveIfError( AppendInitialSettingsL( aAppODT )); + + // Set first plugin nodes from levels to be active. Others are to be deactivated. + hspsServerUtil::EditPluginNodeActivityL( aAppODT.DomDocument().RootNode(), + hspsServerUtil::EActivateFirst ); + + // Update changes into the Plug-in Repository + User::LeaveIfError( iDefinitionRepository.SetOdtL( aAppODT ) ); + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandlePluginReferencesL(): - dumping updated full XML document" ) ); + ChspsOdtDump::Dump( aAppODT, *iLogBus ); + } +#endif + } + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::AddErrorConfigurationL() +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::AddErrorConfigurationL( + ChspsDomDocument& aAppDom, + ChspsDomNode& aMissingPluginNode, + const TInt aPluginUid + ) + { + // Create a new dummy configuration element + ChspsDomNode* confNode = aAppDom.CreateElementNSL( + KConfigurationElement, + aMissingPluginNode.Namespace() + ); + CleanupStack::PushL( confNode ); + + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrType, KConfTypeWidget ); + _LIT8( KUnknown, "unknown" ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrInterface, KUnknown ); + hspsServerUtil::AddAttributeNumericL( *confNode, KConfigurationAttrUid, aPluginUid, EHex ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrName, KUnknown ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrNameEntity, KUnknown ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrVersion, KUnknown ); + hspsServerUtil::AddAttributeNumericL( *confNode, KConfigurationAttrMaxChild, 0, EDecimal ); + + // Indicate that the configuration is in error state + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrState, KConfStateError ); + + // Set parent node + aMissingPluginNode.AddChildL( confNode ); + CleanupStack::Pop( confNode ); + confNode->SetParent( &aMissingPluginNode ); + + // Mandatory configuration-control node + ChspsDomNode* controlNode = aAppDom.CreateElementNSL( + KControlElement, + confNode->Namespace() + ); + CleanupStack::PushL( controlNode ); + confNode->AddChildL( controlNode ); + CleanupStack::Pop( controlNode ); + controlNode->SetParent( confNode ); + + // Mandatory configuration-control-settings node + ChspsDomNode* settingsNode = aAppDom.CreateElementNSL( + KSettingsElement, + controlNode->Namespace() + ); + CleanupStack::PushL( settingsNode ); + controlNode->AddChildL( settingsNode ); + CleanupStack::Pop( settingsNode ); + settingsNode->SetParent( controlNode ); + + // Mandatory configuration-resources node + ChspsDomNode* resourcesNode = aAppDom.CreateElementNSL( + KResourcesElement, + confNode->Namespace() + ); + CleanupStack::PushL( resourcesNode ); + confNode->AddChildL( resourcesNode ); + CleanupStack::Pop( resourcesNode ); + resourcesNode->SetParent( confNode ); + + } + + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::PrepareAndCompleteRequestL() +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::PrepareAndCompleteRequestL( const ThspsRepositoryInfo& aInfo, + const ThspsServiceCompletedMessage& aMessage ) + { + TBool LastDefinitionRepositoryEvent(ETrue); + if( !iReqNotifParams ) + { + User::Leave( KErrCorrupt ); + } + if( !aInfo.iLastNotification ) + { + LastDefinitionRepositoryEvent = EFalse; + } + + // Prepare request notification object. + if(iReqNotifParams->iEvent == EhspsNoEvent || iReqNotifParams->iEvent == aInfo.iEventType ) + { + iReqNotifParams->iEvent = aInfo.iEventType; + iReqNotifParams->iAppUid = aInfo.iAppUid; + iReqNotifParams->iAppConfUid = aInfo.iAppConfUid; + iReqNotifParams->iOrigUid = aInfo.iSecureId; + iReqNotifParams->iPluginUid = aInfo.iPluginUid; + iReqNotifParams->iCount++; + iReqNotifParams->iPluginIds.Append( aInfo.iPluginId ); + + if( aInfo.iName.Length() > 0 ) + { + iReqNotifParams->SetNameL( aInfo.iName ); + } + } + if( LastDefinitionRepositoryEvent ) + { + // Externalize request notification object to message structure. + TInt errorCode = KErrNone; + RDesWriteStream writeBuf( iReqNotifData ); + CleanupClosePushL( writeBuf ); + TRAP( errorCode, iReqNotifParams->ExternalizeL( writeBuf ) ); + CleanupStack::PopAndDestroy(); + + if ( !iMessagePtr.IsNull() ) + { + if ( errorCode ) + { + iMessagePtr.WriteL( 1, KNullDesC8, 0 ); + } + else + { + iMessagePtr.WriteL( 1, iReqNotifData, 0 ); + } + } + // theres no request message pending until request new one + iRequestMessage = EhspsClientRequestBase; + // Send message. + CompleteRequestL( aMessage, iMessagePtr ); + + iReqNotifParams->ResetData(); + + } + + + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::AppendPluginConfigurationsL() +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::AppendPluginConfigurationsL( + ChspsODT& aAppODT ) + { + ChspsDomDocument& appDom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *appDom.RootNode() ); + CleanupStack::PushL( iter ); + + // Each configuration element get's an unique id value - same applies to the plugin elements. + // The ids are then used for referencing a specific configuration or plug-in instance + // in the whole application configuration + TInt confId = 0; + TInt pluginId = 0; + + ChspsDomNode* prevNode = NULL; + ChspsDomNode* node = iter->First(); + while( node && prevNode != node ) + { + + const TDesC8& name = node->Name(); + + // Configuration element + if ( name == KConfigurationElement ) + { + // Generate an ID attribute for the configuration element + confId++; + hspsServerUtil::AddAttributeNumericL( *node, KConfigurationAttrId, confId ); + } + + // Plugin element + else if ( name == KPluginElement ) + { + // Check parent element + ChspsDomNode* parentNode = node->Parent(); + const TDesC8& parentName = parentNode->Name(); + if( parentName == KPluginsElement ) + { + ChspsDomList& attrList = node->AttributeList(); + + // Get configuration attribute from the plugin configuration + ChspsDomAttribute* pluginUidAttr = + static_cast ( attrList.FindByName(KPluginAttrUid) ); + if( !pluginUidAttr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::AppendPluginConfigurationsL(): - Invalid XML" ) ); + } +#endif + + User::Leave( KErrCorrupt ); + } + + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid pluginUid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + + // Get plugin configuration + ChspsODT* pluginOdt = ChspsODT::NewL(); + const TInt interfaceUid = 0; + CleanupStack::PushL( pluginOdt ); + iThemeServer.GetConfigurationL( + interfaceUid, + pluginUid.iUid, + *pluginOdt + ); + if ( !pluginOdt || !pluginOdt->ThemeUid() ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::AppendPluginConfigurationsL(): - Failed to find plugin uid %d" ), + pluginUid.iUid ); + } +#endif + + // Append an empty configuration with error status + AddErrorConfigurationL( + appDom, + *node, + pluginUid.iUid ); + + // Generate an ID attribute for the plugin element + pluginId++; + hspsServerUtil::AddAttributeNumericL( *node, KPluginAttrId, pluginId ); + } + else + { + // Generate an ID attribute for the plugin element + pluginId++; + hspsServerUtil::AddAttributeNumericL( *node, KPluginAttrId, pluginId ); + + // Copy plug-in resources to the application configuration + TInt resourceCount = pluginOdt->ResourceCount(); + for ( TInt index=0; index < resourceCount; index++ ) + { + ChspsResource* pluginResource = &pluginOdt->ResourceL(index); + + // Add only those that are located under the sources or locales folder + if ( pluginResource->FileName().FindF( KSourcesSubFolder ) > 0 + || pluginResource->FileName().FindF( KLocalesSubFolder ) > 0 ) + { + ChspsResource* r = pluginResource->CloneL(); + CleanupStack::PushL( r ); + aAppODT.AddResourceL( r ); + CleanupStack::Pop( r ); + } + } + + ChspsDomDocument& document = pluginOdt->DomDocument(); + if ( !document.RootNode() ) + { + User::Leave( KErrGeneral ); + } + + // Find the KConfigurationElement to step over any optional xml elements + ChspsDomDepthIterator* pluginIter = ChspsDomDepthIterator::NewL( *document.RootNode() ); + CleanupStack::PushL( pluginIter ); + ChspsDomNode* pluginNode = pluginIter->First(); + TBool steppingtoConfNode(EFalse); + while(pluginNode && !steppingtoConfNode) + { + const TDesC8& pluginNodeName = pluginNode->Name(); + + if( pluginNodeName == KConfigurationElement ) + { + steppingtoConfNode=ETrue; + } + else + { + pluginNode = pluginIter->NextL(); + } + } + CleanupStack::PopAndDestroy( pluginIter ); + + // Copy the plugin configuration to the main document. + ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); + rootCopy->SetParent( node ); + node->AddChildL( rootCopy ); + } // !pluginOdt else + + CleanupStack::PopAndDestroy( pluginOdt ); + } // KPluginsElement + } + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + } +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::AppendInitialSettingsL() +// ----------------------------------------------------------------------------- +// +TInt ChspsClientRequestHandler::AppendInitialSettingsL( + ChspsODT& aAppODT ) + { + ChspsDomDocument& appDom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *appDom.RootNode() ); + CleanupStack::PushL( iter ); + + TInt error = KErrNone; + + ChspsDomNode* prevNode = NULL; + ChspsDomNode* parentNode = NULL; + ChspsDomNode* node = iter->First(); + while( node && error == KErrNone && prevNode != node) + { + + if( prevNode ) + { + const TDesC8& prevNodeName = prevNode->Name(); + if( prevNodeName == KInitialSettingsElement ) + { + // clean initial_settings + parentNode = prevNode->Parent(); + parentNode->ChildNodes().RemoveItem(prevNode); + delete prevNode; + prevNode = NULL; + } + } + + const TDesC8& name = node->Name(); + + // Initial settings + if ( name == KInitialSettingsElement ) + { + // Check parent element + parentNode = node->Parent(); + const TDesC8& parentName = parentNode->Name(); + + if( parentName == KPluginElement ) + { + ChspsDomList& initial_settings_childList = node->ChildNodes(); + + ChspsDomNode* initialSettingsNode = static_cast(initial_settings_childList.FindByName( KSettingsElement )); + + ChspsDomList& initial_items = initialSettingsNode->ChildNodes(); + + ChspsDomNode* controlNode = hspsServerUtil::FindNodeByTagL(KControlElement, *parentNode ); + + if( controlNode ) + { + ChspsDomList& controlNode_childList = controlNode->ChildNodes(); + + ChspsDomNode* settingsNode = static_cast(controlNode_childList.FindByName( KSettingsElement )); + + if( settingsNode ) + { + ChspsDomList& items = settingsNode->ChildNodes(); + + if( items.Length() == initial_items.Length() ) + { + TInt index = controlNode->ItemIndex( *settingsNode ); + controlNode->DeleteChild(settingsNode); + ChspsDomNode* clone = initialSettingsNode->CloneL( aAppODT.DomDocument().StringPool() ); + CleanupStack::PushL( clone ); + controlNode->AddChildL( clone, index ); + clone->SetParent( controlNode ); + CleanupStack::Pop( clone ); + } + else if( items.Length() > initial_items.Length() ) + { + error = ParseInitialSettingsItemsL(*initialSettingsNode,*settingsNode); + } + else + { + error = KErrCorrupt; + } + } + else + { + error = KErrNotFound; + } + } + else + { + error = KErrCorrupt; + } + // clean settings under initialsettings + node->ChildNodes().RemoveItem( initialSettingsNode ); + delete initialSettingsNode; + initialSettingsNode = NULL; + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + return error; + + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::ParseInitialSettingsItems +// ----------------------------------------------------------------------------- +// +TInt ChspsClientRequestHandler::ParseInitialSettingsItemsL(ChspsDomNode& aInitialSettingsNode,ChspsDomNode& aSettingsNode) + { + TInt error(KErrNone); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aInitialSettingsNode ); + CleanupStack::PushL( iter ); + + ChspsDomNode* sourceNode = iter->First(); + + ChspsDomNode* prevSourceNode = NULL; + ChspsDomNode* targetNode = NULL; + + while( sourceNode && error == KErrNone && sourceNode != prevSourceNode ) + { + const TDesC8& s_name = sourceNode->Name(); + + if ( s_name == KItemElement ) + { + ChspsDomList& s_attrList = sourceNode->AttributeList(); + + ChspsDomAttribute* s_itemIdAttr = + static_cast ( s_attrList.FindByName(KItemAttrId) ); + if( s_itemIdAttr ) + { + targetNode = &( FindRootNodeByIdentifierL( KItemElement, s_itemIdAttr->Value(), aSettingsNode )); + + if( targetNode ) + { + if( HandlePropertyNodeL( *sourceNode, *targetNode) != KErrNone ) + { + error = KErrNotFound; + } + } + else + { + error = KErrNotFound; + } + } + else + { + error = KErrCorrupt; + } + } + prevSourceNode = sourceNode; + sourceNode = iter->NextL(); + } + + CleanupStack::PopAndDestroy( iter ); + return error; + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandlePropertyNodeL +// ----------------------------------------------------------------------------- +TInt ChspsClientRequestHandler::HandlePropertyNodeL( + ChspsDomNode& aSourceItemNode, ChspsDomNode& aTargetItemNode ) + { + + TInt error(KErrNone); + + TInt propertiesCount = (aSourceItemNode.ChildNodes()).Length(); + + if ( propertiesCount > 0 ) + { + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aSourceItemNode ); + CleanupStack::PushL( iter ); + + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + + // Find items for plugin settings + while( node && error == KErrNone && node != prevNode ) + { + const TDesC8& name = node->Name(); + + if ( name == KPropertyElement ) + { + ChspsDomList& attrList = node->AttributeList(); + + ChspsDomAttribute* nameAttr = static_cast ( attrList.FindByName(KPropertyAttrName) ); + ChspsDomAttribute* valueAttr = static_cast ( attrList.FindByName(KPropertyAttrValue) ); + + if( nameAttr && valueAttr ) + { + const TDesC8& propertyName = nameAttr->Value(); + const TDesC8& propertyValue = valueAttr->Value(); + + error = HandlePropertyAttributesL(propertyName, propertyValue, aTargetItemNode ); + + } + else + { + error = KErrCorrupt; + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + else + { + error=KErrNotFound; + } + + return error; + + } +//----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandlePropertyAttributesL +// ----------------------------------------------------------------------------- +// +TInt ChspsClientRequestHandler::HandlePropertyAttributesL( + const TDesC8& aAttrName, + const TDesC8& aAttrValue, + ChspsDomNode& aNode ) + { + + + TInt error(KErrNotFound); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + TBool replaced(EFalse); + + while( node && !replaced ) + { + const TDesC8& nodeName = node->Name(); + if( nodeName == KPropertyElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPropertyAttrName) ); + if ( attr ) + { + const TDesC8& name = attr->Value(); + if (aAttrName.Compare( name )== 0 ) + { + ChspsDomAttribute* attr2 = static_cast( attrList.FindByName(KPropertyAttrValue) ); + if( attr2 ) + { + attr2->SetValueL( aAttrValue ); + replaced=ETrue; + error = KErrNone; + } + } + } + } + if( !replaced ) + { + node = iter->NextL(); + } + } + + CleanupStack::PopAndDestroy( iter ); + + return error; + + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::FindRootNodeByIdentifierL +// ----------------------------------------------------------------------------- +ChspsDomNode& ChspsClientRequestHandler::FindRootNodeByIdentifierL( + const TDesC8& aNodeTag, + const TDesC8& aNodeIdentifier, + ChspsDomNode& aNode ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* targetNode( NULL ); + ChspsDomNode* node = iter->First(); + TBool found = EFalse; + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( aNodeTag ) == 0) + { + ChspsDomList& attrList = node->AttributeList(); + + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( KItemAttrId )); + const TDesC8& value = attr->Value(); + if( value.Compare( aNodeIdentifier ) == 0 ) + { + found = ETrue; + targetNode = node; + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + return *targetNode; + } +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::ServiceGetOdtUpdateL +// Serves hspsRequestClient on hspsGetODTUpdate() service call. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::ServiceGetOdtUpdateL(const RMessage2& aMessage) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceGetOdtUpdateL(): - subscription received." ) ); + } +#endif + // only allow one request to be submitted at a time and request must be valid + + if( iMessagePtr.IsNull() ) + { + iMessagePtr = aMessage; + iRequestMessage = (ThspsServiceRequestMessage)aMessage.Function(); + if ( !iCenRepListener ) + { + iCenRepListener = ChspsCenRepListener::NewL( *this, KhspsThemeStatusRepositoryUid ); + } + iCenRepListener->Setup( iOdt->RootUid() ); + } + else + { + CompleteRequestL(EhspsServiceRequestError, iMessagePtr ); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::ServiceAccessResourceFileL +// Serves hspsRequestClient on hspsAccessResourceFile() service call. +// Allows synchronic request to be submitted even if there is a asynchronous request outstanding. +// This function should return a file handle to a file in its private area +// in the parameter fileSubSessionHandle +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::ServiceAccessResourceFileL(const RMessage2& aMessage) + { + // incoming data: TIpcArgs: &iReturnData, aAppUid, &aFileName, &fileSubSessionHandle + TInt errorCode = KErrNone; + + // Read packaged structure from slot 1 + ThspsConfiguration configuration; + TPckg packagedStruct(configuration); + aMessage.ReadL(1, packagedStruct); + + // Read packaged file name from slot 2 + TFileName filename; + RMessagePtr2 messagePtr = aMessage; + aMessage.ReadL( 2, filename, 0 ); //file to open is in param slot 2 +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceAccessResourceFileL(): - %S" ), + &filename ); + } +#endif + + // file server session and file to share to client + RFile file; + errorCode = iFs.ShareProtected(); + errorCode = file.Open(iFs, filename, EFileShareReadersOnly ); + CleanupClosePushL( file ); + + // transfer the file to the client in parameter 3 of the IPC message + if ( !errorCode ) + { + // client takes care of it from now on + errorCode = file.TransferToClient(aMessage,3); + } + else + { + // MARKMOIL 14.1.2006: + // Make sure that cache is up to date. This is actually needed in emulator only + // because of possible manually altered repository content by a user; + // user has removed a theme or resource. But next try should provide a better result. +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::ServiceAccessResourceFileL(): - cannnot access file, restoring default.." ) ); + } +#endif + + //RestoreDefaultL( *iOdt ); + iThemeServer.UpdateHeaderListCacheL(); + } + + CleanupStack::PopAndDestroy( &file ); + + User::LeaveIfError(errorCode); + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::SetLogBus +// Set log bus to be used +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsClientRequestHandler::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::hspsGetODT +// Implements hspsGetODT() API-function of MhspsClientRequestService interface. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsClientRequestHandler::hspsGetODT(TInt aAppUid, ChspsODT& aODT) + { + // Get application's active theme from the central repository + TInt themeUid; + TInt errorCode = iCentralRepository.Get( aAppUid, themeUid ); + if ( !errorCode ) + { + // Update ODT: prepare mask for a search + aODT.SetRootUid( aAppUid ); + aODT.SetThemeUid( themeUid ); + + // Store the active theme uid + iActiveThemeUid = themeUid; + + if ( iRequestMessage == EhspsGetODT ) + { + TRAP(errorCode, CallGetODTPathL( aODT, iODTPath )); + } + else + { + errorCode = KErrGeneral; + } + } + + ThspsServiceCompletedMessage ret = EhspsGetODTFailed; + if (errorCode) + { + ret = EhspsGetODTFailed; + iResult->iSystemError = errorCode; + } + else + { + ret = EhspsGetODTSuccess; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::hspsGetODT +// Implements hspsGetODT(with resource API-function of MhspsClientRequestService interface. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsClientRequestHandler::hspsGetODT(TInt /*aAppUid*/, ChspsODT& /*aODT*/, + CArrayPtrSeg& /*aResourceList*/) + { + return EhspsServiceNotSupported; + } + + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::hspsGetODTUpdate +// Implements hspsGetODTUpdate() API-function of MhspsClientRequestService interface. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsClientRequestHandler::hspsGetODTUpdate() + { + return EhspsServiceNotSupported; + } + + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::hspsCancelGetODTUpdate +// Implements hspsCancelGetODTUpdate() API-function of MhspsClientRequestService interface. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsClientRequestHandler::hspsCancelGetODTUpdate() + { + ThspsServiceCompletedMessage ret = EhspsServiceRequestCanceled; + iRequestMessage = EhspsCancelGetODTUpdate; + TRAP_IGNORE(CompleteRequestL( ret, iMessagePtr )); + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::hspsAccessResourceFile +// Not supported +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsClientRequestHandler::hspsAccessResourceFile( + const TDesC& /*aResourceFileName*/, + const ThspsConfiguration& /*aConfiguration*/, + RFile& /*aFile*/ ) + { + return EhspsServiceNotSupported; + } +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandleDefinitionRespositoryEvent() +// Handles events coming from hspsDefinitionRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsClientRequestHandler::HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ) + { + TInt errorCode = KErrNone; + TBool status(EFalse); + TRAP( errorCode, status = HandleDefinitionRespositoryEventL( aRepositoryInfo ) ); + if( errorCode != KErrNone ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - Error occured in HandleDefinitionRespositoryEventL" ) ); + } +#endif + } + return status; + } +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandleDefinitionRespositoryEventL() +// Handles events coming from hspsDefinitionRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsClientRequestHandler::HandleDefinitionRespositoryEventL( ThspsRepositoryInfo aRepositoryInfo ) + { + if ( aRepositoryInfo.iEventTime <= iLastSuccessThemeLoadTime ) + { + // Do not consume this event because there could + // be some other still waiting for it. + return EFalse; + } + + // Check if event regards currently active configuration. + TBool affectsActiveConfiguration = EFalse; + if( aRepositoryInfo.iAppUid == iRootUid && + aRepositoryInfo.iAppConfUid == iActiveThemeUid ) + { + affectsActiveConfiguration = ETrue; + } + + // Work. + if ( ( aRepositoryInfo.iEventType & EhspsODTUpdated ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme update occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsGetODTUpdateHot ); + } + } + else if( aRepositoryInfo.iEventType & EhspsODTAdded ) + { + //new plugin installed +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme update occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsAddPluginSuccess ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsSettingsChanged ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme settings changed occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsSetPluginSettingsSuccess ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsODTModified ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme settings changed occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsGetODTUpdateHot ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsODTRemoved ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme settings changed occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsRemovePluginSuccess ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsClean ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - theme settings changed occurred." ) ); + } +#endif + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsGetODTUpdateHot ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsPluginActivated ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - plugin active state change occured." ) ); + } +#endif + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsSetActivePluginSuccess ); + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsPluginReplaced ) && + affectsActiveConfiguration ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - plugin replace occured." ) ); + } +#endif + if ( !iDefinitionRepository.Locked() ) + { + PrepareAndCompleteRequestL( aRepositoryInfo, EhspsReplacePluginSuccess ); + } + } + + // do not consume this event because there could be some other still waiting for it + return EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandleCenRepChangeL() +// Handles events coming from CentralRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::HandleCenRepChangeL( const TUint32 aId ) + { + // 1. Check if another theme is activated + TInt themeUid(0); + TInt errorCode = iCentralRepository.Get( aId, themeUid ); + if ( !errorCode ) + { + if ( iActiveThemeUid != themeUid ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleCenRepChangeL(): - theme status change occurred." ) ); + } +#endif + + if ( !iDefinitionRepository.Locked() ) + { + + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsODTActivated), + aId, + themeUid, + 0,0,0,0, + 0,0, + ETrue, + KNullDesC(), + ELangTest); + + + + PrepareAndCompleteRequestL( info, EhspsGetODTUpdateStatus ); + + } + } + } + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::CompleteRequestL() +// Completes client request. Writes hspsResult data back. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::CompleteRequestL(const ThspsServiceCompletedMessage aReturnMessage, + RMessagePtr2& aMessagePtr, const TDesC8& /*aHeaderData*/ ) + { + TInt errorCode = KErrNone; + RDesWriteStream writeBuf( iResultData ); + CleanupClosePushL( writeBuf ); + TRAP( errorCode, iResult->ExternalizeL( writeBuf )); + CleanupStack::PopAndDestroy(); + + if ( !aMessagePtr.IsNull() ) + { + if ( errorCode ) + { + aMessagePtr.WriteL( 0, KNullDesC8, 0 ); + } + else + { + aMessagePtr.WriteL( 0, iResultData, 0 ); + } + aMessagePtr.Complete( aReturnMessage ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::CallGetODTPathL +// Retrieves a file path to the provided ODT instance +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::CallGetODTPathL( ChspsODT& aODT, TDes& aODTPath ) + { +#ifdef _hsps_PERFORMANCE_TEST_ + TTime start_time; + TBuf tmp; + tmp.Format( + _L("ChspsClientRequestHandler::CallGetODTPathL(): - getting path for theme %d .."), + aODT.ThemeUid() + ); + start_time = ChspsTimeMon::StartTiming( tmp ); + ChspsTimeMon::PrintUserMem( _L("SERVER: - ready to get theme path.") ); +#endif + + // retrieve specific ODT instance from the header cache + TInt errorCode = iThemeServer.GetConfigurationL( + aODT.RootUid(), + aODT.ThemeUid(), + aODT ); + if ( !errorCode ) + { + // get path to the ODT file + iDefinitionRepository.GetResourcePathL( aODT, EResourceODT, aODTPath ); + iLastSuccessThemeLoadTime.HomeTime(); + +#ifdef _hsps_PERFORMANCE_TEST_ + // calculating service time + tmp.Format(_L("ChspsClientRequestHandler::CallGetODTPathL(): - ODT ready.")); + ChspsTimeMon::StopTiming(start_time, tmp); + ChspsTimeMon::PrintUserMem( _L("SERVER: - theme file path ready.") ); +#endif + } + else + { + // repository was unlocked but theme could not be found +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::CallGetODTPathL(): - theme cannot be accessed." ) ); + } +#endif + // default theme must be restored + iRestoreDefault = ETrue; + } + + User::LeaveIfError( errorCode ); + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::RestoreDefaultL +// Restoring default theme after failed theme load because no active theme found. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsClientRequestHandler::RestoreDefaultL( ChspsODT& aOdt ) + { + TInt errorCode = KErrNone; + ChspsMaintenanceHandler* mh = ChspsMaintenanceHandler::NewL(iThemeServer); + CleanupStack::PushL(mh); + ChspsODT* setmask = ChspsODT::NewL(); + CleanupStack::PushL( setmask ); + setmask->SetRootUid(iRootUid); + // lets make sure that all themes are in cache +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::RestoreDefaultL(): - updating cache." ) ); + } +#endif + + iThemeServer.UpdateHeaderListCacheL(); + ThspsServiceCompletedMessage ret = mh->hspsRestoreDefault(*setmask, aOdt); + if ( ret == EhspsRestoreDefaultSuccess ) + { + // inform for cache update to the repository so that everyone will know + // about the change + ThspsRepositoryInfo info( EhspsCacheUpdate ); + iDefinitionRepository.RegisterNotification( info ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::RestoreDefaultL(): - default theme restored." ) ); + } +#endif + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::RestoreDefaultL(): - failed." ) ); + } +#endif + + errorCode = KErrNotFound; + } + iRestoreDefault = EFalse; + CleanupStack::PopAndDestroy( 2, mh ); + User::LeaveIfError( errorCode ); + } + +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::RestoreValidThemeL +// +// ----------------------------------------------------------------------------- +void ChspsClientRequestHandler::RestoreValidThemeL(ChspsODT& aCorruptedOdt) + { + + // Get current theme + ChspsODT* setmask = ChspsODT::NewL(); + CleanupStack::PushL(setmask); + + setmask->SetRootUid( aCorruptedOdt.RootUid() ); + setmask->SetThemeUid( aCorruptedOdt.ThemeUid() ); + + if (aCorruptedOdt.Flags() & EhspsThemeStatusOperatorDefault) + { + // Need to delete corrupted operator theme to restore licensee default theme + setmask->SetFlags(EhspsThemeStatusClean); + } + + ChspsODT* restoredOdt = ChspsODT::NewL(); + CleanupStack::PushL(restoredOdt); + + TInt errorCode = KErrNone; + ChspsMaintenanceHandler* mh = ChspsMaintenanceHandler::NewL(iThemeServer); + CleanupStack::PushL(mh); + iThemeServer.UpdateHeaderListCacheL(); + ThspsServiceCompletedMessage ret = mh->hspsRestoreDefault(*setmask, *restoredOdt); + if ( ret == EhspsRestoreDefaultSuccess ) + { + // inform for cache update to the repository so that everyone will know + // about the change + ThspsRepositoryInfo info( EhspsCacheUpdate ); + iDefinitionRepository.RegisterNotification( info ); + } + else + { + errorCode = KErrNotFound; + } + + iRestoreDefault = EFalse; + CleanupStack::PopAndDestroy( mh ); + + CleanupStack::PopAndDestroy(restoredOdt); + + CleanupStack::PopAndDestroy(setmask); + + User::LeaveIfError( errorCode ); + } + + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsfamilylistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,253 @@ +/* +* Copyright (c) 2002-2004 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: FamilyListener listens to resolution&orientation +* changes in emulator environment. +* +*/ + +#include "hspsfamilylistener.h" +#include "hsps_builds_cfg.hrh" +#include "hspsmanifest.h" +#include + + +_LIT8(KTch, "_tch"); +const TInt KMaxFamilyLength( 20 ); + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// ChspsFamilyListener::NewL +// ----------------------------------------------------------------------------- +// +ChspsFamilyListener* ChspsFamilyListener::NewL( MhspsFamilyObserver& aObserver ) + { + ChspsFamilyListener* self = new(ELeave) ChspsFamilyListener( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsFamilyListener::ChspsFamilyListener +// ----------------------------------------------------------------------------- +// +ChspsFamilyListener::ChspsFamilyListener( MhspsFamilyObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( aObserver), iActiveFamily( EhspsFamilyUnknown ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// ChspsFamilyListener::ConstructL +// ----------------------------------------------------------------------------- +// +void ChspsFamilyListener::ConstructL() + { + User::LeaveIfError( iWsSession.Connect() ); + + // A group needs to be instansiated so that we're able to receive events + iWindowGroup = RWindowGroup( iWsSession ); + User::LeaveIfError( iWindowGroup.Construct(2,ETrue) ); // '2' is a meaningless handle + + // Enables for EEventScreenDeviceChanged events + iWindowGroup.EnableScreenChangeEvents(); + + iScreenDevice = new (ELeave) CWsScreenDevice( iWsSession ); + User::LeaveIfError( iScreenDevice->Construct() ); + + // Start the listener + Queue(); + } + +// ------------------------------------------------------------------------------ +// ChspsFamilyListener::Queue +// ------------------------------------------------------------------------------ +void ChspsFamilyListener::Queue() + { + ASSERT ( !IsActive() ); + iWsSession.EventReady( &iStatus ); + SetActive(); + } + +// ------------------------------------------------------------------------------ +// ChspsFamilyListener::~ChspsFamilyListener +// ------------------------------------------------------------------------------ +ChspsFamilyListener::~ChspsFamilyListener() + { + Cancel(); + if ( iFeatureManagerLoaded ) + { + FeatureManager::UnInitializeLib(); + } + delete iScreenDevice; + iWindowGroup.Close(); + iWsSession.Close(); + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::GetFamilyString +// ----------------------------------------------------------------------------- +void ChspsFamilyListener::GetFamilyString( + TDes8& aFamily ) + { + // Append input with a prefix based on the active screen resolution + TPixelsTwipsAndRotation sizeAndRotation; + iScreenDevice->GetDefaultScreenSizeAndRotation( sizeAndRotation ); + TSize resolution( sizeAndRotation.iPixelSize ); + if( resolution.iWidth > resolution.iHeight ) + { + TInt temp = resolution.iHeight; + resolution.iHeight = resolution.iWidth; + resolution.iWidth = temp; + } + switch( resolution.iHeight ) + { + case 320: + { + if ( resolution.iWidth == 240 ) + { + aFamily.Append( KFamilyQvga ); + } + } + break; + case 640: + { + if( resolution.iWidth == 360 ) + { + aFamily.Append( KFamilyQhd ); + } + else if( resolution.iWidth == 480 ) + { + aFamily.Append( KFamilyVga ); + } + } + break; + + default: + break; + } + if( aFamily.Length() > 0 ) + { +// // Append input with a suffix based on the touch support +// if ( !iFeatureManagerLoaded ) +// { +// FeatureManager::InitializeLibL(); +// iFeatureManagerLoaded = ETrue; +// } +// if ( FeatureManager::FeatureSupported( KFeatureIdPenSupport ) ) +// { + aFamily.Append( KTch ); +// } + } + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::GetFamilyType +// ----------------------------------------------------------------------------- +ThspsFamily ChspsFamilyListener::GetFamilyType( + const TDesC8& aFamilyString ) + { + ThspsFamily family( EhspsFamilyUnknown ); + + if( aFamilyString == KFamilyQvga ) + { + family = EhspsFamilyQvga; + } + else if( aFamilyString == KFamilyQvga2 ) + { + family = EhspsFamilyQvga2; + } + else if( aFamilyString == KFamilyVga ) + { + family = EhspsFamilyVga; + } + else if( aFamilyString == KFamilyVga3 ) + { + family = EhspsFamilyVga3; + } + else if( aFamilyString == KFamilyQhd ) + { + family = EhspsFamilyQhd; + } + else if( aFamilyString == KFamilyQhd_tch ) + { + family = EhspsFamilyQhd_tch; + } + else if( aFamilyString == KFamilyVga_tch ) + { + family = EhspsFamilyVga_tch; + } + + return family; + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::GetFamilyType +// ----------------------------------------------------------------------------- +ThspsFamily ChspsFamilyListener::GetFamilyType() + { + TBuf8 familyString; + GetFamilyString( familyString ); + return GetFamilyType( familyString ); + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::RunL +// ----------------------------------------------------------------------------- +void ChspsFamilyListener::RunL() + { + TWsEvent wsEvent; + iWsSession.GetEvent(wsEvent); + switch( wsEvent.Type() ) + { + case EEventScreenDeviceChanged: + { + ThspsFamily newFamily = GetFamilyType(); + if ( newFamily > EhspsFamilyUnknown ) + { + iObserver.HandleFamilyChangeL( newFamily ); + iActiveFamily = newFamily; + } + break; + } + default: + break; + } + + Queue(); + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::DoCancel +// ----------------------------------------------------------------------------- +// +void ChspsFamilyListener::DoCancel() + { + iWsSession.EventReadyCancel(); + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::RunError +// ----------------------------------------------------------------------------- +TInt ChspsFamilyListener::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsfilechangelistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsfilechangelistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,251 @@ +/* +* 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: hsps FileChangeListener listens to given file folder and notifies it observer +* if there is any file change. +* +* +*/ + +#include "hsps_builds_cfg.hrh" +#include "hspsfilechangelistener.h" + +#ifdef _hsps_EMULATOR_SUPPORT_ +#include "hspsfilechangelisteneremu.h" +#endif + +#ifdef HSPS_LOG_ACTIVE +#include +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::ChspsFileChangeListener +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// + +ChspsFileChangeListener::ChspsFileChangeListener( RFs& aFs, + MhspsFileChangeObserver& aObserver, + TNotifyType aNotifyType, + TListenerType aListenerType) : + CActive( EPriorityStandard ), + iFs( aFs ), + iObserver( aObserver), + iNotifyType( aNotifyType ), + iListenerType( aListenerType ) + { + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListener::ConstructL( const TDesC& aFullPath ) + { + if ( aFullPath.Length() > 0 ) + { + iFullPath.Append( aFullPath ); + } + CActiveScheduler::Add( this ); + // should not make file change listener active yet because server must let + // start fully first. See ChspsThemeServer constructor. +#ifdef _hsps_EMULATOR_SUPPORT_ + iFileChange = ChspsFileChangeListenerEmu::NewL( iFs, *this, EEmuNotifyAll, aFullPath); +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsFileChangeListener* ChspsFileChangeListener::NewL( RFs& aFs, + MhspsFileChangeObserver& aObserver, + TNotifyType aNotifyType, + const TDesC& aFullPath, + TListenerType aListenerType ) + { + ChspsFileChangeListener* self = new(ELeave) ChspsFileChangeListener( aFs, + aObserver, + aNotifyType, + aListenerType ); + CleanupStack::PushL( self ); + self->ConstructL( aFullPath ); + CleanupStack::Pop( self ); + + return self; + } + + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListener::~ChspsFileChangeListener +// +// ------------------------------------------------------------------------------ +ChspsFileChangeListener::~ChspsFileChangeListener() + { + iFs.NotifyChangeCancel(iStatus); + Cancel(); +#ifdef _hsps_EMULATOR_SUPPORT_ + if (iFileChange) + { + delete iFileChange; + iFileChange = NULL; + } +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::RunL +// From CActive. Called when asynchronous request is completed. +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListener::RunL() + { + if ( iStatus.Int() == KErrNone ) + { + InformObserver(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::RunError +// From CActive. Called when error occurred in asynchronous request +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsFileChangeListener::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListener::DoCancel +// From CActive. Called when asynchronous request is canceled +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListener::DoCancel() + { + iFs.NotifyChangeCancel(iStatus); + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListener::Setup +// +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListener::Setup() + { + if( !IsActive() ) + { + iFs.NotifyChangeCancel(iStatus); + if( iFullPath.Length() > 0 && !IsActive() ) + { + iStatus = KRequestPending; + SetActive(); + iFs.NotifyChange( ENotifyAll, iStatus, iFullPath ); + } + } +#ifdef _hsps_EMULATOR_SUPPORT_ + TInt errCode = KErrNone; + TRAP(errCode,iFileChange->StartL();) + if (errCode) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsFileChangeListener::Setup() errCode=%d" ), + errCode ); + } +#endif + } +#endif + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListener::InformObserver +// +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListener::InformObserver() + { + + switch (iListenerType) + { + case TImportDirListener: + { + iObserver.HandleFileSystemChange(); + } + break; + + case TRepositoryListener: + { + iObserver.HandleRepositoryChange(); + } + break; + + default: + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsFileChangeListener::RunL(): - Invalid listener type(%d)" ), + iListenerType ); + } +#endif + } + break; + } + } + +#ifdef _hsps_EMULATOR_SUPPORT_ + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListener::HandleEmuFileSystemChange +// +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListener::HandleEmuFileSystemChange() + { + InformObserver(); + } +#endif + +#ifdef HSPS_LOG_ACTIVE +// ------------------------------------------------------------------------------ +// ChspsFileChangeListener::SetLogBus +// Set log bus to be used. +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListener::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + +#ifdef _hsps_EMULATOR_SUPPORT_ + if( iFileChange ) + { + iFileChange->SetLogBus( aLogBus ); + } +#endif + + } +#endif + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsfilechangelisteneremu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsfilechangelisteneremu.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2002-2004 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: Xuikon hspshspsFileChangeListenerEmu listens to given file folder and notifies it observer (Only in Emulator environment) +* if there is any file change. +* +* +*/ + + +#include "hsps_builds_cfg.hrh" + +#ifdef _hsps_EMULATOR_SUPPORT_ + +#include "hspsfilechangelisteneremu.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::ChspsFileChangeListenerEmu +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsFileChangeListenerEmu::ChspsFileChangeListenerEmu( RFs& aFs, + MhspsEmuFileChangeObserver& aObserver, + TEmuNotifyType aNotifyType) : + CTimer(EPriorityLow), + iFs( aFs ), + iObserver( aObserver), + iNotifyType( aNotifyType ) + { + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListenerEmu::ConstructL( const TDesC& aFullPath ) + { + + iFileList = new( ELeave ) CDesCArraySeg(KFilelistGranularity ); + iState = EEmuStateIdle; + + if ( aFullPath.Length() > 0 ) + { + iFullPath.Append( aFullPath ); + } + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsFileChangeListenerEmu* ChspsFileChangeListenerEmu::NewL( RFs& aFs, + MhspsEmuFileChangeObserver& aObserver, + TEmuNotifyType aNotifyType, + const TDesC& aFullPath) + { + ChspsFileChangeListenerEmu* self = new(ELeave) ChspsFileChangeListenerEmu( aFs, + aObserver, + aNotifyType); + CleanupStack::PushL( self ); + self->ConstructL( aFullPath ); + CleanupStack::Pop( self ); + + return self; + } + + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::~ChspsFileChangeListenerEmu +// Destructor +// ------------------------------------------------------------------------------ +ChspsFileChangeListenerEmu::~ChspsFileChangeListenerEmu() + { + Cancel(); + + if (iFileList) + { + delete iFileList; + iFileList = NULL; + } + + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::RunL +// From CActive. Called when asynchronous request is completed. +// Notifies the observer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListenerEmu::RunL() + { + TBool Diff(EFalse); + TInt errCode = KErrNone; + if (iStatus.Int() == KErrNone) + { + CDesCArraySeg* CurFileList = new( ELeave ) CDesCArraySeg(KFilelistGranularity ); + CleanupStack::PushL(CurFileList); + + // Retrieve current list of files in filesystem + TRAP(errCode, RetrieveFileListL(*CurFileList, iFullPath);) + if (errCode) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsFileChangeListenerEmu::RunL():RetrieveFileListL, Error=%d" ), + errCode ); + } +#endif + } + + // Compare files + TRAP(errCode, Diff = CompareFilesL(*CurFileList);) + if (errCode) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsFileChangeListenerEmu::RunL():CompareFilesL, Error=%d" ), + errCode ); + } +#endif + } + + // If changes, call observer handle function + if (Diff) + { + InformObserver(); + } + + // Store current file situation + TRAP(errCode, StoreFileListL(*CurFileList);) + if (errCode) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsFileChangeListenerEmu::RunL():StoreFileListL, Error=%d" ), + errCode ); + } +#endif + } + + CleanupStack::Pop( CurFileList ); + if ( CurFileList ) + { + delete CurFileList; + CurFileList = NULL; + } + + // Restart timer + After(KFileSystemPollingTime); + } + + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::RunError +// From CActive. Called when error occurred in asynchronous request +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsFileChangeListenerEmu::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsFileChangeListenerEmu::DoCancel() +// Not implemented yet +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsFileChangeListenerEmu::DoCancel() + { + iState = EEmuStateIdle; + CTimer::DoCancel(); + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::StartL +// Starts polling directory for changes +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::StartL() + { + TInt errCode = KErrNone; + + if (iState == EEmuStateIdle) + { + CDesCArraySeg* CurFileList = new( ELeave ) CDesCArraySeg(KFilelistGranularity ); + + CleanupStack::PushL(CurFileList); + + // Retrieve current list of files in filesystem + TRAP(errCode, RetrieveFileListL(*CurFileList, iFullPath);) + if (errCode) + { + User::Leave(errCode); + } + + // Store current file situation + TRAP(errCode, StoreFileListL(*CurFileList);) + if (errCode) + { + User::Leave(errCode); + } + + CleanupStack::Pop( CurFileList ); + if ( CurFileList ) + { + delete CurFileList; + CurFileList = NULL; + } + + // Start timer + After(KFileSystemPollingTime); + + iState = EEmuStateRunning; + } + + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::Stop +// Stops polling of directory +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::Stop() + { + Cancel(); + } + +#ifdef HSPS_LOG_ACTIVE +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::SetLogBus +// Set log bus to be used. +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#endif + + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::InformObserver +// Informs observer of file change +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::InformObserver() + { + iObserver.HandleEmuFileSystemChange(); + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::RetrieveFileListL +// Retrieves current list of files in filesystem +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::RetrieveFileListL( CDesCArraySeg& aFileList, const TDesC& aPath ) + { + CDirScan* dir_list = CDirScan::NewL( iFs ); + CleanupStack::PushL( dir_list ); + + dir_list->SetScanDataL( aPath, + KEntryAttNormal, + ESortByName | EAscending, + CDirScan::EScanDownTree ); + + CDir* dirEntries = NULL; + dir_list->NextL( dirEntries ); + while( dirEntries != NULL ) + { + CleanupStack::PushL( dirEntries ); + + TInt iDirCount = dirEntries->Count(); + for( TInt i = 0; i < iDirCount; i++ ) + { + const TEntry a = dirEntries->operator[]( i ); + aFileList.AppendL( a.iName ); + } + + CleanupStack::PopAndDestroy( dirEntries ); + dirEntries = NULL; + dir_list->NextL( dirEntries ); + } + + CleanupStack::PopAndDestroy(dir_list); + + } + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::StoreFileListL +// Stores list of files to memory +// ------------------------------------------------------------------------------ +// +void ChspsFileChangeListenerEmu::StoreFileListL(CDesCArraySeg& aFileList) + { + + if (iFileList) + { + iFileList->Reset(); + + for ( TInt i = 0; i < aFileList.Count(); i++) + { + TPtrC t = aFileList.MdcaPoint(i); + iFileList->AppendL(t); + } + } + } + + +// ------------------------------------------------------------------------------ +// ChspsFileChangeListenerEmu::CompareFilesL +// Compares given filelist to filelist on memory +// ------------------------------------------------------------------------------ +// +TBool ChspsFileChangeListenerEmu::CompareFilesL(CDesCArraySeg& aFileList) + { + TInt p = 0; + TBool ret(EFalse); + + if (iFileList->Count() == aFileList.Count() ) + { + for (p = 0;p < iFileList->Count(); p++) + { + TBool found(EFalse); + TInt i=0; + while (!found && iMdcaPoint(i); + if (!(t.CompareF(aFileList.MdcaPoint(p)) ) ) + { + found=ETrue; + break; + } + + i++; + } + + if (!found) + { + ret = ETrue; + break; + } + } + } + else + { + ret = ETrue; + } + + return ret; + + } + +#endif // _hsps_EMULATOR_SUPPORT_ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2636 @@ +/* +* 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: Implementaion of HSPS MhspsInstallationService interface defined +* in hspsThemeManagement.h. For details, see the header file. +* +*/ + + +#include +#include +#include + +#include "hsps_builds_cfg.hrh" +#include "hspsthememanagement.h" +#include "hspsdefinitionrepository.h" +#include "hspsodt.h" +#include "hspsdefinitionengineinterface.h" +#include "hspsdomdocument.h" +#include "hspsresource.h" +#include "hspsresult.h" +#include "hspsthemeserver.h" +#include "hspsinstallationhandler.h" +#include "hspssecurityenforcer.h" +#include "hspsuimanagererrorcodes.h" +#include "hspsdomattribute.h" +#include "hspsdomlist.h" +#include "hspsdomdepthiterator.h" +#include "hspsdomnode.h" +#include "hspsconfiguration.h" +#include "hspsmanifest.h" +#include "hspsserverutil.h" +#include "hspsfamilylistener.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +#ifdef _hsps_PERFORMANCE_TEST_ +#include "hspstimemon.h" +#endif + +_LIT8(KUnknownMimeType, "unknown"); + +_LIT8(KhspsDefinitionEngine, "hspsdefinitionengine"); + +_LIT(KPathDelim, "\\"); +_LIT(KHsps, "\\hsps\\" ); +_LIT(KXuikon, "xuikon\\" ); + +const TInt KMaxMediaTypeLength = 100; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Callback function for removing repository lock if error occurs while repository is locked +// ----------------------------------------------------------------------------- +// +LOCAL_C void UnlockRepository( TAny* aObject ) + { + ChspsDefinitionRepository* DefRep = reinterpret_cast( aObject ); + + if (DefRep->Locked()) + { + DefRep->Unlock(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ChspsInstallationHandler() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsInstallationHandler::ChspsInstallationHandler( ChspsThemeServer& aThemeServer ) + : iThemeServer( aThemeServer ), + iDefinitionRepository( aThemeServer.DefinitionRepository() ), + iSecurityEnforcer( aThemeServer.SecurityEnforcer() ), + iCentralRepository( aThemeServer.CentralRepository() ), + iHeaderListCache( aThemeServer.HeaderListCache() ) + { + iPackageVerSupported = EFalse; + iInstallationPhase = EhspsPhaseIdle; + iConfigurationType = EhspsAppConfiguration; + iThemeStatus = EhspsThemeStatusNone; + iFileNotFound = EFalse; + iLocalized = EFalse; + iDefaultSpecificationSet = EFalse; + iDefaultSpecification = ELangNone; + iInstallationMode = EServiceHandler; + iRomInstallation = EFalse; + iInstallationType = EInstallationTypeNew; + iFamilyMask = 0; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsInstallationHandler* ChspsInstallationHandler::NewL( ChspsThemeServer& aThemeServer ) + { + ChspsInstallationHandler* h = ChspsInstallationHandler::NewLC( aThemeServer ); + CleanupStack::Pop( h ); + return ( h ); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsInstallationHandler* ChspsInstallationHandler::NewLC( ChspsThemeServer& aThemeServer ) + { + ChspsInstallationHandler* h = new (ELeave) ChspsInstallationHandler( aThemeServer ); + CleanupStack::PushL( h ); + h->ConstructL(); + return ( h ); + } + + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +ChspsInstallationHandler::~ChspsInstallationHandler() + { + iFsSession.Close(); + delete iXmlParser; + delete iOdt; + delete iDtdFile; + delete iHeaderData; + delete iThemeFullName; + delete iThemeShortName; + delete iThemeVersion; + delete iThemeDesc; + delete iResourceTag; + delete iPackageVersion; + if ( iTempLocalizedResourceList ) + { + iTempLocalizedResourceList->ResetAndDestroy(); + delete iTempLocalizedResourceList; + } + if( iResourceList ) + { + iResourceList->Reset(); // ODT has an ownership of the items + delete iResourceList; + } + delete iContent; + delete iXmlFile; + delete iMediaType; + delete iResource; + delete iResult; + + if ( iDefEngine ) + { + delete iDefEngine; + } + + REComSession::FinalClose(); + + } + + + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ConstructL() + { + _LIT8(KMimeType, "text/xml"); + MContentHandler* contentHandler = this; + iXmlParser = Xml::CParser::NewL( KMimeType, *contentHandler ); + + iDefEngine = ChspsDefinitionEngineInterface::NewL(KhspsDefinitionEngine); + + iOdt = ChspsODT::NewL(); + iResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); + iTempLocalizedResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); + User::LeaveIfError( iFsSession.Connect() ); + iResult = ChspsResult::NewL(); + + iMultiInstanceFound = EFalse; + + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ServiceInstallThemeL +// Starts the actual installation in ChspsInstallationHandler. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ServiceInstallThemeL( const RMessage2& aMessage ) + { + // incoming arguments: TIpcArgs: &iResultData, &aManifestFileName, &aHeader + iMessagePtr = aMessage; + TBuf8 headerdata; + + iInstallationPhase = EhspsPhaseIdle; + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + + if ( !iDefinitionRepository.Locked() ) + { + // read name of the manifest file + TBuf manifestfilename; + iMessagePtr.ReadL( 1, manifestfilename, 0 ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ServiceInstallThemeL() - Manifest file '%S'" ), + &manifestfilename ); + } +#endif + + // install the manifest file + ret = hspsInstallTheme( manifestfilename, headerdata ); + + // now there will be the time for query validity check + if ( ret == EhspsInstallThemeSuccess ) + { + ret = EhspsInstallPhaseSuccess; + } + } + else + { + iResult->ResetData(); + iResult->iSystemError = KErrInUse; + } + + CompleteRequestL(ret, headerdata); + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ServiceInstallNextPhaseL +// Starts subsequent installation phases. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ServiceInstallNextPhaseL( const RMessage2& aMessage ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ServiceInstallNextPhaseL():" ) ); + } +#endif + + TBuf8 headerdata; + iResult->ResetData(); + iInstallationMode = EServiceHandler; + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + // incoming arguments: TIpcArgs: &iResultData, &KNullDesC, &aHeaderData + iMessagePtr = aMessage; + + // calling installation of next phase + ret = hspsInstallNextPhaseL( headerdata ); + CompleteRequestL( ret, headerdata ); + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::InstallNextPhase() +// Must be completed by EhspsInstallThemeSuccess, EhspsInstallPhaseSuccess or EhspsInstallThemeFailed +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::hspsInstallNextPhaseL( + TDes8& aHeaderData, + TRequestStatus& aRequestStatus ) + { + ThspsServiceCompletedMessage ret = EhspsServiceNotSupported; + iInstallationMode = EAsynchronousObject; + iRequestStatus = &aRequestStatus; + *iRequestStatus = KRequestPending; + ret = hspsInstallNextPhaseL( aHeaderData ); + CompleteRequestL( ret ); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ResetL() +// ----------------------------------------------------------------------------- +void ChspsInstallationHandler::ResetL() + { + iFamilyMask = 0; + iInstallationPhase = EhspsPhaseInitialise; + iThemeStatus = EhspsThemeStatusNone; + iFileNotFound = EFalse; + delete iMediaType; + iMediaType = NULL; + delete iThemeDesc; + iThemeDesc = NULL; + delete iResourceTag; + iResourceTag = NULL; + iLocalized = EFalse; + iDefaultSpecificationSet = EFalse; + iDefaultSpecification = ELangNone; + if ( iOdt ) + { + delete iOdt; + iOdt = NULL; + iOdt = ChspsODT::NewL(); + } + + delete iDtdFile; + iDtdFile = NULL; + + delete iHeaderData; + iHeaderData = NULL; + if ( iDefEngine ) + { + delete iDefEngine; + iDefEngine = NULL; + iDefEngine = ChspsDefinitionEngineInterface::NewL(KhspsDefinitionEngine); + } + if ( iResourceList ) + { + iResourceList->Reset(); // ODT has an ownership of the items + delete iResourceList; + iResourceList = NULL; + iResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); + } + if ( iTempLocalizedResourceList ) + { + iTempLocalizedResourceList->ResetAndDestroy(); + delete iTempLocalizedResourceList; + iTempLocalizedResourceList = NULL; + iTempLocalizedResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); + } + iInstallationType = EInstallationTypeNew; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::hspsInstallTheme() +// From MhspsInstallationService +// Must be completed by EhspsInstallThemeSuccess, EhspsInstallPhaseSuccess or EhspsInstallThemeFailed +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsInstallationHandler::hspsInstallTheme( + const TDesC& aManifestFileName, + TDes8& aHeaderData) + { + // Assume that the installation fails + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + iResult->iXuikonError = KErrManifestFileCorrupted; + + // Reset memeber variables + TInt errorCode = KErrNone; + TRAP( errorCode, ResetL() ); + if ( !errorCode ) + { + // Get manifest file path + iThemeFilePath.Set( TParsePtrC( aManifestFileName ).DriveAndPath() ); + // Check if ROM installation is requested + iRomInstallation = EFalse; + TParse driveParser; + driveParser.Set( iThemeFilePath, NULL, NULL ); + TInt driveNumber; + if ( RFs::CharToDrive( driveParser.Drive()[0], driveNumber ) == KErrNone ) + { + if ( driveNumber == EDriveZ ) + { + iRomInstallation = ETrue; + } + } + +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme() - *** Parsing a manifest file:" ) ); + } +#endif + if( BaflUtils::FileExists( iFsSession, aManifestFileName ) ) + { + // Parse XML from the manifest file + TRAP( errorCode, Xml::ParseL( *iXmlParser, iFsSession, aManifestFileName )); + } + else + { +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme() - Manifest was not found!" ) ); + } +#endif + iFileNotFound = ETrue; + errorCode = KErrNotFound; + } + } + + if ( !errorCode && !iFileNotFound ) + { + // The manifest file has been read at this point and following callbacks have been executed: + // (unless the manifest was invalid): OnContent, OnStartElement, OnEndElement + + // Detect installation type. + // Performance optimization: do not check if installing from rom. + if( !iRomInstallation ) + { + // Check type of installation + TBool instancesFound = EFalse; + TRAP( errorCode, instancesFound = IsPluginUsedInAppConfsL() ); + if( iThemeServer.PluginInHeaderCache( TUid::Uid( iThemeUid ) ) && instancesFound ) + { + // Plugin should be found from cache, update notifications are + // sent only when plugins are used by one/more app configurations + iInstallationType = EInstallationTypeUpdate; + } + else + { + iInstallationType = EInstallationTypeNew; + } + } + if ( !errorCode ) + { + // Check the manifest + TRAP( errorCode, ValidateL() ); + } + if ( !errorCode ) + { + // correct headerdata is in iHeaderData set by CheckHeaderL() + aHeaderData = iHeaderData->Des(); + + ret = EhspsInstallThemeSuccess; + + // Set next phase + iInstallationPhase = EhspsPhaseCleanup; + + // number of all resources to iResult + iResult->iIntValue2 = 0; + } + } + + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::hspsInstallTheme(): - Installation failed with error code %d" ), + errorCode ); + } +#endif + } + + iResult->iSystemError = errorCode; + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::GetInterfacePath() +// ----------------------------------------------------------------------------- +// +TFileName ChspsInstallationHandler::GetInterfacePath() + { + TFileName path; + + TParse pathParser; + pathParser.Set( iThemeFilePath, NULL, NULL ); + pathParser.PopDir(); // pop locale specific folder + + TPtrC parentFolder = pathParser.FullName().Mid( pathParser.FullName().Length() - KHsps().Length() ); + if ( parentFolder.CompareF(KHsps) == 0 ) + { + pathParser.PopDir(); // pop "hsps" folder + path.Copy( pathParser.FullName() ); + path.Append( KXuikon ); + } + return path; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ValidateL() +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ValidateL() + { + TFileName interfacePath( GetInterfacePath() ); + if ( interfacePath.Length() ) + { + // If name of the DTD file was specified in the manifest + if ( iDtdFile ) + { + TParse pathParser; + pathParser.Set( iThemeFilePath, NULL, NULL ); + pathParser.PopDir(); // pop locale specific folder + + // Find locale specific DTD file + AddHspsLocalesV2L( pathParser.FullName() ); + } + + // Find Xuikon resources of each locale + AddInterfaceResourcesV2L( interfacePath ); + } + else + { + // Find DTD files and locale specific resources from subdirectories under the installation path + AddLocalesL( iThemeFilePath ); + } + + // Validate input from the manifest + CheckHeaderL(); + + if ( iSecurityEnforcer.CheckThemeLockingL( *iOdt ) ) + { + iResult->iXuikonError = KErrThemeStatusLocked; +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ValidateL(): - CheckThemeLockingL" ) ); + } +#endif + User::Leave( KErrAccessDenied ); + } + +#ifdef HSPS_LOG_ACTIVE + // printing some debug-info + TPtrC xmlfile = iXmlFile->Des(); + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ValidateL(): - iXmlFile = '%S'" ), + &xmlfile ); + + iLogBus->LogText( _L( "ChspsInstallationHandler::ValidateL(): - resources included = %d" ), + iResourceList->Count() ); + } +#endif + } + + +// ----------------------------------------------------------------------------- +// Execution of specific installation phases and transitions in between. +// Must be completed by EhspsInstallThemeSuccess, EhspsInstallPhaseSuccess or EhspsInstallThemeFailed +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsInstallationHandler::hspsInstallNextPhaseL( TDes8& aHeaderData ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsInstallPhaseSuccess; + TInt errorCode = KErrNone; + + if ( !iDefinitionRepository.Locked() ) + { + iDefinitionRepository.Lock(); + } + + //For unlocking repository in error cases + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + switch ( iInstallationPhase ) + { + case EhspsPhaseIdle: + { + ret = EhspsServiceRequestError; + } + break; + + case EhspsPhaseCleanup: + { + if ( iOdt ) + { + // Remove existing/old files from the Plug-in Repository + TRAP( errorCode, CleanupL( *iOdt ) ); + } + if ( errorCode ) + { + iResult->iSystemError = errorCode; + iResult->iXuikonError = errorCode; + CleanupStack::Pop(&iDefinitionRepository); + return EhspsInstallThemeFailed; + } + else + { + iInstallationPhase = EhspsPhaseInstallSkeleton; + } + } + break; + + case EhspsPhaseInstallSkeleton: + { + // Parses and stores DOM into the ODT being installed + iResult->iIntValue2 = 0; + TRAP( errorCode, InstallSkeletonL( ret ) ); + if ( errorCode ) + { + ret = EhspsInstallThemeFailed; + } + else + { + iResult->iIntValue2 = 0; + + // Success - installation finished + ret = EhspsInstallThemeSuccess; + iInstallationPhase = EhspsPhaseIdle; + } + } + break; + + default: + { + iResult->iSystemError = KErrNotReady; + ret = EhspsServiceRequestError; + } + break; + } // switch + + if ( iHeaderData ) + { + aHeaderData = iHeaderData->Des(); + } + else + { + aHeaderData = KNullDesC8; + } + + CleanupStack::Pop(&iDefinitionRepository); + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::hspsCancelInstallTheme() +// Cancels the theme installation +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsInstallationHandler::hspsCancelInstallTheme() + { + TRAP_IGNORE( CompleteRequestL( EhspsServiceRequestCanceled )); + return EhspsServiceRequestCanceled; + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::CheckAutoInstallationValidityL() +// Returns EFalse if the user tries to install Licensee default theme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsInstallationHandler::CheckAutoInstallationValidityL() + { + if ( iOdt->Flags() & EhspsThemeStatusLicenceeDefault ) + { + iResult->iXuikonError = KErrIllegalInstallation; + return EFalse; + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::SetLogBus() +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsInstallationHandler::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#endif + + +// ChspsInstallationHandler::InstallOdtL() +// Installs DOM-document ODT and processes resource list +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::InstallSkeletonL( ThspsServiceCompletedMessage& /*aReturnMsg*/ ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "hspsInstallationHandler::InstallSkeletonL(): - installing and localizing configuration" ) ); + } +#endif + + iOdt->SetOdtLanguage( ELangNone ); + + // Parse DOM + ParseDocumentL( *iOdt ); + + // Save ODT itself as a resource + SetODTAsResourceL( *iOdt ); + + // Add resources parsed from the manifest file into the new ODT instance, generate + // target paths and update the iResourcesList array with the new paths + User::LeaveIfError( iDefinitionRepository.SetResourceListL( *iOdt, *iResourceList ) ); + + // Update DOM's configuration node with attributes from the manifest + hspsServerUtil::GenerateConfigurationAttributesL( *iOdt ); + + TBuf8<10> uid; + _LIT8( KFormat8, "%X" ); + _LIT8( KHexPrefix, "0x" ); + uid.Append( KHexPrefix ); + uid.AppendFormat( KFormat8, iOdt->ThemeUid() ); + + // Update configuration max child count + if ( hspsServerUtil::FindNodeByTagL( + KPluginsElement, + *( iOdt->DomDocument().RootNode() ) ) ) + { + TPtrC8 maxChildCnt; + // Plugins node found - Configuration can include child configurations + TRAPD( err, hspsServerUtil::GetAttributeValueL( + *iOdt, + KConfigurationElement, + KConfigurationAttrUid, + uid, + KConfigurationAttrMaxChild, + maxChildCnt) ); + if ( err ) + { + // Set default max child configuration count + hspsServerUtil::SetAttributeValueL( + *iOdt, + KConfigurationElement, + KConfigurationAttrUid, + uid, + KConfigurationAttrMaxChild, + _L8( "6" ) ); + } + } + else + { + // Configuration cannot indluce child configurations + hspsServerUtil::SetAttributeValueL( + *iOdt, + KConfigurationElement, + KConfigurationAttrUid, + uid, + KConfigurationAttrMaxChild, + _L8( "0" ) ); + } + + if ( iRomInstallation ) + { + // Update configuration state to KConfStateConfirmed + hspsServerUtil::SetAttributeValueL( + *iOdt, + KConfigurationElement, + KConfigurationAttrUid, + uid, + KConfigurationAttrState, + KConfStateConfirmed + ); + } + + iOdt->SetOdtLanguage( ELangTest ); + + // Add a resouces node and its objects from the manifest into the DOM + hspsServerUtil::GenerateObjectAttributesL( *iOdt ); + + + + + // Make localizations according to the active device language + iThemeServer.LocalizeL( + *iDefEngine, + *iOdt ); + + // Store the ODT instance into the file system + iDefinitionRepository.SetOdtL( *iOdt ); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::CheckHeaderL() +// Checks the installed theme's header correctness +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::CheckHeaderL() + { + // Check whether the manifest is supported by the installer + if ( !iPackageVerSupported ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - package version is not supported by the server!" ) ); + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - Update plug-in configurations and try again" ) ); + } +#endif + + User::Leave( KErrNotSupported ); + } + else + { + // Store package version + iOdt->SetPackageVersionL( *iPackageVersion ); + } + + // Set the resolution family + iOdt->SetFamily( iFamilyMask ); + + // Store root, provider and theme uid + if ( iRootUid && iProviderUid && iThemeUid ) + { + iOdt->SetRootUid( iRootUid ); + iOdt->SetProviderUid( iProviderUid ); + iOdt->SetThemeUid( iThemeUid ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - Manifest file error, no UIDs" ) ); + } +#endif + + // If the content is empty, the file is supposedly wrong + if( !iContent ) + { + iResult->iXuikonError = KErrWrongManifestFile; + User::Leave( KErrNotFound ); + } + // something goes wrong... + if( !iRootUid && !iProviderUid && !iThemeUid && + !iThemeFullName && !iThemeShortName && !iThemeVersion ) + { + iResult->iXuikonError = KErrOtherXuikonError; + User::Leave( KErrNotFound ); + } + if( !iRootUid ) + { + iResult->iXuikonError = KErrAppUidDefinitionMissing; + User::Leave( KErrNotFound ); + } + if( !iProviderUid ) + { + iResult->iXuikonError = KErrProviderUidDefinitionMissing; + User::Leave( KErrNotFound ); + } + if( !iThemeUid ) + { + iResult->iXuikonError = KErrThemeUidDefinitionMissing; + User::Leave( KErrNotFound ); + } + User::Leave(KErrNotFound); + } + + // Store name, short name and version + HBufC* themeFullName = NULL; + HBufC* themeShortName = NULL; + HBufC* themeVersion = NULL; + if ( iThemeFullName && iThemeShortName && iThemeVersion ) + { + themeFullName = HBufC::NewLC( iThemeFullName->Length() ); + themeFullName->Des().Copy( *iThemeFullName ); + themeShortName = HBufC::NewLC( iThemeShortName->Length() ); + themeShortName->Des().Copy( *iThemeShortName ); + themeVersion = HBufC::NewLC( iThemeVersion->Length() ); + themeVersion->Des().Copy( *iThemeVersion ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - Manifest file error, no names" ) ); + } +#endif + + if( !iThemeFullName ) + { + iResult->iXuikonError = KErrThemeFullNameDefinitionMissing; + User::Leave( KErrNotFound ); + } + if( !iThemeShortName ) + { + iResult->iXuikonError = KErrThemeShortDefinitionNameMissing; + User::Leave( KErrNotFound ); + } + if( !iThemeVersion ) + { + iResult->iXuikonError = KErrThemeVersionDefinitionMissing; + User::Leave( KErrNotFound ); + } + User::Leave(KErrNotFound); + } + iOdt->SetThemeFullNameL( themeFullName->Des() ); + iOdt->SetThemeShortNameL( themeShortName->Des() ); + iOdt->SetThemeVersionL( themeVersion->Des() ); + if ( iThemeDesc ) + { + HBufC* buf = HBufC::NewLC( iThemeDesc->Length() ); + buf->Des().Copy( iThemeDesc->Des() ); + iOdt->SetDescriptionL( buf->Des() ); + CleanupStack::PopAndDestroy( buf ); + } + iOdt->SetMultiInstance( iMultiInstance ); + iMultiInstanceFound = EFalse; + + CleanupStack::PopAndDestroy( themeVersion ); + CleanupStack::PopAndDestroy( themeShortName ); + CleanupStack::PopAndDestroy( themeFullName ); + + iOdt->SetConfigurationType( iConfigurationType ); + iOdt->SetFlags( iThemeStatus ); + + // If configuration file is missing + if( !iXmlFile ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - XML was not declared!" ) ); + } +#endif + iResult->iXuikonError = KErrXmlFileDefinitionMissing; + User::Leave( KErrNotFound ); + } + + // If name of the DTD file has been set + if ( iDtdFile ) + { + // Expect localization for at least ELangTest (folder name "00") + if ( !iDefaultSpecificationSet || iDefaultSpecification != ELangTest ) + { + iResult->iXuikonError = KErrDtdFileNotFound; +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CheckHeaderL(): - check localization!" ) ); + } +#endif + User::Leave( KErrNotFound ); + } + } + + // all header-information is in place, now try to marshall it as a return of the service call + iHeaderData = iOdt->MarshalHeaderL(); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ParseDocumentL +// Parses the skeleton DOM with the help of Definition Engine +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ParseDocumentL( ChspsODT& aOdt ) + { + TInt deferror = KErrNone; + TInt errorCode = KErrNone; + ChspsDefinitionEngineInterface::TError t_error; + +#ifdef _hsps_PERFORMANCE_TEST_ + // service time prints + _LIT( KStartTiming, "ChspsInstallationHandler::ParseDocumentL(): - calling iDefEngine->CreateDOM().."); + TTime start_time = ChspsTimeMon::StartTiming( KStartTiming ); +#endif + + t_error = iDefEngine->CreateDOM( iFsSession, *iXmlFile, aOdt ); + + deferror = t_error.iDefEngError + t_error.iSubComponentError; + + if (!deferror) + { + // get ODT information + ChspsDomDocument& domDocument = aOdt.DomDocument(); + TInt domNodeCount = domDocument.DomNodeCount(); + // write the result + iResult->iIntValue1 = 0; + iResult->iIntValue2 = domNodeCount; + +#ifdef _hsps_PERFORMANCE_TEST_ + // calculating service time + _LIT( KStopTiming, "ChspsInstallationHandler::ParseDocumentL(): - Parsing success." ); + ChspsTimeMon::StopTiming(start_time, KStopTiming ); +#endif + } + else + { + errorCode = KErrCorrupt; + iResult->iXuikonError = errorCode; + + iResult->iIntValue1 = t_error.iDefEngError; + iResult->iIntValue2 = t_error.iSubComponentError; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ParseDocumentL(): - TRAP returned %d" ), + errorCode ); + iLogBus->LogText( _L( "ChspsInstallationHandler::ParseDocumentL(): - ChspsDefinition Engine::TError.iParserError: %d" ), + t_error.iDefEngError ); + iLogBus->LogText( _L( "ChspsInstallationHandler::ParseDocumentL(): - ChspsDefinition Engine::TError.iSubComponentError: %d" ), + t_error.iSubComponentError ); + } +#endif + } + + User::LeaveIfError(errorCode); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::AddResourceL() +// Adds parsed resource into a temporary resource list, from which the resources +// are applied to an ODT instance at later phase +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::AddResourceL( + CArrayPtrSeg& aArray, + const TPtrC aFilename, + const TLanguage aLanguage, + const ThspsResourceType aResourceType, + const TPtrC8 aMimetype, + const TPtrC8 aTag ) + { + TParsePtrC parsePtr( aFilename ); + + ChspsResource* r = ChspsResource::NewL(); + CleanupStack::PushL(r); + + r->SetLockingPolicy( EhspsUnlocked ); + if ( iThemeStatus & EhspsThemeStatusLicenceeDefault ) + { + r->SetLockingPolicy( EhspsLocked ); + } + r->SetResourceIdL( parsePtr.NameAndExt() ); + + // Common resources are parsed first - thus when the iLanguageSpecification is other than ELangNone, + // then we are parsing language specific resources + r->SetConfigurationUid( iThemeUid ); + r->SetLanguage( aLanguage ); + r->SetFileNameL( aFilename ); + r->SetResourceType( aResourceType ); + if ( aMimetype.Length() ) + { + r->SetMimeTypeL( TDataType( aMimetype ) ); + } + const TInt l = aTag.Length(); + if ( l ) + { + HBufC* buf = HBufC::NewLC( l ); + buf->Des().Copy( aTag ); + r->SetTagsL( *buf ); + CleanupStack::PopAndDestroy( buf ); + } + aArray.AppendL( r ); + + CleanupStack::Pop( r ); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::CleanupL() +// Executes cleaning of the target folder prior to the installation process +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::CleanupL( const ChspsODT& aOdt ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "hspsInstallationHandler::CleanupL(): - removing previous installation" ) ); + } +#endif + + // Get ODT's relative path in Plug-in Repository without the drive information + HBufC* relativePath = HBufC::NewLC( KMaxFileName ); + TPtr ptr = relativePath->Des(); + iDefinitionRepository.GetODTPathL( aOdt, ptr ); + + // Strip file name and append path with a drive symbol + TParsePtr parser( ptr ); + parser.PopDir(); + TPtrC confPath = parser.Path(); + TPath file; + file.Format( _L("%S%S"), &KCDrive, &confPath ); + CleanupStack::PopAndDestroy( relativePath ); + + // If there was an existing configuration folder + if( BaflUtils::FileExists( iFsSession, file ) ) + { + // Remove the old configuration + CFileMan* fileMan = CFileMan::NewL( iFsSession ); + CleanupStack::PushL( fileMan ); + User::LeaveIfError( fileMan->RmDir( file ) ); + CleanupStack::PopAndDestroy( fileMan ); + } + + iThemeServer.UpdateHeaderListCache( + EhspsCacheRemoveHeader, + aOdt.RootUid(), + aOdt.ProviderUid(), + aOdt.ThemeUid() ); + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::RollBackL() +// Rolls back the installation if it fails or is cancelled. Functionality depends +// on the state where the installation was. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::RollBackL(ChspsODT& aOdt) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "hspsInstallationHandler::RollBackL(): - rolling back.." ) ); + } +#endif + + // then rolling back the installation in according to in which state it was before cancel + switch ( iInstallationPhase ) + { + case EhspsPhaseIdle: + case EhspsPhaseInitialise: + case EhspsPhaseCleanup: + break; + case EhspsPhaseInstallSkeleton: + { + iDefinitionRepository.RemoveThemeL( aOdt ); + iInstallationPhase = EhspsPhaseIdle; // roll-back is completed + } + break; + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::CompleteRequestL() +// Completes client request +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::CompleteRequestL(const ThspsServiceCompletedMessage aReturnMessage, + const TDesC8& aHeaderData ) + { + TBool wasLocked( EFalse ); + + if( iDefinitionRepository.Locked() ) + { + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + wasLocked = ETrue; + } + + // only EhspsInstallThemeSuccess and EhspsInstallPhaseSuccess quaranties valid header to be returned + TBool complete( ETrue ); + + switch( iInstallationMode ) + { + case EServiceHandler: + { + if( aReturnMessage == EhspsInstallThemeSuccess ) + { + // Activate the installed application configuration if EhspsThemeStatusMakeActive is set + if ( iThemeStatus & EhspsThemeStatusMakeActive ) + { + if ( iConfigurationType == EhspsAppConfiguration ) + { + ActivateThemeL(); + } + } + + // lets try to delete temp files. Server will delete them only + // if there are not current resource holders + iInstallationPhase = EhspsPhaseIdle; + // write the result + iResult->iIntValue1 = 0; + iResult->iIntValue2 = 0; + + iDefinitionRepository.Unlock(); + + if ( !iDisableNotifications ) + { + // Inform server that a configuration was added or replaced and that the + // header cache should be updated (specific header to be added can be obtained + // from the uids) + + if( iInstallationType == EInstallationTypeNew ) + { + ThspsRepositoryInfo info( + ThspsRepositoryEvent( EhspsODTAdded ), + 0, + 0, + 0, //=Any file + 0, + iOdt->RootUid(), + iOdt->ProviderUid(), + iOdt->ThemeUid(),0,ETrue, + iOdt->ThemeFullName(), + (TLanguage)( iOdt->OdtLanguage() ) + ); + + iDefinitionRepository.RegisterNotification( info ); + } + else if( iInstallationType == EInstallationTypeUpdate ) + { + NotifyOdtUpdatedL(); + } + } + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CompleteRequestL(): - configuration %d was successfully installed (EServiceHandler)" ), + iOdt->ThemeUid() ); + } +#endif + } + else if ( aReturnMessage == EhspsInstallPhaseSuccess ) + { + iResult->iIntValue1 = iInstallationPhase; + } + else if ( aReturnMessage == EhspsServiceRequestSheduled ) + { + complete = EFalse; + } + else if (aReturnMessage == EhspsServiceRequestCanceled) + { + iDefinitionRepository.Unlock(); + } + else + { + // installation failed, resetting + // system error and xuikon error are writen in iResult when error was encountered + iInstallationPhase = EhspsPhaseIdle; + + if( !iMessagePtr.IsNull() ) + { + iMessagePtr.WriteL( 2, KNullDesC8, 0 ); + } + + RollBackL ( *iOdt ); + iDefinitionRepository.Unlock(); + } + + if( complete && !iMessagePtr.IsNull() ) + { + RDesWriteStream writeBuf( iResultData ); + iResult->ExternalizeL( writeBuf ); + writeBuf.Close(); + iMessagePtr.WriteL( 0, iResultData, 0 ); + iMessagePtr.WriteL( 2, aHeaderData, 0 ); + iMessagePtr.Complete( aReturnMessage ); + } + } + break; + + case EAsynchronousObject: + { + if( aReturnMessage == EhspsInstallThemeSuccess ) + { + + // Activate the installed application configuration if EhspsThemeStatusMakeActive is set + if( iThemeStatus & EhspsThemeStatusMakeActive ) + { + if ( iConfigurationType == EhspsAppConfiguration ) + { + ActivateThemeL(); + } + } + + // lets try to delete temp files. Server will delete them only if there are not + // current resource holders + iInstallationPhase = EhspsPhaseIdle; + iDefinitionRepository.Unlock(); + + if ( !iDisableNotifications ) + { + if( iInstallationType == EInstallationTypeNew ) + { + // Inform server there are files to be cleaned and cache has been updated + ThspsRepositoryInfo info( ThspsRepositoryEvent( EhspsODTAdded ), + 0, + 0, + 0, //=Any file + 0, + iOdt->RootUid(), + iOdt->ProviderUid(), + iOdt->ThemeUid(),0,ETrue, + iOdt->ThemeFullName(), + (TLanguage)( iOdt->OdtLanguage() ) ); + + iDefinitionRepository.RegisterNotification( info ); + } + else if( iInstallationType == EInstallationTypeUpdate ) + { + NotifyOdtUpdatedL(); + } + } + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::CompleteRequestL(): - configuration %d was successfully installed (EAsynchronousObject)" ), + iOdt->ThemeUid() ); + } +#endif + } + else if( aReturnMessage == EhspsInstallPhaseSuccess ) + { + iResult->iIntValue1 = iInstallationPhase; + } + else if( aReturnMessage == EhspsServiceRequestSheduled ) + { + complete = EFalse; + } + else + { + // installation failed, resetting + // system error and xuikon error are written in iResult when error was encountered + iInstallationPhase = EhspsPhaseIdle; + RollBackL ( *iOdt ); + iDefinitionRepository.Unlock(); + } + + if ( complete ) + { + User::RequestComplete( iRequestStatus, (TInt)aReturnMessage ); + } + } + break; + default: + { + if( wasLocked ) + { + CleanupStack::Pop( &iDefinitionRepository ); + } + + User::Leave( KErrCancel ); + } + break; + } + + if( wasLocked ) + { + CleanupStack::Pop( &iDefinitionRepository ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::IsPluginUsedInAppConfsL +// ----------------------------------------------------------------------------- +// +TBool ChspsInstallationHandler::IsPluginUsedInAppConfsL() + { + TBool isUsed = EFalse; + + const TInt KArrayGranularity = 3; + CArrayPtrSeg* activeAppConfs = new ( ELeave ) CArrayPtrSeg( KArrayGranularity ); + CleanupStack::PushL( activeAppConfs ); + + // Retrieve active application configurations. These are not owned! + GetActiveAppConfsL( *activeAppConfs ); + + // Loop found headers + for( TInt i = 0; i < activeAppConfs->Count(); i++ ) + { + ChspsODT* const header = (*activeAppConfs)[i]; + if( header ) + { + // Clone header to avoid modification of original + ChspsODT* odt = header->CloneL(); + CleanupStack::PushL( odt ); + + // Get full ODT instance with DOM data + User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); + + // Get all plugin instances with the configuration UID that was just installed + RArray pluginIds; + CleanupClosePushL( pluginIds ); + hspsServerUtil::GetPluginIdsByUidL( + *odt, + TUid::Uid( iThemeUid ), + pluginIds ); + isUsed = ( pluginIds.Count() > 0 ); + CleanupStack::PopAndDestroy(); + + CleanupStack::PopAndDestroy( odt ); + + if ( isUsed ) + { + break; + } + } + } + + + + CleanupStack::PopAndDestroy( activeAppConfs ); + + return isUsed; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::NotifyOdtUpdatedL +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::NotifyOdtUpdatedL() + { + // Nothing to do if notifications disabled. + if( iDisableNotifications ) + { + return; + } + + // This method should only be called when type is update. + if( iInstallationType != EInstallationTypeUpdate ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::NotifyOdtUpdatedL(): Error: Installation type is not update." ) ); + } +#endif + + return; + } + + // Sanity check. + if( !iOdt ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::NotifyOdtUpdatedL(): Error: iOdt == NULL." ) ); + } +#endif + + return; + } + + const TInt KArrayGranularity = 2; + CArrayPtrSeg* activeAppConfs = new ( ELeave ) CArrayPtrSeg( KArrayGranularity ); + CleanupStack::PushL( activeAppConfs ); + + // Retrieve active application configurations. These are not owned! + GetActiveAppConfsL( *activeAppConfs ); + + // Notification list. + RArray notifications; + CleanupClosePushL( notifications ); + + // Construct notifications for every changed plugin id + // in every active application configuration. + for( TInt i = 0; i < activeAppConfs->Count(); i++ ) + { + ChspsODT* const activeODT = (*activeAppConfs)[i]; + + // Sanity check. + if( !activeODT ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::NotifyOdtUpdatedL(): Error: active ODT list contains NULL." ) ); + } +#endif + + continue; + } + + // Clone activeOdt to avoid modification of original. + ChspsODT* fullODT = activeODT->CloneL(); + CleanupStack::PushL( fullODT ); + + User::LeaveIfError( iDefinitionRepository.GetOdtL( *fullODT ) ); + + RArray pluginIds; + CleanupClosePushL( pluginIds ); + + // Get plugin ids. + hspsServerUtil::GetPluginIdsByUidL( *fullODT, + TUid::Uid( iOdt->ThemeUid() ), + pluginIds ); + + // Construct notifications. One for each plugin instance + // that is affected by update. + for( TInt j = 0; j < pluginIds.Count(); j++ ) + { + ThspsRepositoryInfo info( + ThspsRepositoryEvent( EhspsODTUpdated ), + fullODT->RootUid(), + fullODT->ThemeUid(), + 0, //=Any file + 0, + iOdt->RootUid(), + iOdt->ProviderUid(), + iOdt->ThemeUid(), + pluginIds[j], + EFalse, + KNullDesC(), + (TLanguage)( fullODT->OdtLanguage() ) ); + + notifications.Append( info ); + } + + CleanupStack::PopAndDestroy(); // pluginIds. + CleanupStack::PopAndDestroy( fullODT ); + fullODT = NULL; + + // Send applications notifications in one group. + for( TInt k = 0; k < notifications.Count(); k++ ) + { + // If last... + if( k == notifications.Count() - 1 ) + { + // ... Modify accordingly. + notifications[ k ].iLastNotification = ETrue; + } + + // Send. + iDefinitionRepository.RegisterNotification( notifications[ k ] ); + } + + // Clean notifications list. + notifications.Reset(); + } + + CleanupStack::PopAndDestroy(); // notifications. + CleanupStack::PopAndDestroy( activeAppConfs ); + activeAppConfs = NULL; + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::GetActiveAppConfsL +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::GetActiveAppConfsL( CArrayPtrSeg& aActiveAppConfs ) + { + const TInt count = iHeaderListCache.Count(); + for( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = iHeaderListCache.At( i ); + + if( header && header->ConfigurationType() == EhspsAppConfiguration ) + { + // Check if application configuration is active. + TInt tmp = 0; + if ( iCentralRepository.Get( header->RootUid(), tmp ) == KErrNone ) + { + if( tmp == header->ThemeUid() ) + { + // Active application configuration found. + aActiveAppConfs.AppendL( header ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// Saves ODT itself as an resource +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::SetODTAsResourceL( ChspsODT& aOdt ) + { + TInt errorCode = KErrNone; + + ChspsResource* res = ChspsResource::NewL(); + CleanupStack::PushL( res ); + + ThspsLockingPolicy lockingPolicy = EhspsUnlocked; + if ( aOdt.Flags() & EhspsThemeStatusLicenceeDefault ) + { + lockingPolicy = EhspsLocked; + } + + // ODT-resource is handled as a cached resource + res->SetLockingPolicy( lockingPolicy ); + res->SetResourceType( EResourceODT ); + res->SetResourceIdL( aOdt.ThemeShortName() ); + //res->SetFileNameL( filepath ); will be set by the repository + res->SetMimeTypeL(TDataType( KUnknownMimeType )); + res->SetConfigurationUid( aOdt.ThemeUid() ); + + // Creates a path for given ODT + iDefinitionRepository.MakeODTPathL( aOdt, *res ); + + aOdt.AddResourceL( res ); + + CleanupStack::Pop(res); + + User::LeaveIfError( errorCode ); + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ActivateThemeL() +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ActivateThemeL() + { + const TUint32 fullMask = 0xFFFFFFFF; + RArray res; + CleanupClosePushL( res ); + + TInt errorCode = KErrNone; + iCentralRepository.FindL( iOdt->RootUid(), fullMask, res ); + if ( res.Count() == 0 ) + { + errorCode = iCentralRepository.Create( iOdt->RootUid(), iOdt->ThemeUid() ); + } + else + { + errorCode = iCentralRepository.Set( iOdt->RootUid(), iOdt->ThemeUid() ); + } + if ( !errorCode ) + { + TUint flags = iOdt->Flags(); + iOdt->SetFlags( flags | EhspsThemeStatusActive ); + + // If not processing ROM installations + if ( !iDisableNotifications ) + { + // inform for cache update to the repository so that everyone will know + // about the change + ThspsRepositoryInfo info( EhspsODTActivated ); + iDefinitionRepository.RegisterNotification( info ); + } + } + res.Close(); + CleanupStack::PopAndDestroy(); //res + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::OnStartElementL +// Verifies that the installer is able to parse the manifest file, +// parses language specifications and resources +// ----------------------------------------------------------------------------- +// + void ChspsInstallationHandler::OnStartElementL( + const RTagInfo& aElement, + const RAttributeArray& aAttributes, + TInt /*aErrorCode*/) + { + TPtrC8 localName = aElement.LocalName().DesC(); + + if( iContent ) + { + delete iContent; + iContent = NULL; + } + + if ( localName == KPackage ) + { + // Check whether the version attribute is specified + TInt argCount = aAttributes.Count(); + if( argCount ) + { + for( TInt argIndex=0; argIndex < argCount; argIndex++ ) + { + const TDesC8& attName = aAttributes[argIndex].Attribute().LocalName().DesC(); + if ( attName.Compare(KPackageVersion) == 0 ) + { + delete iPackageVersion; + iPackageVersion = NULL; + iPackageVersion = HBufC::NewL( KMaxFileName ); + iPackageVersion->Des().Copy( aAttributes[argIndex].Value().DesC() ); + // Is manifest supported by this parser? + iPackageVerSupported = ETrue; //TODO temporarily enable till 0.3 to 1.0 changes have been integrated ( iPackageVersion->Des().Compare(KhspsSupportedManifestVersion) == 0); + break; + } + } + } + } + + else if ( localName == KLocalized ) + { + // From now on, we are parsing filenames of localized resources + iLocalized = ETrue; + } + + else if ( localName == KFileResource ) + { + if ( iMediaType ) + { + delete iMediaType; + iMediaType = NULL; + } + + // Get attributes of the resource element and store them for adding in ::OnEndElementL() + TInt attrCount( aAttributes.Count() ); + for( TInt i=0; i KMaxMediaTypeLength ) + { + length = KMaxMediaTypeLength; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::OnStartElementL(): - mediatype was too long!" ) ); + } +#endif + } + + iMediaType = HBufC8::NewL( length ); + iMediaType->Des().Copy( orginalPtr.Left( length ) ); + } + else if ( aAttributes[i].Attribute().LocalName().DesC() == KTag ) + { + delete iResourceTag; + iResourceTag = NULL; + if ( attValueDes8.Length() ) + { + iResourceTag = attValueDes8.Left( KMaxTagsLength ).AllocL(); + } + } + + } // for + + } + + if ( !iMultiInstanceFound ) + { + iMultiInstance = KMultiInstanceDefaultValue; + } + } + +// ----------------------------------------------------------------------------- +// Parsing of the manifest elements. +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnEndElementL( const RTagInfo& aElement, TInt /*aErrorCode*/ ) + { + TPtrC8 localName = aElement.LocalName().DesC(); + + if ( localName == KFamily ) + { +#if defined(WINSCW) || defined(__WINS__) + const TPtrC8 familyPtr( iContent->Des() ); + iFamilyMask |= ChspsFamilyListener::GetFamilyType( familyPtr ); +#endif // defined(WINSCW) + } + else if ( localName == KConfigurationType ) + { + // Get configuration type from the manifest + if( *iContent == KManifestTypeApp ) + { + iConfigurationType = EhspsAppConfiguration; + } + else if ( *iContent == KManifestTypeView ) + { + iConfigurationType = EhspsViewConfiguration; + } + else if ( *iContent == KManifestTypeWidget ) + { + iConfigurationType = EhspsWidgetConfiguration; + } + else if( *iContent == KManifestTypeTemplate ) + { + iConfigurationType = EhspsTemplateConfiguration; + } + else + { + User::Leave( KErrNotSupported ); + } + } + else if ( localName == KInterfaceUid ) + { + if( iContent ) + { + // Delete extra whitespaces. + iContent->Des().TrimAll(); + + // Convert to Uint. + User::LeaveIfError( hspsServerUtil::HexString2Uint( *iContent, iRootUid ) ); + ApplyUidRangeTestsL( iRootUid ); + } + } + else if ( localName == KProviderUid ) + { + if( iContent ) + { + // Delete extra whitespaces. + iContent->Des().TrimAll(); + + // Convert to Uint. + User::LeaveIfError( hspsServerUtil::HexString2Uint( *iContent, iProviderUid ) ); + ApplyUidRangeTestsL( iProviderUid ); + } + } + else if ( localName == KThemeUid ) + { + if( iContent ) + { + // Delete extra whitespaces. + iContent->Des().TrimAll(); + + // Convert to Uint. + User::LeaveIfError( hspsServerUtil::HexString2Uint( *iContent, iThemeUid ) ); + ApplyUidRangeTestsL( iThemeUid ); + } + } + else if ( localName == KThemeStatus ) + { + if( *iContent == KStatusNone ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusNone; + } + else if( *iContent == KStatusLicenceeDefault ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusLicenceeDefault; + } + else if( *iContent == KStatusLicenceeRestorable ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusLicenceeRestorable; + iThemeStatus = iThemeStatus | EhspsThemeStatusLicenceeDefault; + } + else if( *iContent == KStatusOperatorDefault ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusOperatorDefault; + } + else if( *iContent == KStatusUserDefault ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusUserDefault; + } + else if( *iContent == KStatusMakeActive ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusMakeActive; + } + else if( *iContent == KStatusLocked ) + { + iThemeStatus = iThemeStatus | EhspsThemeStatusLocked; + } + } + else if ( localName == KThemeFullName ) + { + // Store value of the parsed "fullname" element + if ( iThemeFullName ) + { + delete iThemeFullName; + iThemeFullName = NULL; + } + iThemeFullName = HBufC::NewL( KMaxFileName ); + TInt contentLength = iContent->Des().Length(); + if ( contentLength > KMaxFileName ) + { + contentLength = KMaxFileName; + } + TPtr ptr( iThemeFullName->Des() ); + ptr.Copy( iContent->Des().Left(contentLength) ); + } + else if ( localName == KThemeShortName ) + { + delete iThemeShortName; + iThemeShortName = NULL; + iThemeShortName = HBufC8::NewL( KMaxFileName ); + TPtr8 themeShortNameDes( iThemeShortName->Des() ); + themeShortNameDes = *iContent; + } + else if ( localName == KThemeVersion ) + { + delete iThemeVersion; + iThemeVersion = NULL; + iThemeVersion = HBufC8::NewL( KMaxFileName ); + TPtr8 themeVersionDes( iThemeVersion->Des() ); + themeVersionDes = *iContent; + } + else if ( localName == KThemeDesc ) + { + if ( iContent ) + { + delete iThemeDesc; + iThemeDesc = NULL; + iThemeDesc = HBufC8::NewL( KMaxDescLength ); + TPtr8 descPtr8( iThemeDesc->Des() ); + descPtr8.Copy( (*iContent).Left( KMaxDescLength ) ); + } + } + else if ( localName == KFileLogo ) + { + if ( iContent ) + { + // Get possible file references and add them to the + // resource array with a logo tag + HBufC* result = NULL; + ParseIconDeclarationL( + *iContent, + KObjectAttrTagLogo, + result ); + if ( result ) + { + // Store logo declaration + CleanupStack::PushL( result ); + iOdt->SetLogoFileL( *result ); + CleanupStack::PopAndDestroy(); + } + } + } + else if ( localName == KFilePreview ) + { + if ( iContent ) + { + // Get possible file references and add them to the + // resource array with a preview tag + HBufC* result = NULL; + ParseIconDeclarationL( + *iContent, + KObjectAttrTagPreview, + result + ); + if ( result ) + { + // Store preview declaration + CleanupStack::PushL( result ); + iOdt->SetPreviewFileL( *result ); + CleanupStack::PopAndDestroy(); + } + } + } + else if ( localName == KFileXML ) + { + delete iXmlFile; + iXmlFile = NULL; + iXmlFile = HBufC::NewL( KMaxFileName ); + TPtr fileDes( iXmlFile->Des() ); + + fileDes.Copy( iThemeFilePath ); + HBufC* data = CnvUtfConverter::ConvertToUnicodeFromUtf8L( *iContent ); + fileDes.Append( *data ); + delete data; + + if( !BaflUtils::FileExists( iFsSession, fileDes ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::OnEndElementL(): - XML file does not exist '%S'" ), + &fileDes ); + } +#endif + + iFileNotFound = ETrue; + iResult->iXuikonError = KErrXmlFileNotFound; + } + } + else if ( localName == KFileDTD ) + { + // Parse name of the DTD files + if ( !iContent || iContent->Length() < 1 ) + { + User::Leave( KErrArgument ); + } + + if ( iDtdFile ) + { + delete iDtdFile; + iDtdFile = 0; + } + iDtdFile = HBufC::NewL( iContent->Length() ); + iDtdFile->Des().Copy( iContent->Des() ); + } + else if ( localName == KFileResource ) + { + // Following attributes are parsed in OnStartElement callback + TPtrC8 mediaPtr; + if ( iMediaType ) + { + mediaPtr.Set( iMediaType->Des() ); + } + TPtrC8 tagsPtr; + if ( iResourceTag ) + { + tagsPtr.Set( iResourceTag->Des() ); + } + + // Parse name of the resource file and make 8bit to 16bit conversion + HBufC* fileName = CnvUtfConverter::ConvertToUnicodeFromUtf8L( *iContent ); + if ( !fileName || fileName->Des().Length() < 1 ) + { + User::Leave( KErrArgument ); + } + CleanupStack::PushL( fileName ); + + // If parsing localized resources + if ( iLocalized ) + { + // Add locale specific resources into temp array + AddResourceL( + *iTempLocalizedResourceList, + *fileName, + ELangNone, + EResourceOther, + mediaPtr, + tagsPtr ); + } + else + { + // If Xuikon resource + TFileName interfacePath( GetInterfacePath() ); + HBufC* resourceFile = NULL; + if( interfacePath.Length() ) + { + _LIT(KSubFolder, "00\\"); + resourceFile = HBufC::NewLC( interfacePath.Length() + KSubFolder().Length() + fileName->Length() ); + resourceFile->Des().Copy( interfacePath ); + resourceFile->Des().Append( KSubFolder ); + resourceFile->Des().Append( *fileName ); + } + else + { + resourceFile = HBufC::NewLC( iThemeFilePath.Length() + fileName->Length() ); + resourceFile->Des().Copy( iThemeFilePath ); + resourceFile->Des().Append( *fileName ); + } + + // Validate the file + if( !BaflUtils::FileExists( iFsSession, *resourceFile ) ) + { +#ifdef HSPS_LOG_ACTIVE + TBuf8 name8; + name8.Copy( *resourceFile ); + if( iLogBus ) + { + iLogBus->LogText( _L8( "ChspsInstallationHandler::OnEndElementL(): - resource file does not exist '%S'" ), + &name8 ); + } +#endif + iFileNotFound = ETrue; + iResult->iXuikonError = KErrResourceFileNotFound; + } + + // Add common resources + AddResourceL( + *iResourceList, + *resourceFile, + ELangNone, + EResourceOther, + mediaPtr, + tagsPtr ); + + CleanupStack::PopAndDestroy( resourceFile ); + } + + CleanupStack::PopAndDestroy( fileName ); + + if ( iMediaType ) + { + delete iMediaType; + iMediaType = NULL; + } + if ( iResourceTag ) + { + delete iResourceTag; + iResourceTag = NULL; + } + } + else if ( localName == KMultiInstance) + { + iMultiInstanceFound = ETrue; + if( iContent ) + { + // Delete extra whitespaces. + iContent->Des().TrimAll(); + + // Convert to int + TLex8 lex( iContent->Des() ); + TInt err = lex.Val( iMultiInstance ); + // iContent is not a number - check for strings + if ( err != KErrNone ) + { + if ( iContent->CompareF( KMultiInstanceUnlimited ) + == KErrNone ) + { + iMultiInstance = KMultiInstanceUnlimitedValue; + } + else if ( iContent->CompareF( KMultiInstanceHidden ) == + KErrNone ) + { + iMultiInstance = KMultiInstanceHiddenValue; + } + else + { + User::Leave( KErrArgument ); + } + } + // iContent is a number - check whether it is valid + else + { + if ( ( iMultiInstance < KMultiInstanceMinimumCountValue ) || + ( iMultiInstance > KMultiInstanceMaximumCountValue ) ) + { + User::Leave( KErrArgument ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// The needed memory for each element information is reserved here. +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::OnContentL(const TDesC8& aBytes, TInt aErrorCode) + { + if ( aErrorCode == KErrNone ) + { + if ( !iContent ) + { + iContent = HBufC8::NewL( aBytes.Size() ); + *iContent = aBytes; + } + else + { + iContent = iContent->ReAllocL( iContent->Size() + aBytes.Size() ); + TPtr8 c( iContent->Des() ); + c.Append( aBytes ); + } + } + + } + +// ----------------------------------------------------------------------------- +// Disables "configuration was installed" notifications +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::DisableNotifications() + { + iDisableNotifications = ETrue; + } + +// ----------------------------------------------------------------------------- +// Finds locale specific subdirectories and DTD resources and appends those +// into the resource array +// Should be executed prior to the CheckHeader method! +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::AddHspsLocalesV2L( + const TDesC& aPath ) + { + // Find all locale specific subfolders + TFindFile fileFinder( iFsSession ); + _LIT( KFilter, "*" ); + CDir* fileList( NULL ); + fileFinder.FindWildByDir( KFilter, aPath, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + TFileName localePath; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + if ( entry.IsDir() ) + { + TInt languageIndex = 0; + TLex lex( entry.iName ); + TInt error = lex.Val( languageIndex ); + + // See enumarations from e32lang.h + if( !error && languageIndex >= ELangTest ) + { + // If we found the first language specification + if ( !iDefaultSpecificationSet ) + { + // Assume this is the default language shown incase + // there is no locale for the active UI language + iDefaultSpecification = (TLanguage)languageIndex; + iDefaultSpecificationSet = ETrue; + } + + // Setup a path to the subdirectory + localePath.Copy( aPath ); + localePath.Append( entry.iName ); + localePath.Append( KPathDelim ); + + // Find localized resources + AddLocalizedResourcesDTDV2L( + localePath, + (TLanguage)languageIndex ); + } + } + + } + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + + // If no DTD files were found + if ( iDefaultSpecification != ELangTest || !iDefaultSpecificationSet ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L8( "ChspsInstallationHandler::AddHspsLocalesV2L(): - mandatory test locale is missing!" ) ); + } +#endif + // Halt installation, test language was not found + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Adds localized resources from the provided subdirectory +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::AddLocalizedResourcesDTDV2L( + const TDesC& aPath, + const TLanguage aLanguage ) + { + // Append path with the default name of DTD files + const TInt len = aPath.Length() + iDtdFile->Des().Length(); + HBufC* dtdPath = HBufC::NewLC( len ); + dtdPath->Des().Copy( aPath ); + dtdPath->Des().Append( *iDtdFile ); + + // Check whether the file exists + if( !BaflUtils::FileExists( iFsSession, *dtdPath ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::AddLocalizedResourcesL(): - DTD file was not found '%S'" ), + &dtdPath ); + } +#endif + iFileNotFound = ETrue; + iResult->iXuikonError = KErrDtdFileNotFound; + User::Leave( KErrNotFound ); + } + + // Store locale specific DTD files into the resource array + TPtrC8 mediaType; + TPtrC8 tags; + AddResourceL( + *iResourceList, + *dtdPath, + aLanguage, + EResourceDTD, + mediaType, + tags ); + + CleanupStack::PopAndDestroy( dtdPath ); + } + +void ChspsInstallationHandler::AddInterfaceResourcesV2L( + const TDesC& aPath ) + { + // Find all locale specific subfolders + TFindFile fileFinder( iFsSession ); + _LIT( KFilter, "*" ); + CDir* fileList( NULL ); + fileFinder.FindWildByDir( KFilter, aPath, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + TFileName localePath; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + if ( entry.IsDir() ) + { + TInt languageIndex = 0; + TLex lex( entry.iName ); + TInt error = lex.Val( languageIndex ); + + // See enumarations from e32lang.h + if( !error && languageIndex >= ELangTest ) + { + // If we found the first language specification + if ( !iDefaultSpecificationSet ) + { + // Assume this is the default language shown incase + // there is no locale for the active UI language + iDefaultSpecification = (TLanguage)languageIndex; + iDefaultSpecificationSet = ETrue; + } + + // Setup a path to the subdirectory + localePath.Copy( aPath ); + localePath.Append( entry.iName ); + localePath.Append( KPathDelim ); + + // Find localized resources + AddLocalizedResourcesV2L( + localePath, + (TLanguage)languageIndex ); + } + } + + } + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + + // If no DTD files were found + if ( iDefaultSpecification != ELangTest || !iDefaultSpecificationSet ) + { + // Halt installation, test language was not found + User::Leave( KErrNotFound ); + } + } + +void ChspsInstallationHandler::AddLocalizedResourcesV2L( + const TDesC& aPath, + const TLanguage aLanguage ) + { + TFindFile fileFinder( iFsSession ); + _LIT( KFilter, "*" ); + CDir* fileList( NULL ); + fileFinder.FindWildByDir( KFilter, aPath, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + + TFileName localePath; + ChspsResource* resource = NULL; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + if ( !entry.IsDir() ) + { + TParsePtrC parserPtr( entry.iName ); + TFileName modName = hspsServerUtil::GetFixedOdtName( entry.iName ); + + TBool addingOk = EFalse; + for( TInt resourceIndex=0; resourceIndex < iTempLocalizedResourceList->Count(); resourceIndex++ ) + { + resource = iTempLocalizedResourceList->At( resourceIndex ); + if( modName.CompareF( resource->FileName() ) == 0 ) + { + addingOk = ETrue; + break; + } + } + if ( addingOk ) + { + HBufC* resourcePath = HBufC::NewLC( aPath.Length() + entry.iName.Length() ); + resourcePath->Des().Copy( aPath ); + resourcePath->Des().Append( entry.iName ); + + TPtrC8 mimeType; + TPtrC8 tag; + + HBufC8* tagBuf8 = NULL; + if ( resource->Tags().Length() ) + { + tagBuf8 = HBufC8::NewLC( resource->Tags().Length() ); + tagBuf8->Des().Copy( resource->Tags() ); + tag.Set( tagBuf8->Des() ); + } + + // Add localized files into the resource array + AddResourceL( + *iResourceList, + *resourcePath, + aLanguage, + EResourceOther, + mimeType, + tag ); + + if ( tagBuf8 ) + { + CleanupStack::PopAndDestroy( tagBuf8 ); + } + CleanupStack::PopAndDestroy( resourcePath ); + } + } + } + + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + } + +// ----------------------------------------------------------------------------- +// Finds locale specific subdirectories and resources and appends those +// into the resource array +// Should be executed prior to the CheckHeader method! +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::AddLocalesL( + const TDesC& aPath ) + { + // Find all locale specific subfolders + TFindFile fileFinder( iFsSession ); + _LIT( KFilter, "*" ); + CDir* fileList( NULL ); + fileFinder.FindWildByDir( KFilter, aPath, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + TFileName localePath; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + if ( entry.IsDir() ) + { + TInt languageIndex = 0; + TLex lex( entry.iName ); + TInt error = lex.Val( languageIndex ); + + // See enumarations from e32lang.h + if( !error && languageIndex >= ELangTest ) + { + // If we found the first language specification + if ( !iDefaultSpecificationSet ) + { + // Assume this is the default language shown incase + // there is no locale for the active UI language + iDefaultSpecification = (TLanguage)languageIndex; + iDefaultSpecificationSet = ETrue; + } + + // Setup a path to the subdirectory + localePath.Copy( aPath ); + localePath.Append( entry.iName ); + localePath.Append( KPathDelim ); + + // Find localized resources + AddLocalizedResourcesL( + localePath, + (TLanguage)languageIndex ); + } + } + + } + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + + // If no DTD files were found + if ( iDefaultSpecification != ELangTest || !iDefaultSpecificationSet ) + { + // Halt installation, test language was not found + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Adds localized resources from the provided subdirectory +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::AddLocalizedResourcesL( + const TDesC& aPath, + const TLanguage aLanguage ) + { + // If FileDTD was declared + if ( iDtdFile && iDtdFile->Des().Length() ) + { + // Append path with the default name of DTD files + const TInt len = aPath.Length() + iDtdFile->Des().Length(); + HBufC* dtdPath = HBufC::NewLC( len ); + dtdPath->Des().Copy( aPath ); + dtdPath->Des().Append( *iDtdFile ); + + // Check whether the file exists + if( !BaflUtils::FileExists( iFsSession, *dtdPath ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::AddLocalizedResourcesL(): - DTD file was not found '%S'" ), + &dtdPath ); + } +#endif + iFileNotFound = ETrue; + iResult->iXuikonError = KErrDtdFileNotFound; + User::Leave( KErrNotFound ); + } + + // Store locale specific DTD files into the resource array + TPtrC8 mediaType; + TPtrC8 tagsPtr; + AddResourceL( + *iResourceList, + *dtdPath, + aLanguage, + EResourceDTD, + mediaType, + tagsPtr ); + + CleanupStack::PopAndDestroy( dtdPath ); + } + + // Store locale specific resources if the "localization" element has been declared in XML definition + ChspsResource* resource = NULL; + for( TInt resourceIndex=0; resourceIndex < iTempLocalizedResourceList->Count(); resourceIndex++ ) + { + resource = iTempLocalizedResourceList->At( resourceIndex ); + + HBufC* resourcePath = HBufC::NewLC( aPath.Length() + resource->FileName().Length() ); + resourcePath->Des().Copy( aPath ); + resourcePath->Des().Append( resource->FileName() ); + + TDataType dataType( resource->MimeType() ); + TPtrC8 tagsPtr; + if ( iResourceTag ) + { + tagsPtr.Set( iResourceTag->Des() ); + } + + // Add localized files into the resource array + AddResourceL( + *iResourceList, + *resourcePath, + aLanguage, + EResourceOther, + dataType.Des8(), + tagsPtr + ); + + CleanupStack::PopAndDestroy( resourcePath ); + } + + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ApplyUidRangeTestsL +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ApplyUidRangeTestsL( const TUint aUid ) + { + // Check for TUint to TInt conversion + const TInt intValue( aUid ); + if ( intValue < 1 ) + { + // Check UID ranges in the manifest file +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsInstallationHandler::ApplyUidRangeTestsL() - Invalid UID value '%d'" ), aUid ); + } +#endif + User::Leave( KErrArgument ); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::ParseIconDeclarationL +// ----------------------------------------------------------------------------- +// +void ChspsInstallationHandler::ParseIconDeclarationL( + HBufC8& aValue8, + const TDesC8& aTag, + HBufC*& aResultString ) + { + // 8bit > 16bit conversion + TInt size = KMaxFileName - iThemeFilePath.Length(); + aResultString = HBufC::NewLC( KMaxFileName ); + TPtr resultPtr( aResultString->Des() ); + resultPtr.Copy( aValue8.Des().Left( size ) ); + + // check whether skin/mif/uid declarations were used + TFileName filename; + if ( hspsServerUtil::IsFile( resultPtr, filename ) ) + { + // check whether the file reference is valid + TPath fullname; + fullname.Copy( iThemeFilePath ); + fullname.Append( filename ); + + if( !BaflUtils::FileExists( iFsSession, fullname ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( + _L( "ChspsInstallationHandler::ParseIconDeclarationL(): - '%S' was not found " ), + &fullname ); + } +#endif +// User::Leave( KErrNotFound ); + } + else + { + // Store logo as a common resource file + TPtrC8 mediaType; + AddResourceL( + *iResourceList, + fullname, + ELangNone, + EResourceOther, + mediaType, + aTag ); + + // get offset of the filename + TInt nameOffset = resultPtr.FindF( (TPtrC)filename ); + if ( nameOffset >= 0 ) + { + // get relative path under the HSPS + if ( iRootUid < 1 || iProviderUid < 1 || iThemeUid < 1 || !iThemeVersion || iThemeVersion->Des().Length() < 1 ) + { + User::Leave( KErrArgument ); + } + // 8bit > 16bit + HBufC* verBuf = HBufC::NewLC( iThemeVersion->Des().Length() ); + verBuf->Des().Copy( *iThemeVersion ); + _LIT(KPathFormat, "%D\\%D\\%D\\%S\\sources\\"); + TFileName relativePath; + relativePath.Format( + KPathFormat, + iRootUid, + iProviderUid, + iThemeUid, + verBuf ); + if ( resultPtr.Length() + relativePath.Length() > KMaxFileName - 1 ) + { + User::Leave( KErrArgument ); + } + resultPtr.Insert( nameOffset, relativePath ); + CleanupStack::PopAndDestroy( verBuf ); + } + + } + + } // IsFile + + CleanupStack::Pop( aResultString ); + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsinstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstaller.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "hsps_builds_cfg.hrh" + +#include +#include "hspsinstaller.h" +#include "hspsthemeserver.h" +#include "hspsinstallationhandler.h" +#include "hspsthememanagement.h" + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +CHSPSInstaller* CHSPSInstaller::NewL( + ChspsThemeServer& aServer ) + { + CHSPSInstaller* self = new ( ELeave ) CHSPSInstaller( aServer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CHSPSInstaller::ConstructL() + { + iInstallationHandler = ChspsInstallationHandler::NewL( iServer ); + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::CHSPSInstaller() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +CHSPSInstaller::CHSPSInstaller( + ChspsThemeServer& aServer ): + CActive(EPriorityStandard), + iServer( aServer ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::~CHSPSInstaller() +// Destructor. +// ----------------------------------------------------------------------------- +// +CHSPSInstaller::~CHSPSInstaller() + { + Cancel(); // Causes call to DoCancel() + delete iLoop; + delete iInstallationHandler; + } + + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::InstallConfigurationL +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage CHSPSInstaller::InstallConfigurationL( + const TDesC& aFileName ) + { + // Start installation by reading the manifest file + iRet = iInstallationHandler->hspsInstallTheme( aFileName, iHeaderData ); + if ( iRet == EhspsInstallThemeSuccess && !IsActive() ) + { + // Continue with remaining installation phases + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + + // Wait until the installation phases have been executed (async->sync) + iLoop = new ( ELeave )CActiveSchedulerWait(); + iLoop->Start(); + + } + + return iRet; + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::RunError +// ----------------------------------------------------------------------------- +// +TInt CHSPSInstaller::RunError( TInt /*aError*/ ) + { + // Called when error occurred in asynchronous request + iLoop->AsyncStop(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::RunL +// ----------------------------------------------------------------------------- +// +void CHSPSInstaller::RunL() + { + iRet = (ThspsServiceCompletedMessage)iStatus.Int(); + switch ( iStatus.Int() ) + { + case EhspsInstallPhaseSuccess: + { + // Execute next phase of the installation + if ( !IsActive() ) + { + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + } + } + break; + + case EhspsInstallThemeSuccess: + case EhspsInstallThemeFailed: + default: + { + // Allow continuation of the InstallTheme function + iLoop->AsyncStop(); + } + break; + } + } + +// ----------------------------------------------------------------------------- +// CHSPSInstaller::DoCancel() +// ----------------------------------------------------------------------------- +// +void CHSPSInstaller::DoCancel() + { + // Cancels any outstanding operation - nothing to do + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsmaintenancehandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4602 @@ +/* +* Copyright (c) 2002-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: Implementation of HSPS MhspsMaintenanceService interface defined +* in hspsThemeManagement.h. For details, see header file. +* +*/ + + +#include + +#include "hsps_builds_cfg.hrh" +#include "hspsthememanagement.h" +#include "hspsdefinitionrepository.h" +#include "hspsresource.h" +#include "hspsresult.h" +#include "hspspluginidlist.h" +#include "hspsodt.h" +#include "hspsmaintenancehandler.h" +#include "hspsthemeserver.h" +#include "hspsinstallationhandler.h" +#include "hspssecurityenforcer.h" +#include "hspsconfiguration.h" +#include "hspsdomdocument.h" +#include "hspsdomlist.h" +#include "hspsdomdepthiterator.h" +#include "hspsdomnode.h" +#include "hspsdomattribute.h" +#include "hspsmanifest.h" +#include "hspsserverutil.h" +#include "hspsthemeserversession.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + + +_LIT(KSourcesFolder, "\\sources\\"); +_LIT(KLocalesFolder, "\\locales\\"); + +const TInt KAdditionalRequiredDiskSpace = 256 * 1024; /// 256KB in bytes. + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Callback function for removing repository lock if error occurs while repository is locked +// Returns: void +// ----------------------------------------------------------------------------- +// +LOCAL_C void UnlockRepository( TAny* aObject ) + { + ChspsDefinitionRepository* DefRep = reinterpret_cast( aObject ); + + if( DefRep->Locked() ) + { + DefRep->Unlock(); + } + } + +// ----------------------------------------------------------------------------- +// ResetAndDestroyArray Callback function for cleaning up the CArrayPtr. +// Returns: void +// ----------------------------------------------------------------------------- +// +LOCAL_C void ResetAndDestroyArray( TAny* aArray ) + { + reinterpret_cast*>( aArray )->ResetAndDestroy(); + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ChspsMaintenanceHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsMaintenanceHandler::ChspsMaintenanceHandler( + ChspsThemeServer& aThemeServer, + const TUint aSecureId ): + CTimer(EPriorityLow), + iLanguage ( aThemeServer.DeviceLanguage() ), + iThemeServer( aThemeServer ), + iSecureId( aSecureId ), + iCentralRepository( aThemeServer.CentralRepository() ), + iDefinitionRepository( aThemeServer.DefinitionRepository() ), + iSecurityEnforcer( aThemeServer.SecurityEnforcer() ), + iHeaderListCache( aThemeServer.HeaderListCache() ), + iFileMan( NULL ) + { + iDeliveryCount = 0; + iSubscription = EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceService::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsMaintenanceHandler* ChspsMaintenanceHandler::NewL( + ChspsThemeServer& aThemeServer, + const TUint aSecureId ) + { + ChspsMaintenanceHandler* h = ChspsMaintenanceHandler::NewLC( + aThemeServer, aSecureId ); + CleanupStack::Pop(h); + return (h); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceService::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsMaintenanceHandler* ChspsMaintenanceHandler::NewLC( + ChspsThemeServer& aThemeServer, + const TUint aSecureId ) + { + ChspsMaintenanceHandler* h = new (ELeave) ChspsMaintenanceHandler( + aThemeServer, aSecureId ); + CleanupStack::PushL(h); + h->ConstructL(); + return (h); + } + +// Destructor +ChspsMaintenanceHandler::~ChspsMaintenanceHandler() + { + Cancel(); + if (iHeaderDataList) + { + iHeaderDataList->ResetAndDestroy(); + } + delete iHeaderDataList; + delete iSearchMask; + delete iSetMask; + delete iResult; + delete iFileMan; + iDefinitionRepository.UnregisterObserver( *this ); + } + + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ConstructL() + { + // call the base class ConstructL + CTimer::ConstructL(); + iHeaderDataList = new( ELeave ) CArrayPtrSeg(KHeaderListGranularity); + iResult = ChspsResult::NewL(); + // add this timer to the active scheduler + CActiveScheduler::Add(this); + iDefinitionRepository.RegisterObserverL( *this ); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceGetListHeadersL +// Fetches the header list from repository and writes the first header back to the caller +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceGetListHeadersL(const RMessage2& aMessage) + { + // only allow one request to be submitted at a time + // all synch call must use local message pointer variable + RMessagePtr2 messagePtr = aMessage; + ThspsServiceCompletedMessage ret = EhspsGetListHeadersFailed; + iDeliveryCount = 0; + + if (!IsActive() && !iSubscription) // first request + { + TBuf8 searchMaskData;// save a search mask + messagePtr.ReadL(1,searchMaskData,0); + // constructing iSearcMask -object + if (iSearchMask) + { + delete iSearchMask; + iSearchMask = NULL; + } + iSearchMask = ChspsODT::NewL(); + iSearchMask->UnMarshalHeaderL(searchMaskData); + + // check the device language + iLanguage = iThemeServer.DeviceLanguage(); + iSearchMask->SetOdtLanguage( (TInt)iLanguage ); + + // now there is a subscription + iSubscription = ETrue; + // fetch the header list from repository + ret = hspsGetListHeaders(searchMaskData, *iHeaderDataList); + if (ret == EhspsGetListHeadersSuccess) + { + TInt count = iHeaderDataList->Count(); + // result informs list count in query + iResult->iIntValue1 = count; + if ( !count ) + { + ret = EhspsGetListHeadersEmpty; + } + } + + CompleteRequest(ret, messagePtr); + } + else + { + iResult->iSystemError = KErrInUse; + iResult->iSystemError = KErrInUse; + CompleteRequest( EhspsServiceRequestError, iMessagePtr ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceGetNextHeaderL +// Writes back to the caller the next headers in the header list one at a time +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceGetNextHeaderL(const RMessage2& aMessage) + { + // only allow one request to be submitted at a time + iRequestMessage = (ThspsServiceRequestMessage) aMessage.Function(); + iCompletedMessage = EhspsGetListHeadersUpdate; + // now using message pointer as member variable because of asynch call + iMessagePtr = aMessage; + if ( !IsActive() && iSubscription) // requesting next as should + { + // is there headers to delivere left + if (iHeaderDataList->Count() > iDeliveryCount) + { + // Handle copying of logo icon resources + CopyIconsToHomescreenL( aMessage.SecureId().iId ); + + // at least one header on the list + TPtr8 bufPtr( iHeaderDataList->At(iDeliveryCount)->Des() ); + iMessagePtr.WriteL(2, bufPtr, 0); + // add list count + iDeliveryCount++; + // deliver a list item + CompleteRequest( EhspsGetListHeadersUpdate, iMessagePtr ); + } + } + else + { + iResult->iSystemError = KErrInUse; + iResult->iXuikonError = KErrPermissionDenied; + CompleteRequest( EhspsServiceRequestError, iMessagePtr ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::CopyIconsToHomescreenL +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::CopyIconsToHomescreenL( + const TUint aAppUid ) + { + HBufC8* headerData = iHeaderDataList->At(iDeliveryCount); + ChspsODT* header = ChspsODT::UnMarshalHeaderLC( headerData->Des() ); + if ( iServerSession && header ) + { + if( header->LogoFile().Length() ) + { + // If a file reference was found from the logo declaration + TFileName filename; + if ( hspsServerUtil::IsFile( header->LogoFile(), filename ) ) + { + if ( !iFileMan ) + { + iFileMan = CFileMan::NewL( iServerSession->FileSystem() ); + } + + // Get client's private directory: + // We should use some common directory if there are more than one SAPI clients, + // for now we can copy files to AI3's private folder + _LIT( KPrivatePath, "c:\\private\\%X\\"); + TPath privatePath; + privatePath.Format( KPrivatePath, aAppUid ); + + // Append private path to the logo file reference + TInt offset = header->LogoFile().FindF( filename ); + if ( offset >= 0 ) + { + // Insert private path prior to the file reference + HBufC* logoBuf = HBufC::NewLC( + privatePath.Length() + header->LogoFile().Length() ); + logoBuf->Des().Copy( header->LogoFile() ); + logoBuf->Des().Insert( offset, privatePath ); + header->SetLogoFileL( logoBuf->Des() ); + CleanupStack::PopAndDestroy( logoBuf ); + + // Replace the serialized header descriptor + HBufC8* newHeaderData = header->MarshalHeaderL(); + CleanupStack::PushL( newHeaderData ); + iHeaderDataList->InsertL( + iDeliveryCount, + newHeaderData ); + CleanupStack::Pop( newHeaderData ); + delete headerData; + headerData = 0; + iHeaderDataList->Delete( iDeliveryCount + 1 ); + } + + // Set target directory for file copying + TPath targetPath; + targetPath.Copy( privatePath ); + targetPath.Append( filename ); + + // Set source directory for file copying + TFileName sourceFile; + _LIT( KThemesFolder, "themes\\" ); + iServerSession->FileSystem().SessionPath( sourceFile ); + sourceFile.Append( KThemesFolder ); + sourceFile.Append( filename ); + + // Create the target path and copy files when required + hspsServerUtil::CopyResourceFileL( + iServerSession->FileSystem(), + *iFileMan, + targetPath, + sourceFile ); + } + } + } + CleanupStack::PopAndDestroy( header ); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::SetServerSession +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::SetServerSession( + ChspsThemeServerSession* aServerSession ) + { + iServerSession = aServerSession; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceSetActiveThemeL +// Sets the active theme and writes back that themes header data +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceSetActiveThemeL(const RMessage2& aMessage) + { + ThspsServiceCompletedMessage ret = EhspsSetActiveThemeFailed; + // using message pointer as a local variable because of a synch call + RMessagePtr2 messagePtr = aMessage; + + TBuf8 setMaskData; + messagePtr.ReadL(1,setMaskData,0); + //constructing setMask -object + if( iSetMask ) + { + delete iSetMask; + iSetMask = NULL; + } + iSetMask = ChspsODT::NewL(); + iSetMask->UnMarshalHeaderL( setMaskData ); + + // calling actual activation + ChspsODT* odt; + odt = ChspsODT::NewL(); + CleanupStack::PushL(odt); + + + iDefinitionRepository.Lock(); + // In case of error. repository is unlocked + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + ret = hspsSetActiveTheme( *iSetMask, *odt ); + if ( ret == EhspsSetActiveThemeSuccess ) + { + // Store updated ODT to definition repository + iDefinitionRepository.SetOdtL( *odt ); + + HBufC8* headerdata; + headerdata = odt->MarshalHeaderL(); + if (headerdata != NULL) + { + // Write activated ODT header data to client + CleanupStack::PushL(headerdata); + messagePtr.WriteL(2,headerdata->Des(),0); + CleanupStack::PopAndDestroy(headerdata); + + ThspsRepositoryInfo info( EhspsODTActivated ); + iDefinitionRepository.RegisterNotification( info ); + } + } + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + + + CleanupStack::Pop(odt); + if (odt) + { + delete odt; + odt = NULL; + } + + // complete the message + CompleteRequest(ret, messagePtr ); + } + + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceRestoreDefaultL +// Restores the default theme according to the information in aMessage and writes +// back restored themes header data. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceRestoreDefaultL( const RMessage2& aMessage ) + { + ThspsServiceCompletedMessage ret = EhspsRestoreDefaultFailed; + // using message pointer as a local variable because of synch call + RMessagePtr2 messagePtr = aMessage; + // TIpcArgs(TInt aAppUid, &aSetMaskData, &aHeaderData) + TBuf8 setMaskData; + messagePtr.ReadL( 1, setMaskData, 0 ); + //constructing setMask -object + if ( iSetMask ) + { + delete iSetMask; + iSetMask = NULL; + } + iSetMask = ChspsODT::NewL(); + iSetMask->UnMarshalHeaderL( setMaskData ); + ChspsODT* odt; + odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + + if ( !iDefinitionRepository.Locked() ) + { + iDefinitionRepository.Lock(); + // In case of error. repository is unlocked + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + // calling actual restoration + ret = hspsRestoreDefault( *iSetMask, *odt ); + if ( ret == EhspsRestoreDefaultSuccess ) + { + HBufC8* headerdata; + headerdata = odt->MarshalHeaderL(); + if (headerdata != NULL) + { + CleanupStack::PushL( headerdata ); + messagePtr.WriteL( 2, headerdata->Des(), 0 ); + CleanupStack::PopAndDestroy( headerdata ); + + // inform for cache update to the repository so that everyone will know + // about the change + ThspsRepositoryInfo info( EhspsCacheUpdate ); + iDefinitionRepository.RegisterNotification( info ); + } + } + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + } + else + { + ret = EhspsRestoreDefaultFailed; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceRestoreDefaultL(): - failed, repository is locked." ) ); + } +#endif + } + + + CleanupStack::PopAndDestroy( odt ); + // complete the message + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceRemoveThemeL +// Reads ODT from RMessage2 and calls the actual removal method. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceRemoveThemeL( const RMessage2& aMessage ) + { + ThspsServiceCompletedMessage ret = EhspsRemoveThemeFailed; + // using message pointer as a local variable because of synch call + RMessagePtr2 messagePtr = aMessage; + + // TIpcArgs(TInt aAppUid, &aSetMaskData, &aHeaderData) + TBuf8 setMaskData; + messagePtr.ReadL( 1, setMaskData, 0 ); + + //constructing setMask -object + if ( iSetMask ) + { + delete iSetMask; + iSetMask = NULL; + } + + iSetMask = ChspsODT::NewL(); + iSetMask->UnMarshalHeaderL( setMaskData ); + + // calling actual removal + ret = hspsRemoveThemeL( *iSetMask ); + + // complete the message + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// Appends an application configuration with the provided plugin configuration +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceAddPluginL( const RMessage2& aMessage ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsAddPluginFailed; + iResult->iXuikonError = KErrNotFound; + TInt err = KErrNone; + + // Parameters + RMessagePtr2 messagePtr = aMessage; + + // IPC slots: + // #0) output: externalized ChspsResult for error handling + // #1) input: ThpsParamAddPlugin struct + // #2) output: added plugin id + + // Get service parameters from IPC slot #1 + ThpsParamAddPlugin params; + TPckg packagedStruct(params); + aMessage.ReadL(1, packagedStruct); + const TInt appUid = params.appUid; + const TInt configurationId = params.configurationId; + const TInt pluginUid = params.pluginUid; + const TInt newPos = params.positionIndex; + + // Application configuration + ChspsODT *appODT = NULL; + if ( !err ) + { + // Get active application configuration from the central repository + TInt appConfUid; + err = iCentralRepository.Get( appUid, appConfUid ); + if ( err || appConfUid < 1 ) + { + err = KErrNotFound; + } + else + { + // Get application configuration + appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + err = iThemeServer.GetConfigurationL( + appUid, + appConfUid, + *appODT ); + } + } + + // Plugin configuration + ChspsODT* pluginODT = NULL; + if ( !err ) + { + // Find the plugin configuration (interface is unknown, so 1st argument is set to zero) + pluginODT = ChspsODT::NewL(); + CleanupStack::PushL( pluginODT ); + err = iThemeServer.GetConfigurationL( + 0, + pluginUid, + *pluginODT ); + } + + // Check needed space for addition. Returns system wide error code. + if( !err ) + { + err = hspsServerUtil::EnoughDiskSpaceAvailableL( + *pluginODT, + iThemeServer.DeviceLanguage(), + iServerSession->FileSystem(), + EDriveC, + KAdditionalRequiredDiskSpace ); + } + + // Modifications + TInt usedConfId = 0; + TInt usedPluginId = 0; + if ( !err && appODT && pluginODT ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + else + { + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Get used conf & plugin ids + GetUsedIdsL( + appODT->DomDocument(), + usedConfId, + usedPluginId ); + + // Add the plugin configuration into the application configuration + err = AppendConfigurationL( + *appODT, + *pluginODT, + configurationId, + newPos, + usedConfId, + usedPluginId ); + +#ifdef HSPS_LOG_ACTIVE + if( appODT && iLogBus ) + { + ChspsOdtDump::Dump( *appODT, *iLogBus ); + } +#endif + + // Stores the new application configuration into the repository + if ( !err ) + { + err = iDefinitionRepository.SetOdtL( *appODT ); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceAddPluginL(): - Updating failed with code: %d" ), err ); + } +#endif + } + } + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + + if ( !err ) + { + // Inform clients that the ODT has been modified + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsODTModified), + appODT->RootUid(), + appODT->ThemeUid(), + aMessage.SecureId().iId, + appODT->ProviderUid(), + 0, + 0, + pluginUid,usedPluginId,ETrue, + pluginODT->ThemeFullName(), + (TLanguage)(appODT->OdtLanguage() ) ); + iDefinitionRepository.RegisterNotification( info ); + } + } + } + + // Cleaning + if ( pluginODT ) + { + CleanupStack::PopAndDestroy( pluginODT ); + pluginODT = NULL; + } + if ( appODT ) + { + CleanupStack::PopAndDestroy( appODT ); + appODT = NULL; + } + + // Error handling + iResult->iXuikonError = err; + if ( !err ) + { + // Get plugin configuration + ret = EhspsAddPluginSuccess; + } + + // Return id of the added plugin + TPckg packagedInt(usedPluginId); + messagePtr.WriteL(2, packagedInt ); + + // Completion + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// Finds last id value from the provided DOM. +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::GetUsedIdsL( + ChspsDomDocument& aDom, + TInt& aLastUsedConfId, + TInt& aLastUsedPluginId ) + { + aLastUsedConfId = 0; + aLastUsedPluginId = 0; + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *aDom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a plugin node with an id attribute that matches the provided parent plugin id + ChspsDomNode* node = iter->First(); + while( node ) + { + const TDesC8& name = node->Name(); + + // A Configuration element was found + if ( name == KConfigurationElement ) + { + // Get value of the id attribute (should exist) + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KConfigurationAttrId) ); + if ( !attr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetUsedIdsL(): Id attribute is missing!" ) ); + } +#endif + User::Leave( KErrCorrupt ); + } + + TInt id(0); + const TDesC8& idDesc = attr->Value(); + TLex8 lex( idDesc ); + if ( lex.Val( id ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetUsedIdsL(): Invalid id" ) ); + } +#endif + User::Leave( KErrCorrupt ); + } + if ( id > aLastUsedConfId ) + { + aLastUsedConfId = id; + } + } + + // A Plugin element was found + else if ( name == KPluginElement ) + { + // Get value of the id attribute (should exist) + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPluginAttrId) ); + if ( !attr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetUsedIdsL(): Id attribute is missing!" ) ); + } +#endif + User::Leave( KErrCorrupt ); + } + + TInt id(0); + const TDesC8& idDesc = attr->Value(); + TLex8 lex( idDesc ); + if ( lex.Val( id ) ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetUsedIdsL(): Invalid id" ) ); + } +#endif + User::Leave( KErrCorrupt ); + } + if ( id > aLastUsedPluginId ) + { + aLastUsedPluginId = id; + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + +// ----------------------------------------------------------------------------- +// Appends an application configuration with an instance of a plugin configuration. +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::AppendConfigurationL( + ChspsODT& aAppODT, + const ChspsODT& aPluginODT, + const TInt aConfigurationId, + const TInt aNewPosition, + TInt& aConfId, + TInt& aPluginId ) + { + TInt ret = KErrNone; + + // Input validation + if ( aPluginODT.ConfigurationType() == EhspsAppConfiguration + || aConfigurationId < 0 + || aPluginODT.ThemeUid() < 1 + || aConfId < 0 + || aPluginId < 0 ) + { + return KErrArgument; + } + + // Find a specific configuration node + ChspsDomNode* confNode = hspsServerUtil::FindConfigurationNodeL( + aAppODT, + aConfigurationId ); + if ( !confNode ) + { + return KErrNotFound; + } + + // Find first plugins node under the searchFromNode node + ChspsDomNode* pluginsNode = FindPluginsNode( *confNode ); + if ( !pluginsNode ) + { + // If there is no plugins node, it means we cannot add plugins! + return KErrAccessDenied; + } + + // Find plugin references from the plugin configuration being added, + // generate ids and update the plugin dom accordingly (changes are not saved) + ret = HandlePluginReferencesL( + aAppODT, + (ChspsODT&)aPluginODT, + aConfId, + aPluginId ); + if ( !ret ) + { + // Get new unique id + aPluginId++; + + // Append the application configuration with the full plugin configuration dom + ret = AppendPluginConfigurationL( + aAppODT, + *pluginsNode, + aPluginODT, + aNewPosition, + aPluginId ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// Finds the plugins node of the provided plugin node. +// ----------------------------------------------------------------------------- +// +ChspsDomNode* ChspsMaintenanceHandler::FindPluginsNode( + ChspsDomNode& aPluginNode ) + { + ChspsDomNode* pluginsNode = NULL; + ChspsDomNode* confNode = &aPluginNode; + if ( aPluginNode.Name() != KConfigurationElement ) + { + ChspsDomList& childList = aPluginNode.ChildNodes(); + confNode = (ChspsDomNode*)childList.FindByName( KConfigurationElement ); + } + if ( confNode ) + { + ChspsDomNode* controlNode = (ChspsDomNode*)confNode->ChildNodes().FindByName( KControlElement ); + if ( controlNode ) + { + pluginsNode = (ChspsDomNode*)controlNode->ChildNodes().FindByName( KPluginsElement ); + } + } + +#ifdef HSPS_LOG_ACTIVE + if ( !pluginsNode ) + { + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::FindPluginsNode(): failed to find a plugins node" ) ); + } + } +#endif + + return pluginsNode; + } + +// ----------------------------------------------------------------------------- +// Appends a plugins list with a new plugin node +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::AppendPluginConfigurationL( + ChspsODT& aAppODT, + ChspsDomNode& aPluginsNode, + const ChspsODT& aPluginODT, + const TInt aNewPosition, + const TInt aNewPluginId ) + { + TInt err = KErrGeneral; + + // Input validation + if ( aPluginODT.ThemeUid() < 1 || aNewPluginId < 1 ) + { + return KErrArgument; + } + + // Find a node to be added, step over any optional xml elements + // (start cloning from the configuration element onwards) + ChspsDomDocument& appDom = aAppODT.DomDocument(); + ChspsDomDepthIterator* pluginIter = ChspsDomDepthIterator::NewL( *aPluginODT.DomDocument().RootNode() ); + CleanupStack::PushL( pluginIter ); + ChspsDomNode* node = pluginIter->First(); + TBool steppingtoConfNode(EFalse); + while(node && !steppingtoConfNode) + { + const TDesC8& pluginNodeName = node->Name(); + + // Find the Configuration element + if( pluginNodeName == KConfigurationElement ) + { + steppingtoConfNode=ETrue; + } + else + { + node = pluginIter->NextL(); + } + } + CleanupStack::PopAndDestroy( pluginIter ); + + if ( node ) + { + // The node instance should now hold the configuration element etc + ChspsDomNode* confNode = node->CloneL( aPluginsNode.StringPool()); + CleanupStack::PushL( confNode ); + + // Create a new plugin node with mandatory attributes + ChspsDomNode* pluginNode = appDom.CreateElementNSL( + KPluginElement, + aPluginsNode.Namespace() + ); + CleanupStack::PushL( pluginNode ); + + // Attach to the plugin node + pluginNode->AddChildL( confNode ); + confNode->SetParent( pluginNode ); + + // Set attributes of the plugin node + hspsServerUtil::AddAttributeNumericL( *pluginNode, KPluginAttrId, aNewPluginId ); + hspsServerUtil::AddAttributeNumericL( *pluginNode, KPluginAttrUid, aPluginODT.ThemeUid(), EHex ); + + // Add active attribute. + // If first plugin in list, then set as active. + // Otherwise other plugin should already be active at this level. + if( aPluginsNode.ChildNodes().Length() == 0 ) + { + hspsServerUtil::AddAttributeDescL( *pluginNode, KPluginAttrActive, KPluginActiveStateActive ); + } + else + { + hspsServerUtil::AddAttributeDescL( *pluginNode, KPluginAttrActive, KPluginActiveStateNotActive ); + } + + // Also make sure that if new node has child nodes, that they get active parameter also. + hspsServerUtil::EditPluginNodeActivityL( pluginNode, + hspsServerUtil::EActivateFirst ); + + // Check when to insert and when to add to the end + if ( aNewPosition < 0 || aNewPosition >= aPluginsNode.ChildNodes().Length() ) + { + // Append the plugin node to the end + aPluginsNode.AddChildL( pluginNode ); + } + else + { + // Insert the plugin node to the position + aPluginsNode.AddChildL( pluginNode, aNewPosition ); + } + pluginNode->SetParent( &aPluginsNode ); + + CleanupStack::Pop( pluginNode ); + CleanupStack::Pop( confNode ); + err = KErrNone; + } + + return err; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::HandlePluginReferencesL() +// ImportPlugins phase. +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::HandlePluginReferencesL( + ChspsODT& aAppODT, + ChspsODT& aPluginODT, + TInt& aLastConfId, + TInt& aLastPluginId ) + { + + ChspsDomDocument& pluginDom = aPluginODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *pluginDom.RootNode() ); + CleanupStack::PushL( iter ); + + // Each configuration element get's an unique id value - same applies to the plugin elements. + // The ids are then used to reference a specific configuration or plugin instance + // in the whole application configuration + + ChspsDomNode* node = iter->First(); + while( node ) + { + const TDesC8& name = node->Name(); + + // Configuration element + if ( name == KConfigurationElement ) + { + // Generate an ID attribute for the configuration element + aLastConfId++; + hspsServerUtil::AddAttributeNumericL( *node, KConfigurationAttrId, aLastConfId ); + } + + // Plugin element + else if ( name == KPluginElement ) + { + // Check parent element + ChspsDomNode* parentNode = node->Parent(); + const TDesC8& parentName = parentNode->Name(); + if( parentName == KPluginsElement ) + { + ChspsDomList& attrList = node->AttributeList(); + + // Get configuration attribute from the plugin configuration + ChspsDomAttribute* pluginUidAttr = + static_cast ( attrList.FindByName(KPluginAttrUid) ); + if( !pluginUidAttr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::HandlePluginReferencesL(): - Invalid XML" ) ); + } +#endif + User::Leave( KErrCorrupt ); + } + + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid pluginUid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + + // Get plugin configuration + ChspsODT* pluginOdt = ChspsODT::NewL(); + CleanupStack::PushL( pluginOdt ); + TInt err = iThemeServer.GetConfigurationL( + 0, + pluginUid.iUid, + *pluginOdt ); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::HandlePluginReferencesL(): - Failed to find a plugin" ) ); + } +#endif + + // Append an empty configuration with error status + AddErrorConfigurationL( + pluginDom, + *node, + pluginUid.iUid ); + + // Generate an ID attribute for the plugin element + aLastPluginId++; + hspsServerUtil::AddAttributeNumericL( *node, KPluginAttrId, aLastPluginId ); + } + else + { + // Set value of the ID attribute + aLastPluginId++; + hspsServerUtil::AddAttributeNumericL( *node, KPluginAttrId, aLastPluginId ); + + + // Copy resources of the referenced plug-in instance to the application configuration + TInt resourceCount = pluginOdt->ResourceCount(); + for ( TInt index=0; index < resourceCount; index++ ) + { + ChspsResource& pluginResource = pluginOdt->ResourceL(index); + // Add only those that are located under the sources folder + if ( pluginResource.FileName().FindF( KSourcesFolder ) > 0 + || pluginResource.FileName().FindF( KLocalesFolder ) > 0 ) + + { + ChspsResource* r = pluginResource.CloneL(); + CleanupStack::PushL( r ); + aAppODT.AddResourceL( r ); + CleanupStack::Pop( r ); + } + } + + ChspsDomDocument& document = pluginOdt->DomDocument(); + if ( !document.RootNode() ) + { + User::Leave( KErrGeneral ); + } + + // Find the KConfigurationElement to step over any optional xml elements + ChspsDomDepthIterator* pluginIter = ChspsDomDepthIterator::NewL( *document.RootNode() ); + CleanupStack::PushL( pluginIter ); + ChspsDomNode* pluginNode = pluginIter->First(); + TBool steppingtoConfNode(EFalse); + while(pluginNode && !steppingtoConfNode) + { + const TDesC8& pluginNodeName = pluginNode->Name(); + + if( pluginNodeName == KConfigurationElement ) + { + steppingtoConfNode=ETrue; + } + else + { + pluginNode = pluginIter->NextL(); + } + } + CleanupStack::PopAndDestroy( pluginIter ); + + // Copy the plugin configuration to the main document. + ChspsDomNode* rootCopy = pluginNode->CloneL( node->StringPool()); + rootCopy->SetParent( node ); + node->AddChildL( rootCopy ); + } + + CleanupStack::PopAndDestroy( pluginOdt ); + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + // Copy resources of the plugin to the application configuration + TInt resourceCount = aPluginODT.ResourceCount(); + for ( TInt index=0; index < resourceCount; index++ ) + { + ChspsResource& pluginResource = aPluginODT.ResourceL(index); + + // Add only those that are located under the sources folder + if ( pluginResource.FileName().FindF( KSourcesFolder ) > 0 + || pluginResource.FileName().FindF( KLocalesFolder ) > 0 ) + { + ChspsResource* r = pluginResource.CloneL(); + CleanupStack::PushL( r ); + aAppODT.AddResourceL( r ); + CleanupStack::Pop( r ); + } + } + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// Service for removing a plugin +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceRemovePluginL( const RMessage2& aMessage ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsRemovePluginFailed; + iResult->iXuikonError = KErrNotFound; + TInt err = KErrNone; + + // Parameters + RMessagePtr2 messagePtr = aMessage; + + // IPC slots: + // #0) output: externalized ChspsResult for error handling + // #1) input: ThpsParamRemovePlugin struct + + // Get service parameters from IPC slot #1 + ThpsParamRemovePlugin params; + TPckg packagedStruct(params); + aMessage.ReadL(1, packagedStruct); + const TInt appUid = params.appUid; + const TInt pluginId = params.pluginId; + + if ( pluginId < 1 ) + { + err = KErrArgument; + } + + // Application configuration + ChspsODT *appODT = NULL; + if ( !err ) + { + // Get active application configuration from the central repository + TInt appConfUid; + err = iCentralRepository.Get( appUid, appConfUid ); + if ( err || appConfUid < 1 ) + { + err = KErrNotFound; + } + else + { + appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + err = iThemeServer.GetConfigurationL( + appUid, + appConfUid, + *appODT ); + } + } + + // Modifications + if ( !err ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + else + { + TInt pluginUid; + TBuf pluginName; + err = GetConfigurationNodeDataL(*appODT, + pluginId,pluginUid, pluginName); + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + if( !err ) + { + // Remove the plugin configuration from the application configuration + err = RemoveConfigurationL( + *appODT, + pluginId ); + } + if ( !err ) + { + +#ifdef HSPS_LOG_ACTIVE + if( appODT && iLogBus ) + { + ChspsOdtDump::Dump( *appODT, *iLogBus ); + } +#endif + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *appODT ); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceRemovePluginL(): - Updating failed" ) ); + } +#endif + } + } + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + + if ( !err ) + { + // Inform clients that the ODT has been modified + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsODTRemoved), + appODT->RootUid(), + appODT->ThemeUid(), + aMessage.SecureId().iId, + appODT->ProviderUid(), + 0,0, + pluginUid,pluginId,ETrue, + pluginName, + (TLanguage)(appODT->OdtLanguage()) + ); + iDefinitionRepository.RegisterNotification( info ); + } + } + } + + // Cleaning + if ( appODT ) + { + CleanupStack::PopAndDestroy( appODT ); + appODT = NULL; + } + + // Error handling + iResult->iXuikonError = err; + if ( !err ) + { + ret = EhspsRemovePluginSuccess; + } + + // Completion + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// Service for setting plugin active. +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceSetActivePluginL( const RMessage2& aMessage ) + { + // Init output parameters. + iResult->ResetData(); + + // Read input parameters. + ThpsParamSetActivePlugin params; + TPckg packagedStruct( params ); + aMessage.ReadL( 1, packagedStruct ); + + // Get uid of active application configuration. + TInt appConfUid = 0; + TInt err = iCentralRepository.Get( params.appUid, appConfUid ); + if ( err != KErrNone || appConfUid < 1 ) + { + err = KErrNotFound; + } + + // Load configuration from repository. + ChspsODT* appODT = NULL; + if( err == KErrNone ) + { + appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + err = iThemeServer.GetConfigurationL( + params.appUid, + appConfUid, + *appODT ); + } + + // Initialize notification structure. + ThspsRepositoryInfo notification( EhspsPluginActivated ); + if( err == KErrNone && appODT ) + { + notification.iAppUid = appODT->RootUid(); + notification.iAppConfUid = appODT->ThemeUid(); + notification.iSecureId = 0; + notification.iAppConfProviderUid = 0; + notification.iPluginIfUid = 0; + notification.iPluginProviderUid = 0; + notification.iPluginUid = 0; + notification.iPluginId = 0; + notification.iLastNotification = ETrue; + notification.iName = KNullDesC(); + notification.iLanguage = ELangTest; + } + + // Find required node and set it active. + if( err == KErrNone ) + { + // Find a plugin node with the provided id. + ChspsDomNode* pluginNode = hspsServerUtil::FindPluginNodeL( *appODT, + params.pluginId ); + if ( pluginNode ) + { + // Get parent node. + ChspsDomNode* parentNode = pluginNode->Parent(); + if ( parentNode ) + { + // Deactivate all plugins at defined level. Do not recurse. + const TInt KDepth = 1; + hspsServerUtil::EditPluginNodeActivityL( parentNode, + hspsServerUtil::EDeactivateAll, + KDepth ); + + // Activate defined plugin. + hspsServerUtil::AddAttributeDescL( *pluginNode, + KPluginAttrActive, + KPluginActiveStateActive ); + + // Fill notification up2date. + notification.iPluginUid = hspsServerUtil::GetPluginUid( pluginNode ).iUid; + notification.iPluginId = hspsServerUtil::GetPluginId( pluginNode ); + } + else + { + err = KErrCorrupt; + } + } + else + { + err = KErrNotFound; + } + } + + if( err == KErrNone ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + } + + if( err == KErrNone ) + { + // Lock and push to cleanup stack. + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *appODT ); + + // Unlock and remove from cleanupstack. + iDefinitionRepository.Unlock(); + CleanupStack::Pop( &iDefinitionRepository ); + } + + // Notify. + if( err == KErrNone ) + { + iDefinitionRepository.RegisterNotification( notification ); + } + + // Set output parameter values and complete request. + iResult->iSystemError = err; + iResult->iXuikonError = err; + + // Complete the message. + RMessagePtr2 messagePtr = aMessage; + if( err == KErrNone ) + { + CompleteRequest( EhspsSetActivePluginSuccess, messagePtr ); + } + else + { + CompleteRequest( EhspsSetActivePluginFailed, messagePtr ); + } + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + ChspsOdtDump::Dump( *appODT, *iLogBus ); + } +#endif + + // Cleanup. + if ( appODT ) + { + CleanupStack::PopAndDestroy( appODT ); + appODT = NULL; + } + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + if( err == KErrNone ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceSetActivePluginL: - OK" ) ); + } + else + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceSetActivePluginL: - Error" ) ); + } + } +#endif + } + +// ----------------------------------------------------------------------------- +// Get plugin's configuration node attributes(plugin name, pluginUid ) +// Can expanded to get configuration Id and plugin type also +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::GetConfigurationNodeDataL( + ChspsODT& aAppODT, + const TInt aPluginId, + TInt& aPluginUid, + TDes& aPluginName ) + { + TInt err = KErrNotFound; + ChspsDomNode *node = hspsServerUtil::FindPluginNodeL( aAppODT, aPluginId ); + if ( node ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *node ); + CleanupStack::PushL( iter ); + + // Find a configuration node with an id attribute that matches the provided id + ChspsDomNode* node2 = iter->First(); + TBool jobDone = EFalse; + while( node2 && !jobDone ) + { + const TDesC8& name = node2->Name(); + + // An element was found + if ( name == KConfigurationElement ) + { + TInt pluginUid = 0; + TBuf pluginName; + ChspsDomList& attrList = node2->AttributeList(); + ChspsDomAttribute* pluginUidAttr = + static_cast ( attrList.FindByName(KConfigurationAttrUid) ); + if( !pluginUidAttr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetConfigurationNodeDataL(): - Invalid XML" ) ); + } +#endif + err = KErrGeneral; + } + else + { + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid uid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + if ( uid.iUid > 0 ) + { + pluginUid = uid.iUid; + // Override default status + err = KErrNone; + } + } + if( !err ) + { + ChspsDomAttribute* pluginUidNameAttr = + static_cast ( attrList.FindByName(KConfigurationAttrName) ); + if( !pluginUidNameAttr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::GetConfigurationNodeDataL(): - Invalid XML" ) ); + } +#endif + err = KErrGeneral; + } + else + { + // Convert uids from string to numeric format + const TDesC8& pluginNameValue = pluginUidNameAttr->Value(); + if ( pluginNameValue.Length() > 0 ) + { + pluginName.Copy( pluginNameValue ); + err = KErrNone; + } + } + } + if( !err ) + { + aPluginUid = pluginUid; + aPluginName.Copy( pluginName ); + jobDone = ETrue; + } + } + node2 = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ServiceReplacePluginL() +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceReplacePluginL( const RMessage2& aMessage ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsReplacePluginFailed; + iResult->iXuikonError = KErrNotFound; + TInt err = KErrNone; + + // Parameters + RMessagePtr2 messagePtr = aMessage; + + // IPC slots: + // #0) output: externalized ChspsResult for error handling + // #1) input: ThpsParamReplacePlugin struct + ThspsParamReplacePlugin params; + TPckg packagedStruct(params); + aMessage.ReadL(1, packagedStruct); + const TInt appUid( params.appUid ); + const TInt pluginId( params.pluginId ); + const TInt confUid( params.confUid ); + if ( pluginId < 1 || confUid < 1 ) + { + err = KErrArgument; + } + + // Application configuration + ChspsODT *appODT = NULL; + if ( !err ) + { + // Get active application configuration from the central repository + TInt appConfUid; + err = iCentralRepository.Get( appUid, appConfUid ); + if ( err || appConfUid < 1 ) + { + err = KErrNotFound; + } + else + { + appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + err = iThemeServer.GetConfigurationL( + appUid, + appConfUid, + *appODT ); + } + } + + // Plugin configuration + ChspsODT *pluginODT = NULL; + if ( !err ) + { + // Find the plugin configuration (interface is unknown, so 1st argument is set to zero) + pluginODT = ChspsODT::NewL(); + CleanupStack::PushL( pluginODT ); + err = iThemeServer.GetConfigurationL( + 0, + confUid, + *pluginODT ); + } + + // Check needed space for replace. Returns system wide error code. + if( !err ) + { + err = hspsServerUtil::EnoughDiskSpaceAvailableL( + *pluginODT, + iThemeServer.DeviceLanguage(), + iServerSession->FileSystem(), + EDriveC, + KAdditionalRequiredDiskSpace ); + } + + // Modifications + if ( !err ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + else + { + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Remove the plugin configuration from the application configuration + err = ReplaceConfigurationL( + *appODT, + pluginId, + *pluginODT ); + if ( !err ) + { + +#ifdef HSPS_LOG_ACTIVE + if( appODT && iLogBus ) + { + ChspsOdtDump::Dump( *appODT, *iLogBus ); + } +#endif + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *appODT ); + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceReplacePluginL(): - Updating failed" ) ); + } +#endif + } + else + { + // Inform clients that the ODT has been modified + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsPluginReplaced), + appODT->RootUid(), + appODT->ThemeUid(), + aMessage.SecureId().iId, + 0, + 0, + 0, + confUid, + pluginId, + ETrue, + KNullDesC(), + (TLanguage)(appODT->OdtLanguage()) + ); + iDefinitionRepository.RegisterNotification( info ); + } + } + else + { + // Unlock repository + iDefinitionRepository.Unlock(); + } + + CleanupStack::Pop(&iDefinitionRepository); + } + } + + // Cleaning + if ( pluginODT ) + { + CleanupStack::PopAndDestroy( pluginODT ); + } + if ( appODT ) + { + CleanupStack::PopAndDestroy( appODT ); + appODT = NULL; + } + + // Error handling + iResult->iXuikonError = err; + if ( !err ) + { + ret = EhspsReplacePluginSuccess; + } + + // Completion + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ReplaceConfigurationL() +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::ReplaceConfigurationL( + ChspsODT& aAppODT, + const TInt aPluginId, + const ChspsODT& aPluginODT ) + { + // Input validation + if ( aAppODT.ConfigurationType() != EhspsAppConfiguration + || aAppODT.ThemeUid() < 1 + || aPluginId < 1 + || aPluginODT.ConfigurationType() == EhspsAppConfiguration + || aPluginODT.ThemeUid() < 1 ) + { + return KErrArgument; + } + + TInt err = KErrNotFound; + + // Find a plugin node with the provided plugin id + ChspsDomNode* pluginNode = hspsServerUtil::FindPluginNodeL( aAppODT, aPluginId); + if ( pluginNode ) + { + ChspsDomNode* pluginsNode = pluginNode->Parent(); + + // Get current position in the plugins list + TInt currentPosition = FindPluginPosition( *pluginNode ); + if ( currentPosition < 0 ) + { + User::Leave( KErrGeneral ); + } + + // Get configuration id from existing configuration + ChspsDomNode* oldConfNode = (ChspsDomNode *)pluginNode->ChildNodes().Item( 0 ); + if ( !oldConfNode ) + { + User::Leave( KErrGeneral ); + } + ChspsDomList& attrList = oldConfNode->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KConfigurationAttrId) ); + if ( !attr ) + { + User::Leave( KErrGeneral ); + } + const TInt oldConfId = hspsServerUtil::DecString2Int( attr->Value() ); + oldConfNode = 0; + + // Remove old plugin configuration instance and it's resources from the application configuration + err = RemoveConfigurationL( aAppODT, aPluginId ); + if ( err ) + { + User::Leave( KErrGeneral ); + } + pluginNode = 0; + + // Find configuration node from the plugin ODT + ChspsDomNode* confNode = aPluginODT.DomDocument().RootNode(); + if ( confNode->Name().CompareF(KConfigurationElement) != 0 ) + { + User::Leave( KErrGeneral ); + } + + // Add configuration id attribute + hspsServerUtil::AddAttributeNumericL( *confNode, KConfigurationAttrId, oldConfId ); + + // Append new plugin configuration node to the application configuration + err = AppendPluginConfigurationL( + aAppODT, + *pluginsNode, + aPluginODT, + currentPosition, + aPluginId ); + + if( !err ) + { + // Add resources of the new plugin into the application configuration + AddPluginResourcesL( + aAppODT, + aPluginODT.ThemeUid() ); + } + } + + return err; + } + +TInt ChspsMaintenanceHandler::FindPluginPosition( + ChspsDomNode& aPluginNode ) + { + TInt pos = -1; + ChspsDomList& childList = aPluginNode.Parent()->ChildNodes(); + for( TInt nodeIndex=0; nodeIndex < childList.Length(); nodeIndex++ ) + { + ChspsDomNode* node = (ChspsDomNode *)childList.Item( nodeIndex ); + + if ( node == &aPluginNode ) + { + pos = nodeIndex; + break; + } + } + return pos; + } + + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::SetLogBus() +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsMaintenanceHandler::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#endif + +// ----------------------------------------------------------------------------- +// Removes an plugin instance from the provided application configuration +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::RemoveConfigurationL( + ChspsODT& aAppODT, + const TInt aPluginId ) + { + TInt err = KErrNotFound; + + // Find a plugin node with the provided id + ChspsDomNode *node = hspsServerUtil::FindPluginNodeL( aAppODT, aPluginId ); + if ( node ) + { + // Get parent node + ChspsDomNode *parentNode = node->Parent(); + if ( parentNode ) + { + // Get uid attribute from the node + TInt pluginUid = 0; + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* pluginUidAttr = + static_cast ( attrList.FindByName(KPluginAttrUid) ); + if( !pluginUidAttr ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::RemoveConfigurationL(): - Invalid XML" ) ); + } +#endif + + err = KErrGeneral; + } + else + { + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid uid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + if ( uid.iUid > 0 ) + { + pluginUid = uid.iUid; + // Override default status + err = KErrNone; + } + } + + // Store activity state for use after deletion. + TBool pluginWasActive = EFalse; + ChspsDomAttribute* pluginActivityAttr = + static_cast( attrList.FindByName( KPluginAttrActive ) ); + if( pluginActivityAttr ) + { + if( pluginActivityAttr->Value().CompareF( KPluginActiveStateActive ) == 0 ) + { + pluginWasActive = ETrue; + } + } + + if ( !err ) + { + // Get number of plugin instances with the plugin uid + TInt instanceCount = 0; + GetPluginInstanceCountL( + aAppODT, + pluginUid, + instanceCount ); + + // Remove plugin resources form the application configuration: + // By default remove all plugin's resources from all instances + // - otherwise, after upgrades, there might be various versions of the same resources + err = RemovePluginResourcesL( aAppODT, pluginUid ); + if ( !err ) + { + // If the application configuration holds other instances of the same plugin + if ( instanceCount > 1 ) + { + // Put back the resources + AddPluginResourcesL( + aAppODT, + pluginUid ); + } + + // Remove the plugin node from parent node + parentNode->DeleteChild( node ); + } + } + + // If plugin was succesfully deleted and was active -> + // need set another plugin active. + // ( Choose to activate topmost item. ) + // ( Use depth of 1 to affect only one level. ) + if ( !err && pluginWasActive ) + { + const TInt KDepth = 1; + hspsServerUtil::EditPluginNodeActivityL( parentNode, + hspsServerUtil::EActivateFirst, + KDepth ); + } + } + } + + return err; + } + +//---------------------------------------------------------------------------- +// Finds a plugin node with the provided id which is also a children of +// the provided plugins node +// ---------------------------------------------------------------------------- +// +ChspsDomNode* ChspsMaintenanceHandler::FindChildPluginNode( + ChspsDomNode& aPluginsNode, + const TInt aPluginId ) + { + ChspsDomNode* pluginNode = NULL; + + // Loop child nodes + ChspsDomList& childList = aPluginsNode.ChildNodes(); + for( TInt nodeIndex=0; nodeIndex < childList.Length(); nodeIndex++ ) + { + // Find a specific node with the provided id value + ChspsDomNode* node = (ChspsDomNode *)childList.Item( nodeIndex ); + if ( node ) + { + // Find the ID attribute + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPluginAttrId) ); + if ( attr ) + { + TInt id = 0; + const TDesC8& idValue = attr->Value(); + TLex8 lex( idValue ); + if ( lex.Val( id ) == 0 && id == aPluginId ) + { + pluginNode = node; + break; + } + } + } + } + + return pluginNode; + } + +// ----------------------------------------------------------------------------- +// Returns a count of plugin instances. +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::GetPluginInstanceCountL( + const ChspsODT& aAppODT, + const TInt aPluginUid, + TInt& aInstanceCount ) + + { + aInstanceCount = 0; + + ChspsDomDocument& dom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a plugin node with the provided id attribute + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Plugin element was found + if ( name == KPluginElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPluginAttrUid) ); + if ( !attr ) + { + // Mandatory information is missing for some reason (should be set at installation handler)! + // Exit with NULL + jobDone = ETrue; + } + else + { + // Convert from (hex?) string into TUid presentation + const TUid uid = hspsServerUtil::ConvertDescIntoUid( attr->Value() ); + if ( aPluginUid == uid.iUid ) + { + aInstanceCount++; + } + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + +// ----------------------------------------------------------------------------- +// Removes plugin resources from the provided ODT +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::RemovePluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ) + { + // Loop resources of the application configuration + for(TInt aresIndex = 0; aresIndex < aAppODT.ResourceCount(); aresIndex++ ) + { + ChspsResource& ares = aAppODT.ResourceL( aresIndex ); + + // If the plugin resource was found at resource list of the application configuration + if ( ares.ConfigurationUid() == aPluginUid ) + { + // Deletes resource from the application configuration + aAppODT.DeleteResourceL( aresIndex ); + aresIndex--; + } + + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Adds plugin resources to the provided application ODT +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::AddPluginResourcesL( + ChspsODT& aAppODT, + const TInt aPluginUid ) + { + // Get plugin ODT + ChspsODT* pluginODT = ChspsODT::NewL(); + CleanupStack::PushL( pluginODT ); + TInt ret = iThemeServer.GetConfigurationL( + 0, + aPluginUid, + *pluginODT ); + + if ( !ret && pluginODT->ThemeUid() ) + { + // Copy resources of the referenced plug-in instance to the application configuration + TInt resourceCount = pluginODT->ResourceCount(); + for ( TInt index=0; index < resourceCount; index++ ) + { + ChspsResource& pluginResource = pluginODT->ResourceL(index); + // Add only those that are located under the sources folder + if ( pluginResource.FileName().FindF( KSourcesFolder ) > 0 + || pluginResource.FileName().FindF( KLocalesFolder ) > 0 ) + { + ChspsResource* r = pluginResource.CloneL(); + CleanupStack::PushL( r ); + aAppODT.AddResourceL( r ); + CleanupStack::Pop( r ); + } + } + } + + if ( pluginODT ) + { + CleanupStack::PopAndDestroy( pluginODT ); + } + } + +// ----------------------------------------------------------------------------- +// Service for personalizing settings +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceSetPluginSettingsL( const RMessage2& aMessage ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsSetPluginSettingsFailed; + iResult->iXuikonError = KErrNotFound; + TInt err = KErrNone; + + // Parameters + RMessagePtr2 messagePtr = aMessage; + + TBuf8 setMaskData; + + + ChspsODT* odt = NULL; + TInt appConfUid; + TInt pluginId; + TBool storingStatus(EFalse); + + // Checking active congiruation and security + messagePtr.ReadL(1,setMaskData,0); + + if (iSetMask) + { + delete iSetMask; + iSetMask = NULL; + } + + iSetMask = ChspsODT::NewL(); + iSetMask->UnMarshalHeaderL( setMaskData ); + + iCentralRepository.Get( iSetMask->RootUid(), appConfUid ); + + // Getting active configuration + odt = ChspsODT::NewL(); + CleanupStack::PushL(odt); + + err = iThemeServer.GetConfigurationL( + iSetMask->RootUid(), + appConfUid, + *odt ); + + if (iSetMask) + { + delete iSetMask; + iSetMask = NULL; + } + + // Set settings to active configuration + if( !err ) + { + if( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + else + { + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + //Read pluginID + // Get configuration + ThspsParamSetPluginSettings params; + TPckg packagedStruct(params); + + messagePtr.ReadL( 2, packagedStruct ); + + pluginId = params.pluginId ; + storingStatus = params.storingStatus ; + + + + // read Domdata + HBufC8* domData = HBufC8::NewL( messagePtr.GetDesLengthL( 3 ) ); + CleanupStack::PushL( domData ); + TPtr8 domPtr = domData->Des(); + messagePtr.ReadL( 3, domPtr, 0 ); + RDesReadStream readBuf( *domData ); + CleanupClosePushL( readBuf ); + + ChspsDomDocument* domDocument = ChspsDomDocument::NewL( readBuf ); + + CleanupStack::PopAndDestroy( &readBuf ); + CleanupStack::PopAndDestroy( domData ); + + CleanupStack::PushL( domDocument ); + err = hspsSetPluginSettingsL( *odt, pluginId, *domDocument ); + + if( !err ) + { + +#ifdef HSPS_LOG_ACTIVE + if( odt && iLogBus ) + { + ChspsOdtDump::Dump( *odt, *iLogBus ); + } +#endif + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *odt ); + + if( !err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceSetPluginSettingsL(): - Updating Success" ) ); + } +#endif + } + } + CleanupStack::PopAndDestroy( domDocument ); + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + + if( storingStatus ) + { + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + ChspsDomNode* pluginNode = hspsServerUtil::FindPluginNodeL( *odt, pluginId ); + + if( pluginNode ) + { + + ChspsDomList& attrList = pluginNode->AttributeList(); + // Get configuration attribute from the plugin configuration + ChspsDomAttribute* pluginUidAttr = static_cast ( attrList.FindByName(KPluginAttrUid) ); + + if( pluginUidAttr ) + { + + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid pluginUid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + // Get plugin configuration + ChspsODT* pluginOdt = ChspsODT::NewL(); + CleanupStack::PushL( pluginOdt ); + + err = iThemeServer.GetConfigurationL( + 0, + pluginUid.iUid, + *pluginOdt ); + + if( !err ) + { + // read Domdata + HBufC8* domData = HBufC8::NewL( messagePtr.GetDesLengthL( 3 ) ); + CleanupStack::PushL( domData ); + TPtr8 domPtr = domData->Des(); + messagePtr.ReadL( 3, domPtr, 0 ); + RDesReadStream readBuf( *domData ); + CleanupClosePushL( readBuf ); + + ChspsDomDocument* domDocument = ChspsDomDocument::NewL( readBuf ); + + CleanupStack::PopAndDestroy( &readBuf ); + CleanupStack::PopAndDestroy( domData ); + + CleanupStack::PushL( domDocument ); + + err = hspsSavePluginSettingsL( *pluginOdt, *domDocument ); + + if( !err ) + { +#ifdef HSPS_LOG_ACTIVE + if( odt && iLogBus ) + { + ChspsOdtDump::Dump( *pluginOdt, *iLogBus ); + } +#endif + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *pluginOdt ); + + if( !err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceSetPluginSettingsL(): - Updating plugin reference Success" ) ); + } +#endif + } + } + CleanupStack::PopAndDestroy( domDocument ); + } + if ( pluginOdt ) + { + CleanupStack::PopAndDestroy( pluginOdt ); + pluginOdt = NULL; + } + + } + else + { + err = KErrCorrupt; + } + } + else + { + err = KErrNotFound; + } + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + } + + if ( !err ) + { + // Inform clients that the ODT has been modified + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsSettingsChanged), + odt->RootUid(), + odt->ThemeUid(), + aMessage.SecureId().iId, //=Any file + odt->ProviderUid(), + 0,0, + 0,pluginId,ETrue,odt->ThemeFullName(), + (TLanguage)(odt->OdtLanguage()) + ); + iDefinitionRepository.RegisterNotification( info ); + } + } + } + + // Cleaning + if (odt) + { + CleanupStack::PopAndDestroy( odt ); + odt = NULL; + } + + // Error handling + iResult->iXuikonError = err; + if ( !err ) + { + ret = EhspsSetPluginSettingsSuccess; + } + + // Completion + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// +// Service to get plugin Odt according plugin uid +// packed parameters +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceGetPluginOdtL( const RMessage2& aMessage ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceGetPluginOdtL: - service called" ) ); + } +#endif + + iMessagePtr = aMessage; + TInt err = KErrNone; + + // Get configuration + ThspsParamGetPluginOdt params; + TPckg packagedStruct(params); + iMessagePtr.ReadL(1, packagedStruct); + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + err = iThemeServer.GetConfigurationL( 0, params.pluginUid, *odt ); + + if( !err ) + { + TPath odtPath; + // Resolve odt path if no errors were occured + iDefinitionRepository.GetResourcePathL( *odt, EResourceODT, odtPath ); + TPckg packagedStruct( params ); + iMessagePtr.WriteL(2, odtPath); + } +#ifdef HSPS_LOG_ACTIVE + else + { + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceGetPluginOdtL: - error occured during GetConfigurationL()" ) ); + } + } +#endif + + CleanupStack::PopAndDestroy( odt ); + + // Error handling + iResult->iXuikonError = err; + + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceGetPluginOdtL: - EhspsGetPluginOdtFailed code: %d" ), err ); + } +#endif + + CompleteRequest( EhspsGetPluginOdtFailed, iMessagePtr ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceGetPluginOdtL: - EhspsGetPluginOdtSuccess" ) ); + } +#endif + + CompleteRequest( EhspsGetPluginOdtSuccess, iMessagePtr ); + } + + } + + +// ----------------------------------------------------------------------------- +// hspsMaintenanceHandler::hspsSetPluginSettings + +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::hspsSetPluginSettingsL( ChspsODT& aOdt, + TInt aPluginId, ChspsDomDocument& aDom ) + { + TInt error = KErrNotFound; + + + TUint value = aPluginId; + + // Find a plugin node with the provided id + ChspsDomNode* pluginNode = hspsServerUtil::FindPluginNodeL( aOdt, value ); + if( !pluginNode ) + { + error = KErrNotFound; + return error; + } + ChspsDomNode* controlNode = &(FindNodeByTagL(KControlElement, *pluginNode )); + if( !controlNode ) + { + error = KErrNotFound; + return error; + } + ChspsDomList& childList = controlNode->ChildNodes(); + ChspsDomNode* settingsNode = (ChspsDomNode*)childList.FindByName( KSettingsElement ); + if( !settingsNode ) + { + error = KErrNotFound; + return error; + } + TInt index = controlNode->ItemIndex( *settingsNode ); + controlNode->DeleteChild(settingsNode); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *aDom.RootNode() ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && node != prevNode) + { + const TDesC8& name = node->Name(); + if( name == KSettingsElement ) + { + // Attach to the plugin node + + ChspsDomNode* clone = node->CloneL( aOdt.DomDocument().StringPool() ); + CleanupStack::PushL( clone ); + controlNode->AddChildL( clone, index ); + clone->SetParent( controlNode ); + CleanupStack::Pop( clone ); + jobDone=ETrue; + error=KErrNone; + } + prevNode=node; + node=iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + + + return error; + + } + +// ----------------------------------------------------------------------------- +// Finds a node from a dom document. +// Looks for the next node tag. +// ----------------------------------------------------------------------------- +ChspsDomNode& ChspsMaintenanceHandler::FindNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aDomNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* targetNode( NULL ); + ChspsDomNode* node = iter->First(); + TBool found = EFalse; + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( aNodeTag ) == 0 ) + { + found = ETrue; + targetNode = node; + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + return *targetNode; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSavePluginSettingsL + +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::hspsSavePluginSettingsL( + ChspsODT& aOdt, + ChspsDomDocument& aDom ) + { + TInt error; + ChspsDomNode* node = aOdt.DomDocument().RootNode(); + + ChspsDomNode* controlNode = &(FindNodeByTagL(KControlElement, *node )); + + if( !controlNode ) + { + return KErrNotFound; + } + + ChspsDomList& childList = controlNode->ChildNodes(); + ChspsDomNode* settingsNode = (ChspsDomNode*)childList.FindByName( KSettingsElement ); + + if( !settingsNode ) + { + return KErrNotFound; + } + + TInt index = controlNode->ItemIndex( *settingsNode ); + controlNode->DeleteChild(settingsNode); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *aDom.RootNode() ); + CleanupStack::PushL( iter ); + ChspsDomNode* iterNode = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + + while( iterNode && !jobDone && iterNode != prevNode) + { + const TDesC8& name = iterNode->Name(); + if( name == KSettingsElement ) + { + // Attach to the plugin node + + ChspsDomNode* clone = iterNode->CloneL( aOdt.DomDocument().StringPool() ); + CleanupStack::PushL( clone ); + controlNode->AddChildL( clone, index ); + clone->SetParent( controlNode ); + CleanupStack::Pop( clone ); + jobDone=ETrue; + error=KErrNone; + } + prevNode=iterNode; + iterNode=iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + return error; + + } +// Service for updating plugin positions +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceMovePluginsL( const RMessage2& aMessage ) + { + // Defaults + ThspsServiceCompletedMessage ret = EhspsMovePluginsFailed; + iResult->iXuikonError = KErrNotFound; + TInt err = KErrNone; + + // Parameters + RMessagePtr2 messagePtr = aMessage; + + // IPC slots: + // #0) output: externalized ChspsResult for error handling + // #1) input: a struct + + // Get service parameters from IPC slot #1 + ThpsParamMovePlugins params; + TPckg packagedStruct(params); + aMessage.ReadL(1, packagedStruct); + const TInt appUid = params.appUid; + const TInt confId = params.configurationId; + TPtrC8 bufPtr( params.pluginIdsBuf ); + + // Internalize the plugin ids array from a descriptor + const TInt KGranularity = 6; + ChspsPluginIdList* idArray = new (ELeave)ChspsPluginIdList( KGranularity ); + CleanupStack::PushL( idArray ); + RDesReadStream readStream( bufPtr ); + CleanupClosePushL( readStream ); + TRAP( err, idArray->InternalizeL(readStream) ); + CleanupStack::PopAndDestroy( &readStream ); + + if ( err || appUid < 1 || confId < 1 || idArray->Count() < 1 ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceMovePluginsL(): invalid input" ) ); + } +#endif + + err = KErrArgument; + } + + // Application configuration + ChspsODT *appODT = NULL; + if ( !err ) + { + // Get active application configuration from the central repository + TInt appConfUid; + err = iCentralRepository.Get( appUid, appConfUid ); + if ( err || appConfUid < 1 ) + { + err = KErrNotFound; + } + else + { + appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + err = iThemeServer.GetConfigurationL( + appUid, + appConfUid, + *appODT ); + } + } + + // Modifications + if ( !err ) + { + if ( iDefinitionRepository.Locked() ) + { + // Repository locked + err = KErrAccessDenied; + } + else + { + // Lock the Plugin Repository (a.k.a. Def.rep) + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Update the provided configuration + err = UpdatePluginListL( + *appODT, + confId, + *idArray ); + if ( !err ) + { + +#ifdef HSPS_LOG_ACTIVE + if( appODT && iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceRemovePluginL() - plugins moved:" ) ); + ChspsOdtDump::Dump( *appODT, *iLogBus ); + } +#endif + // Stores the new application configuration into the repository + err = iDefinitionRepository.SetOdtL( *appODT ); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceRemovePluginL(): - Updating failed" ) ); + } +#endif + } + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::ServiceRemovePluginL(): - UpdatePluginListL failed" ) ); + } +#endif + } + + // Unlock after the changes have been done + iDefinitionRepository.Unlock(); + CleanupStack::Pop(&iDefinitionRepository); + + if ( !err ) + { + // Inform clients that the ODT has been modified + ThspsRepositoryInfo info( + ThspsRepositoryEvent(EhspsODTModified), + appODT->RootUid(), + appODT->ThemeUid(), + 0, //=Any file + appODT->ProviderUid(), + (TLanguage)(appODT->OdtLanguage()) + ); + iDefinitionRepository.RegisterNotification( info ); + } + } + } + + // Cleaning + if ( appODT ) + { + CleanupStack::PopAndDestroy( appODT ); + appODT = NULL; + } + + CleanupStack::PopAndDestroy( idArray ); + + // Error handling + iResult->iXuikonError = err; + if ( !err ) + { + ret = EhspsMovePluginsSuccess; + } + + // Completion + CompleteRequest( ret, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// Service for updating configuration state +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceSetConfStateL( const RMessage2& aMessage ) + { + // Parameters + RMessagePtr2 messagePtr = aMessage; + + // Get service parameters from IPC slot #1 + ThspsParamSetConfState params; + TPckg packagedStruct( params ); + aMessage.ReadL( 1, packagedStruct ); + + // Reserve definition repository + if ( iDefinitionRepository.Locked() ) + { + // Definition repository reserved + User::Leave( KErrAccessDenied ); + } + iDefinitionRepository.Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Get application configuration + TInt appConfUid; + User::LeaveIfError( iCentralRepository.Get( params.appUid, appConfUid ) ); + ChspsODT* appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + User::LeaveIfError( iThemeServer.GetConfigurationL( + params.appUid, + appConfUid, + *appODT ) ); + + // Update configuration state + SetConfStateL( *appODT, params.confId, params.state, params.filter ); + + // Store updated configuration + User::LeaveIfError( iDefinitionRepository.SetOdtL( *appODT ) ); + CleanupStack::PopAndDestroy( appODT ); + + // Release definition repository + iDefinitionRepository.Unlock(); + CleanupStack::Pop( &iDefinitionRepository ); + + // Completion + CompleteRequest( EhspsSetConfStateSuccess, messagePtr ); + } + +// ----------------------------------------------------------------------------- +// Service for restoring active application configuration +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::ServiceRestoreActiveAppConfL( const RMessage2& aMessage ) + { + // Parameters + RMessagePtr2 messagePtr = aMessage; + ThspsServiceCompletedMessage ret( EhspsRestoreActiveAppConfFailed ); + TInt err( KErrNone ); + + // Get service parameters from IPC slot #1 + ThspsParamRestoreActiveAppConf params; + TPckg packagedStruct( params ); + aMessage.ReadL( 1, packagedStruct ); + + // Create search criteria + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( params.appUid ); + searchMask->SetThemeUid( params.confUid ); + + // Get configuration header + ChspsODT* confHeader( NULL ); + TInt pos( 0 ); + iThemeServer.GetConfigurationHeader( *searchMask, confHeader, pos ); + + if ( confHeader && + !iDefinitionRepository.Locked() ) + { + // Lock definition repository + iDefinitionRepository.Lock(); + // Restore backup configuration if it exists + err = iDefinitionRepository.RestoreBackupConfiguration( *confHeader ); + // Release definition repository + iDefinitionRepository.Unlock(); + + if ( err != KErrNone ) + { + // Configuration backup not found - Restore default configuration + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + RestoreDefaultAppConfL( confHeader, *odt ); + iDefinitionRepository.SetOdtL( *odt ); + CleanupStack::PopAndDestroy( odt ); + } + ret = EhspsRestoreActiveAppConfSuccess; + } + + CleanupStack::PopAndDestroy( searchMask ); + + // Completion + CompleteRequest( ret, messagePtr ); + } + +//---------------------------------------------------------------------------- +// ChspsMaintenanceHandler::UpdatePluginListL() +// ---------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::UpdatePluginListL( + ChspsODT& aAppODT, + const TInt aConfigurationId, + const CArrayFixFlat& aPluginIdList ) + { + TInt err = KErrNone; + + // Find the configuration node + ChspsDomNode* confNode = hspsServerUtil::FindConfigurationNodeL( aAppODT, aConfigurationId ); + if ( !confNode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - configuration node was not found" ) ); + } +#endif + + err = KErrNotFound; + } + + ChspsDomNode* controlNode = NULL; + if ( !err ) + { + // Find a control node under the configuration node + controlNode = (ChspsDomNode *)confNode->ChildNodes().FindByName( KControlElement ); + if ( !controlNode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - control node was not found" ) ); + } +#endif + + err = KErrNotFound; + } + } + + ChspsDomNode* oldPluginsNode = NULL; + if ( !err ) + { + // Find a plugins node under the control node + oldPluginsNode = (ChspsDomNode *)controlNode->ChildNodes().FindByName( KPluginsElement ); + if ( !oldPluginsNode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - plugin node was not found" ) ); + } +#endif + err = KErrNotFound; + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - old plugins node has %d childs" ), + oldPluginsNode->ChildNodes().Length() ); + } +#endif + } + } + + const TInt nodeCount = aPluginIdList.Count(); + if ( !err ) + { + // Plugin node count and provided id count should match + if ( nodeCount < 1 || nodeCount != oldPluginsNode->ChildNodes().Length() ) + { + err = KErrArgument; + } + } + + // Find all plugin nodes under the plugins node in the requested sequence + CArrayFixFlat* nodeArray = NULL; + if ( !err ) + { + nodeArray = new (ELeave)CArrayFixFlat( nodeCount ); + CleanupStack::PushL( nodeArray ); + ChspsDomNode* node = NULL; + for( TInt nodeIndex=0; nodeIndex < nodeCount; nodeIndex++ ) + { + const TInt pluginId = aPluginIdList.At(nodeIndex); + node = FindChildPluginNode( + *oldPluginsNode, + pluginId ); + if ( !node ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - FindChildPluginNode failure" ) ); + } +#endif + + err = KErrNotFound; + break; + } + nodeArray->AppendL( node ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::UpdatePluginListL(): - plugin id=%d" ), + pluginId ); + } +#endif + } + } + + ChspsDomNode* newPluginsNode = NULL; + if ( !err ) + { + // Clone the plugins node + newPluginsNode = oldPluginsNode->CloneWithoutKidsL( oldPluginsNode->StringPool() ); + CleanupStack::PushL( newPluginsNode ); + + // Add the cloned plugins node into the control node (removal of the old plugins node is done later) + const TInt KNewPosition = 0; + controlNode->ChildNodes().AddItemL( newPluginsNode, KNewPosition ); + newPluginsNode->SetParent( controlNode ); + + // Transfer ownership of the plugin nodes + const TInt arrayCount = nodeArray->Count(); + for( TInt arrayIndex=0; arrayIndex < arrayCount; arrayIndex++) + { + ChspsDomNode* pluginNode = nodeArray->At(arrayIndex); + if ( !pluginNode ) + { + err = KErrGeneral; + break; + } + newPluginsNode->AddChildL( pluginNode ); + pluginNode->SetParent( newPluginsNode ); + } + } + + if ( !err ) + { + // Remove plugin nodes from the old plugins node + const TInt remainingCount = oldPluginsNode->ChildNodes().Length(); + for( TInt nodeIndex=0; nodeIndex < remainingCount; nodeIndex++) + { + ChspsDomNode* node = (ChspsDomNode*)oldPluginsNode->ChildNodes().Item( 0 ); + if ( node ) + { + oldPluginsNode->ChildNodes().RemoveItem( node ); + } + } + if ( oldPluginsNode->ChildNodes().Length() != 0 ) + { + err = KErrGeneral; + } + } + + if ( !err ) + { + // Remove the old plugins node from the control node + controlNode->ChildNodes().RemoveItem( oldPluginsNode ); + delete oldPluginsNode; + oldPluginsNode = NULL; + } + + if ( newPluginsNode ) + { + CleanupStack::Pop( newPluginsNode ); + } + if ( nodeArray ) + { + CleanupStack::PopAndDestroy( nodeArray ); + } + + return err; + } + +//---------------------------------------------------------------------------- +// ChspsMaintenanceHandler::SetConfStateL() +// ---------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::SetConfStateL( + ChspsODT& aAppODT, + TInt aConfId, + ThspsConfigurationState aState, + ThspsConfStateChangeFilter aFilter ) + { + + // Get state attribute value + TPtrC8 state; + switch ( aState ) + { + case EhspsConfStateNotConfirmed: + state.Set( KConfStateNotConfirmed ); + break; + case EhspsConfStateWaitForConfirmation: + state.Set( KConfStateWaitForConfirmation ); + break; + case EhspsConfStateConfirmed: + state.Set( KConfStateConfirmed ); + break; + default: + state.Set( KConfStateError ); + break; + } + + // Find a configuration node with an id attribute that matches the + // provided id and update found node state attribute + // If aConfId is -1 all configuration nodes are updated + ChspsDomDocument& dom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Configuration node is found + if ( name == KConfigurationElement ) + { + if ( aConfId != -1 ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* idAttr = static_cast( + attrList.FindByName( KConfigurationAttrId ) ); + if ( !idAttr ) + { + User::Leave( KErrNotFound ); + } + TInt id(0); + const TDesC8& idValue = idAttr->Value(); + TLex8 lex( idValue ); + lex.Val( id ); + TBuf8<10> confId; + confId.Num( aConfId ); + if ( aConfId == id && aFilter == EhspsConfStateChangeNoFilter ) + { + hspsServerUtil::AddAttributeDescL( + *node, + KConfigurationAttrState, + state ); + jobDone = ETrue; + } + else if ( aFilter == EhspsConfStateChangePlugins && + hspsServerUtil::GetParentNode( + *node, + KConfigurationElement, + KConfigurationAttrId, + confId ) ) + { + hspsServerUtil::AddAttributeDescL( + *node, + KConfigurationAttrState, + state ); + } + } + else + { + hspsServerUtil::AddAttributeDescL( + *node, + KConfigurationAttrState, + state ); + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceService::hspsGetListHeadersL +// Gets the header list to aHeaderDataList +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders(const TDesC8& + /*aSearchMaskData*/, CArrayPtrSeg& aHeaderDataList) + { + // set the default response + ThspsServiceCompletedMessage ret = EhspsGetListHeadersEmpty; + TInt errorCode; + TRAP( errorCode, GetHeaderListL( aHeaderDataList, *iSearchMask ) ); + if (errorCode) + { + ret = EhspsGetListHeadersFailed; + } + else + { + ret = EhspsGetListHeadersSuccess; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsGetNextHeader() +// Gets the header list to aHeaderDataList +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetNextHeader() + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSetActiveTheme +// Sets the active theme to central repository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsSetActiveTheme(const ChspsODT& aSetMask, + ChspsODT& aOdt) + { + // set the default response + ThspsServiceCompletedMessage ret = EhspsSetActiveThemeFailed; + TInt errorCode = KErrNone; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::hspsSetActiveTheme(): - requested for AppUid = %d, ThemeUid= %d." ), + aSetMask.RootUid(), + aSetMask.ThemeUid() ); + } +#endif + + TRAP( errorCode, errorCode = iThemeServer.ActivateThemeL( aSetMask, aOdt )); + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::hspsSetActiveTheme(): - theme activation failed - bad ODT!" ) ); + } +#endif + + ret = EhspsSetActiveThemeFailed; + } + else + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::hspsSetActiveTheme(): - activated for AppUid = %d, ThemeUid= %d." ), + aOdt.RootUid(), + aOdt.ThemeUid() ); + } +#endif + + ret = EhspsSetActiveThemeSuccess; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsRestoreDefault +// Restores the default theme and returns either EhspsRestoreDefaultSuccess or +// EhspsRestoreDefaultFailed. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsRestoreDefault( const ChspsODT& aSetMask, + ChspsODT& aHeader ) + { + // set the default response + ThspsServiceCompletedMessage ret = EhspsRestoreDefaultFailed; + TInt errorCode = 0; + TRAP( errorCode, RestoredDefaultL( aSetMask, aHeader ) ); + if ( errorCode ) + { + ret = EhspsRestoreDefaultFailed; + } + else + { + ret = EhspsRestoreDefaultSuccess; + } + return ret; + } + + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsRemoveThemeL +// Removes the theme by calling the appropriate method in definition repository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsRemoveThemeL( const ChspsODT& aSetMask ) + { + ThspsServiceCompletedMessage ret( EhspsRemoveThemeFailed ); + + if( !( aSetMask.Flags() & EhspsThemeStatusLicenceeDefault ) ) + { + RArray notifParams; + + if( !iDefinitionRepository.Locked() ) + { + iDefinitionRepository.Lock(); + + // In case of error. repository is unlocked + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // Check what is being being uninstalled + TInt error( KErrNone ); + if ( aSetMask.ConfigurationType() != EhspsAppConfiguration ) + { + // Fix plugin instances and get notifications from valid cases + TRAP( error, RemovePluginFromAppConfsL( aSetMask, notifParams ) ); + } + + if( !error ) + { + // Remove the actual plugin from file system + TRAP( error, RemoveThemeL( aSetMask ) ); + } + + if( !error ) + { + // Remove header from the cache + iThemeServer.UpdateHeaderListCache( + EhspsCacheRemoveHeader, + aSetMask.RootUid(), + aSetMask.ProviderUid(), + aSetMask.ThemeUid() ); + } + + // Must be done before the notifications are sent + iDefinitionRepository.Unlock(); + CleanupStack::Pop( &iDefinitionRepository ); + + if ( !error ) + { + // Send the notifications which will update the client UIs + for( TInt i=0; i < notifParams.Count(); i++ ) + { + iDefinitionRepository.RegisterNotification( notifParams[i] ); + } + + ret = EhspsRemoveThemeSuccess; + } + } + + notifParams.Close(); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// RemovePluginFromAppConfsL +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RemovePluginFromAppConfsL( + const ChspsODT& aOdt, + RArray& aNotificationParams ) + { + __ASSERT_DEBUG( aOdt.ThemeUid(), User::Leave( KErrArgument ) ); + + // Loop application configurations + const TInt count = iHeaderListCache.Count(); + for ( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = iHeaderListCache.At(i); + if ( header && header->ConfigurationType() == EhspsAppConfiguration ) + { + // Get an ODT from the looped application configuration header + ChspsODT* appOdt = ChspsODT::NewL(); + CleanupStack::PushL( appOdt ); + + // Fill only those values which are required by the GetOdtL call + appOdt->SetRootUid( header->RootUid() ); + appOdt->SetProviderUid( header->ProviderUid() ); + appOdt->SetThemeUid( header->ThemeUid() ); + appOdt->SetProviderNameL( header->ProviderName() ); + appOdt->SetThemeShortNameL( header->ThemeShortName() ); + appOdt->SetThemeVersionL( header->ThemeVersion() ); + User::LeaveIfError( iDefinitionRepository.GetOdtL( *appOdt ) ); + + // Get active application configuration for the client in question + TInt activeAppConfUid = 0; + iCentralRepository.Get( appOdt->RootUid(), activeAppConfUid ); + + // Get plugin id's from the instances in the application configuration + RArray pluginIds; + CleanupClosePushL( pluginIds ); + + hspsServerUtil::GetPluginIdsByUidL( *appOdt, + TUid::Uid( aOdt.ThemeUid() ), + pluginIds ); + + // If there were plugin instances in an application configuration + if ( pluginIds.Count() > 0 ) + { + + // If the application configuration is inactive + if ( activeAppConfUid != appOdt->ThemeUid() ) + { + // Prevent notifications and set state of the plugin instances to "uninstalled", + // AI3 will remove instances (or replaces them with an empty widget) + // when it loads the configuration after it has first been activated + TBool updatesDone = InvalidateUninstalledPluginInstancesL( + *appOdt, + aOdt.ThemeUid(), + pluginIds ); +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + if ( updatesDone ) + { + iLogBus->LogText( + _L( "ChspsMaintenanceHandler::RemovePluginFromAppConfsL(): old plugin instances were updated in inactive root configuration" ) + ); + } + else + { + iLogBus->LogText( + _L( "ChspsMaintenanceHandler::RemovePluginFromAppConfsL(): nothing was done" ) + ); + } + } +#endif + } + else + { + // Notify active application configuration that old plugin instances need to be replaced + TBool lastNotification = EFalse; + for( TInt i = 0; i < pluginIds.Count(); i++ ) + { + if( i == pluginIds.Count() - 1 ) + { + lastNotification = ETrue; + } + ThspsRepositoryInfo info( + ThspsRepositoryEvent( EhspsClean ), + appOdt->RootUid(), + appOdt->ThemeUid(), + 0, //=Any file + appOdt->ProviderUid(), + aOdt.RootUid(), + aOdt.ProviderUid(), + aOdt.ThemeUid(), + pluginIds[i], + lastNotification, + aOdt.ThemeFullName(), + (TLanguage)( aOdt.OdtLanguage() ) ); + aNotificationParams.Append(info); + } +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( + _L( "ChspsMaintenanceHandler::RemovePluginFromAppConfsL(): plugin uninstalled notifications sent to SAPI for all instances" ) + ); + } +#endif + } + } // instance count > 0 + else + { + if ( activeAppConfUid == appOdt->ThemeUid() ) + { + // Notify active application configuration which had no plugin instances + ThspsRepositoryInfo info( + ThspsRepositoryEvent( EhspsClean ), + appOdt->RootUid(), + appOdt->ThemeUid(), + 0, //=Any file + appOdt->ProviderUid(), + aOdt.RootUid(), + aOdt.ProviderUid(), + aOdt.ThemeUid(), + 0, + ETrue, + aOdt.ThemeFullName(), + (TLanguage)( aOdt.OdtLanguage() ) ); + aNotificationParams.Append(info); + } + } + + pluginIds.Close(); + CleanupStack::PopAndDestroy( 2, appOdt ); // appOdt, pluginIds + appOdt = NULL; + + } // app configuration + + } // header loop + + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::InvalidateUninstalledPluginInstancesL +// ----------------------------------------------------------------------------- +TBool ChspsMaintenanceHandler::InvalidateUninstalledPluginInstancesL( + ChspsODT& aAppODT, + const TInt aPluginUid, + const RArray& aPluginIds ) + { + // Should be already locked by hspsRemoveThemeL() + __ASSERT_DEBUG( iDefinitionRepository.Locked(), User::Leave( KErrGeneral ) ); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::InvalidateUninstalledPluginInstancesL(): - Before Error state updates:") ); + ChspsOdtDump::Dump( aAppODT, *iLogBus ); + } +#endif + + TInt processedCount = 0; + for( TInt idIndex = 0; idIndex < aPluginIds.Count(); idIndex++ ) + { + const TInt pluginId( aPluginIds[idIndex] ); + + // If full DOM/application configuration hasn't been generated yet (plugin IDs are unset) + if ( pluginId > 0 ) + { + ChspsDomNode *pluginNode = hspsServerUtil::FindPluginNodeL( aAppODT, pluginId ); + __ASSERT_DEBUG( pluginNode, User::Leave( KErrArgument) ); + if ( pluginNode ) + { + ChspsDomNode* confNode = (ChspsDomNode *)pluginNode->ChildNodes().Item( 0 ); + __ASSERT_DEBUG( confNode, User::Leave( KErrArgument) ); + if ( confNode ) + { + // Indicate that the configuration is in error state + // Should be changed to "uninstalled" when Homescreen supports it silently + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrState, KConfStateError ); + processedCount++; + } + } + } + } + + if ( processedCount ) + { + // Remove uninstalled resources from the server (copies will remain in client's private directory) + RemovePluginResourcesL( aAppODT, aPluginUid ); + + // Store changes + User::LeaveIfError( iDefinitionRepository.SetOdtL( aAppODT ) ); + } + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + if ( processedCount > 0 ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::InvalidateUninstalledPluginInstancesL(): - Error states updated") ); + ChspsOdtDump::Dump( aAppODT, *iLogBus ); + } + else + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::InvalidateUninstalledPluginInstancesL(): - Error states were not added") ); + } + } +#endif + + return ( processedCount > 0 ); + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsPluginUpdateL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- + +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsPluginUpdateL( const ChspsODT& aOdt ) + { + ThspsServiceCompletedMessage ret( EhspsUpdatePluginFailed ); + + if( !iDefinitionRepository.Locked() ) + { + iDefinitionRepository.Lock(); + + // In case of error. repository is unlocked + CleanupStack::PushL( TCleanupItem( UnlockRepository, &iDefinitionRepository ) ); + + // set the default response + ret = EhspsUpdatePluginSuccess; + + TInt errorCode( KErrNone ); + + //create whole pluginOdt aOdt is only header for pluginOdt + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->SetRootUid( aOdt.RootUid() ); + odt->SetThemeUid( aOdt.ThemeUid() ); + odt->SetConfigurationType( aOdt.ConfigurationType() ); + odt->SetRootUid( aOdt.RootUid() ); + odt->SetProviderUid( aOdt.ProviderUid() ); + odt->SetThemeUid( aOdt.ThemeUid() ); + odt->SetProviderNameL( aOdt.ProviderName() ); + odt->SetThemeFullNameL( aOdt.ThemeFullName() ); + odt->SetThemeShortNameL( aOdt.ThemeShortName() ); + odt->SetThemeVersionL( aOdt.ThemeVersion() ); + odt->SetFlags( aOdt.Flags() ); + odt->SetMultiInstance( aOdt.MultiInstance() ); + User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); + + RArray notifParams; + + TRAP( errorCode, UpdatePluginFromAppConfsL( *odt, notifParams )); + + if( errorCode ) + { + ret = EhspsUpdatePluginFailed; + } + + iDefinitionRepository.Unlock(); + CleanupStack::Pop( &iDefinitionRepository ); + + if( ret == EhspsUpdatePluginSuccess ) + { + if(notifParams.Count() > 0 ) + { + //There is active app&appconfs to notify + + + for( TInt i=0; i < notifParams.Count(); i++ ) + { + iDefinitionRepository.RegisterNotification( notifParams[i] ); + } + } + + } + notifParams.Close(); + + CleanupStack::PopAndDestroy( odt ); + } + + return ret; + } +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::UpdatePluginFromAppConfsL +// (other items were commented in a header). +//--------------------------------------------------------------------- +void ChspsMaintenanceHandler::UpdatePluginFromAppConfsL( ChspsODT& aOdt, + RArray& aNotificationParams ) + { + + if ( iHeaderListCache.Length() > 0 ) + { + TInt count = iHeaderListCache.Count(); + for ( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = iHeaderListCache.At(i); + if ( header->ConfigurationType() == EhspsAppConfiguration ) + { + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->SetRootUid( header->RootUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetConfigurationType( header->ConfigurationType() ); + odt->SetRootUid( header->RootUid() ); + odt->SetProviderUid( header->ProviderUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetProviderNameL( header->ProviderName() ); + odt->SetThemeFullNameL( header->ThemeFullName() ); + odt->SetThemeShortNameL( header->ThemeShortName() ); + odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetFlags( header->Flags() ); + odt->SetMultiInstance( header->MultiInstance() ); + User::LeaveIfError( iDefinitionRepository.GetOdtL( *odt ) ); + + + RArray pluginIds; + + hspsServerUtil::GetPluginIdsByUidL( *odt, + TUid::Uid( aOdt.ThemeUid() ), + pluginIds ); + + + if ( pluginIds.Count() > 0 ) + { + + + TInt err = UpdatePluginConfigurationL( + *odt, + aOdt, + pluginIds ); + + User::LeaveIfError( iDefinitionRepository.SetOdtL( *odt ) ); + + + + TBool status = EFalse; + for(TInt i = 0; i < pluginIds.Count(); i++ ) + { + if( i == pluginIds.Count() - 1 ) + { + status = ETrue; + } + ThspsRepositoryInfo info( + ThspsRepositoryEvent( EhspsODTUpdated ), + odt->RootUid(), + odt->ThemeUid(), + 0, //=Any file + 0, + aOdt.RootUid(), + aOdt.ProviderUid(), + aOdt.ThemeUid(), + pluginIds[i], + status, + aOdt.ThemeFullName(), + (TLanguage)( aOdt.OdtLanguage() ) ); + aNotificationParams.Append(info); + } + } + + + + pluginIds.Close(); + + CleanupStack::PopAndDestroy( odt ); + + } + } + + } + } +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::UpdatePluginConfigurationL +// Not supported +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::UpdatePluginConfigurationL( + ChspsODT& aOdt, + ChspsODT& aPluginOdt, + RArray& aPluginIds ) + { + TInt err(KErrNone); + + // remove old resources + err = RemovePluginResourcesL( aOdt, aPluginOdt.ThemeUid() ); + + if( err ) + { + return err; + } + + ChspsDomNode* pluginNode = NULL; + ChspsDomNode* configNode = NULL; + for(TInt i = 0; i < aPluginIds.Count() && err == KErrNone; i++ ) + { + pluginNode = + hspsServerUtil::FindPluginNodeL( aOdt, aPluginIds[i] ); + TInt index = 0; + + configNode = + hspsServerUtil::FindChildNodeByTagL( KConfigurationElement, *pluginNode, index ); + + if( configNode ) + { + TInt id = hspsServerUtil::DecString2Int( + configNode->AttributeValue(KConfigurationAttrId)); + hspsServerUtil::AddAttributeNumericL( *aPluginOdt.DomDocument().RootNode(), KConfigurationAttrId, id ); + + pluginNode->ReplaceChildL(configNode,aPluginOdt.DomDocument().RootNode()); + } + else + { + err = KErrNotFound; + } + + } + if( err ) + { + return err; + } + + _LIT(KSourcesFolder, "\\sources\\"); + _LIT(KLocalesFolder, "\\locales\\"); + // Add plugin resources + TInt resourceCount = aPluginOdt.ResourceCount(); + for ( TInt index=0; index < resourceCount; index++ ) + { + ChspsResource& pluginResource = aPluginOdt.ResourceL(index); + // Add only those that are located under the sources folder + if ( pluginResource.FileName().FindF( KSourcesFolder ) > 0 + || pluginResource.FileName().FindF( KLocalesFolder ) > 0 ) + { + ChspsResource* r = pluginResource.CloneL(); + CleanupStack::PushL( r ); + aOdt.AddResourceL( r ); + CleanupStack::Pop( r ); + } + } + + return err; + } +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsGetListHeaders() +// Not supported +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsGetListHeaders(const ChspsODT& /*aSearchMask*/, + CArrayPtrFlat& /*aHeaderList*/) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSetActiveTheme() +// Not supported +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsSetActiveTheme(const TDesC8& /*aSetMaskData*/, + TDes8& /*aHeaderData*/) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsAddPlugin() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsAddPlugin( + const TInt /*aAppUid*/, + const TInt /*aParentPluginId*/, + const TInt /*aPluginUid*/, + const TInt /*aPosition*/, + TInt& /*aAddedPluginId*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsRemovePlugin() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsRemovePlugin( + const TInt /*aAppUid*/, + const TInt /*aPluginId*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSetActivePlugin() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsSetActivePlugin( + const TInt /*aAppUid*/, + const TInt /*aPluginId*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsReplacePlugin() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsReplacePlugin( + const TInt /*aAppUid*/, + const TInt /*aPluginId*/, + const TInt /*aConfUid*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSetPluginSettings() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsSetPluginSettings( + const ChspsODT& /*aHeader*/, + const TInt /*aPluginId*/, + ChspsDomDocument& /*aDom*/, + const TBool /*aPluginStoringStatus*/) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsMovePluginsL() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsMovePluginsL( + const TInt /*aAppUid*/, + const TInt /*aConfId*/, + const CArrayFixFlat& /*aPluginIdList*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsSetConfState() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsSetConfState( + const TInt /*aAppUid*/, + const TInt /*aConfId*/, + const ThspsConfigurationState /*aState*/, + const ThspsConfStateChangeFilter /*aFilter*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsRestoreActiveAppConf() +// Not supported - inherited from an interface and not used. +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsRestoreActiveAppConf( + const TInt /*aAppUid*/, + const TInt /*aConfUid*/ ) + { + return EhspsServiceNotSupported; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::hspsCancelGetListHeaders() +// Cancels the GetListHeaders request +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::hspsCancelGetListHeaders() + { + if ( IsActive() ) + { + Cancel(); + } + iHeaderDataList->ResetAndDestroy(); // no headers + iDeliveryCount = 0; // no delivered headers + iSubscription = EFalse; // no subscription + CompleteRequest( EhspsServiceRequestCanceled, iMessagePtr ); + // return with cancellation confirm + return EhspsServiceRequestCanceled; + } +// ----------------------------------------------------------------------------- +// ChspsClientRequestHandler::HandleDefinitionRespositoryEvent() +// Handles events coming from hspsDefinitionRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsMaintenanceHandler::HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ) + { + TInt errorCode = KErrNone; + TBool status(EFalse); + TRAP( errorCode, status = HandleDefinitionRespositoryEventL( aRepositoryInfo ) ); + if( errorCode != KErrNone ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsClientRequestHandler::HandleDefinitionRespositoryEvent(): - Error occured in HandleDefinitionRespositoryEventL" ) ); + } +#endif + } + return status; + } +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::HandleDefinitionRespositoryEvent() +// Handles events coming from hspsDefinitionRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsMaintenanceHandler::HandleDefinitionRespositoryEventL( ThspsRepositoryInfo aRepositoryInfo ) + { + // is there any changes in cache + if ( ( aRepositoryInfo.iEventType & EhspsCacheUpdate ) && !iDefinitionRepository.Locked() && iSubscription && !iMessagePtr.IsNull() ) + { + // cache changed, check if there is any changes when comparing to the local list + // and what kind of change there is + iCompletedMessage = GetHeaderListUpdateL(); + // is there headers to deliver + if ( iCompletedMessage == EhspsGetListHeadersRestart ) + { + if (iHeaderDataList->Count()) + { + // at least one header on the list + iMessagePtr.WriteL(2,iHeaderDataList->At(iDeliveryCount)->Des(),0); + // add list count + iDeliveryCount++; + // delivery of the first header + } + CompleteRequest( EhspsGetListHeadersRestart, iMessagePtr ); + } + else if ( iCompletedMessage == EhspsGetListHeadersUpdate ) + { + // return list update, count continues from where it was + iMessagePtr.WriteL(2,iHeaderDataList->At(iDeliveryCount)->Des(),0); + // add list count + iDeliveryCount++; + // deliver a list item + CompleteRequest( EhspsGetListHeadersUpdate, iMessagePtr ); + } + else if (iCompletedMessage == EhspsGetListHeadersEmpty) + { + CompleteRequest( EhspsGetListHeadersEmpty, iMessagePtr ); + // no list update available at the moment, continue the polling for list updates + } + } + else if ( ( aRepositoryInfo.iEventType & EhspsCacheUpdate ) && iDefinitionRepository.Locked() + && !IsActive() && iSubscription ) + { + After(KHeaderListUpdatePollingTimeSpan); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::DoCancel() +// Not implemented yet +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::DoCancel() + { + // no need to implement + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::CompleteRequest() +// Completes client request +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::CompleteRequest(const ThspsServiceCompletedMessage aReturnMessage, + RMessagePtr2& aMessagePtr, const TDesC8& /*aHeaderData*/ ) + { + TInt errorCode = KErrNone; + RDesWriteStream writeBuf( iResultData ); + + TRAP( errorCode, iResult->ExternalizeL( writeBuf )); + + writeBuf.Close(); + + if ( !aMessagePtr.IsNull() ) + { + if ( errorCode ) + { + TRAP_IGNORE( aMessagePtr.WriteL( 0, KNullDesC8, 0 )); + } + else + { + TRAP_IGNORE( aMessagePtr.WriteL( 0, iResultData, 0 )); + } + aMessagePtr.Complete( aReturnMessage ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::RunError +// From CActive. Called when error occurred in asynchronous request +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt ChspsMaintenanceHandler::RunError( TInt aError ) + { + iResult->iSystemError = aError; + iResult->iXuikonError = aError; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsMaintenanceHandler::RunError(): - error %d" ), + aError ); + } +#endif + + CompleteRequest( EhspsGetListHeadersFailed, iMessagePtr ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::RunL() +// Handles header list polling +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RunL() + { + if ( !iDefinitionRepository.Locked() && !iMessagePtr.IsNull() ) + { + // cache changed, check if there is any changes when comparring to the local list + // and what kind of change there is + iCompletedMessage = GetHeaderListUpdateL(); + // is there headers to deliver + if ( iCompletedMessage == EhspsGetListHeadersRestart) + { + if (iHeaderDataList->Count()) + { + // at least one header on the list + iMessagePtr.WriteL(2,iHeaderDataList->At(iDeliveryCount)->Des(),0); + // add list count + iDeliveryCount++; + // delivery of the first header + } + CompleteRequest( EhspsGetListHeadersRestart, iMessagePtr ); + } + else if ( iCompletedMessage == EhspsGetListHeadersUpdate ) + { + // return list update, count continues from where it was + iMessagePtr.WriteL(2,iHeaderDataList->At(iDeliveryCount)->Des(),0); + // add list count + iDeliveryCount++; + // deliver a list item + CompleteRequest( EhspsGetListHeadersUpdate, iMessagePtr ); + } + else if (iCompletedMessage == EhspsGetListHeadersEmpty) + { + CompleteRequest( EhspsGetListHeadersEmpty, iMessagePtr ); + // no list update available at the moment, continue the polling for list updates + } + } + else if ( !IsActive() ) + { + After(KHeaderListUpdatePollingTimeSpan); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::GetHeaderListUpdateL +// Checks if the header list has changed and returns the appropriate +// ThspsServiceCompletedMessage answer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsMaintenanceHandler::GetHeaderListUpdateL() + { + ThspsServiceCompletedMessage ret = EhspsGetListHeadersNoChange; + + // chech if repository have a cache update available + TInt oldcount = iHeaderDataList->Count(); + CArrayPtrSeg* newheaderDataList = new( ELeave ) CArrayPtrSeg + (KHeaderListGranularity); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyArray, newheaderDataList ) ); + + GetHeaderListL( *newheaderDataList, *iSearchMask ); + if ( newheaderDataList->Count() ) + { + TBool reset = EFalse; + TBool found = EFalse; + TInt newcount = newheaderDataList->Count(); + // cases: + // 0. both lists are empty => no change + if (!oldcount && !newcount) + { + ret = EhspsGetListHeadersNoChange; + } + else + // 1. new list has members but old list is empty => just add new headers on old list + // => restart anyway + if (!oldcount && newcount) + { + for (TInt k=0;kCount();k++) + { + HBufC8* l = newheaderDataList->At(k)->AllocL(); + if (l != NULL) + { + CleanupStack::PushL(l); + iHeaderDataList->AppendL(l); + CleanupStack::Pop(l); + } + } + ret = EhspsGetListHeadersRestart; // start from begin + } + // 2. new list is empty and old has members => empty old list too => empty the list + else if (!newcount && oldcount) + { + // must fetch whole list again + iHeaderDataList->ResetAndDestroy(); + iDeliveryCount = 0; + ret = EhspsGetListHeadersEmpty; // empty the list + } + // 3. old list and new list both have members, newcount < oldcount => reset + else if (newcount < oldcount) + { + // must fetch whole list again + iHeaderDataList->ResetAndDestroy(); + iDeliveryCount = 0; + GetHeaderListL( *iHeaderDataList, *iSearchMask ); + ret = EhspsGetListHeadersRestart; + } + // 4. old list and new list both have members => examine next cases + else + { + TInt j=0; + for ( TInt i=0; iCount();i++ ) + { + HBufC8* old = iHeaderDataList->At(i); + if (old != NULL) + { + while ( j < newheaderDataList->Count() ) + { + HBufC8* cand = newheaderDataList->At(j); + + if (cand != NULL) + { + if (CompareHeadersL(*old, *cand)) // is it there + { + // delete existing from the new list + newheaderDataList->Delete(j); + delete cand; //free allocated memory + found = ETrue; + break; // take next i in for for-loop + } + else + { + // not found at this round, let see will the next one be a hit + j++; // next j + } + } + else + { + // not found at this round, let see will the next one be a hit + j++; // next j + } + } // while + } + // did it found a match for entry i on iHeaderDataList + if (!found) + { + // lists do not match + reset = ETrue; + break; + } + } // for + if ( reset || newheaderDataList->Count() ) + { + // must fetch whole list again + iHeaderDataList->ResetAndDestroy(); + iDeliveryCount = 0; + GetHeaderListL( *iHeaderDataList, *iSearchMask ); + ret = EhspsGetListHeadersRestart; + } + else + { + iDeliveryCount = 0; + ret = EhspsGetListHeadersNoChange; + } + } + } + else // no headers found => list must be emptied + { + // reset the list + iHeaderDataList->ResetAndDestroy(); + iDeliveryCount = 0; + ret = EhspsGetListHeadersEmpty; + } + CleanupStack::Pop( newheaderDataList ); + if ( newheaderDataList ) + { + newheaderDataList->ResetAndDestroy(); + delete newheaderDataList; + newheaderDataList = NULL; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::GetHeaderListL +// Fills aHeaderDataList with headers and sets the appropriate flag for active theme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::GetHeaderListL( + CArrayPtrSeg& aHeaderDataList, + const ChspsODT& aSearchMask ) + { + HBufC8* headerBuf = aSearchMask.MarshalHeaderL(); + if ( !headerBuf ) + { + User::Leave(KErrGeneral); + } + CleanupStack::PushL( headerBuf ); + ChspsODT* searchOdt = ChspsODT::UnMarshalHeaderLC( *headerBuf ); + + // Reset search results + aHeaderDataList.ResetAndDestroy(); + + for ( TInt i = 0; i < iHeaderListCache.Count(); i++ ) + { + ChspsODT* header = iHeaderListCache.At( i ); + + // Check whether the header matches the search criteria + if ( FilterHeader( *searchOdt, *header ) ) + { + // Append to the search results + HBufC8* data = header->MarshalHeaderL(); + if ( data ) + { + CleanupStack::PushL( data ); + aHeaderDataList.AppendL( data ); + CleanupStack::Pop( data ); + } + } + } + + CleanupStack::PopAndDestroy( 2, headerBuf ); // searchOdt, headerBuf + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::RestoredDefaultL +// Goes through the themes for the application in order to find the Licensee +// Default theme to restore. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RestoredDefaultL( const ChspsODT& aSetMask, ChspsODT& aHeader ) + { + TBool found = EFalse; + TUint mask = 0; + TUint rootUid = aSetMask.RootUid(); + ChspsODT* odt; + + if ( aSetMask.Flags() & EhspsThemeStatusOperatorDefault ) + { + mask = EhspsThemeStatusOperatorDefault; + } + else if ( aSetMask.Flags() & EhspsThemeStatusUserDefault ) + { + mask = EhspsThemeStatusUserDefault; + } + + // If all but ROM based configurations should be removed + if ( aSetMask.Flags() & EhspsThemeStatusClean ) + { + for( TInt i = 0; i < iHeaderListCache.Count(); i++) // delete themes from c: + { + odt = iHeaderListCache.At(i); + + // Remove specific application configurations which are not matching the mask and + // the licencee default flag + if ( rootUid == odt->RootUid() + && !( (odt->Flags() & mask) && (aSetMask.Flags() & mask) ) + && !( odt->Flags() & EhspsThemeStatusLicenceeDefault ) ) + { + // do not care about possible error + TRAP_IGNORE( RemoveThemeL( *odt ) ); + } + } + // update cache after deletion + iThemeServer.UpdateHeaderListCacheL(); + } + + // Try activating the first licencee restorable configuration in the cache + for( TInt i = 0; i < iHeaderListCache.Count() && !found; i++ ) + { + odt = iHeaderListCache.At(i); + if( rootUid == odt->RootUid() && odt->Flags() & EhspsThemeStatusLicenceeRestorable ) + { + if ( iThemeServer.ActivateThemeL( *odt, aHeader ) == KErrNone ) + { + found = ETrue; + } + } + } + // any default will do, depends on restoration level + // this is safe because the default theme could be updated only with other default theme + mask = EhspsThemeStatusLicenceeDefault + EhspsThemeStatusOperatorDefault + EhspsThemeStatusUserDefault; + + // If no luck so far, try activating a "default" configuration with the new mask + for( TInt i = 0; i < iHeaderListCache.Count() && !found; i++ ) + { + odt = iHeaderListCache.At(i); + + if( rootUid == odt->RootUid() && odt->Flags() & mask ) + { + if ( iThemeServer.ActivateThemeL( *odt, aHeader ) == KErrNone ) + { + found = ETrue; + } + } + } + + // If still no success, just select the first one in the cache + if( !found ) + { // should not get here + for( TInt i = 0; i < iHeaderListCache.Count() && !found; i++ ) // licensee default not found, activate some other theme + { + odt = iHeaderListCache.At(i); + if( rootUid == odt->RootUid() ) + { + if ( iThemeServer.ActivateThemeL( *odt, aHeader ) == KErrNone ) + { + found = ETrue; + } + } + } + } + + // If there were no application specific configurations, give up + if( !found ) + { + // should not get here + User::Leave( KErrNotFound ); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::RemoveThemeL +// Removes given theme from repository. If theme is in use (KErrInUse), then the theme +// is added on cleanup list. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RemoveThemeL( const ChspsODT& aSetMask ) + { + // do not even try to delete a theme licencee default theme as it is located in rom + if( !( aSetMask.Flags() & EhspsThemeStatusLicenceeDefault ) ) + { + iDefinitionRepository.RemoveThemeL( aSetMask ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::CompareHeadersL +// Compares the two theme headers and returns ETrue if they are the same +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsMaintenanceHandler::CompareHeadersL(const TDesC8& aOldHeaderData, const TDesC8& + aNewHeaderData) + { + TBool ret; + ChspsODT* old = ChspsODT::UnMarshalHeaderLC(aOldHeaderData); + ChspsODT* cand= ChspsODT::UnMarshalHeaderLC(aNewHeaderData); + if ( old->RootUid() == cand->RootUid() + && old->ProviderUid() == cand->ProviderUid() + && old->ThemeUid() == cand->ThemeUid() + && !old->ThemeVersion().Compare(cand->ThemeVersion()) + && old->Flags() == cand->Flags() + ) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + CleanupStack::PopAndDestroy( cand ); + CleanupStack::PopAndDestroy( old ); + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::ComparePaths +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsMaintenanceHandler::ComparePaths(const ChspsODT& aOldHeader, const ChspsODT& aNewHeader) + { + TBool ret; + if ( aOldHeader.RootUid() == aNewHeader.RootUid() + && aOldHeader.ProviderUid() == aNewHeader.ProviderUid() + && aOldHeader.ThemeUid() == aNewHeader.ThemeUid() + && !aOldHeader.ThemeVersion().Compare(aNewHeader.ThemeVersion()) ) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::FilterHeader +// Compares the header and mask and returns true if the mask doesn't have any different +// values than the header (missing values are OK). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsMaintenanceHandler::FilterHeader( + const ChspsODT& aMask, + const ChspsODT& aHeader ) + { + TBool ret( EFalse ); + if ( + ( // 0 is not valid when comparing + (aMask.RootUid() && aMask.RootUid() == aHeader.RootUid()) + || + // 0 is OK in mask when aHeader is valid + (!aMask.RootUid() && aHeader.RootUid()) + ) + && + ( + (aMask.ProviderUid() && aMask.ProviderUid() == aHeader.ProviderUid()) + || + (!aMask.ProviderUid() && aHeader.ProviderUid()) + ) + && + ( + (aMask.ThemeUid() && aMask.ThemeUid() == aHeader.ThemeUid()) + || + (!aMask.ThemeUid() && aHeader.ThemeUid()) + ) + && + ( + (aMask.ThemeVersion().Length() && !aMask.ThemeVersion().Compare( + aHeader.ThemeVersion())) + || + (!aMask.ThemeVersion().Length() && aHeader.ThemeVersion().Length()) + ) + && + ( + ( aMask.ConfigurationType() && aMask.ConfigurationType() == aHeader.ConfigurationType() ) + || + ( !aMask.ConfigurationType() ) + ) + && + // Show widgets designed for the active resolution or scalable + ( ( aHeader.Family() & aMask.Family() ) || aHeader.Family() == 0 ) + ) + { + ret = ETrue; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::RestoreDefaultAppConfL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::RestoreDefaultAppConfL( + ChspsODT*& aHeader, + ChspsODT& aOdt) + { + + if ( aHeader->Flags() & EhspsThemeStatusLicenceeRestorable ) + { + // Licensee restorable configuration active -> Reinstall configuration + iThemeServer.ReinstallConfL( aHeader->RootUid(), aHeader->ThemeUid() ); + } + else + { + // Get licensee restorable configuation + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( aHeader->RootUid() ); + searchMask->SetFlags( EhspsThemeStatusLicenceeRestorable ); + TInt pos( 0 ); + iThemeServer.GetConfigurationHeader( *searchMask, aHeader, pos ); + if ( aHeader ) + { + // Activate licensee restorable configuration + iThemeServer.ActivateThemeL( *aHeader, aOdt ); + ThspsRepositoryInfo info( EhspsODTActivated ); + iDefinitionRepository.RegisterNotification( info ); + } + else + { + // Licensee restorable configuration not found + // There must be at least one licensee restorable configuration + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( searchMask ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsMaintenanceHandler::AddErrorConfigurationL() +// ----------------------------------------------------------------------------- +// +void ChspsMaintenanceHandler::AddErrorConfigurationL( + ChspsDomDocument& aAppDom, + ChspsDomNode& aMissingPluginNode, + const TInt aPluginUid + ) + { + // Create a new dummy configuration element + ChspsDomNode* confNode = aAppDom.CreateElementNSL( + KConfigurationElement, + aMissingPluginNode.Namespace() + ); + CleanupStack::PushL( confNode ); + + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrType, KConfTypeWidget ); + _LIT8( KUnknown, "unknown" ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrInterface, KUnknown ); + hspsServerUtil::AddAttributeNumericL( *confNode, KConfigurationAttrUid, aPluginUid, EHex ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrName, KUnknown ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrNameEntity, KUnknown ); + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrVersion, KUnknown ); + hspsServerUtil::AddAttributeNumericL( *confNode, KConfigurationAttrMaxChild, 0, EDecimal ); + + // Indicate that the configuration is in error state + hspsServerUtil::AddAttributeDescL( *confNode, KConfigurationAttrState, KConfStateError ); + + // Set parent node + aMissingPluginNode.AddChildL( confNode ); + CleanupStack::Pop( confNode ); + + confNode->SetParent( &aMissingPluginNode ); + + // Mandatory configuration-control node + ChspsDomNode* controlNode = aAppDom.CreateElementNSL( + KControlElement, + confNode->Namespace() + ); + CleanupStack::PushL( controlNode ); + confNode->AddChildL( controlNode ); + CleanupStack::Pop( controlNode ); + + controlNode->SetParent( confNode ); + + // Mandatory configuration-control-settings node + ChspsDomNode* settingsNode = aAppDom.CreateElementNSL( + KSettingsElement, + controlNode->Namespace() + ); + CleanupStack::PushL( settingsNode ); + controlNode->AddChildL( settingsNode ); + CleanupStack::Pop( settingsNode ); + settingsNode->SetParent( controlNode ); + + + // Mandatory configuration-resources node + ChspsDomNode* resourcesNode = aAppDom.CreateElementNSL( + KResourcesElement, + confNode->Namespace() + ); + CleanupStack::PushL( resourcesNode ); + confNode->AddChildL( resourcesNode ); + CleanupStack::Pop( resourcesNode ); + resourcesNode->SetParent( confNode ); + + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "hsps_builds_cfg.hrh" + +#include +#include +#include +#include "hspsrominstaller.h" +#include "hspsthemeserver.h" +#include "hspsinstallationhandler.h" +#include "hspsclientrequesthandler.h" +#include "hspsserverutil.h" + +_LIT( KInstallDirectoryZ, "z:\\private\\200159c0\\install\\" ); +_LIT( KHsps, "hsps"); + +// ========================= MEMBER FUNCTIONS ================================== + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +ChspsRomInstaller* ChspsRomInstaller::NewL( + ChspsThemeServer& aThemeServer, + RFs& aFsSession ) + { + ChspsRomInstaller* self = NewLC( aThemeServer, aFsSession ); + CleanupStack::Pop( self ); + return( self ) ; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +ChspsRomInstaller* ChspsRomInstaller::NewLC( + ChspsThemeServer& aThemeServer, + RFs& aFsSession) + { + ChspsRomInstaller* self = new ( ELeave ) ChspsRomInstaller( aThemeServer, aFsSession ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::ConstructL() + { + iInstallationHandler = ChspsInstallationHandler::NewL( iThemeServer ); + + // Prevent notifications from ROM based installations + iInstallationHandler->DisableNotifications(); + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::ChspsRomInstaller() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +ChspsRomInstaller::ChspsRomInstaller( + ChspsThemeServer& aThemeServer, + RFs& aFsSession ) + : CActive(EPriorityStandard), + iThemeServer(aThemeServer), + iFsSession(aFsSession), + iRet(EhspsInstallThemeFailed) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::~ChspsRomInstaller() +// Destructor. +// ----------------------------------------------------------------------------- +// +ChspsRomInstaller::~ChspsRomInstaller() + { + Cancel(); // Causes call to DoCancel() + delete iInstallationHandler; + iImportsArrayV1.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::SetImportsFilterL() +// ----------------------------------------------------------------------------- +// +TBool ChspsRomInstaller::SetImportsFilterL( + const TDesC& aFileFilter ) + { + TFindFile fileFinder( iFsSession ); + CDir* fileList( NULL ); + fileFinder.FindWildByDir( aFileFilter, KInstallDirectoryZ, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + + TFileName sourceName; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + sourceName.Copy( KInstallDirectoryZ ); + sourceName.Append( entry.iName ); + iImportsArrayV1.AppendL( sourceName.AllocL() ); + } + + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::GetInstallationFoldersL() +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::GetInstallationFoldersL( + RPointerArray& aFolders ) + { + aFolders.ResetAndDestroy(); + + _LIT(KAllFolders, "*"); + _LIT(KFolderSuffix, "\\"); + CDir* fileList( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( KAllFolders, KInstallDirectoryZ, fileList ); + if ( fileList ) + { + CleanupStack::PushL( fileList ); + + TFileName sourceName; + TBool verChecked = EFalse; + for( TInt i = 0; i < fileList->Count(); i++ ) + { + const TEntry& entry = (*fileList)[i]; + if ( entry.IsDir() ) + { + const TEntry& entry = (*fileList)[i]; + sourceName.Copy( KInstallDirectoryZ ); + sourceName.Append( entry.iName ); + sourceName.Append( KFolderSuffix ); + + if ( !verChecked ) + { + // Check whether the V2 directory structure is available + TFileName nameV2; + nameV2.Copy( sourceName ); + nameV2.Append( KHsps ); + nameV2.Append( KFolderSuffix ); + if( !BaflUtils::FolderExists( iFsSession, nameV2 ) ) + { + CleanupStack::PopAndDestroy( fileList ); + return; + } + verChecked = ETrue; + } + + aFolders.AppendL( sourceName.AllocL() ); + } + } + + CleanupStack::PopAndDestroy( fileList ); + fileList = NULL; + } + } + +void ChspsRomInstaller::FindImportsV1L() + { + iImportsArrayV1.ResetAndDestroy(); + SetImportsFilterL( KFilterAllPluginImportsV1 ); + SetImportsFilterL( KFilterAllAppImportsV1 ); + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::ImportsV1 +// ----------------------------------------------------------------------------- +// +const RPointerArray& ChspsRomInstaller::ImportsV1() + { + return iImportsArrayV1; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::InstallThemeL +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsRomInstaller::InstallThemeL( + const TDesC& aFileName ) + { + // Start installation by reading the manifest file + iRet = iInstallationHandler->hspsInstallTheme( aFileName, iHeaderData ); + if ( iRet == EhspsInstallThemeSuccess && !IsActive() ) + { + // Continue with remaining installation phases + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + + // Wait until the installation phases have been executed (async->sync) + CActiveScheduler::Start(); + } + + return iRet; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::ReinstallThemeL +// ----------------------------------------------------------------------------- +// +ThspsServiceCompletedMessage ChspsRomInstaller::ReinstallThemeL( + const TInt aAppUid, + const TInt aConfigurationUid ) + { + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + + iImportsArrayV1.ResetAndDestroy(); + + if ( aAppUid > 0 && aConfigurationUid > 0 ) + { + // Setup a filter for finding a specific import + _LIT(KFormat, "app_%X_*_%X_1.0.dat"); + HBufC* filter = HBufC::NewLC( KMaxFileName ); + filter->Des().AppendFormat( KFormat, aAppUid, aConfigurationUid ); + SetImportsFilterL( *filter ); + CleanupStack::PopAndDestroy( filter ); + + // There should be only one import matching the UIDs + if ( iImportsArrayV1.Count() == 1 ) + { + // Get path for a manifest from the import's file name + HBufC* manifestBuf = iThemeServer.GetManifestFromImportLC( + iImportsArrayV1[0]->Des(), + KInstallDirectoryZ ); + if ( manifestBuf ) + { + // Sync request + ret = InstallThemeL( manifestBuf->Des() ); + CleanupStack::PopAndDestroy( manifestBuf ); + } + } + + iImportsArrayV1.ResetAndDestroy(); + } + + // Complete application configuration reinstallation + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + User::LeaveIfError( iThemeServer.GetConfigurationL( aAppUid, aConfigurationUid, *odt ) ); + if ( odt->ConfigurationType() == EhspsAppConfiguration ) + { + // Add plugin configurations to the application configuration + ChspsClientRequestHandler* clientReqHandler = ChspsClientRequestHandler::NewL( iThemeServer ); + CleanupStack::PushL( clientReqHandler ); + clientReqHandler->HandlePluginReferencesL( *odt ); + CleanupStack::PopAndDestroy( clientReqHandler ); + } + CleanupStack::PopAndDestroy( odt ); + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::SetLogBus() +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsRomInstaller::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + iInstallationHandler->SetLogBus( aLogBus ); + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::RunError +// ----------------------------------------------------------------------------- +// +TInt ChspsRomInstaller::RunError( TInt /*aError*/ ) + { + // Called when error occurred in asynchronous request + CActiveScheduler::Stop(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::RunL +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::RunL() + { + iRet = (ThspsServiceCompletedMessage)iStatus.Int(); + switch ( iStatus.Int() ) + { + case EhspsInstallPhaseSuccess: + { + // Execute next phase of the installation + if ( !IsActive() ) + { + SetActive(); + iInstallationHandler->hspsInstallNextPhaseL( iHeaderData, iStatus ); + } + } + break; + + case EhspsInstallThemeSuccess: + case EhspsInstallThemeFailed: + default: + { + // Allow continuation of the InstallTheme function + CActiveScheduler::Stop(); + } + break; + } + } + +// ----------------------------------------------------------------------------- +// ChspsRomInstaller::DoCancel() +// ----------------------------------------------------------------------------- +// +void ChspsRomInstaller::DoCancel() + { + // Cancels any outstanding operation - nothing to do + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspssecurityenforcer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspssecurityenforcer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +#include "hspsthememanagement.h" +#include "hspsodt.h" +#include "hspsdefinitionrepository.h" +#include "hspssecurityenforcer.h" +#include "hspsserverutil.h" +#include "hspsthemeserver.h" +#ifdef HSPS_LOG_ACTIVE +#include +#endif + + +// ============================ LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ResetAndDestroyArray Callback function for cleaning up the CArrayPtr. +// Returns: void +// ----------------------------------------------------------------------------- +// +LOCAL_C void ResetAndDestroyArray( TAny* aArray ) + { + CArrayPtrSeg* tmp = reinterpret_cast*>( aArray ); + tmp->ResetAndDestroy(); + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::ChspsSecurityEnforcer +// C++ default constructor can not contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsSecurityEnforcer::ChspsSecurityEnforcer( + ChspsDefinitionRepository& aDefRep, CRepository& aCenRep ) +: iDefRep( aDefRep ), iCentralRepository( aCenRep ) + { + } + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsSecurityEnforcer::ConstructL() + { + iAccessControlList.Reset(); + TBuf8 buf; + iCentralRepository.Get(KCenrepKeyAccessControlList, buf ); + HandleAccessControlListL(buf, iAccessControlList); + } + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +ChspsSecurityEnforcer* ChspsSecurityEnforcer::NewL( ChspsDefinitionRepository& aDefRep, CRepository& aCenRep ) + { + ChspsSecurityEnforcer* self = new( ELeave ) ChspsSecurityEnforcer( aDefRep, aCenRep ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +ChspsSecurityEnforcer::~ChspsSecurityEnforcer() + { + iAccessControlList.Close(); + } + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::CheckIfLicenseeDefaultExistsL() +// Checks if Licensee Default theme exists. Leaves if there doesn't exist a licensee +// default theme that has the same AppUid and ThemeUid as aOdt. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsSecurityEnforcer::CheckIfLicenseeDefaultExistsL( const ChspsODT& aOdt ) + { + CArrayPtrSeg* headerDataList = new( ELeave ) CArrayPtrSeg( + KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyArray, headerDataList ) ); + TBool found( EFalse ); + + ChspsODT* tempMask = ChspsODT::NewL(); + CleanupStack::PushL( tempMask ); + tempMask->SetRootUid( aOdt.RootUid() ); + tempMask->SetThemeUid( aOdt.ThemeUid() ); + + iDefRep.GetThemeListAsStreamL( *headerDataList, *tempMask ); + CleanupStack::PopAndDestroy( tempMask ); + + for( TInt j = headerDataList->Count(); --j>=0; ) + { + TPtr8 h = headerDataList->At( j )->Des(); + ChspsODT* odt = ChspsODT::UnMarshalHeaderLC( h ); + if ( odt->Flags() & EhspsThemeStatusLicenceeDefault ) + { + found = ETrue; + } + CleanupStack::PopAndDestroy( odt ); + } + + CleanupStack::Pop( headerDataList ); + if ( headerDataList ) + { + headerDataList->ResetAndDestroy(); + delete headerDataList; + } + + if ( !found ) + { + User::LeaveIfError( KErrGeneral );//TO DO: Use HSPS error space + } + } + + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::CheckThemeLockingL() +// Checks if there exists a licencee default theme on ROM which has the same +// identity and has the theme status locked. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsSecurityEnforcer::CheckThemeLockingL( const ChspsODT& aOdt ) + { + CArrayPtrSeg* headerDataList = new( ELeave ) CArrayPtrSeg( + KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyArray, headerDataList ) ); + TBool found( EFalse ); + + ChspsODT* tempMask = ChspsODT::NewL(); + CleanupStack::PushL( tempMask ); + tempMask->SetRootUid( aOdt.RootUid() ); + tempMask->SetThemeUid( aOdt.ThemeUid() ); + + iDefRep.GetThemeListAsStreamL( *headerDataList, *tempMask ); + CleanupStack::PopAndDestroy( tempMask ); + + for( TInt j = headerDataList->Count(); --j>=0; ) + { + TPtr8 h = headerDataList->At( j )->Des(); + ChspsODT* odt = ChspsODT::UnMarshalHeaderLC( h ); + if ( odt->Flags() & EhspsThemeStatusLocked && odt->Flags() & EhspsThemeStatusLicenceeDefault ) + { + found = ETrue; + } + CleanupStack::PopAndDestroy( odt ); + } + + CleanupStack::Pop( headerDataList ); + if ( headerDataList ) + { + headerDataList->ResetAndDestroy(); + delete headerDataList; + } + + return found; + } + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::SetLogBus() +// ----------------------------------------------------------------------------- +// +#ifdef HSPS_LOG_ACTIVE +void ChspsSecurityEnforcer::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#endif + +//------------------------------------------------------------------------------ +// ChspsSecurityEnforcer::HandleAccessControlListL() +//------------------------------------------------------------------------------ +// +void ChspsSecurityEnforcer::HandleAccessControlListL( const TDesC8& aStrBuf, RArray& aArray ) + { + TLex8 input( aStrBuf ); + input.Mark(); + + while ( !input.Eos() ) + { + if( input.Peek() == ';') + { + TUint uid; + User::LeaveIfError( hspsServerUtil::HexString2Uint( input.MarkedToken(), uid ) ); + aArray.AppendL(uid); + input.Inc(); + input.Mark( ); + } + input.Inc(); + } + + } + +//------------------------------------------------------------------------------ +// ChspsSecurityEnforcer::CheckAccessControlListL() +//------------------------------------------------------------------------------ +// +TBool ChspsSecurityEnforcer::CheckAccessControlListL( TInt aUid ) + { + + TBool status(EFalse); +#ifdef _hsps_INTERNAL_ + if( aUid == KSecureId_EUnit.iUid ) + { + status = ETrue; + return status; + } +#endif + for( TInt i = 0; i < iAccessControlList.Count(); i++ ) + { + if( aUid == iAccessControlList[i] ) + { + status = ETrue; + break; + } + } + + return status; + } + +// ----------------------------------------------------------------------------- +// ChspsSecurityEnforcer::CheckAccessRightsL() +// This function is called by CPolicyServer when hspsThemeServer receives user request. +// Access rights are hard-coded here for S60 3.1, however, in later versions +// support for dynamic configuration of access rights must taken care. +// This would be appropriate to solve together with TARM-policy implementation. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +#ifdef _hsps_SECURITY_NOT_IN_USE_ +TBool ChspsSecurityEnforcer::CheckAccessRightsL( const RMessage2& /*aMessage*/ ) + { + return ETrue; + } +#else +TBool ChspsSecurityEnforcer::CheckAccessRightsL( const RMessage2& aMessage ) + { + TBool passed = EFalse; + TInt function = aMessage.Function(); + TInt secure_id = aMessage.SecureId().iId; + TInt vendor_id = aMessage.VendorId().iId; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsSecurityEnforcer::CheckAccessRightsL(): - SID: %d, VID: %d, function: %d" ), + secure_id, + vendor_id, + function ); + } +#endif + + switch ( function ) + { + // installation: + case EhspsInstallTheme: + case EhspsInstallNextPhase: + case EhspsCancelInstallTheme: + case EhspsReinstallConf: + { + if( CheckAccessControlListL( secure_id ) ) + { + passed = ETrue; + } + else + { + passed = aMessage.HasCapability( ECapabilityWriteDeviceData ); + } + break; + } + // maintenance + case EhspsGetListHeaders: + case EhspsGetNextHeader: + case EhspsCancelGetListHeaders: + case EhspsSetActiveTheme: + case EhspsRestoreDefault: + case EhspsAddPlugin: + case EhspsRemovePlugin: + case EhspsSetPluginSettings: + case EhspsGetPluginOdt: + case EhspsSetActivePlugin: + case EhspsMovePlugins: + case EhspsReplacePlugin: + case EhspsSetConfState: + case EhspsRestoreActiveAppConf: + case EhspsUpdatePluginConf: + { + if( CheckAccessControlListL( secure_id ) ) + { + passed = ETrue; + } + else + { + passed = aMessage.HasCapability( ECapabilityWriteDeviceData ); + } + break; + } + case EhspsRemoveTheme: + { + if( CheckAccessControlListL( secure_id ) ) + { + passed = ETrue; + } + else + { + passed = aMessage.HasCapability( ECapabilityWriteDeviceData ); + } + break; + } + // theme usage + case EhspsGetODT: + case EhspsGetODTUpdate: + case EhspsCancelGetODTUpdate: + case EhspsAccessResourceFile: + case EhspsCopyResources: + { + if( CheckAccessControlListL( secure_id ) ) + { + passed = ETrue; + } + else + { + passed = aMessage.HasCapability( ECapabilityWriteDeviceData ); + } + break; + } + + default: + { + passed = EFalse; + break; + } + } + +#ifdef HSPS_LOG_ACTIVE + if ( !passed ) + { + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsSecurityEnforcer::CheckAccessRightsL(): - security violation, client process is now frozen." ) ); + } + } +#endif + + return passed; + } +#endif + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1840 @@ +/* +* 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: Utility for common code. +* +*/ + + +#include "hspsthememanagement.h" +#include "hspsserverutil.h" +#include "hspsodt.h" +#include "hspsdomdepthiterator.h" +#include "hspsdomnode.h" +#include "hspsdomdocument.h" +#include "hspsconfiguration.h" +#include "hspsdomlist.h" +#include "hspsresource.h" +#include "hspsdomattribute.h" +#include "hspsmanifest.h" +#include "bautils.h" +#include "sysutil.h" + + +_LIT(KHspsFolder, "\\200159c0\\themes\\" ); +_LIT(KSourcesFolder, "\\sources\\"); +_LIT( KThemesFolder, "\\themes\\" ); +_LIT( KDoubleBackSlash, "\\" ); +_LIT8( KHexPrefix8, "0x" ); + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GenerateConfigurationAttributesL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GenerateConfigurationAttributesL( ChspsODT& aOdt ) + { + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + ChspsDomNode* prevNode = NULL; + ChspsDomNode* node = iter->First(); + while( node && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Configuration element + if ( name == KConfigurationElement ) + { + // Add attributes for the configuration node + // NOTE! ID attribute is not set here + TPtrC8 ptr = KManifestTypeApp().Ptr(); + switch ( aOdt.ConfigurationType() ) + { + case EhspsViewConfiguration: + { + ptr.Set( KManifestTypeView ); + } + break; + case EhspsWidgetConfiguration: + { + ptr.Set( KManifestTypeWidget ); + } + break; + case EhspsTemplateConfiguration: + { + ptr.Set( KManifestTypeTemplate ); + } + break; + default: + { + } + } + + AddAttributeDescL( *node, KConfigurationAttrType, ptr ); + + AddAttributeNumericL( *node, KConfigurationAttrInterface, aOdt.RootUid(), EHex ); + + AddAttributeNumericL( *node, KConfigurationAttrUid, aOdt.ThemeUid(), EHex ); + + // Create "name" and "_name" attributes, of which latter holds the entity reference + // (logical key for finding localizad strings) + HBufC8* nameBuf = HBufC8::NewLC( aOdt.ThemeFullName().Length() ); + TPtr8 namePtr( nameBuf->Des() ); + namePtr.Copy( aOdt.ThemeFullName() ); + AddAttributeDescL( *node, KConfigurationAttrName, namePtr ); // will be updated when localized + AddAttributeDescL( *node, KConfigurationAttrNameEntity, namePtr ); // logical id + CleanupStack::PopAndDestroy( nameBuf ); + + // Create theme version attribute + HBufC8* tv = HBufC8::NewLC( aOdt.ThemeVersion().Length() ); + TPtr8 tvPtr( tv->Des() ); + tvPtr.Copy( aOdt.ThemeVersion() ); + AddAttributeDescL( *node, KConfigurationAttrVersion, tvPtr ); + CleanupStack::PopAndDestroy( tv ); + + AddAttributeNumericL ( *node, KConfigurationAttrMultiInstance, + aOdt.MultiInstance(), EDecimal ); + + AddAttributeDescL( *node, KConfigurationAttrState, KConfStateNotConfirmed ); + + const TInt descLength = aOdt.Description().Length(); + if ( descLength ) + { + // Add description of the widget (16 > 8bit conversion) + HBufC8* buf = HBufC8::NewLC( descLength ); + TPtr8 bufPtr( buf->Des() ); + bufPtr.Copy( aOdt.Description() ); + AddAttributeDescL( *node, KConfigurationAttrDesc, bufPtr ); // will be updated when localized + AddAttributeDescL( *node, KConfigurationAttrDescEntity, bufPtr ); // logical id + CleanupStack::PopAndDestroy( buf ); + } + else + { + AddAttributeDescL( *node, KConfigurationAttrDesc, KNullDesC8 ); + } + + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + +// ----------------------------------------------------------------------------- +// ChspsInstallationHandler::GenerateObjectAttributesL() +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GenerateObjectAttributesL( ChspsODT& aOdt ) + { + // Find the configuration node + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomNode* configurationNode = dom.RootNode(); + if ( !configurationNode ) + { +#ifdef _hsps_DEBUG_ + RDebug::Print( _L("hspsServerUtil::GenerateObjectAttributesL(): - invalid ODT!") ); +#endif + User::Leave( KErrGeneral ); + } + + // Find resources node from the XML definition (child of the configuration node) + ChspsDomList& childsList = configurationNode->ChildNodes(); + ChspsDomNode* resourcesNode = (ChspsDomNode *)childsList.FindByName( KResourcesElement ); + TInt popResources = EFalse; + if ( !resourcesNode ) + { + // Create a node and add it into the configuration node + resourcesNode = dom.CreateElementNSL( + KResourcesElement, + configurationNode->Namespace() + ); + CleanupStack::PushL( resourcesNode ); + popResources = ETrue; + configurationNode->AddChildL( resourcesNode ); + resourcesNode->SetParent( configurationNode ); + } + + // Loop ODT's resources (parsed ealier from the manifest file) + const TInt resourceCount = aOdt.ResourceCount(); + TBool addResource = EFalse; + for( TInt resourceIndex=0; resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& resource = aOdt.ResourceL( resourceIndex ); + + addResource = EFalse; + + // If resource is located under the sources folder + if ( resource.FileName().FindF( KSourcesFolder ) > 0 ) + { + // If resource is for the active device language or it's a locale independent resource + addResource = ( resource.Language() == aOdt.OdtLanguage() || resource.Language() == ELangNone ); + } + + if ( addResource ) + { + // Create an object node and add the object into the resources list + ChspsDomNode* objectNode = dom.CreateElementNSL( + KObjectElement, + resourcesNode->Namespace() + ); + CleanupStack::PushL( objectNode ); + resourcesNode->AddChildL( objectNode ); + objectNode->SetParent( resourcesNode ); + + // Name (16->8bit conversion) + HBufC8* nameBuf = HBufC8::NewLC( resource.ResourceId().Length() ); + TPtr8 namePtr( nameBuf->Des() ); + namePtr.Copy( GetFixedOdtName( resource.ResourceId() ) ); + + AddAttributeDescL( *objectNode, KObjectAttrFilename, namePtr ); + CleanupStack::PopAndDestroy( nameBuf ); + + // Media type + TPtrC8 mimePtr( resource.MimeType().Des8() ); + if ( mimePtr.Length() ) + { + AddAttributeDescL( *objectNode, KObjectAttrMediatype, mimePtr ); + } + + // Tag + TPtrC tagPtr( resource.Tags() ); + if ( tagPtr.Length() ) + { + // (16->8bit conversion) + HBufC8* buf = HBufC8::NewLC( tagPtr.Length() ); + TPtr8 bufPtr( buf->Des() ); + bufPtr.Copy( tagPtr ); + AddAttributeDescL( *objectNode, KObjectAttrTag, bufPtr ); + CleanupStack::PopAndDestroy( buf ); + } + + // Path + TInt pos = resource.FileName().FindF( KHspsFolder ); + if ( pos > 0 ) + { + // Remove filename and extension from the path + TParsePtrC parserPtr( resource.FileName() ); + TFileName path( parserPtr.DriveAndPath() ); + + // Remove path to the Definition repository + path.Copy( path.Mid( pos + KHspsFolder().Length() ) ); + + // Fix path references for localized resources + GetLocaleIndependentResourcePath( resource.Language(), path ); + + // 16->8bit conversion + HBufC8 *pathBuf = HBufC8::NewLC( path.Length() ); + pathBuf->Des().Copy( path ); + + AddAttributeDescL( *objectNode, KObjectAttrPath, pathBuf->Des() ); + CleanupStack::PopAndDestroy( pathBuf ); + } + + // Now the document has an ownership of the objectnode + CleanupStack::Pop( objectNode ); + + } + + } // for loop + + if ( popResources ) + { + // Now the document has an ownership of the resourcesNode + CleanupStack::Pop( resourcesNode ); + } + } + + +TFileName hspsServerUtil::GetFixedOdtName( + const TDesC& aNameAndExtension ) + { + TParsePtrC parsePtr( aNameAndExtension ); + TPtrC fileExtension = parsePtr.Ext(); + if ( fileExtension.Length() > 2 && fileExtension.Left(2).CompareF( _L(".o") ) == 0 ) + { + // Strip the first letter + TInt odtIndex(0); + TLex lex( fileExtension.Mid(3) ); + if ( lex.Val( odtIndex ) == KErrNone && odtIndex >= 0 ) + { + fileExtension.Set( _L(".o0000") ); + } + } + + TFileName fileName( parsePtr.Name() ); + fileName.Append( fileExtension ); + return fileName; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetLocaleIndependentResourcePath +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GetLocaleIndependentResourcePath( + const TLanguage& aResourceLanguage, + TFileName& aPath ) + { + TBool isLocaleSpecificResource = ( aResourceLanguage != ELangNone ); + + // If locale specific resource + if ( isLocaleSpecificResource ) + { + // Remove locale specific subfolder from the path + TInt pos = aPath.FindF( KSourcesFolder ); + if ( pos ) + { + aPath.Copy( aPath.Left( pos + KSourcesFolder().Length() ) ); + } + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetRelativeResourcePath +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GetRelativeResourcePath( + const TFileName& aSourceFile, + TPath& aRelativePath ) + { + // find last part (structure after "/themes/") + TInt pos = aSourceFile.FindF( KThemesFolder ); + if( pos != KErrNotFound ) + { + pos += KThemesFolder().Length(); + TInt len( aSourceFile.Length() - pos ); + aRelativePath.Copy( aSourceFile.Right( len ) ); + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::AddAttributeNumericL +// ----------------------------------------------------------------------------- +// +TInt hspsServerUtil::AddAttributeNumericL( + ChspsDomNode& aNode, + const TDesC8& aAttrName, + const TInt aValue, + const TRadix aFormat ) + { + // Format change + // Value string, 10 -> Max decimal 4294967295 , max hexadecimal 0xXXXXXXXX + const TInt KMaxLength = 10; + TBuf8 attValueDes8; + + if ( aFormat == EHex ) + { + _LIT8( KFormat8, "%X" ); + _LIT8( KHexPrefix, "0x" ); + attValueDes8.Append( KHexPrefix ); + attValueDes8.AppendFormat( KFormat8, aValue ); + } + else // EDecimal + { + _LIT8( KFormat8, "%d" ); + attValueDes8.AppendFormat( KFormat8, aValue ); + } + + ChspsDomList& attrList = aNode.AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(aAttrName) ); + if ( attr ) + { + // Replace value of the attribute + attr->SetValueL( attValueDes8 ); + } + else + { + // Add an attribute + ChspsDomAttribute* attr = ChspsDomAttribute::NewL( aAttrName, aNode.StringPool() ); + CleanupStack::PushL( attr ); + attr->SetValueL( attValueDes8 ); + ChspsDomList& attrList = aNode.AttributeList(); + attrList.AddItemL( attr ); //takes ownership + CleanupStack::Pop( attr ); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::AddAttributeDescL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::AddAttributeDescL( + ChspsDomNode& aNode, + const TDesC8& aAttrName, + const TDesC8& aValue ) + { + ChspsDomList& attrList = aNode.AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(aAttrName) ); + if ( attr ) + { + // Replace value of the attribute + attr->SetValueL( aValue ); + } + else + { + // Add an attribute + ChspsDomAttribute* attr = ChspsDomAttribute::NewL( aAttrName, aNode.StringPool() ); + CleanupStack::PushL( attr ); + attr->SetValueL( aValue ); + ChspsDomList& attrList = aNode.AttributeList(); + attrList.AddItemL( attr ); //takes ownership + CleanupStack::Pop( attr ); + } + } + + +// ----------------------------------------------------------------------------- +// Finds a configuration node with the provided id attribute +// ----------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::FindConfigurationNodeL( + ChspsODT& aOdt, + const TInt aConfigurationId ) + { + __UHEAP_MARK; + + ChspsDomNode *configurationNode = NULL; + + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a configuration node with an id attribute that matches the provided id + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // An element was found + if ( name == KConfigurationElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* idAttr = static_cast( attrList.FindByName(KConfigurationAttrId) ); + if ( !idAttr ) + { + // Return with NULL + jobDone = ETrue; + } + else + { + TInt id(0); + const TDesC8& idValue = idAttr->Value(); + TLex8 lex( idValue ); + lex.Val( id ); + if ( aConfigurationId == id ) + { + configurationNode = node; + jobDone = ETrue; + } + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + +#ifdef _hsps_DEBUG_ + if ( !configurationNode ) + { + RDebug::Print( _L("hspsServerUtil::FindConfigurationNodeL(): failed to find the configuration node") ); + } +#endif + + __UHEAP_MARKEND; + + return configurationNode; + } + +// ----------------------------------------------------------------------------- +// Finds a plugin node with the provided id +// ----------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::FindPluginNodeL( + ChspsODT& aOdt, + const TInt aPluginId ) + { + __UHEAP_MARK; + + ChspsDomNode* pluginNode = NULL; + + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a plugin node with the provided id attribute + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Plugin element was found + if ( name == KPluginElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* idAttr = static_cast( attrList.FindByName(KPluginAttrId) ); + if ( !idAttr ) + { + // Mandatory information is missing for some reason (should be set at installation handler)! + // Exit with NULL + jobDone = ETrue; + } + else + { + TInt id(0); + const TDesC8& idValue = idAttr->Value(); + TLex8 lex( idValue ); + lex.Val( id ); + if ( aPluginId == id ) + { + pluginNode = node; + jobDone = ETrue; + } + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + +#ifdef _hsps_DEBUG_ + if ( !pluginNode ) + { + RDebug::Print( _L("hspsServerUtil::FindPluginNodeL(): failed to find the plugin node") ); + } +#endif + + __UHEAP_MARKEND; + + return pluginNode; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetConfigurationNameFromDomL +// ----------------------------------------------------------------------------- +// +TPtrC8 hspsServerUtil::FindConfigurationAttrL( + const ChspsODT& aOdt, + const TDesC8& aAttr ) + { + TPtrC8 ptr; + + // Get ODT's DOM and find the 1st configuration node + ChspsDomNode* confNode = aOdt.DomDocument().RootNode(); + if( !confNode || confNode->Name().CompareF( KConfigurationElement) != 0 ) + { + User::Leave( KErrGeneral ); + } + + // Find the name attribute and return it's value + ChspsDomList& attrList = confNode->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(aAttr) ); + if ( !attr ) + { + User::Leave( KErrGeneral ); + } + ptr.Set( attr->Value() ); + + return ptr; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::CopyResourceFileL +// ----------------------------------------------------------------------------- +// +TInt hspsServerUtil::CopyResourceFileL( + RFs& aFs, + CFileMan& aFilemanager, + const TPath& aTargetPath, + const TFileName& aSourceFile ) + { + // Make target folder + TInt error = aFs.MkDirAll( aTargetPath ); + if( error == KErrAlreadyExists ) + { + // lets ignore error if directory already exists + error = KErrNone; + } + if( !error ) + { + // Default to 'copying was not neccessary' + error = KErrAlreadyExists; + + // Check whether the resource needs to be copied + if ( hspsServerUtil::ResourceCopyIsRelevantL( + aSourceFile, + aTargetPath, + aFs ) + ) + { + // Slowish operation + error = aFilemanager.Copy( + aSourceFile, + aTargetPath ); + if( !error ) + { + // Clear readonly file attribs that might be inherited from the source file + aFilemanager.Attribs( + aTargetPath, + 0, + KEntryAttReadOnly, + TTime( 0 ) ); // TTime(0) = preserve original time stamp. + } + + } // copy op + } + + return error; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::ResourceCopyIsRelevant +// ----------------------------------------------------------------------------- +// +TBool hspsServerUtil::ResourceCopyIsRelevantL( + const TDesC& aSource, + const TDesC& aTarget, + RFs& aFs ) + { + // Basic sanity check. + if( aSource.Length() == 0 || aTarget.Length() == 0 ) + { + return EFalse; + } + + // Collect data from files. + + TEntry sourceEntry; + TInt entryError = aFs.Entry( aSource, sourceEntry ); + if( entryError != KErrNone ) + { + // Problem. Do not copy. + return EFalse; + } + + TEntry targetEntry; + entryError = aFs.Entry( aTarget, targetEntry ); + if( entryError == KErrNotFound ) + { + // Target does not exist. Copy needed. + return ETrue; + } + else if( entryError != KErrNone ) + { + // All other errors handled here. Better not to copy. + return EFalse; + } + + TParse sourceParser; + sourceParser.Set( aSource, NULL, NULL ); + + TParse targetParser; + targetParser.Set( aTarget, NULL, NULL ); + + // We have tdesc of target drive but SysUtils need TDriveNumber instead + // so extract it from tdesc. default to C. + TInt targetDriveNumber = EDriveC; + + // Sanity checks before accessing descriptor (prevent "out of bounds" panic). + if( targetParser.DrivePresent() && + targetParser.Drive().Length() > 0 ) + { + // Use tmp variable so that CharToDrive does not mess our fallback + // value. (it should not do that in case of error... but better + // to do fool-proof.) + TInt tmpDriveNumber = EDriveC; + + // Convert from TDesC to enumeration of drives. + if( RFs::CharToDrive( targetParser.Drive()[0], tmpDriveNumber ) == KErrNone ) + { + targetDriveNumber = tmpDriveNumber; + } + } + + const TInt KTargetExists = BaflUtils::FileExists( aFs, aTarget ); + + // Target exists + size and time stamp identical? + if( KTargetExists && + sourceEntry.iSize == targetEntry.iSize && + sourceEntry.iModified == targetEntry.iModified ) + { + return EFalse; + } + + // Check required disk space. + TInt requiredDiskSpace = 0; + + if( KTargetExists && sourceEntry.iSize > targetEntry.iSize ) + { + requiredDiskSpace = sourceEntry.iSize - targetEntry.iSize; + } + else if( !KTargetExists ) + { + requiredDiskSpace = sourceEntry.iSize; + } + + if( requiredDiskSpace != 0 ) + { + if( SysUtil::DiskSpaceBelowCriticalLevelL( &aFs, requiredDiskSpace, targetDriveNumber ) ) + { + return EFalse; + } + } + + // All tests passed. + return ETrue; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::UpdateConfigurationStateL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::UpdateConfigurationStateL( + ChspsODT& aOdt, + TDesC8& aConfState, + TDesC8& aNextConfState, + TBool& aOdtUpdated ) + { + aOdtUpdated = EFalse; + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + ChspsDomNode* prevNode = NULL; + ChspsDomNode* node = iter->First(); + + while( node && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Configuration element + if ( name == KConfigurationElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( KConfigurationAttrState ) ); + if ( attr && attr->Value().CompareF( aConfState ) == 0 ) + { + attr->SetValueL( aNextConfState ); + aOdtUpdated = ETrue; + } + } + + prevNode = node; + node = iter->NextL(); + } + + CleanupStack::PopAndDestroy( iter ); + + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::UpdateAppConfigurationStateL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::UpdateAppConfigurationStateL( + ChspsODT& aAppOdt, + const TDesC8& aConfState, + const TDesC8& aNextConfState ) + { + __ASSERT_DEBUG( aConfState.Length() > 0, User::Leave( KErrArgument) ); + __ASSERT_DEBUG( aNextConfState.Length() > 0, User::Leave( KErrArgument) ); + + // Update application configuration state + ChspsDomNode* appConfNode = hspsServerUtil::FindNodeByAttributeL( + aAppOdt, + KConfigurationElement, + KConfigurationAttrType, + KConfTypeApp ); + ChspsDomList& attrList = appConfNode->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( KConfigurationAttrState ) ); + if ( attr && attr->Value().CompareF( aConfState ) == 0 ) + { + attr->SetValueL( aNextConfState ); + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::FindNodeByAttributeL +// ----------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::FindNodeByAttributeL( + ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue) + { + __UHEAP_MARK; + + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + ChspsDomNode* foundNode( NULL ); + ChspsDomNode* prevNode( NULL ); + ChspsDomNode* node = iter->First(); + while( node && + prevNode != node && + foundNode == NULL ) + { + const TDesC8& name = node->Name(); + if ( name.CompareF( aNodeName ) == 0 ) + { + // Node name match + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( aAttrName ) ); + if ( attr && attr->Value().CompareF( aAttrValue ) == 0 ) + { + // Attribute name and value match + foundNode = node; + } + } + // Get next node + prevNode = node; + node = iter->NextL(); + } + + CleanupStack::PopAndDestroy( iter ); + + __UHEAP_MARKEND; + + return foundNode; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::FindUniquePluginsL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::FindUniquePluginsL( + ChspsODT& aOdt, + RArray& aPluginArray ) + { + aPluginArray.Reset(); + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + while( node && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Plugin element was found + if ( name == KPluginElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* uidAttr = static_cast( attrList.FindByName(KPluginAttrUid) ); + if ( uidAttr ) + { + // Convert from hex to int + const TUid pluginUid = ConvertDescIntoUid( uidAttr->Value() ); + if ( pluginUid.iUid > 0 ) + { + TBool isUnique = ETrue; + for( TInt i=0; isUnique && iNextL(); + } + CleanupStack::PopAndDestroy( iter ); +} + +//---------------------------------------------------------------------------- +// CHspsServiceUtilities::HexString2Uint +// ---------------------------------------------------------------------------- +// +TInt hspsServerUtil::HexString2Uint( + const TDesC8& aStr, + TUint& aTrg ) + { + // Assign to lexer. + TLex8 lex( aStr ); + + // Ignore preceding "0x" if it exists. TLex does not know how to handle that + // and returns just zero. + if( aStr.Length() >= KHexPrefix8().Length() && + aStr.FindF( KHexPrefix8() ) == 0 ) + { + lex.Inc( KHexPrefix8().Length() ); + } + + // Actual conversion. + TInt status = KErrNone; + TUint val = 0; + status = lex.Val( val, EHex ); + + // Error check. + if( status == KErrNone ) + { + aTrg = val; + } + + return status; + } + +//---------------------------------------------------------------------------- +// CHspsServiceUtilities::DecString2Int +// ---------------------------------------------------------------------------- +// +TInt hspsServerUtil::DecString2Int( + const TDesC8& aStr ) + { + TLex8 lex( aStr ); + TUint value; + lex.Mark(); + + while ( lex.Peek().IsDigit() ) + { + lex.Inc(); + } + TPtrC8 uidToken = lex.MarkedToken(); + TLex8 uidLex( uidToken ); + TInt err = uidLex.Val( value, EDecimal ); + + return value; + } +// ----------------------------------------------------------------------------- +// Returns a count of plugin instances. +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::PluginInstanceCountL( + const ChspsODT& aAppODT, + const TInt aPluginUid, + TInt& aInstanceCount ) + { + aInstanceCount = 0; + + ChspsDomDocument& dom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a plugin node with the provided id attribute + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Plugin element was found + if ( name == KPluginElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPluginAttrUid) ); + if ( !attr ) + { + // Mandatory information is missing for some reason (should be set at installation handler)! + // Exit with NULL + jobDone = ETrue; + } + else + { + // Convert from (hex?) string into TUid presentation + const TUid uid = ConvertDescIntoUid( attr->Value() ); + if ( aPluginUid == uid.iUid ) + { + aInstanceCount++; + } + } + } + + prevNode = node; + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } +// ----------------------------------------------------------------------------- +// hspsServerUtil::ConvertDescIntoUid() +//---------------------------------------------------------------------------- +// +TUid hspsServerUtil::ConvertDescIntoUid( + const TDesC8& aStr ) + { + TLex8 lex(aStr); + TUint pluginUid; + lex.Mark(); + + if(lex.Peek() == '0') + { + lex.Inc(); + } + if(lex.Peek() == 'x') + { + lex.Inc(); + } + lex.Mark(); + while (lex.Peek().IsHexDigit()) + { + lex.Inc(); + } + TPtrC8 uidToken = lex.MarkedToken(); + TLex8 uidLex(uidToken); + TInt err = uidLex.Val(pluginUid,EHex); + + return TUid::Uid(pluginUid); + } +//---------------------------------------------------------------------------- +// hspsServerUtil::FindChildNodeByTagL() +// ---------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::FindChildNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aParentNode, + TInt& aIndex ) + { + ChspsDomNode* node( NULL ); + ChspsDomList& items = aParentNode.ChildNodes(); + TInt length = items.Length(); + node = NULL; + for ( TInt i = aIndex; i < length && node == NULL; i++ ) + { + node = static_cast( items.Item( i ) ); + const TDesC8& name = node->Name(); + if( name.Compare( aNodeTag ) != 0 ) + { + node = NULL; + } + else + { + aIndex = i; + } + } + + return node; + } + +//---------------------------------------------------------------------------- +// hspsServerUtil::FindFilesL() +// ---------------------------------------------------------------------------- +// +void hspsServerUtil::FindFilesL( + const TDesC& aDirName, + const TDesC& aFileName, + RArray & aFiles ) + { + RFs fs; + CleanupClosePushL( fs ); + User::LeaveIfError( fs.Connect() ); + + // Find files from root directory + hspsServerUtil::FindFilesFromDirL( + aDirName, + aFileName, + aFiles ); + + // Directory scanner to browse directory structure + CDirScan* dirScan = CDirScan::NewL( fs ); + CleanupStack::PushL( dirScan ); + dirScan->SetScanDataL( + aDirName, + ( KEntryAttDir | KEntryAttMatchExclusive ), + ESortNone ); + + // Directory path where installation files are searched + TFileName dirName; + + // Get first directory list + CDir* dirList( NULL ); + dirScan->NextL( dirList ); + // Find files from root directories + while ( dirList ) + { + CleanupStack::PushL( dirList ); + for ( TInt i = 0; i < dirList->Count(); i++ ) + { + // Get directory path + dirName = dirScan->FullPath(); + // Append directory entry + const TEntry& dirEntry = ( *dirList )[ i ]; + dirName.Append( dirEntry.iName ); + dirName.Append( KDoubleBackSlash ); + hspsServerUtil::FindFilesFromDirL( + dirName, + aFileName, + aFiles ); + } + // Get next directory list + CleanupStack::PopAndDestroy( dirList ); + dirScan->NextL( dirList ); + } + + CleanupStack::PopAndDestroy( dirScan ); + + CleanupStack::PopAndDestroy(); // fs + + } + +//---------------------------------------------------------------------------- +// hspsServerUtil::FindFilesFromDirL() +// ---------------------------------------------------------------------------- +// +void hspsServerUtil::FindFilesFromDirL( + const TDesC& aDirName, + const TDesC& aFileName, + RArray & aFiles ) + { + RFs fs; + CleanupClosePushL( fs ); + User::LeaveIfError( fs.Connect() ); + + // File finder to search files from a directory + TFindFile fileFinder( fs ); + + // Define drives where files are searched + TInt driveNumber; + TParse dirParser; + dirParser.Set( aDirName, NULL, NULL ); + // Default drives C: and Z: + TInt findMask( + KDriveAttExclude | + KDriveAttRemovable | + KDriveAttRemote ); + if( RFs::CharToDrive( dirParser.Drive()[0], driveNumber ) == KErrNone ) + { + if ( driveNumber == EDriveC ) + { + // Search from C: drive + findMask = ( + KDriveAttExclude | + KDriveAttRemovable | + KDriveAttRemote | + KDriveAttRom ); + } + else if ( driveNumber == EDriveZ ) + { + // Search from Z: drive + findMask = KDriveAttRom; + } + } + fileFinder.SetFindMask( findMask ); + + // Find files from the directory entry + CDir* fileList( NULL ); + fileFinder.FindWildByDir( aFileName, aDirName, fileList ); + CleanupStack::PushL( fileList ); + for ( TInt k = 0; fileList && k < fileList->Count(); k++ ) + { + // Add found file with full path to file array + const TEntry& fileEntry = (*fileList)[k]; + TFileName file; + file.Append( aDirName ); + file.Append( fileEntry.iName ); + aFiles.Append( file ); + } + CleanupStack::PopAndDestroy( fileList ); + + CleanupStack::PopAndDestroy(); // fs + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::SetAttributeValueL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::SetAttributeValueL( + const ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue, + const TDesC8& aSetAttrName, + const TDesC8& aSetAttrValue ) + { + + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + TBool nodeFound( EFalse ); + ChspsDomNode* prevNode( NULL ); + ChspsDomNode* node = iter->First(); + while( node && + prevNode != node ) + { + const TDesC8& name = node->Name(); + if ( name.CompareF( aNodeName ) == 0 ) + { + // Node name match + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( aAttrName ) ); + if ( attr && attr->Value().CompareF( aAttrValue ) == 0 ) + { + // Attribute name and value match - Defined node found + attr = static_cast( + attrList.FindByName( aSetAttrName ) ); + if ( attr ) + { + // Updated attribute found - Update attribute value + attr->SetValueL( aSetAttrValue ); + } + else + { + // Add new attribute + AddAttributeDescL( *node, aSetAttrName, aSetAttrValue ); + } + nodeFound = ETrue; + } + } + // Get next node + prevNode = node; + node = iter->NextL(); + } + + if ( !nodeFound ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( iter ); + + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetAttributeValueL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GetAttributeValueL( + const ChspsODT& aOdt, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue, + const TDesC8& aGetAttrName, + TPtrC8& aGetAttrValue ) + { + __UHEAP_MARK; + + ChspsDomDocument& dom = aOdt.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + TBool nodeFound( EFalse ); + ChspsDomNode* prevNode( NULL ); + ChspsDomNode* node = iter->First(); + while( node && + prevNode != node && + !nodeFound ) + { + const TDesC8& name = node->Name(); + if ( name.CompareF( aNodeName ) == 0 ) + { + // Node name match + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( aAttrName ) ); + if ( attr && attr->Value().CompareF( aAttrValue ) == 0 ) + { + // Attribute name and value match - Defined node found + attr = static_cast( + attrList.FindByName( aGetAttrName ) ); + if ( attr ) + { + // Updated + aGetAttrValue.Set( attr->Value() ); + nodeFound = ETrue; + } + } + } + // Get next node + prevNode = node; + node = iter->NextL(); + } + + if ( !nodeFound ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( iter ); + + __UHEAP_MARKEND; + + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::CheckResourceFilesL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::CheckResourceFilesL( + const ChspsODT& aOdt, + const TInt aConfUid ) + { + __UHEAP_MARK; + + // Convert configuration UID to decimal string + TBuf<10> confUid; + _LIT( KFormat, "%D" ); + confUid.AppendFormat( KFormat, aConfUid ); + + RFs fs; + CleanupClosePushL( fs ); + User::LeaveIfError( fs.Connect() ); + + TInt resCount = aOdt.ResourceCount(); + for ( TInt i = 0; i < resCount; i++ ) + { + // Check if resource file belongs to defined configuration + // (file path contains configuration UID string) + ChspsResource& res = aOdt.ResourceL( i ); + TPtrC resFile = res.FileName(); + if ( resFile.FindC( confUid ) != KErrNotFound ) + { + // Check that resource files exists + if ( !BaflUtils::FileExists( fs, resFile ) ) + { + User::Leave( KErrNotFound ); + } + } + } + + CleanupStack::PopAndDestroy(); // fs + + __UHEAP_MARKEND; + + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetConfigurationVersionL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::CheckConfigurationVersionL( + ChspsODT& aOdt, + const TInt aConfUid, + const TDesC& aVersion ) + { + __UHEAP_MARK; + + // Create configuration UID string + TBuf8<10> confUid; + _LIT8( KFormat8, "%X" ); + _LIT8( KHexPrefix, "0x" ); + confUid.Append( KHexPrefix ); + confUid.AppendFormat( KFormat8, aConfUid ); + + // Find configuration node + ChspsDomNode* confNode = hspsServerUtil::FindNodeByAttributeL( + aOdt, + KConfigurationElement, + KConfigurationAttrUid, + confUid ); + + if ( confNode ) + { + ChspsDomList& attrList = confNode->AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( KConfigurationAttrVersion ) ); + if ( attr ) + { + HBufC8* tv = HBufC8::NewLC( aVersion.Length() ); + TPtr8 tvPtr( tv->Des() ); + tvPtr.Copy( aVersion ); + // Check configuration version + if ( attr->Value().Compare( tvPtr ) != 0 ) + { + // Configuration not supported + User::Leave( KErrNotSupported ); + } + CleanupStack::PopAndDestroy( tv ); + } + else + { + // Invalid configuration + User::Leave( KErrGeneral ); + } + } + else + { + // Configuration not found + User::Leave( KErrNotFound ); + } + + __UHEAP_MARKEND; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::EditPluginNodeActivityL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::EditPluginNodeActivityL( ChspsDomNode* aRootNode, + const TNodeEditMode aEditMode, + TInt aDepth ) + { + // This wrapper exists to prevent modification of original aDepth + // (_EditPluginNodeActivityL uses TInt reference for depth count and + // modifies it). + hspsServerUtil::_EditPluginNodeActivityL( aRootNode, aEditMode, aDepth ); + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::_EditPluginNodeActivityL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::_EditPluginNodeActivityL( ChspsDomNode* aRootNode, + const TNodeEditMode aEditMode, + TInt& aDepth ) + { + // Sanity check. + if( !aRootNode ) + { + return; + } + + // Recursion depth logic. + if( aDepth == RECURSION_DEPTH_INFINITE ) + { + // Work as normal. Recurse as far as object tree exists. + } + else if( aDepth > 0 ) + { + // Depth was defined. Decrement by one. + aDepth--; + } + else if( aDepth == 0 ) + { + // No more recursion. + return; + } + + // Iterate childs + ChspsDomList& childs = aRootNode->ChildNodes(); + for( int i = 0; i < childs.Length(); i++ ) + { + ChspsDomNode* child = static_cast( childs.Item( i ) ); + + // Modify node activity based on selected edit mode. + if( child->Name().CompareF( KPluginElement ) == 0 ) + { + if( aEditMode == EActivateFirst && i == 0 ) + { + hspsServerUtil::AddAttributeDescL( *child, + KPluginAttrActive, + KPluginActiveStateActive ); + } + else + { + hspsServerUtil::AddAttributeDescL( *child, + KPluginAttrActive, + KPluginActiveStateNotActive ); + } + } + + // Recurse. + _EditPluginNodeActivityL( child, + aEditMode, + aDepth ); + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetActivePluginNode +// ----------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::GetActivePluginNode( ChspsDomNode* aParentNode ) + { + // Sanity check. + if( !aParentNode ) + { + return NULL; + } + + // Return structure. + ChspsDomNode* activeNode = NULL; + + // Iterate childs + ChspsDomList& childs = aParentNode->ChildNodes(); + for( int i = 0; i < childs.Length(); i++ ) + { + ChspsDomNode* child = static_cast( childs.Item( i ) ); + + // Only for plugin elements. + if( child->Name().CompareF( KPluginElement ) == 0 ) + { + // 1. Check if has activity attribute. + ChspsDomList& attrList = child->AttributeList(); + ChspsDomAttribute* pluginActivityAttr = + static_cast( attrList.FindByName( KPluginAttrActive ) ); + if( pluginActivityAttr ) + { + // 2. Check whether node is active. + if( pluginActivityAttr->Value().CompareF( KPluginActiveStateActive ) == 0 ) + { + // 3. Active node found. assign and break. + activeNode = child; + break; + } + } + } + } + + return activeNode; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetPluginId +// ----------------------------------------------------------------------------- +// +TInt hspsServerUtil::GetPluginId( ChspsDomNode* aNode ) + { + // Sanity check. + if( !aNode ) + { + return KErrArgument; + } + + // Return value. + TInt pluginId = KErrNotFound; + + // Find out plugin id. + ChspsDomList& attrList = aNode->AttributeList(); + ChspsDomAttribute* pluginIdAttr = + static_cast ( attrList.FindByName( KPluginAttrId ) ); + if( pluginIdAttr ) + { + // Found. + const TDesC8& pluginIdValue = pluginIdAttr->Value(); + pluginId = DecString2Int( pluginIdValue ); + } + + return pluginId; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetPluginUid +// ----------------------------------------------------------------------------- +// +TUid hspsServerUtil::GetPluginUid( ChspsDomNode* aNode ) + { + // Sanity check. + if( !aNode ) + { + return KNullUid; + } + + // Read Uid from attribute list. + ChspsDomList& attrList = aNode->AttributeList(); + ChspsDomAttribute* pluginUidAttr = + static_cast ( attrList.FindByName( KPluginAttrUid ) ); + + // Sanity check. + if( !pluginUidAttr ) + { + return KNullUid; + } + + // Convert uids from string to numeric format + const TDesC8& pluginUidValue = pluginUidAttr->Value(); + const TUid pluginUid = hspsServerUtil::ConvertDescIntoUid(pluginUidValue); + + // Return result. + return pluginUid; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetPluginIdsByUidL +// ----------------------------------------------------------------------------- +// +void hspsServerUtil::GetPluginIdsByUidL( + const ChspsODT& aAppODT, + const TUid aPluginUid, + RArray& aPluginIds ) + { + ChspsDomDocument& dom = aAppODT.DomDocument(); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *dom.RootNode() ); + CleanupStack::PushL( iter ); + + // Find a plugin node with the provided id attribute + ChspsDomNode* node = iter->First(); + ChspsDomNode* prevNode = NULL; + TBool jobDone = EFalse; + while( node && !jobDone && prevNode != node ) + { + const TDesC8& name = node->Name(); + + // Plugin element was found + if ( name == KPluginElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPluginAttrUid) ); + if ( !attr ) + { + // Mandatory information is missing for some reason (should be set at installation handler)! + // Exit with NULL + jobDone = ETrue; + } + else + { + // Convert from (hex?) string into TUid presentation + const TUid uid = ConvertDescIntoUid( attr->Value() ); + if ( aPluginUid == uid ) + { + const TDesC8& strPluginId = node->AttributeValue(KPluginAttrId); + TInt pluginId = DecString2Int( strPluginId ); + aPluginIds.AppendL( pluginId ); + } + } + } + + prevNode = node; + node = iter->NextL(); + } + + CleanupStack::PopAndDestroy( iter ); + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetParentNode +// ----------------------------------------------------------------------------- +// +ChspsDomNode* hspsServerUtil::GetParentNode( + const ChspsDomNode& aNode, + const TDesC8& aNodeName, + const TDesC8& aAttrName, + const TDesC8& aAttrValue ) + { + ChspsDomNode* parent = aNode.Parent(); + TBool found( EFalse ); + while ( parent && !found ) + { + if ( parent->Name().CompareF( aNodeName ) == 0 ) + { + ChspsDomList& attrList = parent->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName( aAttrName ) ); + if ( attr->Value().CompareF( aAttrValue ) == 0 ) + { + found = ETrue; + } + } + if ( !found ) + { + // Get next level parent node + parent = parent->Parent(); + } + } + + return parent; + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::IsFile +// ----------------------------------------------------------------------------- +// +TBool hspsServerUtil::IsFile( + const TDesC& aFileDeclaration, + TFileName& aFilename ) + { + _LIT(KDeclarationSkin, "SKIN("); // prefixes for filelogo/filepreview values + _LIT(KDeclarationMif, "MIF("); + _LIT(KDeclarationUid, "UID("); + + aFilename = KNullDesC(); + if ( aFileDeclaration.FindF( KDeclarationSkin ) >= 0 + || aFileDeclaration.FindF( KDeclarationMif ) >= 0 + || aFileDeclaration.FindF( KDeclarationUid ) >= 0 ) + { + // pick filename from the mif declaration if it's available (e.g. "skin( ):mif( )") + TInt mifOffset = aFileDeclaration.FindF( KDeclarationMif ); + if ( mifOffset >= 0 ) + { + aFilename = aFileDeclaration.Mid( mifOffset + KDeclarationMif().Length() ); + aFilename.TrimAll(); + + // drop everything before the first bitmap index + TInt endPos = aFilename.Locate( ' ' ); + if ( endPos > 1 ) + { + aFilename = aFilename.Left( endPos ); + } + } + } + else + { + // store possible icon path + aFilename.Copy( aFileDeclaration ); + } + + return ( aFilename.Length() > 0 ); + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetValidResourcesL +// ----------------------------------------------------------------------------- +void hspsServerUtil::GetValidResourcesL( + ChspsODT& aODT, + const TInt aConfUid, + const TLanguage aActiveLanguage, + RPointerArray& aWidgetResources ) + { + const TInt resourceCount = aODT.ResourceCount(); + + // pick resources with the active language + for( TInt resourceIndex = 0; resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& resource = aODT.ResourceL( resourceIndex ); + if ( resource.ConfigurationUid() == aConfUid && + resource.FileName().FindF( KSourcesFolder ) > 0 && + resource.Language() == aActiveLanguage ) + { + aWidgetResources.Append( &resource ); + } + } + + // Resources for language none or language test. + for( TInt resourceIndex = 0; resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& resource = aODT.ResourceL( resourceIndex ); + if ( resource.ConfigurationUid() == aConfUid && + resource.FileName().FindF( KSourcesFolder ) > 0 ) + { + if( resource.Language() == ELangTest || resource.Language() == ELangNone ) + { + // Checking also that not going to overwrite existing localized resource. + TBool localizedVersionAvailable = EFalse; + for( TInt checkIndex = 0; checkIndex < aWidgetResources.Count(); checkIndex++ ) + { + ChspsResource* checkResource = aWidgetResources[ checkIndex ]; + if( !checkResource ) + { + continue; + } + + TParsePtrC resource1FullPath( resource.FileName() ); + TParsePtrC resource2FullPath( checkResource->FileName() ); + + if( resource1FullPath.NameAndExt().CompareF( resource2FullPath.NameAndExt() ) == 0 ) + { + localizedVersionAvailable = ETrue; + break; + } + } + + if( !localizedVersionAvailable ) + { + aWidgetResources.Append( &resource ); + } + } + } + } + } + +// ----------------------------------------------------------------------------- +// hspsServerUtil::EnoughDiskSpaceAvailable +// ----------------------------------------------------------------------------- +TInt hspsServerUtil::EnoughDiskSpaceAvailableL( + ChspsODT& aODT, + const TLanguage aActiveLanguage, + RFs& aFs, + const TDriveNumber aDriveNumber, + const TInt aAdditionalDiskSpace ) + { + __UHEAP_MARK; + + TInt err = KErrNone; + + // Retrieve data for needed resource files. + RPointerArray widgetResources; // Objects are not owned. + CleanupClosePushL( widgetResources ); + + GetValidResourcesL( aODT, + aODT.ThemeUid(), + aActiveLanguage, + widgetResources ); + + TInt requiredDiskSpace = aAdditionalDiskSpace; + + // Calculate disk space required for resources. + for( TInt i = 0; i < widgetResources.Count() && !err; i++ ) + { + ChspsResource* resource = widgetResources[i]; + if( !resource ) + { + continue; + } + + TEntry entryData; + err = aFs.Entry( resource->FileName(), entryData ); + requiredDiskSpace += entryData.iSize; + } + + widgetResources.Reset(); + CleanupStack::PopAndDestroy( 1, &widgetResources ); + + // Check if calculated space is available. + if( !err && + SysUtil::DiskSpaceBelowCriticalLevelL( &aFs, + requiredDiskSpace, + aDriveNumber ) ) + { + err = KErrDiskFull; + } + + __UHEAP_MARKEND; + + return err; + } +// ----------------------------------------------------------------------------- +// Finds a node from a dom document. +// Looks for the next node tag. +// ----------------------------------------------------------------------------- +ChspsDomNode* hspsServerUtil::FindNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aDomNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* targetNode( NULL ); + ChspsDomNode* node = iter->First(); + TBool found = EFalse; + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( aNodeTag ) == 0 ) + { + found = ETrue; + targetNode = node; + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + return targetNode; + } +// ----------------------------------------------------------------------------- +// hspsServerUtil::hspsServerUtil +// ----------------------------------------------------------------------------- +// +hspsServerUtil::hspsServerUtil() + { + // Empty. Should never be called. + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3592 @@ +/* +* 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: HSPS Theme Server. For more information, see the header. +* +*/ + + +#define __INCLUDE_CAPABILITY_NAMES__ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include + +#include "hsps_builds_cfg.hrh" +#include "hspsthemeserver.h" +#include "hspsthemeserversession.h" +#include "hspssecurityenforcer.h" +#include "hspsserverutil.h" +#include "hspsdefinitionrepository.h" +#include "hspsdefinitionengineinterface.h" +#include "hspsconfiguration.h" +#ifdef _hsps_PERFORMANCE_TEST_ +#include "hspstimemon.h" +#endif //_hsps_PERFORMANCE_TEST_ + +#ifndef __DISABLE_SISX_INSTALLATION_ +#include "hspsrominstaller.h" +#include "hspsautoinstaller.h" +#include "hspsinstaller.h" +#include "hspsinstallationhandler.h" +#endif //__DISABLE_SISX_INSTALLATION_ + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +// CONSTANTS + +// Directory for the SISX installation files +_LIT( KImportDirectoryC, "c:\\private\\200159c0\\import\\" ); + +// Directory for the ROM based installation files + +// Directories for backup folders +_LIT( KBackupThemesDirectoryC, "c:\\private\\200159c0\\backup\\themes\\" ); + +// Name of the installation file +_LIT( KManifestFile, "manifest.dat" ); + +// Name of the configuration file +_LIT( KConfFile, "*.o0000" ); + +// File prefixes for the *.DAT imports +_LIT( KPrefixFileApp, "app_"); +_LIT( KPrefixFilePlugin, "plugin_"); + +_LIT( KUpgradePlugin, "upgrade_plugin" ); +_LIT( KUpgrade, "upgrade" ); +_LIT( KDoubleBackSlash, "\\" ); +_LIT( KUpgradePluginWild, "upgrade_plugin_*.dat" ); +// Just in case emulator cannot read system version we use this to +// prevent ROM installation on every boot up +_LIT( KDummyVersionInfo, "dummyversioninfo" ); + +const TUint KAppId_hspsAS = 270486738; // 0x101F4CD2 from S60 3.1 Xuikon AppShell in 3.1 product. +const TUint KAppId_hspsAI = 271012080 ; // 0x102750F0 support for Xuikon-based ActiveIdle +const TUint KAppId_LE = 270551469 ; // 0x102049AD LayoutTest + +const TInt KAppIdAny = -1; // All applications + +// ======== LOCAL FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// ResetAndDestroyHBufCArray +// cleanup item for HBufC dynamic arrays +// ----------------------------------------------------------------------------- +static void ResetAndDestroyHBufC8Array( TAny* aArray ) + { + CArrayPtrSeg* array = reinterpret_cast< CArrayPtrSeg* >( aArray ); + array->ResetAndDestroy(); + delete array; + } + +// ----------------------------------------------------------------------------- +// ResetAndDestroyChspsODTArray +// cleanup item for ChspsODT dynamic arrays +// ----------------------------------------------------------------------------- +static void ResetAndDestroyChspsODTArray( TAny* aArray ) + { + CArrayPtrSeg* array = reinterpret_cast< CArrayPtrSeg* >( aArray ); + array->ResetAndDestroy(); + delete array; + } + +// ----------------------------------------------------------------------------- +// Callback function for removing repository lock if error occurs while repository is locked +// ----------------------------------------------------------------------------- +// +static void UnlockRepository( TAny* aObject ) + { + ChspsDefinitionRepository* DefRep = reinterpret_cast( aObject ); + + if (DefRep->Locked()) + { + DefRep->Unlock(); + } + } + +// ----------------------------------------------------------------------------- +// GetFWVersion +// Gets firmware version of phone and sets it to buffer given as parameter +// ----------------------------------------------------------------------------- +// +static void GetFWVersion( TDes& aVersion ) + { + TInt err = SysVersionInfo::GetVersionInfo( SysVersionInfo::EFWVersion, aVersion ); + if ( err != KErrNone ) + { + // emulator might not have fwid*.txt files so we need to read sw version + // by using sysutil. + aVersion.Zero(); + err = SysUtil::GetSWVersion( aVersion ); + if ( err != KErrNone ) + { + // for some reason emulator cannot read version info + aVersion.Copy( KDummyVersionInfo ); + } + } + } + +// ----------------------------------------------------------------------------- +// RunServerL() +// Server startup code +// Perform all server initialisation, in particular creation of the +// scheduler and server and then run the scheduler +// ----------------------------------------------------------------------------- +// +static void RunServerL() + { +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("hspsThemeServer::RunServerL(): - initialising..") ); +#endif//_hsps_PERFORMANCE_TEST_ + // naming the server thread after the server helps to debug panics + User::LeaveIfError(User::RenameThread(KhspsThemeServerName)); + // create and install the active scheduler we need + CActiveScheduler* s=new(ELeave) CActiveScheduler; + CleanupStack::PushL(s); + CActiveScheduler::Install(s); + // create the server (leave it on the cleanup stack) + ChspsThemeServer::NewLC(); + // Initialisation complete, now signal the client + RProcess::Rendezvous(KErrNone); + CActiveScheduler::Start(); + // Cleanup the server and scheduler + CleanupStack::PopAndDestroy( 2, s ); +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("hspsThemeServer::RunServerL(): - server fully running") ); +#endif//_hsps_PERFORMANCE_TEST_ + } + +// ----------------------------------------------------------------------------- +// E32Main +// Server process entry-point +// ----------------------------------------------------------------------------- +// +TInt E32Main() + { + __UHEAP_MARK; + CTrapCleanup* cleanup=CTrapCleanup::New(); + TInt r=KErrNoMemory; + if (cleanup) + { + TRAP(r,RunServerL()); + delete cleanup; + } + __UHEAP_MARKEND; + return r; + } + +// ======== MEMBER FUNCTIONS ======== + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ +// ----------------------------------------------------------------------------- +// CShutdown::NewL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CShutdown* CShutdown::NewL( MShutdownObserver& aObserver ) + { + CShutdown* object = new (ELeave) CShutdown( aObserver ); + CleanupStack::PushL( object ); + object->ConstructL(); + CleanupStack::Pop( object ); + return object; + } + +// ----------------------------------------------------------------------------- +// CShutdown::CShutdown +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CShutdown::CShutdown( MShutdownObserver& aObserver ) : CTimer(-1), iObserver( aObserver ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CShutdown::ConstructL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CShutdown::ConstructL() + { + CTimer::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CShutdown::Start +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CShutdown::Start() + { + After( KhspsShutdownDelay ); + } + +// ----------------------------------------------------------------------------- +// CShutdown::RunL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CShutdown::RunL() + { + // Notify observer. + iObserver.ShutdownInitiating(); + + // Stop active scheduler. + CActiveScheduler::Stop(); + } +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ChspsThemeServer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline ChspsThemeServer::ChspsThemeServer():CPolicyServer(0,hspsThemePolicy,ESharableSessions) + { + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::NewLC +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CServer2* ChspsThemeServer::NewLC() + { +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("SERVER: - ready to install server.") ); +#endif + ChspsThemeServer* self=new(ELeave) ChspsThemeServer; + CleanupStack::PushL(self); + self->ConstructL(); + +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("SERVER: - server installed.") ); +#endif + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ConstructL +// 2nd phase construction - ensure the timer and server objects are running +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::ConstructL() + { + User::LeaveIfError( iFsSession.Connect() ); + +#ifdef HSPS_LOG_ACTIVE + iLogBus = ChspsLogBusFile::NewL( ChspsLogBusFile::CreateLogFilename( _L("themeserver") ) ); + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); + iLogBus->LogText( _L( "hspsThemeServer: constructing server" ) ); +#endif + + // Setup a runtime array of headers (=header cache) + iHeaderListCache = new ( ELeave ) CArrayPtrSeg< ChspsODT >( KHeaderListGranularity ); + + iDefinitionRepository = ChspsDefinitionRepository::NewL(); +#ifdef HSPS_LOG_ACTIVE + iDefinitionRepository->SetLogBus( iLogBus ); +#endif + // Setup a Plug-in Repository listener + iCentralRepository = CRepository::NewL( KhspsThemeStatusRepositoryUid ); + + // Get active device language + iDeviceLanguage = GetDeviceLanguage(); + + // Setup a search mask for finding headers from the cache + iCacheMask = ChspsODT::NewL(); + + // Setup a listener for changes in the Central Repository + iCenRepListener = ChspsCenRepListener::NewL( *this, KhspsThemeStatusRepositoryUid ); + + // Access lists for client processes + iSecurityEnforcer = ChspsSecurityEnforcer::NewL( *iDefinitionRepository, *iCentralRepository ); +#ifdef HSPS_LOG_ACTIVE + iSecurityEnforcer->SetLogBus( iLogBus ); +#endif + + // Find header files from the Plug-in Repository + UpdateHeaderListCacheL(); + + // Adds the server with the specified name to the active scheduler, and issues the + // first request for messages, and leaves if the operation fails + StartL( KhspsThemeServerName ); + + // Initialize remove index + iThemeIndexToRemove = KErrNotFound; + + // Listen to changes in any key + iCenRepListener->SetupAll(); + + // Start observing the notifications + iDefinitionRepository->RegisterObserverL( *this ); + + // Resolution & orientation change listener +#if defined(WINSCW) || defined(__WINS__) + iFamilyListener = ChspsFamilyListener::NewL( *this ); +#endif // defined(WINSCW) + + // Auto-localize ODTs in the Definition Repository when the device language has changed + HandleLanguageChangeL(); + + // Installs manifest files from the ROM drive when server is starting for the first time + HandleRomInstallationsL(); + +#ifndef __DISABLE_SISX_INSTALLATION_ + // Start observing of import folder to enable autoinstallations + EnableAutoInstallationL(); +#endif //__DISABLE_SISX_INSTALLATION_ + + // Update configurations + // When server is started all configurations with "WaitForConfirmation" state are updated + // to "NotConfirmed" state to allow client to validate configurations + User::LeaveIfError( iCentralRepository->Set( KCenrepKeyCheckConf, 0 ) ); + CheckConfigurationL( KAppIdAny ); + // Activate configuration checking + // Configurations are checked every time when a new client session is created + User::LeaveIfError( iCentralRepository->Set( KCenrepKeyCheckConf, 1 ) ); + + // Backup event listener + iBRObserver = CHSPSBRObserver::NewL( *this ); + iBRObserver->Start(); + + // Initialize backup state + iBRState = EhspsBRNormal; + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + iShutdown = CShutdown::NewL( *this ); +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "hspsThemeServer: server fully constructed" ) ); + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); +#endif + } + +// Destructor +ChspsThemeServer::~ChspsThemeServer() + { +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + delete iShutdown; + iShutdown = NULL; +#else + // Server must call cleanup if shutdown object does not exist (and call it). + Cleanup(); +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +#ifdef HSPS_LOG_ACTIVE + // Delete log bus as absolute last! + // Some members might log destructor activity to this object. + delete iLogBus; + iLogBus = NULL; +#endif + } + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ShutdownInitiating +// From MShutdownObserver. +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::ShutdownInitiating() + { + Cleanup(); + } +#endif // #ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::Cleanup +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::Cleanup() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "hspsThemeServer: server is shutting down" ) ); +#endif + + if( iDefinitionRepository ) + { + iDefinitionRepository->UnregisterObserver( *this ); + } + +#ifndef __DISABLE_SISX_INSTALLATION_ + DisableAutoInstallation(); +#endif //__DISABLE_SISX_INSTALLATION_ + +#if defined(WINSCW) || defined(__WINS__) + delete iFamilyListener; + iFamilyListener = NULL; +#endif // defined(WINSCW) + + delete iCenRepListener; + iCenRepListener = NULL; + + delete iRomInstaller; + iRomInstaller = NULL; + + delete iAutoInstaller; + iAutoInstaller = NULL; + + if( iHeaderListCache ) + { + iHeaderListCache->ResetAndDestroy(); + delete iHeaderListCache; + iHeaderListCache = NULL; + } + + delete iDefinitionRepository; + iDefinitionRepository = NULL; + + delete iCentralRepository; + iCentralRepository = NULL; + + delete iSecurityEnforcer; + iSecurityEnforcer = NULL; + + delete iCacheMask; + delete iBRObserver; + delete iActiveBackupClient; + delete iBRHandler; + + iCacheMask = NULL; + + iFsSession.Close(); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::NewSessionL +// Create a new client session. This should really check the version number. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CSession2* ChspsThemeServer::NewSessionL(const TVersion&,const RMessage2& aMessage ) const + { + return new (ELeave) ChspsThemeServerSession( aMessage.SecureId().iId ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::AddSession +// A new session is being created +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::AddSession() + { + iSessionCount++; + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + if( iShutdown->IsActive() ) + { + iShutdown->Cancel(); + } +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::AddSession(): - now %d concurrent sessions." ), + iSessionCount ); +#endif + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DropSession +// A session is being destroyed +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::DropSession() + { + iSessionCount--; + +#ifdef _hsps_SERVER_SHUTDOWN_ENABLED_ + if( iSessionCount == 0 ) + { + iShutdown->Cancel(); + iShutdown->Start(); + } +#endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::DropSession(): - %d concurrent sessions left." ), + iSessionCount ); +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::IncreaseRequestClientCount +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::IncreaseRequestClientCount() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer: ChspsThemeServer::IncreaseRequestClientCount()" ) ); +#endif + + iRequestClientCount++; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DecreaseRequestClientCount +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::DecreaseRequestClientCount() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer: ChspsThemeServer::DecreaseRequestClientCount()" ) ); +#endif + + if ( iRequestClientCount ) + { + iRequestClientCount--; + } + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleDefinitionRespositoryEvent() +// Handles events coming from hspsDefinitionRepository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ) + { + TInt mask = aRepositoryInfo.iEventType; + TBool ret = EFalse; + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); +#endif + + // If header cache should be updated from files in the Plug-in Repository + if (mask & EhspsCacheUpdate) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsCacheUpdate occurred." ) ); +#endif + // Update the cache from contents of the themes folder in drive C (slowish operation!) + TRAP_IGNORE( UpdateHeaderListCacheL() ); + } + + // If a plug-in configuration was uninstalled from the Plug-in Repository + if (mask & EhspsClean) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsClean occurred." ) ); +#endif + if(aRepositoryInfo.iLastNotification) + { + // Remove the provided ODT from the header list cache + UpdateHeaderListCache( + EhspsCacheRemoveHeader, + aRepositoryInfo.iPluginIfUid, + aRepositoryInfo.iPluginProviderUid, + aRepositoryInfo.iPluginUid + ); + } + + } + + // If a plug-in configuration was installed into the Plug-in Repository + if (mask & EhspsODTAdded) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsODTAdded occurred." ) ); +#endif + if(aRepositoryInfo.iLastNotification) + { + // Add the provided ODT to the header list cache + UpdateHeaderListCache( + EhspsCacheAddHeader, + aRepositoryInfo.iPluginIfUid, + aRepositoryInfo.iPluginProviderUid, + aRepositoryInfo.iPluginUid + ); + } + + } + + // If a plug-in configuration was upgraded into the Plug-in Repository + if( mask & EhspsODTUpdated ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsODTUpdate occurred." ) ); +#endif + if( aRepositoryInfo.iLastNotification ) + { + // Add the provided ODT to the header list cache + UpdateHeaderListCache( + EhspsCacheAddHeader, + aRepositoryInfo.iPluginIfUid, + aRepositoryInfo.iPluginProviderUid, + aRepositoryInfo.iPluginUid + ); + } + } + + // If settings of an application configuration were modified + if (mask & EhspsSettingsChanged) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsSettingsChanged occurred." ) ); +#endif + } + + // If a plug-in configuration was added into or moved within an application configuration + if (mask & EhspsODTModified) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsODTModified occured." ) ); +#endif + } + + // If a plug-in configuration was removed from an application configuration + if (mask & EhspsODTRemoved) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleDefinitionRespositoryEvent(): - EhspsODTRemoved occurred." ) ); +#endif + } + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); +#endif + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DefinitionRepository +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ChspsDefinitionRepository& ChspsThemeServer::DefinitionRepository() + { + return *iDefinitionRepository; + } + +// ChspsThemeServer::SecurityEnforcer +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ChspsSecurityEnforcer& ChspsThemeServer::SecurityEnforcer() + { + return *iSecurityEnforcer; + } + + +// ChspsThemeServer::CentralRepository +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CRepository& ChspsThemeServer::CentralRepository() + { + return *iCentralRepository; + } + +// ChspsThemeServer::DeviceLaguage +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TLanguage ChspsThemeServer::DeviceLanguage() + { + iDeviceLanguage = GetDeviceLanguage(); + return iDeviceLanguage; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::UpdateHeaderListCache +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CArrayPtrSeg& ChspsThemeServer::HeaderListCache() + { + return *iHeaderListCache; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::UninstallImport +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::UninstallImport( + const CDir* aFilelist ) + { + TInt count( 0 ); + if ( aFilelist ) + { + count = aFilelist->Count(); + } + + // Loop installed configurations + for( TInt i = 0; i < iInstalledSisxThemes.Count(); i++ ) + { + // Suppose this is the one which was removed + iThemeIndexToRemove = i; + + // Loop files under the imports folder + for( TInt j = 0; j < count; j++ ) + { + TPtrC filename( ( *aFilelist )[j].iName ); + + // If theme path exists + if( filename == *( iInstalledSisxThemes[i] ) ) + { + // Break inner loop + iThemeIndexToRemove = KErrNotFound; + break; + } + } + + // iThemeIndexToRemove should now point the configuration which was removed + RunAutoInstaller( EAutoInstallerUninstall ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetManifestFromImportLC +// ----------------------------------------------------------------------------- +// +HBufC* ChspsThemeServer::GetManifestFromImportLC( + const TDesC& aImportFile, + const TDesC& aPath ) + { + HBufC* manifestBuf = 0; + + const TChar KCharUnderscore('_'); + + // Strip file prefix + TPtrC fixedName; + TInt offset = aImportFile.Locate( KCharUnderscore ); + if( offset ) + { + TPtrC filePrefix( aImportFile.Left(offset+1) ); + + // If a valid prefix + if ( filePrefix.CompareF( KPrefixFileApp) || filePrefix.CompareF( KPrefixFilePlugin ) ) + { + fixedName.Set( aImportFile.Mid( filePrefix.Length() ) ); + } + } + + // If stripping was successfull + if ( fixedName.Length() ) + { + // Remove file extension + TParsePtrC parsePtr( fixedName ); + TPtrC fileName( parsePtr.Name() ); + + // Setup path for the manifest file + manifestBuf = HBufC::NewLC( KMaxFileName ); + TPtr manifestPtr( manifestBuf->Des() ); + manifestPtr.Append( aPath ); + manifestPtr.Append( fileName ); + + // Replace underscores with backslashes + TInt pos( manifestPtr.Locate( KCharUnderscore ) ); + while( pos != KErrNotFound ) + { + manifestPtr.Replace( pos, 1, KDoubleBackSlash ); + pos = manifestPtr.Locate( KCharUnderscore ); + } + manifestPtr.Append( KDoubleBackSlash ); + + // Find a manifest.dat file from the generated path + CDir* manifestDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( KManifestFile, manifestPtr, manifestDir ); + + // Check whether the manifest was found + if( !manifestDir || manifestDir->Count() > 1 ) + { + // Failed + CleanupStack::PopAndDestroy( 1, manifestBuf ); + manifestBuf = NULL; + } + else + { + manifestPtr.Append( KManifestFile ); + } + + delete manifestDir; + manifestDir = NULL; + } + + return manifestBuf; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CheckConfiguration +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::CheckConfigurationL( + const TInt aAppUid ) + { + + if ( iHeaderListCache ) + { + TInt count = iHeaderListCache->Count(); + if ( iDefinitionRepository->Locked() ) + { + User::Leave( KErrInUse ); + } + iDefinitionRepository->Lock(); + + // Check if configuration checking is activated + TPtrC8 confState; + TPtrC8 nextConfState; + TInt value( 0 ); + User::LeaveIfError( iCentralRepository->Get( KCenrepKeyCheckConf, value ) ); + if ( value == 1 ) + { + // Configuration checking activated + // All configurations with "WaitForConfiguration" state will be updated to + // "Error" state + confState.Set( KConfStateWaitForConfirmation ); + nextConfState.Set( KConfStateError ); + } + else + { + // Configuration checking not activated + // All configurations with "WaitForConfiguration" state will be updated to + // "NotConfirmed" state + confState.Set( KConfStateWaitForConfirmation ); + nextConfState.Set( KConfStateNotConfirmed ); + } + + for ( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = ( *iHeaderListCache )[ i ]; + if ( header->ConfigurationType() == EhspsAppConfiguration && + ( header->RootUid() == aAppUid || + aAppUid == KAppIdAny ) ) + { + // Get ODT from definition repository + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->SetRootUid( header->RootUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetConfigurationType( header->ConfigurationType() ); + odt->SetRootUid( header->RootUid() ); + odt->SetProviderUid( header->ProviderUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetProviderNameL( header->ProviderName() ); + odt->SetThemeFullNameL( header->ThemeFullName() ); + odt->SetThemeShortNameL( header->ThemeShortName() ); + odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetFlags( header->Flags() ); + odt->SetMultiInstance( header->MultiInstance() ); + + User::LeaveIfError( iDefinitionRepository->GetOdtL( *odt ) ); + + // Update configuration states + TBool odtUpdated( EFalse ); + hspsServerUtil::UpdateConfigurationStateL( + *odt, + confState, + nextConfState, + odtUpdated ); + if ( odtUpdated ) + { + // Update modified ODT to definition repository + User::LeaveIfError( iDefinitionRepository->SetOdtL( *odt ) ); + } + + CleanupStack::PopAndDestroy( odt ); + } + } + iDefinitionRepository->Unlock(); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::InstallImportsL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::InstallImportsL( + const CDir& aFilelist ) + { + const TInt count( aFilelist.Count() ); + + // Go through the filtered file list + for( TInt importIndex = 0; importIndex < count; importIndex++ ) + { + TBool found( EFalse ); + TPtrC importName( aFilelist[importIndex].iName ); + + // Is the file already pending an installation? + for( TInt j = 0; !found && j < iInstallableSisxThemes.Count(); j++ ) + { + if( importName == *( iInstallableSisxThemes[j] ) ) + { + found = ETrue; + } + } + + // Is the file already installed? + for( TInt j = 0; !found && j < iInstalledSisxThemes.Count(); j++ ) + { + if( importName == *( iInstalledSisxThemes[j] ) ) + { + found = ETrue; + } + } + + if ( !found ) + { + // Get manifest from the import's name in C drive + HBufC* manifestBuf = GetManifestFromImportLC( + importName, + KImportDirectoryC ); + if( manifestBuf ) + { + // Append the manifest + iManifestFiles.AppendL( manifestBuf ); + CleanupStack::Pop( manifestBuf ); + + // Append the import + iInstallableSisxThemes.AppendL( importName.AllocL() ); + } + } + } + + // Now that the manifest list has been parsed, initiate installation of + // the new manifest files + if( iAutoInstallerState != EAutoInstallerStateInstall ) + { + RunAutoInstaller( EAutoInstallerStateInstall ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleConfigurationImportsL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleConfigurationImportsL( + const TDesC& aFilePrefix ) + { + // Set mask for finding files under imports folder + TPtrC filter( KFilterAllPluginImportsV1 ); + if ( aFilePrefix.CompareF( KPrefixFileApp ) == 0 ) + { + filter.Set( KFilterAllAppImportsV1 ); + } + + // Get a listing of plugin_*.dat files from the imports folder in C drive + CDir* importsDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( filter, KImportDirectoryC, importsDir ); + CleanupStack::PushL( importsDir ); + + // pathFileList can be NULL when no path_*.dat files are available in the import folder. + // This can mean that currently the last sisx package is under unistallation, and because + // of that, we need to check that case with pathFileCount = 0 + TInt importsCount( 0 ); + if( importsDir ) + { + importsCount = importsDir->Count(); + } + + // Find out number of installed themes with the provided file prefix + TInt installedCount = 0; + const TInt prefixLength = aFilePrefix.Length(); + for( TInt i=0; i < iInstalledSisxThemes.Count(); i++ ) + { + TPtrC ptr( iInstalledSisxThemes[ i ]->Des() ); + if ( ptr.Length() > prefixLength ) + { + if ( ptr.Left( prefixLength ).CompareF( aFilePrefix ) == 0 ) + { + installedCount++; + } + } + } + + if( importsCount < installedCount ) + { + // there were less *.dat files than in the last evaluation + UninstallImport( importsDir ); + } + else if( importsCount > installedCount && importsDir ) + { + // If a *.dat file was added since the last evaluation + InstallImportsL( *importsDir ); + } + + CleanupStack::PopAndDestroy( importsDir ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleFileSystemChangeL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleFileSystemChangeL() + { + // Install unprocessed plug-in configurations from the import folders, + // these might be referenced by one or more application configurations - thus, + // this step should be done first! + HandleConfigurationImportsL( KPrefixFilePlugin ); + + // Install remaining application configurations from the import folders + HandleConfigurationImportsL( KPrefixFileApp ); + + // File system change can also mean that a theme is being updated + HandleThemeUpgradeL(); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleFileSystemChange +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleFileSystemChange() + { + // Fancy way of checking whether SISX installations are enabled :) +#ifndef __DISABLE_SISX_INSTALLATION_ + + // Register again ... + iFileChangeListener->Setup(); + + // ... and then handle the change + TRAP_IGNORE( HandleFileSystemChangeL() ); + +#endif // __DISABLE_SISX_INSTALLATION_ + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CheckActiveTheme +// CheckActiveTheme the specified theme. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsThemeServer::CheckActiveThemesL() + { +#ifndef __DISABLE_SISX_INSTALLATION_ + TInt themeUid; + RArray res; + CleanupClosePushL( res ); + TInt errorCode = KErrNone; + iCentralRepository->FindL( 0x00000000,0xFFFFFFFF, res ); + const TInt keyCount = res.Count(); + for (TInt i = 0; i < keyCount; i++ ) + { + errorCode = iCentralRepository->Get( res[i], themeUid ); + if ( !errorCode ) + { + HBufC* matchthemeUid = HBufC::NewLC( KMaxFileName ); + TPtr matchthemeUidPtr = matchthemeUid->Des(); + matchthemeUidPtr.Append( KPrefixFileApp ); + matchthemeUidPtr.Append( _L("*_") ); + matchthemeUidPtr.AppendNumUC( themeUid, EHex ); + matchthemeUidPtr.Append( _L( "_*" ) ); + + HBufC* pathFileName = HBufC::NewL ( KMaxFileName ); + TPtr pathFileNamePtr = pathFileName->Des(); + CDir* fileList; + TFindFile fileFinder( iFsSession ); + // Find path info file for matching unique themeuid + fileFinder.FindWildByDir( *matchthemeUid, KImportDirectoryC, fileList ); + if( fileList ) + { + TBool isItOpen = EFalse; + pathFileNamePtr.Copy( KImportDirectoryC ); + pathFileNamePtr.Append( (*fileList)[0].iName ); + if ( res[i] == KAppId_hspsAS ) + { + errorCode = iFsSession.IsFileOpen( pathFileNamePtr, isItOpen ); + if ( !isItOpen ) + { + errorCode = iFileAS.Open(iFsSession, pathFileNamePtr, EFileRead ); + } + } + else if ( res[i] == KAppId_hspsAI ) + { + errorCode = iFsSession.IsFileOpen( pathFileNamePtr, isItOpen ); + if ( !isItOpen ) + { + errorCode = iFileAI.Open(iFsSession, pathFileNamePtr, EFileRead ); + } + } + else if ( res[i] == KAppId_LE ) + { + errorCode = iFsSession.IsFileOpen( pathFileNamePtr, isItOpen ); + if ( !isItOpen ) + { + errorCode = iFileLT.Open(iFsSession, pathFileNamePtr, EFileRead ); + } + } + } + delete fileList; + delete pathFileName; + CleanupStack::PopAndDestroy( matchthemeUid ); + } + } + res.Close(); + CleanupStack::PopAndDestroy(1, &res); +#endif //__DISABLE_SISX_INSTALLATION_ + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::UnlockSisxImportL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::UnlockSisxImportL( + const TUint32 aAppUid ) + { +__UHEAP_MARK; + // Setup a filter for finding an SISX import with the provided application uid + HBufC* filterBuf = HBufC::NewLC( KMaxFileName ); + TPtr filterPtr = filterBuf->Des(); + filterPtr.Copy( KPrefixFileApp ); + filterPtr.AppendNumUC( aAppUid, EHex ); + _LIT(KFilter, "_*_*_1.0.dat"); + filterPtr.Append( KFilter ); + + // Find imports with the generated filter (ROM based imports should not be found) + CDir* importsDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( filterPtr, KImportDirectoryC, importsDir ); + if( importsDir ) + { + HBufC* importBuf = HBufC::NewLC ( KMaxFileName ); + TPtr importPtr = importBuf->Des(); + + // CleanupStack is not required since there are no leaving function calls below + + // Loop application specific imports + TInt errorCode = KErrNone; + TBool isOpen = EFalse; + for ( TInt i = 0; i< importsDir->Count(); i++ ) + { + importPtr.Copy( KImportDirectoryC ); + importPtr.Append( (*importsDir)[i].iName ); + errorCode = iFsSession.IsFileOpen( importPtr, isOpen ); + if ( errorCode == KErrNone ) + { + // Only a single file should be open + if( isOpen ) + { + // Close application specific file handles + if ( aAppUid == KAppId_hspsAS ) + { + iFileAS.Close(); + } + else if ( aAppUid == KAppId_hspsAI ) + { + iFileAI.Close(); + } + else if ( aAppUid == KAppId_LE ) + { + iFileLT.Close(); + } + } + } + } + + CleanupStack::PopAndDestroy( importBuf ); + delete importsDir; + } + + CleanupStack::PopAndDestroy( filterBuf ); +__UHEAP_MARKEND; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::LockSisxImportL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::LockSisxImportL( + const TUint32 aAppUid, + const TInt aConfUid ) + { +__UHEAP_MARK; + // Setup a filter for finding specific application configuration + HBufC* filterBuf = HBufC::NewLC( KMaxFileName ); + TPtr filterPtr = filterBuf->Des(); + filterPtr.Copy( KPrefixFileApp ); + filterPtr.Append( _L("*_*_") ); + filterPtr.AppendNumUC( aConfUid, EHex ); + filterPtr.Append( _L( "_1.0.dat" ) ); + + // Find imports with the generated filter (ROM based imports should not be found) + CDir* importsDir( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( filterPtr, KImportDirectoryC, importsDir ); + if ( importsDir ) + { + CleanupStack::PushL( importsDir ); + + // themeuid is unique so count should be 1 + if ( importsDir->Count() == 1 ) + { + HBufC* importBuf = HBufC::NewLC ( KMaxFileName ); + TPtr importPtr = importBuf->Des(); + importPtr.Copy( KImportDirectoryC ); + importPtr.Append( (*importsDir)[0].iName ); + + TBool isOpen = EFalse; + TInt errorCode = iFsSession.IsFileOpen( importPtr, isOpen ); + if ( errorCode == KErrNone && !isOpen ) + { + // Lock the application specific SISX imports + if ( aAppUid == KAppId_hspsAS ) + { + errorCode = iFileAS.Open( iFsSession, importPtr, EFileRead ); + } + else if ( aAppUid == KAppId_hspsAI ) + { + errorCode = iFileAI.Open( iFsSession, importPtr, EFileRead ); + } + else if ( aAppUid == KAppId_LE ) + { + errorCode = iFileLT.Open( iFsSession, importPtr, EFileRead ); + } + } + CleanupStack::PopAndDestroy( importBuf ); + } + + CleanupStack::PopAndDestroy( importsDir ); + } + + CleanupStack::PopAndDestroy( filterBuf ); +__UHEAP_MARKEND; + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleCenRepChangeL() +// Handles events coming from CentralRepository. +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleCenRepChangeL( const TUint32 aKey ) + { + switch ( aKey ) + { + case KCenrepKeyLang: + case KCenrepKeyPostRFS: + case KCenrepKeyCheckConf: + { + // No processing required + } + break; + default: + { + + // If SISX installations were enabled +#ifndef __DISABLE_SISX_INSTALLATION_ + // Get active application configuration for the provided application uid + TInt confUid(0); + TInt errorCode = iCentralRepository->Get( aKey, confUid ); + if ( !errorCode && confUid > 0 ) + { + // Remove file lock from active SISX import + UnlockSisxImportL( aKey ); + // Lock the new SISX import (prevents uninstallation of the SISX + // while it's being used as an active application configuration) + LockSisxImportL( aKey, confUid ); + } +#endif //__DISABLE_SISX_INSTALLATION_ + + } + } + + // Set up the listener to listen to changes in Central Repository for all settings + iCenRepListener->SetupAll(); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleAutoInstallerEvent +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleAutoInstallerEvent( ThspsServiceCompletedMessage aMsg ) + { +#ifndef __DISABLE_SISX_INSTALLATION_ + switch ( aMsg ) + { + case EhspsInstallPhaseSuccess: + // Phase was success, installation will continue + break; + case EhspsInstallThemeSuccess: + { + // Mark current theme as installed + TBool isInstalled = EFalse; + + //check if theme is already listed as installed + //there is a possibility that the install is an upgrade and the theme would be alredy listed + //in the iInstalledSisxThemes + if( iInstalledSisxThemes.Count() > iCurrentManifestFile ) + { + for (TInt i = 0; i < iInstalledSisxThemes.Count(); i++) + { + if ( *iInstalledSisxThemes[i] == *iInstallableSisxThemes[ iCurrentManifestFile ] ) + { + isInstalled = ETrue; + break; + } + } + } + + //if theme is not installed yet than add it to iInstalledSisxThemes + if ( !isInstalled ) + { + iInstalledSisxThemes.Append( iInstallableSisxThemes[ iCurrentManifestFile ] ); + } + + iCurrentManifestFile++; + + // Check if more installable files available + delete iAutoInstaller; + iAutoInstaller = NULL; + + RunAutoInstaller( EAutoInstallerStateInstall ); + } + break; + case EhspsRemoveThemeSuccess: + { + delete iInstalledSisxThemes[ iThemeIndexToRemove ]; + iInstalledSisxThemes[ iThemeIndexToRemove ] = NULL; + iInstalledSisxThemes.Remove( iThemeIndexToRemove ); + } + /* flow through */ + case EhspsRemoveThemeFailed: + /* flow through */ + default: + StopAutoInstaller(); + break; + } +#endif //__DISABLE_SISX_INSTALLATION_ + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::RunAutoInstaller +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::RunAutoInstaller( TAutoInstallerStates aState ) + { +#ifndef __DISABLE_SISX_INSTALLATION_ + TBool started( EFalse ); + + if( !iAutoInstaller ) + { + TRAP_IGNORE( iAutoInstaller = ChspsAutoInstaller::NewL( *this ) ); +#ifdef HSPS_LOG_ACTIVE + if ( iAutoInstaller ) + { + iAutoInstaller->SetLogBus( iLogBus ); + } +#endif + } + + iAutoInstallerState = aState; + + switch( aState ) + { + case EAutoInstallerStateInstall: + { + if( iCurrentManifestFile < iManifestFiles.Count() ) + { + TInt ret = KErrNone; + + TRAPD( err, ret = iAutoInstaller->InstallThemeL( *iManifestFiles[ iCurrentManifestFile ] ) ); + if( err == KErrNone && ret == KErrNone ) + { + started = ETrue; + } + } + } + break; + case EAutoInstallerUninstall: + { + if( iThemeIndexToRemove != KErrNotFound && iThemeIndexToRemove < iInstalledSisxThemes.Count() ) + { + TRAPD( err, iAutoInstaller->UnInstallThemeL( *iInstalledSisxThemes[ iThemeIndexToRemove ] ) ) + + if( !err ) + { + started = ETrue; + } + } + } + break; + default: + { + iAutoInstallerState = EAutoInstallerStateIdle; + } + break; + } + + if( !started ) + { + StopAutoInstaller(); + } + + return started; +#else + return EFalse; +#endif // __DISABLE_SISX_INSTALLATION_ + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::StopAutoInstaller +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::StopAutoInstaller() + { +#ifndef __DISABLE_SISX_INSTALLATION_ + switch( iAutoInstallerState ) + { + case EAutoInstallerStateInstall: + { + iCurrentManifestFile = 0; + iInstallableSisxThemes.Reset(); + iManifestFiles.ResetAndDestroy(); + } + break; + case EAutoInstallerUninstall: + { + iThemeIndexToRemove = KErrNotFound; + } + break; + default: + break; + } + + iAutoInstallerState = EAutoInstallerStateIdle; + + delete iAutoInstaller; + iAutoInstaller = NULL; +#endif // __DISABLE_SISX_INSTALLATION_ + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CheckInstalledPluginUsageL +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::CheckInstalledPluginUsageL( const TInt aPluginUid ) + { + TInt sum = 0; + if ( iHeaderListCache ) + { + TInt count = iHeaderListCache->Count(); + if ( iDefinitionRepository->Locked() ) + { + User::Leave( KErrInUse ); + } + iDefinitionRepository->Lock(); + for ( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = ( *iHeaderListCache )[ i ]; + if ( header->ConfigurationType() == EhspsAppConfiguration ) + { + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->SetRootUid( header->RootUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetConfigurationType( header->ConfigurationType() ); + odt->SetRootUid( header->RootUid() ); + odt->SetProviderUid( header->ProviderUid() ); + odt->SetThemeUid( header->ThemeUid() ); + odt->SetProviderNameL( header->ProviderName() ); + odt->SetThemeFullNameL( header->ThemeFullName() ); + odt->SetThemeShortNameL( header->ThemeShortName() ); + odt->SetThemeVersionL( header->ThemeVersion() ); + odt->SetFlags( header->Flags() ); + odt->SetMultiInstance( header->MultiInstance() ); + User::LeaveIfError( iDefinitionRepository->GetOdtL( *odt ) ); + TInt count = 0; + hspsServerUtil::PluginInstanceCountL( *odt, aPluginUid, count ); + sum = sum + count; + CleanupStack::PopAndDestroy( odt ); + } + } + iDefinitionRepository->Unlock(); + + } + return sum; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::PluginInHeaderCache +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::PluginInHeaderCache( const TUid aPluginUid ) + { + TBool found = EFalse; + + if ( iHeaderListCache ) + { + const TInt count = iHeaderListCache->Count(); + for ( TInt i = 0; i < count; i++ ) + { + ChspsODT* header = (*iHeaderListCache)[i]; + if( header->ThemeUid() == aPluginUid.iUid ) + { + found = ETrue; + break; + } + } + } + + return found; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::UpdateHeaderListCacheL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::UpdateHeaderListCacheL() + { + if ( iHeaderListPending ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::UpdateHeaderListCacheL(): already updating the cache" ) ); +#endif + } + else + { + iHeaderListPending = ETrue; + +#ifdef _hsps_PERFORMANCE_TEST_ + TTime start_time; + start_time = ChspsTimeMon::StartTiming(_L("timer started")); +#endif + + // Get headers from the Plug-in Repository + CArrayPtrSeg* headerList = new (ELeave)CArrayPtrSeg(KHeaderListGranularity); + CleanupStack::PushL( headerList ); + + // Reset search mask + iCacheMask->SetRootUid( 0 ); + iCacheMask->SetProviderUid( 0 ); + iCacheMask->SetThemeUid( 0 ); + + TInt err = DoUpdateHeaderListCache( *headerList ); + User::LeaveIfError( err ); + + if ( headerList->Count() > 0 ) + { + // Destroys all objects whose pointers form the elements of the array, + // before resetting the array. + iHeaderListCache->ResetAndDestroy(); + + TInt count = headerList->Count() - 1; + for (TInt i = count; i >= 0; --i) + { + // Update the cache array (ownership is transferred) + TRAP( err, iHeaderListCache->InsertL(0, headerList->At(i)) ); + + // If allocation failed + if ( err ) + { + break; + } + + // Complete the ownership transfer + headerList->Delete(i); + } + } + + // Destroys all objects whose pointers form the elements of the array, + // before resetting the array. + headerList->ResetAndDestroy(); + CleanupStack::PopAndDestroy( headerList ); + + // calculating service time +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::StopTiming( start_time, _L( "ChspsThemeServer::UpdateHeaderListCache(): - timer stopped" ) ); +#endif + + iHeaderListPending = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::UpdateHeaderListCache +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::UpdateHeaderListCache( + ThspsCacheOperations aOperation, + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ) + { + TInt err = KErrNone; + + // Input validation + if ( aRootUid < 1 || aProviderUid < 1 || aConfigurationUid < 1 ) + { + err = KErrArgument; + } + + if ( !err ) + { + if ( aOperation == EhspsCacheAddHeader ) + { + // Add or replace a header in the header list cache + TRAP( + err, + HeaderCacheAddL( + aRootUid, + aProviderUid, + aConfigurationUid ) + ); + } + else + { + // Remove a header from the header list cache + err = HeaderCacheRemove( + aRootUid, + aProviderUid, + aConfigurationUid + ); + } + } + + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::UpdateHeaderListCache(): - Failed to update %d header in the cache!" ), + aConfigurationUid + ); +#endif + } + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DoUpdateHeaderListCache +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::DoUpdateHeaderListCache( + CArrayPtrSeg& aHeaderList ) + { + // Get headers matching the search mask + TRAPD( err, GetHeaderListL( aHeaderList, *iCacheMask ) ); + if ( err ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::DoUpdateHeaderListCache(): - failed %d"), + err + ); +#endif + } + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HeaderCacheAddL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HeaderCacheAddL( + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ) + { + // Setup a search mask + iCacheMask->SetRootUid( aRootUid ); + iCacheMask->SetProviderUid( aProviderUid ); + iCacheMask->SetThemeUid( aConfigurationUid ); + + // Setup a list for headers matching the search mask + CArrayPtrSeg* newHeadersList = new (ELeave)CArrayPtrSeg(KHeaderListGranularity); + CleanupStack::PushL( newHeadersList ); + + // Find the headers + User::LeaveIfError( DoUpdateHeaderListCache( *newHeadersList ) ); + + // There should be only one match + if ( newHeadersList->Count() != 1 ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::HeaderCacheAddL(): - same %S header was found several times!" ), + &(newHeadersList->At(0)->ThemeShortName()) + ); +#endif + User::Leave( KErrGeneral ); + } + + // Set new default position + TInt newIndex = 0; + + // Check if old version of the header instance exists in the cache + TBool replaced = EFalse; + ChspsODT* header = NULL; + for( TInt index=0; !replaced && index < iHeaderListCache->Count(); index++ ) + { + header = iHeaderListCache->At( index ); + if ( header ) + { + if ( header->RootUid() == aRootUid + && header->ProviderUid() == aProviderUid + && header->ThemeUid() == aConfigurationUid ) + { + // Remove the old header instance + iHeaderListCache->Delete( index ); + delete header; + header = NULL; + replaced = ETrue; + newIndex = index; + } + } + } + + // Append the new version into the specified position (ownership is transferred) + iHeaderListCache->InsertL(newIndex, newHeadersList->At(0) ); + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HeaderCacheAddL(): - header '%S' was added/updated to cache!" ), &(newHeadersList->At(0)->ThemeShortName()) ); +#endif + + // Complete the ownership transfer + newHeadersList->Delete(0); + + // Cleanup + newHeadersList->ResetAndDestroy(); + CleanupStack::PopAndDestroy( newHeadersList ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HeaderCacheRemove +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::HeaderCacheRemove( + const TInt aRootUid, + const TInt aProviderUid, + const TInt aConfigurationUid ) + { + TInt err = KErrNone; + + // Find the header to be removed from the cache + ChspsODT* header = NULL; + for( TInt index=0; index < iHeaderListCache->Count(); index++ ) + { + header = iHeaderListCache->At( index ); + if ( header ) + { + if ( header->RootUid() == aRootUid + && header->ProviderUid() == aProviderUid + && header->ThemeUid() == aConfigurationUid ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HeaderCacheRemove(): - header '%S' was removed from cache!" ), &(header->ThemeShortName()) ); +#endif + iHeaderListCache->Delete( index ); + delete header; + header = NULL; + break; + } + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CompareL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::ComparePaths(const ChspsODT& aOldHeader, const ChspsODT& aNewHeader) + { + TBool ret; + if ( + ( + aOldHeader.RootUid() == aNewHeader.RootUid() + ) + && + ( + aOldHeader.ProviderUid() == aNewHeader.ProviderUid() + ) + && + ( + aOldHeader.ThemeUid() == aNewHeader.ThemeUid() + ) + && + ( + !aOldHeader.ThemeVersion().Compare( aNewHeader.ThemeVersion()) + ) + ) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetDeviceLanguage() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TLanguage ChspsThemeServer::GetDeviceLanguage() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetDeviceLanguage(): %d returned" ), User::Language() ); +#endif + + return User::Language(); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetHeaderListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::GetHeaderListL(CArrayPtrSeg& aHeaderList, const ChspsODT& aSearchMask ) + { + CArrayPtrSeg* licenceeDefaultList = new (ELeave)CArrayPtrSeg( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyChspsODTArray, licenceeDefaultList ) ); + + CArrayPtrSeg* headerDataList = new (ELeave)CArrayPtrSeg( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyHBufC8Array, headerDataList ) ); + iDefinitionRepository->GetThemeListAsStreamL( *headerDataList, aSearchMask ); + + // Convert data streams into header instances and populate the lincencee and header lists + for ( TInt i=0; i < headerDataList->Count(); i++ ) + { + HBufC8* headerData = headerDataList->At(i); + if ( headerData ) + { + ChspsODT* header = ChspsODT::UnMarshalHeaderLC( *headerData ); + if ( header->Flags() & EhspsThemeStatusLicenceeDefault ) + { + licenceeDefaultList->AppendL( header ); + } + else + { + // Get header's file path + HBufC* fileBuf = HBufC::NewLC ( KMaxFileName ); + TPtr filePtr = fileBuf->Des(); + iDefinitionRepository->GetResourcePathL( *header, EResourceODT, filePtr ); + aHeaderList.AppendL( header ); + CleanupStack::PopAndDestroy( fileBuf ); + } + CleanupStack::Pop( header ); + } + } + + // Cleanup the data streams + CleanupStack::PopAndDestroy( headerDataList ); + + + // remove duplicate headers from the licencee list + if( aHeaderList.Count() ) + { + // go through the theme list again and put back the themes without update + const TInt headersCount = aHeaderList.Count(); + for( TInt i = 0; i < licenceeDefaultList->Count(); i++ ) + { + ChspsODT* licenceeHeader = licenceeDefaultList->At( i ); + + TBool found( EFalse ); + for( TInt j = 0; !found && j < headersCount; j++ ) + { + ChspsODT* header = aHeaderList.At( j ); + + // compare two themes to find out are they they the same + if( ComparePaths( *header, *licenceeHeader ) ) + { + // there was an update, this theme does not need licencee default + licenceeDefaultList->Delete( i ); + delete licenceeHeader; + // next i + i--; + found = ETrue; + } + } + } + } + + // append headers from the licencee list into the headers list + for ( TInt i = 0; i < licenceeDefaultList->Count(); i++) + { + ChspsODT* licenceeHeader = licenceeDefaultList->At(i); + + HBufC8* data = licenceeHeader->MarshalHeaderL(); + CleanupStack::PushL( data ); + + ChspsODT* odt = ChspsODT::UnMarshalHeaderLC( data->Des() ); + aHeaderList.AppendL( odt ); + CleanupStack::Pop( odt ); + + CleanupStack::PopAndDestroy( data ); + } + + CleanupStack::PopAndDestroy( licenceeDefaultList ); + + // Modify headers flags + for ( TInt i = 0; i < aHeaderList.Count(); i++ ) + { + ChspsODT* header = aHeaderList.At(i); + TInt appUid = header->RootUid(); + if ( header->ConfigurationType() == EhspsAppConfiguration ) + { + // Check whether the application has an active configuration + TInt confUid = 0; + if ( iCentralRepository->Get( appUid, confUid ) == KErrNone && confUid > 0 ) + { + // If active application configuration is the same as the header in question + if ( header->ThemeUid() == confUid ) + { + // Update header's flags + TUint flags = header->Flags(); + header->SetFlags( flags | EhspsThemeStatusActive ); + } + } + } + } + + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CustomSecurityCheckL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CPolicyServer::TCustomResult ChspsThemeServer::CustomSecurityCheckL(const RMessage2& aMsg, + TInt& /*aAction*/, TSecurityInfo& /*aMissing*/ ) + { + CPolicyServer::TCustomResult ret; + if ( iSecurityEnforcer->CheckAccessRightsL( aMsg ) ) + { + ret = EPass; + } + else + { + ret = EFail; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::HandleThemeUpgradeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleThemeUpgradeL() + { + CDir* upgradePathFileList( NULL ); + TFindFile upgradeFileFinder( iFsSession ); + + // If a upgrade_path_*.dat file appears in the import directory this means that a theme is being upgraded + upgradeFileFinder.FindWildByDir( KUpgradePluginWild , + KImportDirectoryC, upgradePathFileList ); + if( !upgradePathFileList ) + { + return; + } + // only one upgrade_path file can be present because it is deleted after upgrade + if ( upgradePathFileList->Count() == 1 ) + { + CleanupStack::PushL( upgradePathFileList ); + TPtrC upgradePathFile( ( *upgradePathFileList )[0].iName ); + + //path_*.dat theme file + HBufC* fileNamePathOnly = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePathOnlyPtr( fileNamePathOnly->Des() ); + TParsePtrC parsePtrTemp( upgradePathFile.Right( + upgradePathFile.Length() - KUpgrade().Length() - 1 ) ); + fileNamePathOnlyPtr.Append( parsePtrTemp.FullName() ); + + TBool isInstalled = EFalse; + //check if theme is installed + for (TInt i = 0; i < iInstalledSisxThemes.Count(); i++) + { + if ( *iInstalledSisxThemes[i] == *fileNamePathOnly ) + { + isInstalled = ETrue; + break; + } + } + + if ( !isInstalled ) + { + // base theme package is not an installed theme +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "hspsThemeServer: ChspsThemeServer::HandleThemeUpgradeL(): Base theme package not installed" ) ); +#endif + } + else + { + //upgrade_path_*.dat file path portion + TParsePtrC parsePtr( upgradePathFile.Right( + upgradePathFile.Length() - KUpgradePlugin().Length() - 1 ) ); + TPtrC fileNameUpgradePath( parsePtr.Name() ); + + //path to manifest + HBufC* manifestFile = HBufC::NewLC( KMaxFileName ); + TPtr manifestFilePtr( manifestFile->Des() ); + manifestFilePtr.Append( KImportDirectoryC ); + manifestFilePtr.Append( fileNameUpgradePath ); + + TInt pos( manifestFilePtr.Locate( TChar( '_' ) ) ); + while( pos != KErrNotFound ) + { + manifestFilePtr.Replace( pos, 1, KDoubleBackSlash ); + pos = manifestFilePtr.Locate( TChar( '_' ) ); + } + + manifestFilePtr.Append( KDoubleBackSlash ); + manifestFilePtr.Append( KManifestFile ); + + //store manifest file for autoinstaller + iManifestFiles.AppendL( manifestFile ); + + //Store current path_*.dat file + iInstallableSisxThemes.AppendL( ( *fileNamePathOnly ).AllocL() ); + iCurrentManifestFile = 0; + + if( !RunAutoInstaller( EAutoInstallerStateInstall ) ) + { + // All installation files are not present + // here should be some kind of error handling + } + + CleanupStack::Pop( manifestFile ); //manifestFile + } + + HBufC * upgradePathFileToDelete = HBufC::NewLC( KMaxFileName ); + TPtr upgradePathFileToDeletePtr( upgradePathFileToDelete->Des() ); + upgradePathFileToDeletePtr.Append( KImportDirectoryC ); + upgradePathFileToDeletePtr.Append( upgradePathFile ); + + //delete the upgrade_path_*.dat auxiliary file + TInt err = iFsSession.Delete( *upgradePathFileToDelete ); + if ( err != KErrNone ) + { +#ifdef HSPS_LOG_ACTIVE + //file not deleted error handling + iLogBus->LogText( _L( "hspsThemeServer: ChspsThemeServer::HandleThemeUpgradeL(): %d ,upgrade_path_*.dat file not deleted" ), err ); +#endif + } + + CleanupStack::PopAndDestroy( upgradePathFileToDelete ); + CleanupStack::PopAndDestroy( fileNamePathOnly ); + CleanupStack::PopAndDestroy( upgradePathFileList ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + //more than one upgrade_path is present. in import directory error handling + iLogBus->LogText( _L( "hspsThemeServer: ChspsThemeServer::HandleThemeUpgradeL(): more than one upgrade_path_*.dat file" ) ); +#endif + } + } + +// ----------------------------------------------------------------------------- +// Checks whether the device language has been changed and updates +// configurations accordingly +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleLanguageChangeL() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL()") ); +#endif + + // Set key for fetching previously used language from the cenrep + const TInt KCenrepLangKey = 100000001; + + // The key should already exist + const TUint32 fullMask = 0xFFFFFFFF; + RArray res; + CleanupClosePushL( res ); + + iCentralRepository->FindL( KCenrepLangKey, fullMask, res ); + if ( res.Count() == 0 ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL(): - Couldn't find %d key from the HSPS cenrep!" ), KCenrepLangKey ); +#endif + + User::Leave( KErrNotFound ); + } + + // Check the cenrep key's value + TInt prevLanguage = ELangNone; + iCentralRepository->Get( KCenrepLangKey, prevLanguage ); + + // If the language has been changed + if( iDeviceLanguage != prevLanguage ) + { + // Update all the ODTs so that the localized configurations can be fetched + LocalizeConfigurationsL(); + + // Finally, update the cenrep with the new language + TInt errorCode = iCentralRepository->Set( KCenrepLangKey, iDeviceLanguage ); + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL(): - Failed to update the cenrep!" ) ); +#endif + + User::Leave( KErrWrite ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL(): - themes were localized successfully" ) ); +#endif + } + } + + res.Close(); + CleanupStack::PopAndDestroy(1, &res); + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::SetHeadersLanguages() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::LocalizeConfigurationsL() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::LocalizeConfigurationsL()" ) ); +#endif + + // Check header count + TInt headerCount = HeaderListCache().Count(); + if( headerCount ) + { + _LIT8(KhspsDefinitionEngine, "hspsdefinitionengine"); + ChspsDefinitionEngineInterface* defEngine = ChspsDefinitionEngineInterface::NewL(KhspsDefinitionEngine); + CleanupStack::PushL( defEngine ); + + // Loop found headers + ChspsODT* header = NULL; + const TInt KInterfaceUid = 0; + for( TInt headerIndex=0; headerIndex < headerCount; headerIndex++ ) + { + // Get pointer to the header (contains minimal information from an ODT) + header = iHeaderListCache->At( headerIndex ); + + // Get the ODT based on header UIDs + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + GetConfigurationL( + KInterfaceUid, + header->ThemeUid(), + *odt ); + if ( !odt || !odt->ThemeUid() ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::LocalizeConfigurationsL(): - Failed to retrieve header with an configuration uid %d" ), + header->ThemeUid() ); +#endif + + User::Leave( KErrNotFound ); + } + + // Try to localize the ODT according to the new device language + TBool localized = LocalizeL( + *defEngine, + *odt ); + if ( localized ) + { + // Set header's name from the ODT + header->SetThemeFullNameL( odt->ThemeFullName() ); + } + + CleanupStack::PopAndDestroy( odt ); + } // for loop + + CleanupStack::PopAndDestroy( defEngine ); + + } // count + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::LocalizeL() +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::LocalizeL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt ) + { + TBool localized = ETrue; + + TLanguage requestedLanguage = DeviceLanguage(); + if ( requestedLanguage == ELangNone ) + { + requestedLanguage = ELangTest; + } + + if ( aOdt.OdtLanguage() != requestedLanguage ) + { + localized = EFalse; + TBool domChanged = EFalse; + + // Localize XML configuration with the requested language + if ( aOdt.ConfigurationType() == EhspsAppConfiguration ) + { + // Apply plugin and application specific DTD files + domChanged = LocalizeApplicationConfigurationL( + aEngine, + aOdt, + requestedLanguage ); + } + else + { + // Apply plugin specific DTD files only + domChanged = LocalizePluginConfigurationL( + aEngine, + aOdt, + requestedLanguage, + 0 ); + } + + if ( domChanged ) + { + // Update ODT with the new localized name from the XML configuration + TPtrC8 name( hspsServerUtil::FindConfigurationAttrL( aOdt, KConfigurationAttrName ) ); + if ( name.Length() ) + { + HBufC* buf = HBufC::NewLC( name.Length() ); + buf->Des().Copy( name ); + aOdt.SetThemeFullNameL( buf->Des() ); + CleanupStack::PopAndDestroy( buf ); + + // The ODT instance has now been localized - either with the requested language or a test language + aOdt.SetOdtLanguage( requestedLanguage ); + } + + // Update ODT with the new localized description from the XML configuration + TPtrC8 desc( hspsServerUtil::FindConfigurationAttrL( aOdt, KConfigurationAttrDesc ) ); + if ( desc.Length() ) + { + HBufC* buf = HBufC::NewLC( desc.Length() ); + buf->Des().Copy( desc ); + aOdt.SetDescriptionL( buf->Des() ); + CleanupStack::PopAndDestroy( buf ); + } + + // Save the changes + iDefinitionRepository->SetOdtL( aOdt ); + localized = ETrue; + } + + if ( !localized ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizeL(): - failed to localize header %S!" ), + &aOdt.ThemeShortName() + ); +#endif + } + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::LocalizeL() - DOM dump after localization:" ) ); + // Print DOM debug + ChspsOdtDump::Dump( aOdt, *iLogBus ); +#endif + } + + return localized; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::LocalizeApplicationConfigurationL() +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::LocalizeApplicationConfigurationL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt, + const TLanguage aRequestedLanguage ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizeApplicationConfigurationL(): - Localizing %S application configuration..." ), + &aOdt.ThemeShortName() + ); +#endif + + // Localize the application configuration itself + TInt resourceFilter = aOdt.ThemeUid(); + TBool domLocalized = LocalizePluginConfigurationL( + aEngine, + aOdt, + aRequestedLanguage, + resourceFilter ); + + // Next, localize all plugins instances in the DOM + if ( domLocalized ) + { + // Find all unique plugin uids that are used in the application configuration + RArray pluginArray; + CleanupClosePushL( pluginArray ); + hspsServerUtil::FindUniquePluginsL( aOdt, pluginArray ); + + // Loop the plugins + const TInt pluginsCount = pluginArray.Count(); + for( TInt pluginIndex=0; domLocalized && pluginIndex < pluginsCount; pluginIndex++ ) + { + // Apply plugin specific DTD files only + TBool pluginLocalized = LocalizePluginConfigurationL( + aEngine, + aOdt, + aRequestedLanguage, + pluginArray[pluginIndex] ); + } + + pluginArray.Reset(); + CleanupStack::PopAndDestroy( &pluginArray ); + } + + return domLocalized; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::LocalizePluginConfigurationL() +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::LocalizePluginConfigurationL( + ChspsDefinitionEngineInterface& aEngine, + ChspsODT& aOdt, + const TLanguage aRequestedLanguage, + TInt aPluginUid ) + { + // If the plugin has already been localized as requested + if ( aOdt.OdtLanguage() == aRequestedLanguage ) + { + return ETrue; + } + + TBool domLocalized = EFalse; + const TInt resourceCount = aOdt.ResourceCount(); + + // Localize XML document + TFileName pluginFolder; + for( TInt resourceIndex=0; !domLocalized && resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& r = aOdt.ResourceL( resourceIndex ); + if ( r.ResourceType() == EResourceDTD ) + { + TBool isPluginSpecific = ETrue; + + // If plugin uid restriction was set (localizing an application configuration) + if ( aPluginUid > 0 ) + { + // Check whether the resource belongs to the plugin + pluginFolder.Format( _L("\\%d\\"), aPluginUid ); + isPluginSpecific = ( r.FileName().Find(pluginFolder) > 0 ); + } + if ( isPluginSpecific && r.Language() == aRequestedLanguage ) + { + // Parses the given DTD file and replaces all entity referencies in the DOM tree + aEngine.ApplyLanguageL( + iFsSession, + r.FileName(), + aOdt ); + domLocalized = ETrue; +#ifdef HSPS_LOG_ACTIVE + if ( aPluginUid > 0 ) + { + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizePluginConfigurationL(): - %S/%X instances localized to %d language!" ), + &aOdt.ThemeShortName(), + aPluginUid, + aRequestedLanguage ); + } + else + { + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizePluginConfigurationL(): - %S localized to %d language!" ), + &aOdt.ThemeShortName(), + aRequestedLanguage ); + } +#endif + } + } + } + + // If the requested locale couldn't be found + if ( !domLocalized ) + { + // Localize XML document with the test locale (mandatory language, used by HSPS developers) + for( TInt resourceIndex=0; !domLocalized && resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& r = aOdt.ResourceL( resourceIndex ); + if ( r.ResourceType() == EResourceDTD ) + { + TBool isPluginSpecific = ETrue; + + // If plugin uid restriction was set (localizing an application configuration) + if ( aPluginUid > 0 ) + { + // Check whether the resource belongs to the plugin + pluginFolder.Format( _L("\\%d\\"), aPluginUid ); + isPluginSpecific = ( r.FileName().Find(pluginFolder) > 0 ); + } + if ( isPluginSpecific && r.Language() == ELangTest ) + { + // Parses the given DTD file and replaces all entity referencies in the DOM tree + aEngine.ApplyLanguageL( + iFsSession, + r.FileName(), + aOdt ); + domLocalized = ETrue; +#ifdef HSPS_LOG_ACTIVE + if ( aPluginUid > 0 ) + { + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizePluginConfigurationL(): - %S/%X instances localized to %d language!" ), + &aOdt.ThemeShortName(), + aPluginUid, + ELangTest ); + } + else + { + iLogBus->LogText( + _L( "ChspsThemeServer::LocalizePluginConfigurationL(): - %S localized to %d language!" ), + &aOdt.ThemeShortName(), + ELangTest ); + } +#endif + } + } + } + } + + return domLocalized; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetConfigurationL() +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::GetConfigurationL( + const TInt aInterfaceUid, + const TInt aConfigurationUid, + ChspsODT& aRetrievedODT ) + { + // Input validation + if ( aInterfaceUid < 0 || aConfigurationUid < 1) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - Invalid arguments" ) ); +#endif + + return KErrArgument; + } + + TInt headerCount = HeaderListCache().Count(); + if ( headerCount < 1 ) + { + UpdateHeaderListCacheL(); + headerCount = HeaderListCache().Count(); + if ( headerCount < 1 ) + { + // configurations were not found or repository is locked +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - Cache is empty" ) ); +#endif + return KErrAbort; + } + } + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - header count in cache: %d" ), iHeaderListCache->Count() ); +#endif + + // Loop headers in the cache + TBool found = EFalse; + ChspsODT* h = NULL; + for ( TInt i=0; !found && iCount(); i++ ) + { + h = iHeaderListCache->At(i); + TBool rootUidMatched = ETrue; + TBool themeUidMatched = ETrue; + if ( aInterfaceUid ) + { + rootUidMatched = ( h->RootUid() == aInterfaceUid ); + } + themeUidMatched = ( h->ThemeUid() == aConfigurationUid ); + + found = ( rootUidMatched && themeUidMatched ); +//#ifdef HSPS_LOG_ACTIVE +// iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - header '%S' matched: %d" ), &(h->ThemeShortName()), found ); +//#endif + } + if ( !found ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - theme %D was not found!" ), aConfigurationUid ); +#endif + return KErrNotFound; + } + + // Copy properties which are needed by the definition repository to form up ODT paths + aRetrievedODT.SetRootUid( h->RootUid() ); + aRetrievedODT.SetThemeUid( h->ThemeUid() ); + aRetrievedODT.SetConfigurationType(h->ConfigurationType()); + aRetrievedODT.SetRootUid(h->RootUid()); + aRetrievedODT.SetProviderUid(h->ProviderUid()); + aRetrievedODT.SetThemeUid(h->ThemeUid()); + aRetrievedODT.SetProviderNameL(h->ProviderName()); + aRetrievedODT.SetThemeFullNameL(h->ThemeFullName()); + aRetrievedODT.SetThemeShortNameL(h->ThemeShortName()); + aRetrievedODT.SetThemeVersionL(h->ThemeVersion()); + aRetrievedODT.SetFlags(h->Flags()); + aRetrievedODT.SetMultiInstance( h->MultiInstance() ); + + // Get a complete ODT instance from the definition repository + if ( iDefinitionRepository->GetOdtL( aRetrievedODT ) ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::GetConfigurationL(): - theme cannot be accessed." ) ); +#endif + return KErrAccessDenied; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleRomInstallationsL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleRomInstallationsL() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL()" ) ); +#endif + + const TInt key = KCenrepKeyPostRFS; + const TUint32 fullMask = 0xFFFFFFFF; + RArray res; + CleanupClosePushL( res ); + iCentralRepository->FindL( key, fullMask, res ); + if ( res.Count() == 0 ) + { + // The key should already exist! +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL(): - Couldn't find %d key from the HSPS cenrep!" ), key ); +#endif + + User::Leave( KErrNotFound ); + } + + // Check the key's value + // lets use KSysUtilVersionTextLength instead of KSysVersionInfoRevisionLength if we + // have to use SysUtil::GetSWVersion because KSysUtilVersionTextLength is bigger. + TBuf fwVersion; + TInt errorCode = iCentralRepository->Get( key, fwVersion ); + if( ( errorCode == KErrNone ) && + ( fwVersion.Length() == 0 ) ) + { + // Install manifest files from ROM + InstallManifestsFromRomDriveL(); + + // Post RFS installations have been done, prevent re-installations at next startup + // by reading firmware version and saving it to cenrep. + GetFWVersion( fwVersion ); + + errorCode = iCentralRepository->Set( key, fwVersion ); + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL(): - Failed to update the cenrep!" ) ); +#endif + + User::Leave( KErrWrite ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL(): - ROM configurations were installed successfully." ) ); +#endif + } + } + else + { + // We have to check whether phone software has been updated for example by FOTA. + // If the firmware version is different we need to run backup and restore to + // check whether there are any new widgets introduced and check can we use + // still same application configure. If firmware is same nothing needs to be done. + TBuf currentFWVersion; + GetFWVersion( currentFWVersion ); + if ( fwVersion != currentFWVersion ) + { + // Phone software has been updated. + CreateBackupDataL(); + InstallManifestsFromRomDriveL(); + RestoreApplicationConfigurationsL(); + // Save new firmware version to cenrep + if ( errorCode == KErrNone ) + { + errorCode = iCentralRepository->Set( key, currentFWVersion ); + } + else if ( errorCode == KErrArgument ) + { + // We came here because older version of HSPS cenrep value + // of key was integer and now it is string. + // Delete key and create new with different type + iCentralRepository->Delete( key ); + errorCode = iCentralRepository->Create( key, currentFWVersion ); + } + + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL(): - Failed to update the cenrep!" ) ); +#endif + + User::Leave( KErrWrite ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleRomInstallationsL(): - ROM configurations were installed successfully." ) ); +#endif + } + } + } + +#if defined(WINSCW) || defined(__WINS__) + // Activate client specific root configurations from active display resolution + ActivateRootConfigurationsL(); +#endif // defined(WINSCW) + + res.Close(); + CleanupStack::PopAndDestroy(1, &res); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::InstallManifestsFromRomDriveL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::InstallManifestsFromRomDriveL() + { + if ( iRomInstaller || iManifestFiles.Count() ) + { + // Invalid usage + User::Leave( KErrGeneral ); + } + iRomInstaller = ChspsRomInstaller::NewL( *this, iFsSession ); +#ifdef HSPS_LOG_ACTIVE + iRomInstaller->SetLogBus( iLogBus ); +#endif + + // An array for installation files with V2 directory structure + RPointerArray pluginFolders; + CleanupClosePushL( pluginFolders ); + + // Retrieve an array of folder names + iRomInstaller->GetInstallationFoldersL( pluginFolders ); + + // Add manifest files from the subfolders + FindRomInstallationsV2L( pluginFolders ); + + pluginFolders.ResetAndDestroy(); + + if ( iManifestFiles.Count() < 1 ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - mandatory plugins were not found from the ROM drive!" ) ); +#endif + // Mandatory plugins were missing from the ROM drive + User::Leave( KErrGeneral ); + } + + CleanupStack::PopAndDestroy( 1, &pluginFolders ); + + + // Install configurations from the manifest files + ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; + for( TInt manifestIndex=0; manifestIndex < iManifestFiles.Count(); manifestIndex++ ) + { + // Synchronous API call + TPtr name( iManifestFiles[manifestIndex]->Des() ); +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - installing ROM configuration from: %S" ), &name ); +#endif + ret = iRomInstaller->InstallThemeL( name ); + if ( ret != EhspsInstallThemeSuccess ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - configuration is corrupted, critical error - shutting down!" ) ); +#endif +// User::Leave( KErrAbort ); + } + } + + // Cancel any actions done in the previous functionality + iManifestFiles.ResetAndDestroy(); + + // The ROM installer is not needed anymore and therefore it can be released + delete iRomInstaller; + iRomInstaller = NULL; + + // Force updating of the header cache + ThspsRepositoryInfo info( EhspsCacheUpdate ); + iDefinitionRepository->RegisterNotification( info ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::FindRomInstallationsV2L() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::FindRomInstallationsV2L( + RPointerArray& aPluginFolders ) + { + _LIT(KHspsFolder, "hsps\\"); + TFileName hspsPath; + for( TInt folderIndex=0; folderIndex < aPluginFolders.Count(); folderIndex++ ) + { + // Set path + hspsPath.Copy( aPluginFolders[folderIndex]->Des() ); + hspsPath.Append( KHspsFolder ); + + // Add full path into the installation queue + TInt len = hspsPath.Length() + 3 + KDoubleBackSlash().Length() + KManifestFile().Length(); + HBufC* manifestBuf = HBufC::NewLC( len ); + manifestBuf->Des().Copy( hspsPath ); + manifestBuf->Des().Append( _L("00") ); + manifestBuf->Des().Append( KDoubleBackSlash ); + manifestBuf->Des().Append( KManifestFile ); + + iManifestFiles.AppendL( manifestBuf ); + CleanupStack::Pop( manifestBuf ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetConfigurationHeader() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::GetConfigurationHeader( + ChspsODT& aSearchMask, + ChspsODT*& aConfHeader, + TInt& aPos ) + { + ChspsODT* header( NULL ); + TBool rootUidMatch( ETrue ); + TBool themeUidMatch( ETrue ); + TBool flagsMatch( ETrue ); + TBool typeMatch( ETrue ); + aConfHeader = NULL; + for ( TInt i = aPos; i < iHeaderListCache->Count() && aConfHeader == NULL; i++ ) + { + header = iHeaderListCache->At(i); + if ( aSearchMask.RootUid() && + aSearchMask.RootUid() != header->RootUid() ) + { + // Root UID defined in search criteria and Root UID does not match + rootUidMatch = EFalse; + } + // else Root UID check ignored + if ( aSearchMask.ThemeUid() && + aSearchMask.ThemeUid() != header->ThemeUid() ) + { + // Theme UID defined in search criteria and Theme UID does not match + themeUidMatch = EFalse; + } + // else Theme UID check ignored + if ( aSearchMask.Flags() && + !( aSearchMask.Flags() & header->Flags() ) ) + { + // Header flags defined in search criteria and Header flags does not match + flagsMatch = EFalse; + } + // else header flags check ignored + if ( aSearchMask.ConfigurationType() && + aSearchMask.ConfigurationType() != header->ConfigurationType() ) + { + typeMatch = EFalse; + } + // else configuration type ignored + if ( rootUidMatch && themeUidMatch && flagsMatch && typeMatch ) + { + aConfHeader = header; + aPos = i; + } + else + { + rootUidMatch = ETrue; + themeUidMatch = ETrue; + flagsMatch = ETrue; + typeMatch = ETrue; + } + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ReinstallConfL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::ReinstallConfL( + TInt aAppUid, + TInt aConfUid ) + { + + RFs fileserver; + CleanupClosePushL( fileserver ); + User::LeaveIfError( fileserver.Connect() ); + + ChspsRomInstaller* installer = ChspsRomInstaller::NewL( *this, fileserver ); + CleanupStack::PushL( installer ); + + installer->ReinstallThemeL( aAppUid, aConfUid ); + + CleanupStack::PopAndDestroy( installer ); + CleanupStack::PopAndDestroy( &fileserver ); + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleBREventL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleBREventL( + TInt aEvent ) + { + + switch ( iBRState ) + { + case EhspsBRRestore: + { + HandleBRRestoreStateL( aEvent ); + } + break; + case EhspsBRBackup: + { + HandleBRBackupStateL( aEvent ); + } + break; + default: // EhspsBRNormal + { + HandleBRNormalStateL( aEvent ); + } + break; + } + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleBRNormalStateL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleBRNormalStateL( + TInt aEvent ) + { + if ( aEvent & conn::EBURBackupFull || + aEvent & conn::EBURBackupPartial ) + { + CreateBRHandlerL( aEvent ); + if ( iBRHandler && iActiveBackupClient ) + { + iBRState = EhspsBRBackup; +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleBRNormalStateL(): - Backup starts" ) ); +#endif + } + } + + if ( aEvent & conn::EBURRestoreFull || + aEvent & conn::EBURRestorePartial ) + { + CreateBRHandlerL( aEvent ); + if ( iBRHandler && iActiveBackupClient ) + { + iBRState = EhspsBRRestore; +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleBRNormalStateL(): - Restore starts" ) ); +#endif + } + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleBRBackupStateL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleBRBackupStateL( + TInt aEvent ) + { + if ( aEvent & conn::EBURNormal ) + { + DeleteBRHandler(); + iBRState = EhspsBRNormal; +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleBRBackupStateL(): - Backup completed" ) ); +#endif + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleBRRestoreState() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::HandleBRRestoreStateL( + TInt aEvent ) + { + if ( aEvent & conn::EBURNormal ) + { + // Disable auto installations + DisableAutoInstallation(); + // Restore imported configurations from backup/import folder + RestoreImportedConfigurationsL(); + // Restore application configurations from backup/themes folder + RestoreApplicationConfigurationsL(); + // Restore completed + DeleteBRHandler(); + iBRState = EhspsBRNormal; + EnableAutoInstallationL(); +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleBRRestoreStateL(): - Restore completed" ) ); +#endif + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CreateBRHandlerL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::CreateBRHandlerL( + TInt aEvent ) + { + if ( !iBRHandler ) + { + iBRHandler = CHSPSBRHandler::NewL( *this ); + } + if ( !iActiveBackupClient ) + { + iActiveBackupClient = conn::CActiveBackupClient::NewL( iBRHandler ); + } + if ( aEvent & conn::EBURBackupPartial || + aEvent & conn::EBURRestorePartial ) + { + if( !iActiveBackupClient->DoesPartialBURAffectMeL() ) + { + DeleteBRHandler(); + } + } + if ( iBRHandler && iActiveBackupClient ) + { + iActiveBackupClient->ConfirmReadyForBURL( KErrNone ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DeleteBRHandler() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::DeleteBRHandler() + { + delete iActiveBackupClient; + iActiveBackupClient = NULL; + delete iBRHandler; + iBRHandler = NULL; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::CreateBackupDataL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::CreateBackupDataL() + { + + // Clear previous backup data + iDefinitionRepository->ClearBackupsL(); + + // Get first application configuration header + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetConfigurationType( EhspsAppConfiguration ); + ChspsODT* confHeader( NULL ); + TInt pos( 0 ); + GetConfigurationHeader( *searchMask, confHeader, pos ); + + while ( confHeader != NULL ) + { + // Backup application configuration + iDefinitionRepository->BackupConfigurationL( *confHeader ); + // Get next application configuration header + pos++; + GetConfigurationHeader( *searchMask, confHeader, pos ); + } + + CleanupStack::PopAndDestroy( searchMask ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::EnableAutoInstallationL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::EnableAutoInstallationL() + { + + // Reset installation arrays + iInstallableSisxThemes.Reset(); + iInstalledSisxThemes.ResetAndDestroy(); + iManifestFiles.ResetAndDestroy(); + + // Get installed configurations from the import folders + CDir* fileList( NULL ); + TFindFile fileFinder( iFsSession ); + fileFinder.FindWildByDir( + KFilterAllImportsV1, + KImportDirectoryC, + fileList ); + CleanupStack::PushL( fileList ); + if( fileList ) + { + const TInt installedCount = fileList->Count(); + for( TInt i = 0; i < installedCount ; i++ ) + { + const TEntry& entry = (*fileList)[i]; + iInstalledSisxThemes.AppendL( entry.iName.AllocL() ); + } + } + CleanupStack::PopAndDestroy( fileList ); + + // Create file change listener to observe changes in import folder + delete iFileChangeListener; + iFileChangeListener = NULL; + iFileChangeListener = ChspsFileChangeListener::NewL( + iFsSession, + *this, + ENotifyAll, + KImportDirectoryC, + TImportDirListener ); +#ifdef HSPS_LOG_ACTIVE + iFileChangeListener->SetLogBus( iLogBus ); +#endif + iFileChangeListener->Setup(); + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::DisableAutoInstallation() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::DisableAutoInstallation() + { + // Reset installation arrays + iInstallableSisxThemes.Reset(); + iInstalledSisxThemes.ResetAndDestroy(); + iManifestFiles.ResetAndDestroy(); + + // Delete import folder observer + delete iFileChangeListener; + iFileChangeListener = NULL; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::RestoreImportedConfigurationsL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::RestoreImportedConfigurationsL() + { + // Check that import folder exists and can be opened + if ( BaflUtils::CheckFolder( iFsSession, KImportDirectoryC ) == KErrNone ) + { + // Get list of restored configuration manifest.dat files included in + // import directory + RArray files; + CleanupClosePushL( files ); + hspsServerUtil::FindFilesL( + KImportDirectoryC, + KManifestFile, + files ); + + // Install found configurations + TInt err( KErrNone ); + CHSPSInstaller* installer = CHSPSInstaller::NewL( *this ); + CleanupStack::PushL( installer ); + for ( TInt i = 0; i < files.Count(); i++ ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::InstallRestoredConfigurationsL(): - Install configuration: %S" ), &files[ i ] ); +#endif + TRAP( err, installer->InstallConfigurationL( files[ i ] ) ); +#ifdef HSPS_LOG_ACTIVE + if ( err != KErrNone ) + { + iLogBus->LogText( _L( "ChspsThemeServer::InstallRestoredConfigurationsL(): - Installation failed: %S" ), &files[ i ] ); + } +#endif + } + CleanupStack::PopAndDestroy( installer ); + CleanupStack::PopAndDestroy( &files ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::RestoreApplicationConfigurationsL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::RestoreApplicationConfigurationsL() + { + // Get the list of application configuration files included + // backup/themes directory + RArray files; + CleanupClosePushL( files ); + hspsServerUtil::FindFilesL( + KBackupThemesDirectoryC, + KConfFile, + files ); + + // Get application configuration ODT's + TInt err( KErrNone ); + CArrayPtrSeg* odts = + new ( ELeave )CArrayPtrSeg( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( ResetAndDestroyChspsODTArray, odts ) ); + + for ( TInt i = 0; i < files.Count(); i++ ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::RestoreApplicationConfigurationsL(): - Read application configuration ODT: %S" ), &files[ i ] ); +#endif + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + TRAP( err, iDefinitionRepository->GetOdtL( files[ i ], *odt ) ); + if ( err == KErrNone ) + { + // Add ODT to ODT list + odts->AppendL( odt ); + CleanupStack::Pop( odt ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::RestoreApplicationConfigurationsL(): - Application configuration ODT reading faild: %S" ), &files[ i ] ); +#endif + CleanupStack::PopAndDestroy( odt ); + } + } + + // Validate application configurations + for ( TInt i = 0; i < odts->Count(); i++ ) + { + ChspsODT* odt = odts->At( i ); +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::RestoreApplicationConfigurationsL(): - Validate applicartion configuration: %S" ), &odt->ThemeFullName() ); +#endif + TRAP( err, ValidateRestoredConfigurationL( *odt ) ); + if ( err == KErrNone ) + { + // Restore application configuration + RestoreConfigurationL( *odt ); + } + else + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::RestoreApplicationConfigurationsL(): - Validation failed: %S" ), &odt->ThemeFullName() ); +#endif + } + } + + CleanupStack::PopAndDestroy( odts ); + CleanupStack::PopAndDestroy( &files ); + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ValidateRestoredConfigurationL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::ValidateRestoredConfigurationL( + ChspsODT& aOdt ) + { + + // Validate application configuration + TBuf8<10> appConfUid; + _LIT8( KFormat8, "%X" ); + _LIT8( KHexPrefix, "0x" ); + appConfUid.Append( KHexPrefix ); + appConfUid.AppendFormat( KFormat8, aOdt.ThemeUid() ); + TPtrC8 appConfState; + hspsServerUtil::GetAttributeValueL( + aOdt, + KConfigurationElement, + KConfigurationAttrUid, + appConfUid, + KConfigurationAttrState, + appConfState ); + + if ( appConfState.Compare( KConfStateError ) == 0 ) + { + // Invalid application configuration + User::Leave( KErrGeneral ); + } + + // Check application configuration version + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetThemeUid( aOdt.ThemeUid() ); + ChspsODT* header( NULL ); + TInt pos( 0 ); + GetConfigurationHeader( *searchMask, header, pos ); + if ( !header ) + { + User::Leave( KErrNotFound ); + } + else + { + hspsServerUtil::CheckConfigurationVersionL( + aOdt, + aOdt.ThemeUid(), + header->ThemeVersion() ); + } + CleanupStack::PopAndDestroy( searchMask ); + + // Validate included plugins + // Get configuration UIDs from restored configuration + RArray uids; + CleanupClosePushL( uids ); + hspsServerUtil::FindUniquePluginsL( + aOdt, + uids ); + + for ( TInt i = 0; i < uids.Count(); i++ ) + { + // Check if the configuration is installed + TInt err( KErrNone ); + ChspsODT* searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetThemeUid( uids[ i ] ); + ChspsODT* header( NULL ); + TInt pos( 0 ); + GetConfigurationHeader( *searchMask, header, pos ); + if ( !header ) // Configuration not found + { + err = KErrNotFound; + } + else // Configuration found + { + // Check the configuration version + TPtrC8 version; + TRAP( err, hspsServerUtil::CheckConfigurationVersionL( + aOdt, + uids[ i ], + header->ThemeVersion() ) ); + if ( err == KErrNone ) + { + // Check that configuration resource files are found + TRAP( err, hspsServerUtil::CheckResourceFilesL( + aOdt, + uids[ i ] ) ); + } + } + + // Check configuration state attribute + // Configuration UID as HEX string + // 10 -> TInt as 0xXXXXXXXX string + TBuf8<10> confUid; + _LIT8( KFormat8, "%X" ); + _LIT8( KHexPrefix, "0x" ); + confUid.Append( KHexPrefix ); + confUid.AppendFormat( KFormat8, uids[ i ] ); + TPtrC8 state; + hspsServerUtil::GetAttributeValueL( + aOdt, + KConfigurationElement, + KConfigurationAttrUid, + confUid, + KConfigurationAttrState, + state ); + + if ( err != KErrNone ) + { + // Invalid configuration + state.Set( KConfStateError ); + } + else if ( state.CompareF( KConfStateError ) != 0 ) + { + state.Set( KConfStateNotConfirmed ); + } + hspsServerUtil::SetAttributeValueL( + aOdt, + KConfigurationElement, + KConfigurationAttrUid, + confUid, + KConfigurationAttrState, + state ); + + CleanupStack::PopAndDestroy( searchMask ); + } + + CleanupStack::PopAndDestroy( &uids ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::RestoreConfigurationL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::RestoreConfigurationL( + ChspsODT& aOdt ) + { + + if ( iDefinitionRepository->Locked() ) + { + User::Leave( KErrServerBusy ); + } + iDefinitionRepository->Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, iDefinitionRepository ) ); + + iDefinitionRepository->SetOdtL( aOdt ); + // repository is unlocked in UnlockRepository function during PopAndDestroy + CleanupStack::PopAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::ActivateThemeL() +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::ActivateThemeL( + const ChspsODT& aSetMask, + ChspsODT& aOdt ) + { + TInt errorCode = GetConfigurationL( + aSetMask.RootUid(), + aSetMask.ThemeUid(), + aOdt ); + if ( aOdt.ConfigurationType() != EhspsAppConfiguration ) + { + errorCode = KErrArgument; + } + + if( !errorCode ) + { + const TUint32 KMask = 0xFFFFFFFF; + RArray res; + CleanupClosePushL( res ); + + iCentralRepository->FindL( aSetMask.RootUid(), KMask, res ); + if ( res.Count() == 0 ) + { + errorCode = iCentralRepository->Create( aSetMask.RootUid(), aSetMask.ThemeUid() ); + } + else + { + errorCode = iCentralRepository->Set( aSetMask.RootUid(), aSetMask.ThemeUid() ); + } + if ( !errorCode ) + { + // Request re-evaluation of the new application configuration + hspsServerUtil::UpdateAppConfigurationStateL( + aOdt, + KConfStateConfirmed, + KConfStateNotConfirmed ); + + // Store changes to the Plug-in Repository + iDefinitionRepository->SetOdtL( aOdt ); + } + + res.Close(); + CleanupStack::PopAndDestroy(); // res + } + + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetActivateAppConfigurationL() +// ----------------------------------------------------------------------------- +// +TInt ChspsThemeServer::GetActivateAppConfigurationL( + const TInt aAppUid, + ChspsODT& aOdt ) + { + // Get active application configuration for the provided application + TInt configurationUid = -1; + TInt errorCode = iCentralRepository->Get( + aAppUid, + configurationUid ); + if ( !errorCode ) + { + __ASSERT_DEBUG( configurationUid > 0, User::Leave( KErrArgument) ); + + // Get the ODT object + errorCode = GetConfigurationL( + aAppUid, + configurationUid, + aOdt ); + + __ASSERT_DEBUG( aOdt.ConfigurationType() == EhspsAppConfiguration, User::Leave( KErrArgument) ); + } + + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::GetActiveFamilyL() +// ----------------------------------------------------------------------------- +// +TUint32 ChspsThemeServer::GetActiveFamilyL( + const TInt aAppUid ) + { + if ( aAppUid < 1 ) + { + User::Leave( KErrArgument ); + } + TUint32 familyMask( 0 ); + ChspsODT* appODT = ChspsODT::NewL(); + CleanupStack::PushL( appODT ); + if ( !GetActivateAppConfigurationL( aAppUid, *appODT ) ) + { + familyMask = appODT->Family(); + } + CleanupStack::PopAndDestroy( appODT ); + return familyMask; + } + +#if defined(WINSCW) || defined(__WINS__) +void ChspsThemeServer::ActivateRootConfigurationsL() + { + // Get family from the active resolution + const ThspsFamily family = iFamilyListener->GetFamilyType(); + + // Try to activate an application configuration which was designed + // for the active resolution + if ( !HandleFamilyChangeL( family ) ) + { + // Try default family or just use the last one installed + HandleFamilyChangeL( KDefaultFamily ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServer::HandleFamilyChangeL() +// ----------------------------------------------------------------------------- +// +TBool ChspsThemeServer::HandleFamilyChangeL( + const ThspsFamily aNewFamily ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleFamilyChangeL(): resolution has changed, notifying clients..." ) ); +#endif // HSPS_LOG_ACTIVE + + __ASSERT_DEBUG( aNewFamily > EhspsFamilyUnknown && aNewFamily <= EhspsFamilyVga_tch, User::Leave( KErrArgument) ); + + RArray notificationTargets; + CleanupClosePushL( notificationTargets ); + + if ( iDefinitionRepository->Locked() ) + { + User::Leave( KErrAccessDenied ); + } + // In case of error. repository is unlocked + iDefinitionRepository->Lock(); + CleanupStack::PushL( TCleanupItem( UnlockRepository, iDefinitionRepository ) ); + + // Find first application configurations with the provided family id + ChspsODT* header = NULL; + ChspsODT* targetHeader = NULL; + for ( TInt headerIndex=0; headerIndex < iHeaderListCache->Count(); headerIndex++ ) + { + header = iHeaderListCache->At( headerIndex ); + + // It's totally acceptable that all clients haven't got resolution specific widgets, + // in that case the UI should remaing the same - others should reload the application configuration + // when appropriate for them + if ( header->ConfigurationType() == EhspsAppConfiguration ) + { + + // If the bit is set + if ( header->Family() & aNewFamily ) + { + + // Skip family change if it's already up to date + TInt activeConfigurationUid = -1; + User::LeaveIfError( + iCentralRepository->Get( + header->RootUid(), + activeConfigurationUid ) + ); + + // Notify each client only once + TBool alreadyIncluded = EFalse; + for( TInt targetIndex=0; targetIndex < notificationTargets.Count(); targetIndex++ ) + { + targetHeader = notificationTargets[ targetIndex ]; + if ( header->RootUid() == targetHeader->RootUid() ) + { + alreadyIncluded = ETrue; + break; + } + } + if ( !alreadyIncluded ) + { + notificationTargets.Append( header ); + + TBool updateRequired = ( activeConfigurationUid != header->ThemeUid() ); + if ( updateRequired ) + { + // Activate the resolution specific theme + ChspsODT* newOdt = ChspsODT::NewL(); + CleanupStack::PushL( newOdt ); + ActivateThemeL( *header, *newOdt ); + CleanupStack::PopAndDestroy( newOdt ); +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( + _L( "ChspsThemeServer::HandleFamilyChangeL(): application configuration %D has been activated" ), + header->ThemeUid() + ); +#endif // HSPS_LOG_ACTIVE + } + } // updateRequired + + } // header type + + } + + } // headers loop + + iDefinitionRepository->Unlock(); + CleanupStack::Pop(iDefinitionRepository); + + // Signal that we found an application configuration for the requested family + TBool activated = ( notificationTargets.Count() > 0 ); + + // Reloading notifications are sent from void ChspsClientRequestHandler::HandleCenRepChangeL() + notificationTargets.Close(); + CleanupStack::PopAndDestroy( ¬ificationTargets ); + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServer::HandleFamilyChangeL(): notifications sent" ) ); +#endif // HSPS_LOG_ACTIVE + + return activated; + } + +#endif // defined(WINSCW) + +// end of file + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,988 @@ +/* +* 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: HSPS Theme Server Session. For more information, see the header. +* +*/ + + +// INCLUDE FILES +#include + +#include "hsps_builds_cfg.hrh" +#ifdef _hsps_PERFORMANCE_TEST_ +#include "hspstimemon.h" +#endif //_hsps_PERFORMANCE_TEST_ +#include "hspsthemeserversession.h" +#include "hspsthemeserver.h" +#include "hspsinstallationhandler.h" +#include "hspsmaintenancehandler.h" +#include "hspsclientrequesthandler.h" +#include "hspsserverutil.h" +#include "hspsrominstaller.h" +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +// CONSTANTS + +// +// +// Class ChspsThemeServerSession +// +// + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ChspsThemeServerSession +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +ChspsThemeServerSession::ChspsThemeServerSession( + const TInt aAppUid ) + { + iAppUid = aAppUid; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ChspsThemeServerSession +// 2nd phase construct for sessions - called by the CServer framework +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CreateL() + { +#ifdef HSPS_LOG_ACTIVE + iLogBus = ChspsLogBusFile::NewL( ChspsLogBusFile::CreateLogFilename( _L("themeserver_session") ) ); + iLogBus->LogText( _L( "ChspsThemeServerSession::CreateL" ) ); + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); +#endif + + Server().AddSession(); + iHoldingResources = EFalse; + User::LeaveIfError( iFs.Connect() ); + Server().CheckConfigurationL( iAppUid ); + } + +// Destructor +ChspsThemeServerSession::~ChspsThemeServerSession() + { + iFs.Close(); + + if ( iInstallationHandler ) + { + delete iInstallationHandler; + Server().DefinitionRepository().Unlock(); + } + + delete iMaintenanceHandler; + // decrease number of resource holders if this sessions did hold one + if ( iHoldingResources ) + { + Server().DecreaseRequestClientCount(); + } + delete iClientRequestHandler; + + Server().DropSession(); + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsThemeServerSession::~ChspsThemeServerSession" ) ); + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); + } + // Delete as last if another components use this log bus instance. + delete iLogBus; + iLogBus = NULL; +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::Server +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +inline ChspsThemeServer& ChspsThemeServerSession::Server() + { + return *static_cast(const_cast(CSession2::Server())); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ServiceL +// Handle a client request. +// Leaving is handled by ChspsThemeServerSession::ServiceError() which reports +// the error code to the client +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::ServiceL( const RMessage2& aMessage ) + { + TRAPD( errorCode, DoServiceL( aMessage ) ); + if ( errorCode && !aMessage.IsNull() ) + { + aMessage.Complete( EhspsServiceRequestError ); +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ServiceL: - error in calling function %d." ), aMessage.Function() ); +#endif + } + +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ServiceL completed with code: %d" ), errorCode ); + iLogBus->LogText( _L( "--------------------------------------------------------" ) ); +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::DoServiceL +// ----------------------------------------------------------------------------- +void ChspsThemeServerSession::DoServiceL( const RMessage2& aMessage ) + { + switch ( aMessage.Function() ) + { + // installation: + case EhspsInstallTheme: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsInstallTheme" ) ); +#endif + InstallThemeL( aMessage ); + break; + } + + case EhspsInstallNextPhase: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsInstallNextPhase" ) ); +#endif + InstallNextPhaseL( aMessage ); + break; + } + + case EhspsCancelInstallTheme: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsCancelInstallTheme" ) ); +#endif + CancelInstallThemeL( aMessage ); + break; + } + + case EhspsReinstallConf: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsReinstallConf" ) ); +#endif + ReinstallConfL( aMessage ); + break; + } + + // maintenance + case EhspsGetListHeaders: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsGetListHeaders" ) ); +#endif + GetListHeadersL( aMessage ); + break; + } + + case EhspsGetNextHeader: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsGetNextHeader" ) ); +#endif + GetNextHeaderL( aMessage ); + break; + } + + case EhspsCancelGetListHeaders: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsCancelGetListHeaders" ) ); +#endif + CancelGetListHeadersL( aMessage ); + break; + } + + case EhspsSetActiveTheme: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsSetActiveTheme" ) ); +#endif + SetActiveThemeL( aMessage ); + break; + } + + case EhspsRestoreDefault: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsRestoreDefault" ) ); +#endif + RestoreDefaultL( aMessage ); + break; + } + + case EhspsRemoveTheme: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsRemoveTheme" ) ); +#endif + RemoveThemeL( aMessage ); + break; + } + + // client request + case EhspsGetODT: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsGetODT" ) ); +#endif + GetOdtL( aMessage ); + break; + } + + case EhspsGetODTUpdate: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsGetODTUpdate" ) ); +#endif + GetOdtUpdateL( aMessage ); + break; + } + + case EhspsCancelGetODTUpdate: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsCancelGetODTUpdate" ) ); +#endif + CancelGetOdtUpdateL( aMessage ); + break; + } + + case EhspsAccessResourceFile: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsAccessResourceFile" ) ); +#endif + AccessResourceFileL( aMessage ); + break; + } + + case EhspsCopyResources: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsCopyResources" ) ); +#endif + CopyResourceFilesL( aMessage ); + break; + } + case EhspsAddPlugin: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsAddPlugin" ) ); +#endif + AddPluginL( aMessage ); + break; + } + case EhspsRemovePlugin: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsRemovePlugin" ) ); +#endif + RemovePluginL( aMessage ); + break; + } + case EhspsSetActivePlugin: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsSetActivePlugin" ) ); +#endif + SetActivePluginL( aMessage ); + break; + } + case EhspsReplacePlugin: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsReplacePlugin" ) ); +#endif + ReplacePluginL( aMessage ); + break; + } + case EhspsSetPluginSettings: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsSetPluginSettings" ) ); +#endif + SetPluginSettingsL( aMessage ); + break; + } + case EhspsGetPluginOdt: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsGetPluginOdt" ) ); +#endif + GetPluginOdtL( aMessage ); + break; + } + case EhspsMovePlugins: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsMovePlugins" ) ); +#endif + MovePluginsL( aMessage ); + break; + } + case EhspsSetConfState: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsSetConfState" ) ); +#endif + SetConfStateL( aMessage ); + break; + } + case EhspsRestoreActiveAppConf: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: EhspsRestoreActiveAppConf" ) ); +#endif + RestoreActiveAppConfL( aMessage ); + break; + } + default: + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "DoServiceL: - unrecognized function %d called." ), aMessage.Function() ); +#endif + User::Leave( KErrNotSupported ); + break; + } + + } // switch + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ServiceError +// Handle an error from ChspsThemeServerSession::ServiceL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::ServiceError(const RMessage2& aMessage,TInt aError) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "hspsThemeServer: ChspsThemeServerSession::ServiceError(): %d" ), aError ); +#endif + + CSession2::ServiceError(aMessage,aError); + } + +// Installation +// ************ +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::InstallThemeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::InstallThemeL(const RMessage2& aMessage) + { + // delete previous handler and create new one for this installation + if ( iInstallationHandler ) + { + delete iInstallationHandler; + iInstallationHandler = NULL; + } + iInstallationHandler = ChspsInstallationHandler::NewL( Server() ); + +#ifdef HSPS_LOG_ACTIVE + // set logging bus. + iInstallationHandler->SetLogBus( iLogBus ); +#endif + + // call the service + iInstallationHandler->ServiceInstallThemeL(aMessage); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::InstallNextPhaseL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::InstallNextPhaseL(const RMessage2& aMessage) + { + // make an asynchronous request + if (!iInstallationHandler) + { + User::Leave( KErrNotReady ); + } + else + { + // call the service + iInstallationHandler->ServiceInstallNextPhaseL( aMessage ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CancelInstallTheme +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CancelInstallThemeL(const RMessage2& aMessage) + { + if ( iInstallationHandler ) + { + // wait until service has finalised itself + ThspsServiceCompletedMessage ret = iInstallationHandler->hspsCancelInstallTheme(); + // clean up the service + delete iInstallationHandler; + iInstallationHandler = NULL; + if ( !aMessage.IsNull() ) + { + aMessage.Complete( ret ); + } + } + else + { + User::Leave( KErrNotReady ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ReinstallConf +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::ReinstallConfL( const RMessage2& aMessage ) + { + + ThspsParamReinstallConf params; + TPckg packagedStruct( params ); + aMessage.ReadL( 1, packagedStruct ); + + Server().ReinstallConfL( params.appUid, params.confUId ); + + aMessage.Complete( EhspsReinstallConfSuccess ); + + } + + +// Maintenance +// *********** +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::GetListHeadersL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::GetListHeadersL(const RMessage2& aMessage) + { + // Exception: should be reset since previous instance might be pending + if ( iMaintenanceHandler ) + { + delete iMaintenanceHandler; + iMaintenanceHandler = NULL; + } + + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceGetListHeadersL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::GetNextHeaderL +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::GetNextHeaderL(const RMessage2& aMessage) + { + if ( !iMaintenanceHandler ) + { + User::Leave( KErrNotReady ); + } + else + { + iMaintenanceHandler->ServiceGetNextHeaderL(aMessage); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CancelGetListHeaders +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CancelGetListHeadersL(const RMessage2& aMessage) + { + if ( iMaintenanceHandler ) + { + ThspsServiceCompletedMessage ret = iMaintenanceHandler->hspsCancelGetListHeaders(); + delete iMaintenanceHandler; + iMaintenanceHandler = NULL; + if ( !aMessage.IsNull() ) + { + aMessage.Complete( EhspsServiceRequestCanceled ); + } + } + else + { + User::Leave( KErrNotReady ); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetActiveThemeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetActiveThemeL(const RMessage2& aMessage) + { + // make a synchronous request + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceSetActiveThemeL(aMessage); + } + + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::RestoreDefaultL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::RestoreDefaultL(const RMessage2& aMessage) + { + // make a synchronous request + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceRestoreDefaultL(aMessage); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::RemoveThemeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::RemoveThemeL(const RMessage2& aMessage) + { + // make a synchronous request + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceRemoveThemeL(aMessage); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::AddPluginL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::AddPluginL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceAddPluginL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::RemovePluginL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::RemovePluginL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceRemovePluginL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetActivePluginL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetActivePluginL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceSetActivePluginL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::ReplacePluginL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::ReplacePluginL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceReplacePluginL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetPluginSettingsL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetPluginSettingsL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceSetPluginSettingsL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::GetPluginOdtL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::GetPluginOdtL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceGetPluginOdtL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::MovePluginsL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::MovePluginsL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceMovePluginsL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::SetConfStateL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::SetConfStateL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceSetConfStateL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::RestoreActiveAppConfL +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::RestoreActiveAppConfL(const RMessage2& aMessage) + { + CreateMaintenanceHandlerL( aMessage.SecureId().iId ); + iMaintenanceHandler->ServiceRestoreActiveAppConfL( aMessage ); + } + +// Client Request +// ************** +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::GetOdtL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::GetOdtL(const RMessage2& aMessage) + { + //Make an asynchronous request + CreateClientRequestHandlerL(); + iClientRequestHandler->ServiceGetOdtL( aMessage ); + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::GetOdtUpdateL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::GetOdtUpdateL(const RMessage2& aMessage) + { + // make an asynchronous request + if (!iClientRequestHandler) + { + User::Leave( KErrNotReady ); + } + else + { + iClientRequestHandler->ServiceGetOdtUpdateL(aMessage); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CancelGetOdtUpdate +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CancelGetOdtUpdateL(const RMessage2& aMessage) + { + if ( iClientRequestHandler ) + { + ThspsServiceCompletedMessage ret = iClientRequestHandler->hspsCancelGetODTUpdate(); + if ( !aMessage.IsNull() ) + { + aMessage.Complete( EhspsServiceRequestCanceled ); + } + } + else + { + User::Leave( KErrNotReady ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::AccessResourceFileL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::AccessResourceFileL(const RMessage2& aMessage) + { + //Make a synchronous request + CreateClientRequestHandlerL(); + +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("hspsThemeServer::AccessResourceFileL(): - accessing..") ); +#endif //_hsps_PERFORMANCE_TEST_ + + // call the service with TRAP + iClientRequestHandler->ServiceAccessResourceFileL( aMessage ); + if ( !iHoldingResources ) + { + iHoldingResources = ETrue; + // add number of resource holders + Server().IncreaseRequestClientCount(); + } + +#ifdef _hsps_PERFORMANCE_TEST_ + ChspsTimeMon::PrintUserMem( _L("hspsThemeServer::AccessResourceFileL(): - file accessed.") ); +#endif //_hsps_PERFORMANCE_TEST_ + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::FindWidgetUids +// ----------------------------------------------------------------------------- +void ChspsThemeServerSession::FindWidgetUidsL( + ChspsODT& aAppODT, + RArray& aUidArray ) + { + aUidArray.Reset(); + const TInt resourceCount = aAppODT.ResourceCount(); + for( TInt resourceIndex = 0; resourceIndex < resourceCount; resourceIndex++ ) + { + ChspsResource& r = aAppODT.ResourceL( resourceIndex ); + const TInt uid = r.ConfigurationUid(); + if ( uid > 0 && + aUidArray.Find( uid ) == KErrNotFound ) + { + aUidArray.Append( uid ); + } + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::DoCopyResourceFilesL +// ----------------------------------------------------------------------------- +TInt ChspsThemeServerSession::DoCopyResourceFilesL( + ChspsODT& aAppODT, + CFileMan& aFilemanager, + const TInt aConfUid, + const TDesC& aDestination ) + { + TInt error( KErrNone ); + RPointerArray widgetResources; // Objects are not owned. + CleanupClosePushL( widgetResources ); + + // Get resources that need to be copied. + hspsServerUtil::GetValidResourcesL( aAppODT, + aConfUid, + Server().DeviceLanguage(), + widgetResources ); + + // Copy the resources found + for( TInt i = 0; ( i < widgetResources.Count() && !error ); i++ ) + { + ChspsResource* resource = widgetResources[i]; + if( !resource ) + { + continue; + } + + // Get relative path under the themes folder + TPath relativePath; + hspsServerUtil::GetRelativeResourcePath( + resource->FileName(), + relativePath ); + + // Strip language indicator from the relative path + hspsServerUtil::GetLocaleIndependentResourcePath( + resource->Language(), + relativePath ); + + // Finalize target path + TPath targetPath; + targetPath.Copy( aDestination ); + targetPath.Append( relativePath ); + + // Create missing target path and copy files when needed only + error = hspsServerUtil::CopyResourceFileL( + iFs, + aFilemanager, + targetPath, + resource->FileName() ); + if ( !error ) + { +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( + _L( "hspsServerUtil::DoCopyResourceFilesL(): - %S was copied" ), + &targetPath + ); + } +#endif + } + if ( error == KErrAlreadyExists ) + { + error = KErrNone; + } + + } // copy loop + + widgetResources.Reset(); + CleanupStack::PopAndDestroy( 1, &widgetResources ); + + return error; + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CopyResourceFilesL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CopyResourceFilesL(const RMessage2& aMessage) + { + // read paths from the buffer + TFileName odtPath; + TPath destinationPath; // Private root folder of the client application + aMessage.ReadL( 1, odtPath, 0 ); + aMessage.ReadL( 2, destinationPath, 0 ); + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + + // phase counter for cleaning and debug prints + TInt phaseCounter = 1; + + RFile odtfile; + CleanupClosePushL( odtfile ); + TInt error = odtfile.Open( iFs, odtPath, EFileRead ); + if( error == KErrNone ) + { + phaseCounter++; + + // set stream on file + CFileStore* store = CDirectFileStore::FromLC( odtfile ); + RStoreReadStream instream; + CleanupClosePushL( instream ); + instream.OpenLC( *store, store->Root() ); + + // stream in the ODT + instream >> *odt; + + // the file is no longer needed + odtfile.Close(); + + // destroy the stream object and close the instream + CleanupStack::PopAndDestroy(3); // instream,store + } + + CleanupStack::PopAndDestroy(1, &odtfile); // odtfile + + if( error == KErrNone ) + { + phaseCounter++; + + RArray widgetArray; + CleanupClosePushL( widgetArray ); + + // Find unique configuration UIDs from the resource array + FindWidgetUidsL( *odt, widgetArray ); + + CFileMan* fileManager = NULL; + fileManager = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileManager ); + + // Loop widgets belonging to the root configuration + const TInt uidCount = widgetArray.Count(); + for( TInt i = 0; i < uidCount && !error; i++ ) + { + // Copy widget's resources to client's private folder + error = DoCopyResourceFilesL( + *odt, + *fileManager, + widgetArray[i], + destinationPath ); + } + + widgetArray.Reset(); + + CleanupStack::PopAndDestroy( 2, &widgetArray ); // fileManager, widgetArray + } // KErrNone + + //Tidy-up + if ( odt ) + { + CleanupStack::PopAndDestroy( odt ); + } + + if( error ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "ChspsThemeServerSession::CopyResourceFilesL(): - creating target directory failed! ( error : %d in phase: %d)." ), + error, + phaseCounter ); +#endif + + aMessage.Complete( EhspsResourceCopyFailed ); + } + else + { + aMessage.Complete( EhspsResourceCopySuccess ); + } + } +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CreateMaintenanceHandlerL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CreateMaintenanceHandlerL( + const TUint aSecureId ) + { + if( !iMaintenanceHandler ) + { + iMaintenanceHandler = ChspsMaintenanceHandler::NewL( Server(), aSecureId ); + iMaintenanceHandler->SetServerSession( this ); +#ifdef HSPS_LOG_ACTIVE + iMaintenanceHandler->SetLogBus( iLogBus ); +#endif + } + + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::CreateClientRequestHandlerL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void ChspsThemeServerSession::CreateClientRequestHandlerL() + { + if( !iClientRequestHandler ) + { + iClientRequestHandler = ChspsClientRequestHandler::NewL( Server() ); + +#ifdef HSPS_LOG_ACTIVE + iClientRequestHandler->SetLogBus( iLogBus ); +#endif + } + } + +// ----------------------------------------------------------------------------- +// ChspsThemeServerSession::FileSystem +// ----------------------------------------------------------------------------- +// +RFs& ChspsThemeServerSession::FileSystem() + { + return iFs; + } + +// end of file + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/tools/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/tools/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +WINSCW + +#include "../../inc/hsps_builds_cfg.hrh" + +PRJ_MMPFILES +hspsthemeinstallercons.mmp + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,610 @@ +/* +* Copyright (c) 2004,2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "hspsthemeinstallercons.h" +#include +#include +#include +#include "hspsthememanagement.h" +#include +#include +#include + +#include "hspsodt.h" +#include "hspsclient.h" + +_LIT(KDATFileExtension,".dat"); +_LIT(KLogFile,"hspsthemeinstallercons.log"); +_LIT(KLogFolder,"hspsthemeinstallercons"); +_LIT(KLogFilePath,"c:\\logs\\hspsthemeinstallercons\\hspsthemeinstallercons.log"); +_LIT(KThemeSourcePath,"c:\\data\\installs\\test\\"); +_LIT(KDefaultInput, "install.dat"); + +#define _WRITELOG(aDescription) RFileLogger::Write( KLogFolder,KLogFile,EFileLoggingModeOverwrite, aDescription ); +#define _WRITE_ERRORLOG(aErrCode) WriteErrorLog(aErrCode); + + + +class CThemeInstaller:public CBase, public MhspsThemeManagementServiceObserver + { + public: + ~CThemeInstaller(); + static CThemeInstaller* NewL(TInt aAppUid); + static CThemeInstaller* NewLC(TInt aAppUid); + void StartL(); + + private: + void InstallThemeL(const TDesC& aManifestFileName); + void InstallFilesL(CDesCArraySeg& aManifestFile); + void GetFilesL(RFs& aFs, CDesCArraySeg& aFileList, const TDesC& aDirectory); + void DeleteDirL(RFs& aFs, const TDesC& aDir); + void HandlehspsClientMessage(ThspsServiceCompletedMessage aMessage); + void ConstructL(TInt aAppUid); + void GetDirectoriesL( + RFs& aFs, + TPtrC aPath, + TPtrC aPluginsFile, + CDesCArrayFlat& aDirectoryList ); + void InstallFilesFromL( + RFs& aFs, + TPtrC aDirectory ); + private: + TBuf8 iHeaderData; + TRequestStatus iStatus; + ChspsClient *ihspsClient; + ChspsResult* iResult; + TInt iConvertedResourceCount; + ChspsODT* iHeader; + TInt iListCount; + CDesCArraySeg* iThemeList; + TInt iAppUid; + }; + +CThemeInstaller* themeinstaller; +CActiveScheduler* scheduler; + + + + + +// ----------------------------------------------------------------------------- +// E32Main +// ----------------------------------------------------------------------------- +// +GLDEF_C TInt E32Main() // main function called by E32 + { + CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack + TRAPD( error, startupL() ); // more initialization, then do example + + delete scheduler; + delete themeinstaller; + delete cleanup; // destroy clean-up stack + + // Forward errors to be catched with ERRORLEVEL method in batch files + return error; // and return + } + +// ----------------------------------------------------------------------------- +// WriteErrorLog +// +// Writes error to log +// ----------------------------------------------------------------------------- +// +void WriteErrorLog(TInt error) + { + if (error == ENoFilesNotFound) + { + _WRITELOG( _L("ERROR::Theme files not found") ); + } + else if (error == EErrorDeletingDir) + { + _WRITELOG( _L("ERROR::Could not delete themes") ); + } + else if (error == EErrorDirNotExists) + { + _WRITELOG( _L("ERROR::Source directory does not exist") ); + } + else + { + _WRITELOG( _L("ERROR::Unknown error") ); + } + } + + +// ----------------------------------------------------------------------------- +// startup +// +// +// ----------------------------------------------------------------------------- +// +void startupL() + { + TInt errorCode = KErrNone; + + // Start active scheduler + scheduler = new ( ELeave ) CActiveScheduler; + CleanupStack::PushL( scheduler ); + CActiveScheduler::Install( scheduler ); + + TUid appuid = KUidhspsThemeInstallerCons; + themeinstaller = CThemeInstaller::NewL( appuid.iUid ); + CleanupStack::PushL( themeinstaller ); + + TRAP( errorCode, themeinstaller->StartL() ); + + _WRITELOG( _L("") ); + + if( errorCode ) + { + _WRITE_ERRORLOG( errorCode ); + _WRITELOG( _L("Failed to start an installation!") ); + } + + _WRITELOG( _L("Installer done") ); + + CleanupStack::Pop( themeinstaller ); + CleanupStack::Pop( scheduler ); + + User::LeaveIfError( errorCode ); + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::NewL() +// +// +// ----------------------------------------------------------------------------- +// +CThemeInstaller* CThemeInstaller::NewL( TInt aAppUid ) + { + CThemeInstaller* self = NewLC( aAppUid ); + CleanupStack::Pop( self ); + return( self ); + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::NewLC() +// +// +// ----------------------------------------------------------------------------- +// +CThemeInstaller* CThemeInstaller::NewLC( TInt aAppUid ) + { + CThemeInstaller* self = new ( ELeave ) CThemeInstaller(); + CleanupStack::PushL( self ); + self->ConstructL( aAppUid ); + return self; + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::ConstructL() +// +// +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::ConstructL( TInt aAppUid ) + { + iResult = ChspsResult::NewL(); + ihspsClient = ChspsClient::NewL( *this ); + iHeader = NULL; + iListCount = 0; + iConvertedResourceCount = 0; + iAppUid = aAppUid; + iThemeList = NULL; + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::~CThemeInstaller() +// +// +// ----------------------------------------------------------------------------- +// +CThemeInstaller:: ~CThemeInstaller() + { + delete ihspsClient; + delete iResult; + delete iHeader; + delete iThemeList; + } + +// ----------------------------------------------------------------------------- +// Gets program arguments and starts the installer +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::StartL() + { + // Init + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + // Set logging + fs.MkDirAll( KLogFilePath ); + _WRITELOG(_L("Starting installer")); + + // Check arguments + CCommandLineArguments* args = CCommandLineArguments::NewLC(); + TInt argsCount = args->Count(); + TPtrC inputFile; + const TInt firstArgIndex = 2; + if ( argsCount < firstArgIndex ) + { + _WRITELOG(_L("Missing an argument!")); +// User::LeaveIfError( KErrArgument ); + inputFile.Set( KDefaultInput ); + } + else + { + inputFile.Set( args->Arg(1) ); + } + + // Setup an array for directory names + const TInt KGranularity = 10; + CDesCArrayFlat* directoryList = new ( ELeave ) CDesCArrayFlat( KGranularity ); + CleanupStack::PushL( directoryList ); + + // Get directory names + GetDirectoriesL( fs, KThemeSourcePath().Ptr(), inputFile, *directoryList ); + + // Install manifest files from the directories + TInt count = directoryList->MdcaCount(); + for( TInt i=0; iMdcaPoint(i) ); + InstallFilesFromL( fs, dirPtr ); + } + + CleanupStack::PopAndDestroy( 3, &fs ); // directoryList, args, Fs + } + +// ----------------------------------------------------------------------------- +// Installs a new configuration from the provided manifest file. +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::InstallFilesFromL( + RFs& aFs, + TPtrC aDirectory ) + { + TInt errorCode = EErrorDirNotExists; + + // Check if the dir exists + BaflUtils baf; + if( baf.PathExists( aFs, aDirectory ) ) + { + errorCode = KErrNone; + + // Setup an array for manifests (member variable) + if ( iThemeList ) + { + delete iThemeList; + iThemeList = NULL; + } + iThemeList = new( ELeave ) CDesCArraySeg( KArrGranularity ); + + // Get manifests located at the directory + GetFilesL( aFs, *iThemeList, aDirectory ); + if( iThemeList->Count() > 0 ) + { + // Install first manifest + InstallThemeL( iThemeList->MdcaPoint( 0 ) ); + + // Handle asynch messages + scheduler->Start(); + } + else + { + errorCode = ENoFilesNotFound; + } + } + + User::LeaveIfError( errorCode ); + } + +// ----------------------------------------------------------------------------- +// Reads directory names from the input file and appends names into the provided array +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::GetDirectoriesL( + RFs& aFs, + TPtrC aPath, + TPtrC aPluginsFile, + CDesCArrayFlat& aDirectoryList ) + { + TFileName directoryFile; + directoryFile.Copy( aPath ); + directoryFile.Append( aPluginsFile ); + + // Convert into a 8-bit descriptor + _LIT8(KLogPrefix, "Reading directory names from the " ); + _LIT8(KLogSuffix, " file.." ); + const TInt lineLength = KLogPrefix().Length() + directoryFile.Length() + KLogSuffix().Length(); + HBufC8* line = HBufC8::NewLC(lineLength ); + TPtr8 linePtr( line->Des() ); + linePtr.Append( KLogPrefix ); + linePtr.Append( directoryFile ); + linePtr.Append( KLogSuffix ); + _WRITELOG( linePtr ); + CleanupStack::PopAndDestroy( line ); + line = NULL; + + // Check if the f exists + BaflUtils baf; + if( !baf.FileExists( aFs, directoryFile ) ) + { + _WRITELOG(_L("File not found!")); + User::LeaveIfError( KErrNotFound ); + } + + // Open a file handle + RFile file; + User::LeaveIfError( file.Open(aFs, directoryFile, EFileRead|EFileShareReadersOnly) ); + CleanupClosePushL(file); + + // Get size of the file + TInt fileSize; + User::LeaveIfError( file.Size(fileSize) ); + + // Get file content + HBufC8* buf8 = HBufC8::NewLC( fileSize ); + TPtr8 ptr8( buf8->Des() ); + User::LeaveIfError( file.Read(ptr8) ); + + // Convert from a 8bit to 16bit descriptor + HBufC16* buf16 = HBufC16::NewLC( ptr8.MaxLength() ); + TPtr16 ptr16 = buf16->Des(); + ptr16.Copy( ptr8 ); + + // Parse directories from the string + TInt offset = 0; + _LIT(KLineSeperator, "\r\n"); + _LIT(KDirectorySuffix, "\\"); + do + { + offset = ptr16.Find( KLineSeperator ); + TPtrC ptr; + if ( offset < 1 ) + { + ptr.Set( ptr16 ); + } + else + { + ptr.Set( ptr16.Left( offset ) ); + } + if ( ptr.Length() ) + { + HBufC* nameBuf = HBufC::NewLC( aPath.Length() + ptr.Length() + KDirectorySuffix().Length() ); + TPtr fullPtr( nameBuf->Des() ); + fullPtr.Copy( aPath ); + fullPtr.Append( ptr ); + fullPtr.Append( KDirectorySuffix ); + aDirectoryList.AppendL( fullPtr ); + CleanupStack::PopAndDestroy( nameBuf ); + } + if ( offset > 0 ) + { + ptr16 = ptr16.Mid( offset + KLineSeperator().Length() ); + } + } + while ( offset > 0 ); + + // Cleanup + CleanupStack::PopAndDestroy( buf16 ); + CleanupStack::PopAndDestroy( buf8 ); + CleanupStack::PopAndDestroy( ); // file + } + +// ----------------------------------------------------------------------------- +// Deletes theme installation path +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::DeleteDirL( RFs& aFs, const TDesC& aDir ) + { + _WRITELOG( _L("Deleting existing themes") ); + + HBufC* path = HBufC::NewLC( KMaxFileName ); + TPtr pathPtr = path->Des(); + pathPtr.Append( aDir ); + + CFileMan* fileMan = CFileMan::NewL( aFs ); + CleanupStack::PushL( fileMan ); + TInt err = fileMan->RmDir( pathPtr ); + + CleanupStack::PopAndDestroy( fileMan ); + CleanupStack::PopAndDestroy( path ); + + if( err ) + { + _WRITE_ERRORLOG( EErrorDeletingDir ); + } + } + +// ----------------------------------------------------------------------------- +// Searches for theme files from path and adds them to list +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::GetFilesL( RFs& aFs, CDesCArraySeg& aFileList, const TDesC& aDirectory ) + { + CDir* dirList; + User::LeaveIfError( aFs.GetDir( aDirectory, + KEntryAttMaskSupported, ESortByDate, dirList ) ); + + CleanupStack::PushL( dirList ); + + for( TInt i = 0; i < dirList->Count(); i++ ) + { + if ( !( *dirList )[i].IsDir() ) + { + HBufC* path = HBufC::NewLC( aDirectory.Length() + ( *dirList )[i].iName.Length() ); + TPtr pathPtr = path->Des(); + pathPtr.Copy( aDirectory ); + TEntry entry = ( *dirList )[i]; + pathPtr.Append( entry.iName ); + TParse p; + p.Set( pathPtr, NULL, NULL ); + + if ( p.Ext().CompareF( KDATFileExtension ) == 0 ) + { + aFileList.AppendL( pathPtr ); + } + + CleanupStack::PopAndDestroy( path ); + } + } + + CleanupStack::PopAndDestroy( dirList ); + } + +// ----------------------------------------------------------------------------- +// Initiates installing of a confgiruation from the provided manifest file +// ----------------------------------------------------------------------------- +// +void CThemeInstaller::InstallThemeL( const TDesC& aManifestFileName ) + { + + TBuf tmp; + _WRITELOG(_L("")); + tmp.Format( _L("Manifest: %S"), &aManifestFileName ); + _WRITELOG(tmp); + + if ( iHeader ) + { + delete iHeader; + iHeader = NULL; + } + iHeader = ChspsODT::NewL(); + + TParse p; + p.Set( aManifestFileName, NULL, NULL ); + TPtrC ptr = p.NameAndExt(); + + ThspsServiceCompletedMessage ret = ihspsClient->hspsInstallTheme( aManifestFileName, *iHeader ); + + if( ret == EhspsInstallThemeSuccess ) + { + ihspsClient->GethspsResult( *iResult ); + } + else if( ret == EhspsInstallPhaseSuccess ) + { + ihspsClient->GethspsResult( *iResult ); + iConvertedResourceCount = 0; + + tmp.Format( _L("Installing ..") ); + _WRITELOG(tmp); + ihspsClient->hspsInstallNextPhaseL( *iHeader ); + } + else if( ret == EhspsInstallThemeFailed ) + { + ihspsClient->GethspsResult(*iResult); + TBuf tmp2; + TInt syserr = iResult->iSystemError; + TInt hspserr = iResult->iXuikonError; + tmp.Format(_L("Installation of \'%S\' failed. System error: %d, HSPS error: %d."), &ptr, syserr, hspserr ); + _WRITELOG(tmp); + User::Leave( KErrGeneral ); + } + else if( ret == EhspsServiceNotSupported ) + { + _WRITELOG(_L("EhspsServiceNotSupported")); + } + else if( ret == EhspsServiceRequestError ) + { + _WRITELOG(_L("EhspsServiceRequestError")); + } + else if( ret == EhspsServiceRequestCanceled ) + { + _WRITELOG(_L("EhspsServiceRequestCanceled")); + } + else + { + tmp.Format(_L("Undefined response: %d"), ret); + _WRITELOG(tmp); + } + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::HandlehspsClientMessage() +// +// Handles events received from themeserver via hspsClient +// ----------------------------------------------------------------------------- + +void CThemeInstaller::HandlehspsClientMessage(ThspsServiceCompletedMessage aEvent) + { + TInt errorCode = KErrNone; + + TBuf tmp; + ihspsClient->GethspsResult(*iResult); + + if( aEvent == EhspsInstallThemeSuccess ) + { + iListCount++; + + if ( iListCount < iThemeList->MdcaCount() ) + { + TRAP( errorCode, InstallThemeL( iThemeList->MdcaPoint( iListCount ) ) ); + + if( errorCode ) + { + tmp.Format( _L("InstallThemeL() failed...") ); + _WRITELOG( tmp ); + } + } + else + { + scheduler->Stop(); + } + } + else if( aEvent == EhspsInstallPhaseSuccess ) + { + + TBuf tmp; + + if( iResult->iIntValue1 == EhspsPhaseCleanup ) + { + tmp.Format(_L("Removing previous configuration ..")); + } + else if( iResult->iIntValue1 == EhspsPhaseInstallSkeleton ) + { + tmp.Format(_L("Installing a new configuration ..")); + } + else + { + tmp.Format(_L("Processing phase %d .."), iResult->iIntValue1 ); + } + + _WRITELOG(tmp); + + } + else if( aEvent == EhspsInstallThemeFailed ) + { + + TBuf tmp2; + TInt syserr = iResult->iSystemError; + TInt hspserr = iResult->iXuikonError; + TInt defengerr = iResult->iIntValue1; + TInt subcomperr = iResult->iIntValue2; + tmp.Format(_L("Installation of /'%S/' failed. Sys.err: %d, hsps.err: %d, Def.eng.err: %d, subcomp.err: %d."), + &iHeader->ThemeFullName(), syserr, hspserr, defengerr, subcomperr ); + _WRITELOG(tmp); + scheduler->Stop(); + } + else + { + tmp.Format(_L("Unknown event received: %d"), aEvent ); + _WRITELOG(tmp); + } + } + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2004 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 __CommonFramework_H +#define __CommonFramework_H + +#include +#include + +const TUid KUidhspsThemeInstallerCons = { 0x054FDF26 }; +const TInt KArrGranularity = 10; + +void startupL(); + +enum TType +{ + EArgumentsNotDefined= -1, + ENoFilesNotFound = -2, + EErrorDeletingDir = -3, + EErrorDirNotExists = -4 +}; + + + +#endif + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsmanager/tools/hspsthemeinstallercons.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +TARGET hspsthemeinstallercons.exe +TARGETTYPE exe +UID 0x100039CE 0x200159C6 //0x054FDF26 +SECUREID 0x200159C6 + +CAPABILITY ALL -tcb -DRM +MACRO __SYMBIAN32__ + +SOURCEPATH . +SOURCE hspsthemeinstallercons.cpp + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/libc +SYSTEMINCLUDE /epoc32/include/xml + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY eikctl.lib +LIBRARY bafl.lib +LIBRARY commonengine.lib +LIBRARY efsrv.lib +LIBRARY hspsclientsession.lib +LIBRARY hspsclient.lib +LIBRARY hspsodt.lib +LIBRARY hspsresult.lib +LIBRARY fbscli.lib +LIBRARY estor.lib +LIBRARY flogger.lib + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsodt/bwins/hspsodtu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsodt/bwins/hspsodtu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +EXPORTS + ?AddResourceL@ChspsODT@@QAEXPAVChspsResource@@@Z @ 1 NONAME ; void ChspsODT::AddResourceL(class ChspsResource *) + ?CloneL@ChspsODT@@QAEPAV1@XZ @ 2 NONAME ; class ChspsODT * ChspsODT::CloneL(void) + ?ConfigurationType@ChspsODT@@QBEIXZ @ 3 NONAME ; unsigned int ChspsODT::ConfigurationType(void) const + ?CopyDomDocumentL@ChspsODT@@QAEXAAVChspsDomDocument@@@Z @ 4 NONAME ; void ChspsODT::CopyDomDocumentL(class ChspsDomDocument &) + ?DeleteResourceL@ChspsODT@@QAEXH@Z @ 5 NONAME ; void ChspsODT::DeleteResourceL(int) + ?DomDocument@ChspsODT@@QBEAAVChspsDomDocument@@XZ @ 6 NONAME ; class ChspsDomDocument & ChspsODT::DomDocument(void) const + ?ExternalizeHeaderL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 7 NONAME ; void ChspsODT::ExternalizeHeaderL(class RWriteStream &) const + ?ExternalizeL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 8 NONAME ; void ChspsODT::ExternalizeL(class RWriteStream &) const + ?ExternalizeResourceListL@ChspsODT@@QBEXAAVRWriteStream@@@Z @ 9 NONAME ; void ChspsODT::ExternalizeResourceListL(class RWriteStream &) const + ?Flags@ChspsODT@@QBEIXZ @ 10 NONAME ; unsigned int ChspsODT::Flags(void) const + ?InternalizeHeaderL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void ChspsODT::InternalizeHeaderL(class RReadStream &) + ?InternalizeL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void ChspsODT::InternalizeL(class RReadStream &) + ?InternalizeResourceListL@ChspsODT@@QAEXAAVRReadStream@@@Z @ 13 NONAME ; void ChspsODT::InternalizeResourceListL(class RReadStream &) + ?MarshalHeaderL@ChspsODT@@QBEPAVHBufC8@@XZ @ 14 NONAME ; class HBufC8 * ChspsODT::MarshalHeaderL(void) const + ?NewL@ChspsODT@@SAPAV1@XZ @ 15 NONAME ; class ChspsODT * ChspsODT::NewL(void) + ?NewLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 16 NONAME ; class ChspsODT * ChspsODT::NewLC(class TDesC8 const &) + ?OdtLanguage@ChspsODT@@QBEHXZ @ 17 NONAME ; int ChspsODT::OdtLanguage(void) const + ?PackageVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & ChspsODT::PackageVersion(void) const + ?ProviderName@ChspsODT@@QBEABVTDesC16@@XZ @ 19 NONAME ; class TDesC16 const & ChspsODT::ProviderName(void) const + ?ProviderUid@ChspsODT@@QBEHXZ @ 20 NONAME ; int ChspsODT::ProviderUid(void) const + ?ResourceCount@ChspsODT@@QBEHXZ @ 21 NONAME ; int ChspsODT::ResourceCount(void) const + ?ResourceL@ChspsODT@@QBEAAVChspsResource@@H@Z @ 22 NONAME ; class ChspsResource & ChspsODT::ResourceL(int) const + ?RootUid@ChspsODT@@QBEHXZ @ 23 NONAME ; int ChspsODT::RootUid(void) const + ?SetConfigurationType@ChspsODT@@QAEXI@Z @ 24 NONAME ; void ChspsODT::SetConfigurationType(unsigned int) + ?SetFlags@ChspsODT@@QAEXI@Z @ 25 NONAME ; void ChspsODT::SetFlags(unsigned int) + ?SetOdtLanguage@ChspsODT@@QAEXH@Z @ 26 NONAME ; void ChspsODT::SetOdtLanguage(int) + ?SetPackageVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 27 NONAME ; void ChspsODT::SetPackageVersionL(class TDesC16 const &) + ?SetProviderNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 28 NONAME ; void ChspsODT::SetProviderNameL(class TDesC16 const &) + ?SetProviderUid@ChspsODT@@QAEXH@Z @ 29 NONAME ; void ChspsODT::SetProviderUid(int) + ?SetRootUid@ChspsODT@@QAEXH@Z @ 30 NONAME ; void ChspsODT::SetRootUid(int) + ?SetThemeFullNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 31 NONAME ; void ChspsODT::SetThemeFullNameL(class TDesC16 const &) + ?SetThemeShortNameL@ChspsODT@@QAEXABVTDesC16@@@Z @ 32 NONAME ; void ChspsODT::SetThemeShortNameL(class TDesC16 const &) + ?SetThemeUid@ChspsODT@@QAEXH@Z @ 33 NONAME ; void ChspsODT::SetThemeUid(int) + ?SetThemeVersionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 34 NONAME ; void ChspsODT::SetThemeVersionL(class TDesC16 const &) + ?ThemeFullName@ChspsODT@@QBEABVTDesC16@@XZ @ 35 NONAME ; class TDesC16 const & ChspsODT::ThemeFullName(void) const + ?ThemeShortName@ChspsODT@@QBEABVTDesC16@@XZ @ 36 NONAME ; class TDesC16 const & ChspsODT::ThemeShortName(void) const + ?ThemeUid@ChspsODT@@QBEHXZ @ 37 NONAME ; int ChspsODT::ThemeUid(void) const + ?ThemeVersion@ChspsODT@@QBEABVTDesC16@@XZ @ 38 NONAME ; class TDesC16 const & ChspsODT::ThemeVersion(void) const + ?UnMarshalHeaderL@ChspsODT@@QAEXABVTDesC8@@@Z @ 39 NONAME ; void ChspsODT::UnMarshalHeaderL(class TDesC8 const &) + ?UnMarshalHeaderLC@ChspsODT@@SAPAV1@ABVTDesC8@@@Z @ 40 NONAME ; class ChspsODT * ChspsODT::UnMarshalHeaderLC(class TDesC8 const &) + ?Family@ChspsODT@@QBEKXZ @ 41 NONAME ; unsigned long ChspsODT::Family(void) const + ?SetFamily@ChspsODT@@QAEXK@Z @ 42 NONAME ; void ChspsODT::SetFamily(unsigned long) + ?SetMultiInstance@ChspsODT@@QAEXH@Z @ 43 NONAME ; void ChspsODT::SetMultiInstance(int) + ?MultiInstance@ChspsODT@@QBEHXZ @ 44 NONAME ; int ChspsODT::MultiInstance(void) const + ?Description@ChspsODT@@QBEABVTDesC16@@XZ @ 45 NONAME ; class TDesC16 const & ChspsODT::Description(void) const + ?PreviewFile@ChspsODT@@QBEABVTDesC16@@XZ @ 46 NONAME ; class TDesC16 const & ChspsODT::PreviewFile(void) const + ?SetLogoFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 47 NONAME ; void ChspsODT::SetLogoFileL(class TDesC16 const &) + ?SetDescriptionL@ChspsODT@@QAEXABVTDesC16@@@Z @ 48 NONAME ; void ChspsODT::SetDescriptionL(class TDesC16 const &) + ?SetPreviewFileL@ChspsODT@@QAEXABVTDesC16@@@Z @ 49 NONAME ; void ChspsODT::SetPreviewFileL(class TDesC16 const &) + ?LogoFile@ChspsODT@@QBEABVTDesC16@@XZ @ 50 NONAME ; class TDesC16 const & ChspsODT::LogoFile(void) const + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsodt/eabi/hspsodtu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsodt/eabi/hspsodtu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +EXPORTS + _ZN8ChspsODT10SetRootUidEi @ 1 NONAME + _ZN8ChspsODT11SetThemeUidEi @ 2 NONAME + _ZN8ChspsODT12AddResourceLEP13ChspsResource @ 3 NONAME + _ZN8ChspsODT12InternalizeLER11RReadStream @ 4 NONAME + _ZN8ChspsODT14SetOdtLanguageEi @ 5 NONAME + _ZN8ChspsODT14SetProviderUidEi @ 6 NONAME + _ZN8ChspsODT15DeleteResourceLEi @ 7 NONAME + _ZN8ChspsODT16CopyDomDocumentLER16ChspsDomDocument @ 8 NONAME + _ZN8ChspsODT16SetProviderNameLERK7TDesC16 @ 9 NONAME + _ZN8ChspsODT16SetThemeVersionLERK7TDesC16 @ 10 NONAME + _ZN8ChspsODT16UnMarshalHeaderLERK6TDesC8 @ 11 NONAME + _ZN8ChspsODT17SetThemeFullNameLERK7TDesC16 @ 12 NONAME + _ZN8ChspsODT17UnMarshalHeaderLCERK6TDesC8 @ 13 NONAME + _ZN8ChspsODT18InternalizeHeaderLER11RReadStream @ 14 NONAME + _ZN8ChspsODT18SetPackageVersionLERK7TDesC16 @ 15 NONAME + _ZN8ChspsODT18SetThemeShortNameLERK7TDesC16 @ 16 NONAME + _ZN8ChspsODT20SetConfigurationTypeEj @ 17 NONAME + _ZN8ChspsODT24InternalizeResourceListLER11RReadStream @ 18 NONAME + _ZN8ChspsODT4NewLEv @ 19 NONAME + _ZN8ChspsODT5NewLCERK6TDesC8 @ 20 NONAME + _ZN8ChspsODT6CloneLEv @ 21 NONAME + _ZN8ChspsODT8SetFlagsEj @ 22 NONAME + _ZNK8ChspsODT11DomDocumentEv @ 23 NONAME + _ZNK8ChspsODT11OdtLanguageEv @ 24 NONAME + _ZNK8ChspsODT11ProviderUidEv @ 25 NONAME + _ZNK8ChspsODT12ExternalizeLER12RWriteStream @ 26 NONAME + _ZNK8ChspsODT12ProviderNameEv @ 27 NONAME + _ZNK8ChspsODT12ThemeVersionEv @ 28 NONAME + _ZNK8ChspsODT13ResourceCountEv @ 29 NONAME + _ZNK8ChspsODT13ThemeFullNameEv @ 30 NONAME + _ZNK8ChspsODT14MarshalHeaderLEv @ 31 NONAME + _ZNK8ChspsODT14PackageVersionEv @ 32 NONAME + _ZNK8ChspsODT14ThemeShortNameEv @ 33 NONAME + _ZNK8ChspsODT17ConfigurationTypeEv @ 34 NONAME + _ZNK8ChspsODT24ExternalizeResourceListLER12RWriteStream @ 35 NONAME + _ZNK8ChspsODT5FlagsEv @ 36 NONAME + _ZNK8ChspsODT7RootUidEv @ 37 NONAME + _ZNK8ChspsODT8ThemeUidEv @ 38 NONAME + _ZNK8ChspsODT9ResourceLEi @ 39 NONAME + _ZTI8ChspsODT @ 40 NONAME ; ## + _ZTV8ChspsODT @ 41 NONAME ; ## + _ZN8ChspsODT9SetFamilyEm @ 42 NONAME + _ZNK8ChspsODT6FamilyEv @ 43 NONAME + _ZN8ChspsODT16SetMultiInstanceEi @ 44 NONAME + _ZNK8ChspsODT13MultiInstanceEv @ 45 NONAME + _ZN8ChspsODT12SetLogoFileLERK7TDesC16 @ 46 NONAME + _ZN8ChspsODT15SetDescriptionLERK7TDesC16 @ 47 NONAME + _ZN8ChspsODT15SetPreviewFileLERK7TDesC16 @ 48 NONAME + _ZNK8ChspsODT11DescriptionEv @ 49 NONAME + _ZNK8ChspsODT11PreviewFileEv @ 50 NONAME + _ZNK8ChspsODT8LogoFileEv @ 51 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsodt/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsodt/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2002-2004 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: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS +//Exporting new system headers: + +PRJ_MMPFILES +hspsodt.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsodt/group/hspsodt.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsodt/group/hspsodt.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2002-2004 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: MMP-file for hspsODT +* +*/ + + +#include + +TARGET hspsodt.dll +TARGETTYPE dll + +SOURCEPATH ../src +SOURCE hspsodt.cpp + +USERINCLUDE ../../inc +USERINCLUDE . ../inc + +MW_LAYER_SYSTEMINCLUDE + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY hspsdomdocument.lib +LIBRARY hspsresource.lib +LANG SC + +//end of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsodt/src/hspsodt.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsodt/src/hspsodt.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,911 @@ +/* +* Copyright (c) 2002-2004 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: Class represents an Object Description Tree of Xuikon. +* +*/ + + +#include "hspsodt.h" +#include +#include +#include "hspsthememanagement.h" +#include "hspsdomdocument.h" +#include "hspsresource.h" + +/* Literal delim is used in separation of theme header and and other data in ODT-streaming. */ +_LIT(KDelim, "#"); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsODT::ChspsODT +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsODT::ChspsODT() + { + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsODT::ConstructL() + { + iDomDocument = ChspsDomDocument::NewL(); + iResourceList = new( ELeave ) CArrayPtrSeg( KPathListGranularity ); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsODT* ChspsODT::NewL() + { + ChspsODT* self = new( ELeave ) ChspsODT; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsODT* ChspsODT::NewLC( const TDesC8& aStreamData ) + { + ChspsODT* data = ChspsODT::NewL(); + CleanupStack::PushL( data ); + RDesReadStream stream( aStreamData ); + CleanupClosePushL( stream ); + data->InternalizeL( stream ); + CleanupStack::PopAndDestroy( &stream ); + return data; + } + +// Destructor +ChspsODT::~ChspsODT() + { + delete iDescription; + delete iLogoFile; + delete iPreviewFile; + delete iProviderName; + delete iThemeFullName; + delete iThemeShortName; + delete iThemeVersion; + delete iPackageVersion; + // clean up the array + if( iResourceList ) + { + iResourceList->ResetAndDestroy(); + delete iResourceList; + } + delete iDomDocument; + } + + +// ----------------------------------------------------------------------------- +// ChspsODT::MarshalHeaderL +// Marshals the ODT header into descriptor +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C HBufC8* ChspsODT::MarshalHeaderL() const + { + CBufFlat* buf = CBufFlat::NewL( KMaxHeaderDataLength8 ); + CleanupStack::PushL( buf ); + RBufWriteStream stream( *buf ); //stream over the buffer + CleanupClosePushL( stream ); + ExternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + + //Create a heap descriptor from the buffer + HBufC8* des = HBufC8::NewL( buf->Size() ); + TPtr8 ptr( des->Des() ); + buf->Read( 0, ptr, buf->Size() ); + CleanupStack::PopAndDestroy( buf ); + + return des; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::UnMarshalHeaderLC +// Unmarshals the ODT header from descriptor stream +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C ChspsODT* ChspsODT::UnMarshalHeaderLC( const TDesC8& aStreamData ) + { + ChspsODT* data = ChspsODT::NewL(); + CleanupStack::PushL( data ); + RDesReadStream stream( aStreamData ); + CleanupClosePushL( stream ); + data->InternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + + return data; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::UnMarshalHeaderL +// Unmarshals the ODT header from descriptor stream +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::UnMarshalHeaderL( const TDesC8& aStreamData ) + { + + RDesReadStream stream( aStreamData ); + CleanupClosePushL( stream ); + InternalizeHeaderL( stream ); + CleanupStack::PopAndDestroy( &stream ); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ExternalizeL +// Externalizes the ODT +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::ExternalizeL( RWriteStream& aStream ) const + { + ExternalizeHeaderL( aStream ); + ExternalizeResourceListL( aStream ); + aStream << *iDomDocument; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::InternalizeL +// Internalizes the ODT +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::InternalizeL( RReadStream& aStream ) + { + InternalizeHeaderL( aStream ); + // consumes header delimiter + aStream.ReadInt16L(); + InternalizeResourceListL( aStream ); + delete iDomDocument; + iDomDocument = NULL; + iDomDocument = ChspsDomDocument::NewL( aStream ); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ExternalizeHeaderL +// Externalizes the ODT header +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsODT::ExternalizeHeaderL( RWriteStream& aStream ) const + { + if ( iPackageVersion ) + { + aStream << *iPackageVersion; + } + else + { + aStream << KNullDesC; + } + + aStream.WriteUint32L( iFamilyMask ); + aStream.WriteUint32L( iConfigurationType ); + aStream.WriteUint32L( iRootUid ); + aStream.WriteUint32L( iProviderUid ); + aStream.WriteUint32L( iThemeUid ); + aStream.WriteInt32L( iMultiInstance ); + if ( iDescription ) + { + aStream << *iDescription; + } + else + { + aStream << KNullDesC; + } + if ( iLogoFile ) + { + aStream << *iLogoFile; + } + else + { + aStream << KNullDesC; + } + if ( iPreviewFile ) + { + aStream << *iPreviewFile; + } + else + { + aStream << KNullDesC; + } + if ( iProviderName ) + { + aStream << *iProviderName; + } + else + { + aStream << KNullDesC; + } + + if ( iThemeFullName ) + { + aStream << *iThemeFullName; + } + else + { + aStream << KNullDesC; + } + + if ( iThemeShortName ) + { + aStream << *iThemeShortName; + } + else + { + aStream << KNullDesC; + } + + if ( iThemeVersion ) + { + aStream << *iThemeVersion; + } + else + { + aStream << KNullDesC; + } + aStream.WriteInt32L( iLanguage ); + aStream.WriteUint32L( iFlags ); + // end of the header delimiter + aStream.WriteL( KDelim ); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::InternalizeHeaderL +// Internalizes the ODT header +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::InternalizeHeaderL( RReadStream& aStream ) + { + HBufC* version = HBufC::NewL( aStream, KMaxFileName ); + CleanupStack::PushL( version ); + if ( iPackageVersion && version->Des().Compare( iPackageVersion->Des() ) != 0 ) + { + // Package version check requested (iPackageVersion defined) + // and package version not supported + User::Leave( KErrNotSupported ); + } + if ( !iPackageVersion && version->Length() ) + { + // Package version check not requested + iPackageVersion = version->AllocL(); + } + CleanupStack::PopAndDestroy( version ); + + iFamilyMask = aStream.ReadUint32L(); + iConfigurationType = aStream.ReadUint32L(); + iRootUid = aStream.ReadUint32L(); + iProviderUid = aStream.ReadUint32L(); + iThemeUid = aStream.ReadUint32L(); + iMultiInstance = aStream.ReadInt32L(); + + delete iDescription; + iDescription = NULL; + iDescription = HBufC::NewL(aStream, KMaxDescLength ); + + delete iLogoFile; + iLogoFile = NULL; + iLogoFile = HBufC::NewL(aStream, KMaxFileName ); + + delete iPreviewFile; + iPreviewFile = NULL; + iPreviewFile = HBufC::NewL(aStream, KMaxFileName ); + + delete iProviderName; + iProviderName = NULL; + iProviderName = HBufC::NewL(aStream, KMaxFileName ); + + delete iThemeFullName; + iThemeFullName = NULL; + iThemeFullName = HBufC::NewL(aStream, KMaxFileName ); + + delete iThemeShortName; + iThemeShortName = NULL; + iThemeShortName = HBufC::NewL(aStream, KMaxFileName ); + + delete iThemeVersion; + iThemeVersion = NULL; + iThemeVersion = HBufC::NewL(aStream, KMaxFileName ); + + iLanguage = aStream.ReadInt32L(); + iFlags = aStream.ReadUint32L(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::AddResourceL +// Adds a resource into Resource List. Takes ownership. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::AddResourceL( ChspsResource* aResource ) + { + const TInt resourceIndex = CheckResourceL( aResource ); + if ( resourceIndex >= 0 ) + { + ChspsResource* resource = iResourceList->At( resourceIndex ); + delete resource; + resource = NULL; + iResourceList->Delete( resourceIndex ); + } + iResourceList->AppendL( aResource ); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::CheckResourceL +// Check for duplicates +// ----------------------------------------------------------------------------- +TInt ChspsODT::CheckResourceL( ChspsResource* aResource ) + { + if ( !aResource ) + { + User::Leave( KErrArgument ); + } + + for ( TInt index=0; index < ResourceCount(); index++ ) + { + ChspsResource& r = ResourceL(index); + if ( r.ResourceId() == aResource->ResourceId() + && r.FileName() == aResource->FileName() ) + { + return index; + } + } + + return KErrNotFound; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::DeleteResourceL +// Deletes resource from the element array +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::DeleteResourceL( TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= ResourceCount() ) + { + User::Leave( KErrArgument ); + } + + ChspsResource* resource = iResourceList->At( aIndex ); + if ( resource ) + { + delete resource; + resource = NULL; + iResourceList->Delete( aIndex ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ResourceL +// Get the resource by the index +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C ChspsResource& ChspsODT::ResourceL( TInt aIndex ) const + { + if ( aIndex < 0 || aIndex >= ResourceCount() ) + { + User::Leave( KErrArgument ); + } + + return ( *iResourceList->At(aIndex)); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ElementCount +// Returns the amount of elements +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::ResourceCount() const + { + return iResourceList->Count(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ExternalizeResourceListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::ExternalizeResourceListL( RWriteStream& aStream ) const + { + // Stream out the resource list + TInt count = iResourceList->Count(); + aStream.WriteInt32L(count); + ChspsResource* resource; + for (TInt i=0;iAt(i); + resource->ExternalizeL(aStream); + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::InternalizeResourceListL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::InternalizeResourceListL( RReadStream& aStream ) + { + // clean up the array + if( iResourceList ) + { + iResourceList->ResetAndDestroy(); + } + // stream in the resource list + TInt count = aStream.ReadInt32L(); + for (TInt i=0;iInternalizeL(aStream); + iResourceList->AppendL( resource ); + CleanupStack::Pop( resource ); // now owned by array + resource = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// ChspsODT::SetRootUid +// Set RootUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetRootUid( TInt aUid ) + { + iRootUid = aUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::RootUid +// Get RootUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::RootUid() const + { + return iRootUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetProviderUid +// Set ProviderUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetProviderUid( TInt aUid ) + { + iProviderUid = aUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ProviderUid +// Get ProviderUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::ProviderUid() const + { + return iProviderUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetThemeUid +// Set ThemeUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetThemeUid( TInt aUid ) + { + iThemeUid = aUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ThemeUid +// Get ThemeUid +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::ThemeUid() const + { + return iThemeUid; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetProviderNameL +// Set ProviderNameL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetProviderNameL( const TDesC& aName ) + { + delete iProviderName; + iProviderName = NULL; + iProviderName = aName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ProviderName +// Get ProviderName +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::ProviderName() const + { + if ( iProviderName ) + { + return *iProviderName; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetThemeFullNameL +// Set ThemeFullNameL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetThemeFullNameL( const TDesC& aName ) + { + delete iThemeFullName; + iThemeFullName = NULL; + iThemeFullName = aName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ThemeFullName +// Get ThemeFullName +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::ThemeFullName() const + { + if ( iThemeFullName ) + { + return *iThemeFullName; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetThemeShortNameL +// Set ThemeShortNameL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetThemeShortNameL( const TDesC& aName ) + { + delete iThemeShortName; + iThemeShortName = NULL; + iThemeShortName = aName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ThemeShortName +// Get ThemeShortName +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::ThemeShortName() const + { + if ( iThemeShortName ) + { + return *iThemeShortName; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetThemeVersionL +// Set ThemeVersionL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetThemeVersionL( const TDesC& aVersion ) + { + delete iThemeVersion; + iThemeVersion = NULL; + iThemeVersion = aVersion.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ThemeVersion +// Get ThemeVersion +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::ThemeVersion() const + { + if ( iThemeVersion ) + { + return *iThemeVersion; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetOdtLanguage +// Set OdtLanguage +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetOdtLanguage( TInt aLanguage ) + { + iLanguage = aLanguage; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::OdtLanguage +// Get OdtLanguage +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::OdtLanguage() const + { + return iLanguage; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetFlags +// Set Flags +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetFlags( TUint aFlags ) + { + iFlags = aFlags; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::Flags +// Get Flags +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TUint ChspsODT::Flags() const + { + return iFlags; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::DomDocument +// Get DomDocument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDomDocument& ChspsODT::DomDocument() const + { + return *iDomDocument; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::CloneL() +// Makes a clone of this ODT and returns pointer to it +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsODT* ChspsODT::CloneL() + { + ChspsODT* clone = new (ELeave) ChspsODT; + CleanupStack::PushL( clone ); + clone->ConstructL(); + clone->SetConfigurationType( iConfigurationType ); + clone->SetRootUid( iRootUid ); + clone->SetProviderUid( iProviderUid ); + clone->SetThemeUid( iThemeUid ); + if( iProviderName ) + { + clone->SetProviderNameL( *iProviderName ); + } + if( iThemeFullName ) + { + clone->SetThemeFullNameL( *iThemeFullName ); + } + if( iThemeShortName ) + { + clone->SetThemeShortNameL( *iThemeShortName ); + } + if( iThemeVersion ) + { + clone->SetThemeVersionL( *iThemeVersion ); + } + if( iPackageVersion ) + { + clone->SetPackageVersionL( *iPackageVersion ); + } + clone->SetOdtLanguage( iLanguage ); + clone->SetFlags( iFlags ); + + TInt resourceCount = iResourceList->Count(); + + for ( TInt index = 0; index < resourceCount ; index++ ) + { + ChspsResource& resource = ResourceL( index ); + clone->AddResourceL( resource.CloneL() ); + } + + CleanupStack::Pop( clone ); + return clone; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::CopyDomDocumentL() +// Clones the aDom and sets it as this ChspsODT's DomDocument +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsODT::CopyDomDocumentL( ChspsDomDocument& aDom ) + { + delete iDomDocument; + iDomDocument = NULL; + iDomDocument = aDom.CloneL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetConfigurationType() +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsODT::SetConfigurationType( TUint aType ) + { + iConfigurationType = aType; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::ConfigurationType() +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint ChspsODT::ConfigurationType() const + { + return iConfigurationType; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetPackageVersionL +// Set package version +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetPackageVersionL( const TDesC& aVersion ) + { + delete iPackageVersion; + iPackageVersion = NULL; + iPackageVersion = aVersion.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::PackageVersion +// Get package version +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::PackageVersion() const + { + if ( iPackageVersion ) + { + return *iPackageVersion; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetFamily +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetFamily( const TUint32 aFamilyMask ) + { + iFamilyMask = aFamilyMask; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::Family +// ----------------------------------------------------------------------------- +EXPORT_C TUint32 ChspsODT::Family() const + { + return iFamilyMask; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetMultiInstance +// Set MultiInstance +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetMultiInstance( TInt aMultiInstance ) + { + iMultiInstance = aMultiInstance; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::MultiInstance +// Get MultiInstance +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsODT::MultiInstance() const + { + return iMultiInstance; + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetDescriptionL +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetDescriptionL( const TDesC& aDesc ) + { + delete iDescription; + iDescription = NULL; + iDescription = aDesc.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::Description +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::Description() const + { + if ( iDescription ) + { + return *iDescription; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetLogoFileL +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetLogoFileL( const TDesC& aPath ) + { + delete iLogoFile; + iLogoFile = NULL; + iLogoFile = aPath.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::LogoFile +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::LogoFile() const + { + if ( iLogoFile ) + { + return *iLogoFile; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsODT::SetPreviewFileL +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsODT::SetPreviewFileL( const TDesC& aPath ) + { + delete iPreviewFile; + iPreviewFile = NULL; + iPreviewFile = aPath.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsODT::PreviewFile +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsODT::PreviewFile() const + { + if ( iPreviewFile ) + { + return *iPreviewFile; + } + else + { + return KNullDesC; + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspspluginregistry/bwins/hspsdefrepu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspspluginregistry/bwins/hspsdefrepu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +EXPORTS + ?SetLocaleL@ChspsDefinitionRepository@@QAEHAAVChspsODT@@AAVChspsResource@@@Z @ 1 NONAME ; int ChspsDefinitionRepository::SetLocaleL(class ChspsODT &, class ChspsResource &) + ?RemoveThemeL@ChspsDefinitionRepository@@QAEXABVChspsODT@@@Z @ 2 NONAME ; void ChspsDefinitionRepository::RemoveThemeL(class ChspsODT const &) + ?Locked@ChspsDefinitionRepository@@QBEHXZ @ 3 NONAME ; int ChspsDefinitionRepository::Locked(void) const + ?GetResourceListL@ChspsDefinitionRepository@@QAEHABVChspsODT@@AAV?$CArrayPtrSeg@VChspsResource@@@@@Z @ 4 NONAME ; int ChspsDefinitionRepository::GetResourceListL(class ChspsODT const &, class CArrayPtrSeg &) + ?SetLogBus@ChspsDefinitionRepository@@QAEXPAX@Z @ 5 NONAME ; void ChspsDefinitionRepository::SetLogBus(void *) + ?Unlock@ChspsDefinitionRepository@@QAEXXZ @ 6 NONAME ; void ChspsDefinitionRepository::Unlock(void) + ?UnregisterObserver@ChspsDefinitionRepository@@QAEXABVMhspsDefinitionRepositoryObserver@@@Z @ 7 NONAME ; void ChspsDefinitionRepository::UnregisterObserver(class MhspsDefinitionRepositoryObserver const &) + ?RestoreBackupConfiguration@ChspsDefinitionRepository@@QAEHABVChspsODT@@@Z @ 8 NONAME ; int ChspsDefinitionRepository::RestoreBackupConfiguration(class ChspsODT const &) + ?SetOdtL@ChspsDefinitionRepository@@QAEHABVChspsODT@@@Z @ 9 NONAME ; int ChspsDefinitionRepository::SetOdtL(class ChspsODT const &) + ?GetResourcePathL@ChspsDefinitionRepository@@QAEXABVChspsODT@@W4ThspsResourceType@@AAVTDes16@@@Z @ 10 NONAME ; void ChspsDefinitionRepository::GetResourcePathL(class ChspsODT const &, enum ThspsResourceType, class TDes16 &) + ?GetODTPathL@ChspsDefinitionRepository@@QAEXABVChspsODT@@AAVTDes16@@@Z @ 11 NONAME ; void ChspsDefinitionRepository::GetODTPathL(class ChspsODT const &, class TDes16 &) + ?MakeODTPathL@ChspsDefinitionRepository@@QAEXAAVChspsODT@@AAVChspsResource@@@Z @ 12 NONAME ; void ChspsDefinitionRepository::MakeODTPathL(class ChspsODT &, class ChspsResource &) + ?RegisterNotification@ChspsDefinitionRepository@@QAEXVThspsRepositoryInfo@@@Z @ 13 NONAME ; void ChspsDefinitionRepository::RegisterNotification(class ThspsRepositoryInfo) + ?GetThemeListAsStreamL@ChspsDefinitionRepository@@QAEXAAV?$CArrayPtrSeg@VHBufC8@@@@ABVChspsODT@@@Z @ 14 NONAME ; void ChspsDefinitionRepository::GetThemeListAsStreamL(class CArrayPtrSeg &, class ChspsODT const &) + ?ClearBackupsL@ChspsDefinitionRepository@@QAEXXZ @ 15 NONAME ; void ChspsDefinitionRepository::ClearBackupsL(void) + ?MakeResourcePathL@ChspsDefinitionRepository@@QAEXABVChspsODT@@AAVChspsResource@@@Z @ 16 NONAME ; void ChspsDefinitionRepository::MakeResourcePathL(class ChspsODT const &, class ChspsResource &) + ?GetOdtL@ChspsDefinitionRepository@@QAEHAAVChspsODT@@@Z @ 17 NONAME ; int ChspsDefinitionRepository::GetOdtL(class ChspsODT &) + ?Lock@ChspsDefinitionRepository@@QAEXXZ @ 18 NONAME ; void ChspsDefinitionRepository::Lock(void) + ?NewL@ChspsDefinitionRepository@@SAPAV1@XZ @ 19 NONAME ; class ChspsDefinitionRepository * ChspsDefinitionRepository::NewL(void) + ?GetThemePathListL@ChspsDefinitionRepository@@QAEXAAVCDesC16ArraySeg@@ABVChspsODT@@@Z @ 20 NONAME ; void ChspsDefinitionRepository::GetThemePathListL(class CDesC16ArraySeg &, class ChspsODT const &) + ?GetOdtL@ChspsDefinitionRepository@@QAEXABVTDes16@@AAVChspsODT@@@Z @ 21 NONAME ; void ChspsDefinitionRepository::GetOdtL(class TDes16 const &, class ChspsODT &) + ?SetResourceListL@ChspsDefinitionRepository@@QAEHAAVChspsODT@@ABV?$CArrayPtrSeg@VChspsResource@@@@@Z @ 22 NONAME ; int ChspsDefinitionRepository::SetResourceListL(class ChspsODT &, class CArrayPtrSeg const &) + ?RegisterObserverL@ChspsDefinitionRepository@@QAEXABVMhspsDefinitionRepositoryObserver@@@Z @ 23 NONAME ; void ChspsDefinitionRepository::RegisterObserverL(class MhspsDefinitionRepositoryObserver const &) + ?GetOdtHeaderL@ChspsDefinitionRepository@@QAEHAAVTDes16@@W4TLanguage@@AAVChspsODT@@@Z @ 24 NONAME ; int ChspsDefinitionRepository::GetOdtHeaderL(class TDes16 &, enum TLanguage, class ChspsODT &) + ?BackupConfigurationL@ChspsDefinitionRepository@@QAEXABVChspsODT@@@Z @ 25 NONAME ; void ChspsDefinitionRepository::BackupConfigurationL(class ChspsODT const &) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspspluginregistry/eabi/hspsdefrepu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspspluginregistry/eabi/hspsdefrepu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +EXPORTS + _ZN25ChspsDefinitionRepository10SetLocaleLER8ChspsODTR13ChspsResource @ 1 NONAME + _ZN25ChspsDefinitionRepository11GetODTPathLERK8ChspsODTR6TDes16 @ 2 NONAME + _ZN25ChspsDefinitionRepository12MakeODTPathLER8ChspsODTR13ChspsResource @ 3 NONAME + _ZN25ChspsDefinitionRepository12RemoveThemeLERK8ChspsODT @ 4 NONAME + _ZN25ChspsDefinitionRepository13ClearBackupsLEv @ 5 NONAME + _ZN25ChspsDefinitionRepository13GetOdtHeaderLER6TDes169TLanguageR8ChspsODT @ 6 NONAME + _ZN25ChspsDefinitionRepository16GetResourceListLERK8ChspsODTR12CArrayPtrSegI13ChspsResourceE @ 7 NONAME + _ZN25ChspsDefinitionRepository16GetResourcePathLERK8ChspsODT17ThspsResourceTypeR6TDes16 @ 8 NONAME + _ZN25ChspsDefinitionRepository16SetResourceListLER8ChspsODTRK12CArrayPtrSegI13ChspsResourceE @ 9 NONAME + _ZN25ChspsDefinitionRepository17GetThemePathListLER15CDesC16ArraySegRK8ChspsODT @ 10 NONAME + _ZN25ChspsDefinitionRepository17MakeResourcePathLERK8ChspsODTR13ChspsResource @ 11 NONAME + _ZN25ChspsDefinitionRepository17RegisterObserverLERK33MhspsDefinitionRepositoryObserver @ 12 NONAME + _ZN25ChspsDefinitionRepository18UnregisterObserverERK33MhspsDefinitionRepositoryObserver @ 13 NONAME + _ZN25ChspsDefinitionRepository20BackupConfigurationLERK8ChspsODT @ 14 NONAME + _ZN25ChspsDefinitionRepository20RegisterNotificationE19ThspsRepositoryInfo @ 15 NONAME + _ZN25ChspsDefinitionRepository21GetThemeListAsStreamLER12CArrayPtrSegI6HBufC8ERK8ChspsODT @ 16 NONAME + _ZN25ChspsDefinitionRepository26RestoreBackupConfigurationERK8ChspsODT @ 17 NONAME + _ZN25ChspsDefinitionRepository4LockEv @ 18 NONAME + _ZN25ChspsDefinitionRepository4NewLEv @ 19 NONAME + _ZN25ChspsDefinitionRepository6UnlockEv @ 20 NONAME + _ZN25ChspsDefinitionRepository7GetOdtLER8ChspsODT @ 21 NONAME + _ZN25ChspsDefinitionRepository7GetOdtLERK6TDes16R8ChspsODT @ 22 NONAME + _ZN25ChspsDefinitionRepository7SetOdtLERK8ChspsODT @ 23 NONAME + _ZN25ChspsDefinitionRepository9SetLogBusEPv @ 24 NONAME + _ZNK25ChspsDefinitionRepository6LockedEv @ 25 NONAME + _ZTI25ChspsDefinitionRepository @ 26 NONAME ; ## + _ZTV25ChspsDefinitionRepository @ 27 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspspluginregistry/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspspluginregistry/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2002-2004 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: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + +PRJ_EXPORTS +//Exporting new system headers: + +PRJ_MMPFILES +hspsdefinitionrepository.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspspluginregistry/group/hspsdefinitionrepository.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspspluginregistry/group/hspsdefinitionrepository.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,51 @@ +/* +* 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: Ui Definition Repository of hsps +* +*/ + + +#include +#include "../../inc/hsps_log_cfg.hrh" + +TARGET hspsdefrep.dll +TARGETTYPE dll +// this is official uid +UID 0x1000008d 0x200159BC //old uid 1020725C +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hspsdefinitionrepository.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY hspsodt.lib +LIBRARY hspsresource.lib +LIBRARY sysutil.lib +LIBRARY fbscli.lib + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspspluginregistry/src/hspsdefinitionrepository.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1536 @@ +/* +* 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: Service for maintaining contents of the "themes" folder +* +*/ + + +// INCLUDE FILES +#include +#include +#include + +#include "hsps_builds_cfg.hrh" + +#include "hspsthememanagement.h" +#include "hspsdefinitionrepository.h" +#include "hspsodt.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#endif + +// CONSTANTS +const TInt KDefRepArrayGranularity = 5; + +_LIT(KImportFolder, "import"); +_LIT(KThemesFolder, "themes"); +_LIT(KSourceFolder, "sources"); +_LIT(KSourceFolderWithSeperators, "\\sources\\"); +_LIT(KLocaleFolder, "locales"); +_LIT(KBackupFolder, "backup"); + + +_LIT(KDoubleBackSlash,"\\"); + +_LIT(KFolderFormat,"%d"); // folder format for localized resources + +_LIT(KMatchAll, "*"); + + +_LIT(KMatchSkeleton, ".o0000"); + +const TInt KTIntMahspsumbers( 11 ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::ChspsDefinitionRepository +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsDefinitionRepository::ChspsDefinitionRepository() + { + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsDefinitionRepository::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + //Create private path if it doesn't exist already + TInt err=iFs.CreatePrivatePath(EDriveC); + if (err!=KErrNone && err!=KErrAlreadyExists) + { + User::Leave(err); + } + HBufC* path = HBufC::NewLC( KMaxFileName ); + TPtr pathPtr = path->Des(); + User::LeaveIfError( iFs.PrivatePath( pathPtr )); + AppendDesCIntoPathL( pathPtr, KImportFolder ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + iFs.MkDir( pathPtr ); + CleanupStack::PopAndDestroy( path ); + User::LeaveIfError(iFs.SetSessionToPrivate(EDriveC)); + iLicenseDefault = EFalse; + iLockSemaphore = 0; + + iTempFileName1 = KNullDesC; + iTempFileName2 = KNullDesC; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsDefinitionRepository* ChspsDefinitionRepository::NewL() + { + ChspsDefinitionRepository* self = new( ELeave ) ChspsDefinitionRepository; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// Destructor +ChspsDefinitionRepository::~ChspsDefinitionRepository() + { + iFs.Close(); + iRepositoryInfoQueue.Reset(); + iRepositoryInfoQueue.Close(); + iObservers.Reset(); + iObservers.Close(); + delete iPath; + + iTempFileName1 = KNullDesC; + iTempFileName2 = KNullDesC; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::SetLocaleL +// Saves the dtd-file into the repository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsDefinitionRepository::SetLocaleL( ChspsODT& aODT, ChspsResource& aResource ) + { + // Populate a path based on ODT attributes and file extension of the resource file + GetPathL( aODT, EResourceDTD ); + + // Results are in iPath, copy resouce file from temp path to a new path in the repository + TInt errorCode = CopyFileL( aResource.FileName() ); + if ( !errorCode ) + { + // Store the new path + aResource.SetFileNameL( iPath->Des() ); + } + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::MakeODTPathL +// Creates a path for given ODT. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::MakeODTPathL( ChspsODT& aODT, ChspsResource& aResource ) + { + // make sure the temporary buffer is empty + iTempFileName1.Zero(); + + // get the path for ODT-resource to store + GetPathL( aODT, EResourceODT ); + + TPtr ptrPath = iPath->Des(); + TParsePtr p( ptrPath ); + aODT.SetThemeShortNameL(p.Name()); + + // iPath is modified + TPtrC pathPtr = iPath->Des(); + iTempFileName1.Format( _L("%S%S"), &KCDrive, &pathPtr ); + aResource.SetFileNameL( iTempFileName1 ); + + iTempFileName1.Zero(); + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::SetOdtL +// Saves the odt-structure into the repository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDefinitionRepository::SetOdtL( const ChspsODT &aODT ) + { + TInt ret = KErrGeneral; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::SetOdtL(): - rewriting the binary file." ) ); + } +#endif + + GetPathL( aODT, EResourceODT ); + ret = WriteToFileL( aODT); + + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::SetOdtL(): - rewriting done. return code: %d." ), ret ); + } +#endif + + return ret; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetOdtL +// Retrieves the odt-structure from the repository as a reference. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDefinitionRepository::GetOdtL( ChspsODT& aODT ) + { + TInt errorCode = KErrNone; + if ( aODT.Flags() & EhspsThemeStatusLicenceeDefault ) + { + iLicenseDefault = ETrue; + } + else + { + iLicenseDefault = EFalse; + } + + TRAP( errorCode, GetPathL( aODT, EResourceODT )); + if ( !errorCode ) + { + errorCode = ReadFromFileL( *iPath, aODT ); + } + iLicenseDefault = EFalse; + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetOdtHeaderL +// Retrieves the odt-structure from the repository as a reference. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsDefinitionRepository::GetOdtHeaderL( TDes& aPath, TLanguage /*aLang*/, ChspsODT& aODT ) + { + TInt err( KErrNotFound ); + + CDesCArraySeg* themeList = new ( ELeave ) CDesCArraySeg( KDefRepArrayGranularity ); + CleanupStack::PushL( themeList ); + + SelectFilesFromPathL( *themeList, aPath, ESortByDate, KMatchSkeleton ); + + if( themeList->MdcaCount() > 0 ) + { + + TPtrC name = themeList->MdcaPoint( 0 ); + if ( name.FindF( KSourceFolderWithSeperators ) == KErrNotFound ) + { + HBufC8* header( StreamHeaderFromFileL( name ) ); + CleanupStack::PushL( header ); + + if( header ) + { + aODT.UnMarshalHeaderL( *header ); + err = KErrNone; + } + + CleanupStack::PopAndDestroy( header ); + } + } + + CleanupStack::PopAndDestroy( themeList ); + + User::LeaveIfError( err ); + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetODTPathL +// Retrieves the path of given ODT. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDefinitionRepository::GetResourcePathL( const ChspsODT& aODT, ThspsResourceType aResourceType, TDes& aFilePath ) + { + // get the path for source resources to store + GetPathL( aODT, aResourceType ); + TPtrC ptr = iPath->Des(); + // modifying the resource file path on the resource + aFilePath.Format( _L("%S%S"), &KCDrive, &ptr ); + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetThemePathListL +// Retrieves the list of installed themes. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::GetThemePathListL( CDesCArraySeg& aThemeList, const ChspsODT& aODT ) + { + CDesCArraySeg* pathList = new( ELeave ) CDesCArraySeg(KDefRepArrayGranularity); + CleanupStack::PushL( pathList ); + + CDesCArraySeg* tempPathList = new( ELeave ) CDesCArraySeg(KDefRepArrayGranularity); + CleanupStack::PushL( tempPathList ); + + // The "themes" folder must exist at this point (C drive) + _LIT( KDriveC, "C:" ); + TFileName themesPath; + User::LeaveIfError( iFs.PrivatePath( themesPath )); + HBufC* path = HBufC::NewLC( KMaxFileName ); + TPtr pathPtr = path->Des(); + AppendDesCIntoPathL( pathPtr, KDriveC ); + AppendDesCIntoPathL( pathPtr, themesPath ); + AppendDesCIntoPathL( pathPtr, KThemesFolder ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + + // Allocate memory for the folder name to be found (uid folder) + HBufC* match = HBufC::NewLC( KTIntMahspsumbers ); + TPtr matchPtr = match->Des(); + + // Setup a mask from the search criterias + TInt8 rootUid = aODT.RootUid() ? 1 : 0; + TInt8 provUid = aODT.ProviderUid() ? 2 : 0; + TInt8 themeUid = aODT.ThemeUid() ? 4 : 0; + TInt8 mask = rootUid | provUid | themeUid; + + TInt index( 0 ); + + switch ( mask ) + { + case 0://No data in ODT. + { + MatchingFoldersFromAllDrivesL( KMatchAll, pathPtr, *pathList ); + } + break; + case 1://AppUid given. + case 3://AppUid and ProviderUid given. + case 7://AppUid, ProviderUid and ThemeUid given. + { + if ( aODT.RootUid() ) + { + AppendNumIntoPathL( pathPtr, aODT.RootUid() ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + if ( aODT.ProviderUid() ) + { + AppendNumIntoPathL( pathPtr, aODT.ProviderUid() ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + if ( aODT.ThemeUid() ) + { + AppendNumIntoPathL( pathPtr, aODT.ThemeUid() ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + MatchingFoldersFromAllDrivesL( KMatchAll, pathPtr, *pathList ); + } + break; + case 2://ProviderUid given. + { + MatchingFoldersFromAllDrivesL( KMatchAll, pathPtr, *tempPathList ); + matchPtr.Zero(); + matchPtr.AppendNum( aODT.ProviderUid() ); + for ( index = 0; index < tempPathList->Count(); index++ ) + { + MatchingFoldersL( *match, tempPathList->MdcaPoint( index ), *pathList ); + } + } + break; + case 4://ThemeUid given. + { + MatchingFoldersFromAllDrivesL( KMatchAll, pathPtr, *pathList ); + for ( index = 0; index < pathList->Count(); index++ ) + { + MatchingFoldersL( *match, pathList->MdcaPoint( index ), *tempPathList ); + } + matchPtr.Zero(); + matchPtr.AppendNum( aODT.ThemeUid() ); + pathList->Reset(); + for ( index = 0; index < tempPathList->Count(); index++ ) + { + MatchingFoldersL( *match, tempPathList->MdcaPoint( index ), *pathList ); + } + } + break; + case 6://ProviderUid and ThemeUid given. + { + MatchingFoldersFromAllDrivesL( KMatchAll, pathPtr, *pathList ); + matchPtr.Zero(); + matchPtr.AppendNum( aODT.ProviderUid() ); + for ( index = 0; index < pathList->Count(); index++ ) + { + MatchingFoldersL( *match, pathList->MdcaPoint( index ), *tempPathList ); + } + matchPtr.Zero(); + matchPtr.AppendNum( aODT.ThemeUid() ); + pathList->Reset(); + for ( index = 0; index < tempPathList->Count(); index++ ) + { + MatchingFoldersL( *match, tempPathList->MdcaPoint( index ), *pathList ); + } + } + break; + case 5://AppUid and ThemeUid given. + { + // Get paths matching the 1st argument into pathList array + matchPtr.Zero(); + matchPtr.AppendNum( aODT.RootUid() ); + MatchingFoldersFromAllDrivesL( *match, pathPtr, *pathList ); + // From previous results, match and store results into tempPathList array + matchPtr.Zero(); + matchPtr = KMatchAll; + for ( index = 0; index < pathList->Count(); index++ ) + { + MatchingFoldersL( *match, pathList->MdcaPoint( index ), *tempPathList ); + } + // From previous results, find mathing plugins and store them back to the pathList + matchPtr.Zero(); + matchPtr.AppendNum( aODT.ThemeUid() ); + pathList->Reset(); + for ( index = 0; index < tempPathList->Count(); index++ ) + { + MatchingFoldersL( *match, tempPathList->MdcaPoint( index ), *pathList ); + } + } + break; + default: + { + pathList->AppendL( pathPtr ); + } + break; + } + + TInt err( KErrNotFound ); + for ( TInt i = 0; i < pathList->MdcaCount(); i++ ) + { + err = MatchingFoldersL( KMatchAll, pathList->MdcaPoint(i), *pathList ); + if ( err == KErrNotFound ) + { + TPtrC pathPtr = pathList->MdcaPoint(i); + aThemeList.AppendL( pathPtr ); + } + } + CleanupStack::PopAndDestroy( 4, pathList );//path, match, pathList, tempPathList + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetThemeListAsStreamL +// Retrieves the headers of installed themes as an array of streams. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDefinitionRepository::GetThemeListAsStreamL( CArrayPtrSeg& aHeaderList, const ChspsODT& aODT ) + { + CDesCArraySeg* pathList = new( ELeave ) CDesCArraySeg(KDefRepArrayGranularity); + CleanupStack::PushL( pathList ); + GetThemePathListL( *pathList, aODT ); + CDesCArraySeg* themeList = new( ELeave ) CDesCArraySeg(KDefRepArrayGranularity); + CleanupStack::PushL( themeList ); + + for ( TInt i = 0; i < pathList->MdcaCount(); i++ ) + { + SelectFilesFromPathL( *themeList, pathList->MdcaPoint( i ), ESortByDate, KMatchSkeleton ); + } + + for ( TInt j = 0; j < themeList->MdcaCount(); j++ ) + { + TPtrC ptr( themeList->MdcaPoint( j ) ); + if ( ptr.FindF( KSourceFolderWithSeperators ) == KErrNotFound ) + { + HBufC8* temp = StreamHeaderFromFileL( themeList->MdcaPoint( j ) ); + if ( temp ) + { + aHeaderList.AppendL( temp ); + } + } + } + CleanupStack::PopAndDestroy( 2, pathList );//themeList, pathList + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::RemoveThemeL +// Removes the specified theme. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::RemoveThemeL( const ChspsODT& aODT ) + { + GetPathL( aODT, EResourceNone ); + RemoveDirectoryL(); + // theme removal is not informed to the clients through RepositoryInfoArray + // because this function is used also by the theme server's clean up functions - + // and it not necessary inform about them. + // insteads, maintenance handler does inform the removal. + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::MakeResourcePathL +// Makes a path in the repository that can be used to store the resource file. +// The path is written back into aResource +// The path depends on the locale under which the resource belongs. +// The path information will be used to retrieve the source later. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::MakeResourcePathL( const ChspsODT& aODT, ChspsResource& aResource ) + { + // get the path for source resources to store (results are stored into the iPath instance) + GetPathL( aODT, aResource.ResourceType() ); + TPtr pathPtr = iPath->Des(); + + // If the resource is of type "Other" then skip renaming of the file extension + if ( aResource.ResourceType() == EResourceOther ) + { + if ( aResource.Language() != ELangNone ) + { + AddLocalePathL( pathPtr, aODT.OdtLanguage() ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + + // Append the iPath with the resource name + AppendDesCIntoPathL( pathPtr, aResource.ResourceId() ); + + // Append with original file extension or fix it + const TDesC& name = aResource.FileName(); + TParsePtr parsePtr( (TDes&)name ); + TPtrC fileExtension = parsePtr.Ext(); + if ( fileExtension.Length() > 2 && fileExtension.Left(2).CompareF( _L(".o") ) == 0 ) + { + // Strip the first letter + TInt odtIndex(0); + TLex lex( fileExtension.Mid(3) ); + if ( lex.Val( odtIndex ) == KErrNone && odtIndex >= 0 ) + { + fileExtension.Set( KMatchSkeleton ); + } + } + AppendDesCIntoPathL( pathPtr, fileExtension ); + } + else + { + // If replaceable resource + if ( aResource.LockingPolicy() == EhspsUnlocked ) + { + AppendDesCIntoPathL( pathPtr, aResource.ResourceId() ); + FileExtensionL( aResource.ResourceType(), aODT.OdtLanguage() ); + } + else + { + // make phycical path + User::LeaveIfError(iFs.SetSessionToPrivate(EDriveC)); + // create the directory structure on the path + TInt err = iFs.MkDirAll( *iPath ); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + User::Leave( err ); + } + AppendDesCIntoPathL( pathPtr, aResource.ResourceId() ); + FileExtensionL( aResource.ResourceType(), aODT.OdtLanguage() ); + } + } + aResource.SetFileNameL( iPath->Des() ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::SetResourceListL +// Stores the resource list to the repository. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsDefinitionRepository::SetResourceListL( ChspsODT& aODT, const CArrayPtrSeg& aResourceList ) + { + // make sure the temporary buffers are empty. + iTempFileName1.Zero(); + iTempFileName2.Zero(); + + TInt errorCode = KErrNone; + + TInt tempLanguage = aODT.OdtLanguage(); + + // Loop provided resources and copy them to correct places in the repository + for ( TInt i=0; iLanguage() ); + + if ( res->ResourceType() == EResourceDTD ) + { + SetLocaleL( aODT, *res ); + } + else + { + // save source path because res->FileName() will be modified by MakeResourcePath but + // the original path is still needed + HBufC* fileName = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = fileName->Des(); + fileNamePtr.Append( res->FileName() ); + + // strip the extension temporarily + TParsePtr k( fileNamePtr ); + TPtrC name = k.Name(); + res->SetResourceIdL(name); + + // copy a non-cacheable resource from its location into the repository + MakeResourcePathL( aODT, *res ); + + // restore the file extension + TPtrC nameAndExt = k.NameAndExt(); + res->SetResourceIdL(nameAndExt); + + // copy the resource file to the repository + errorCode = CopyFileL( *fileName, iPath->Des() ); + if ( errorCode ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::SetResourceListL() - resource copying failed" ) ); + } +#endif + } + + CleanupStack::PopAndDestroy( fileName ); + + + // Set drive information + iTempFileName1.Format( _L("%S"), &res->FileName() ); + TParsePtr f( iTempFileName1 ); + TPtrC path = f.Path(); + TPtrC file = f.NameAndExt(); + iTempFileName2.Format(_L("%S%S%S"), &KCDrive, &path, &file ); + res->SetFileNameL( iTempFileName2 ); + } + aODT.AddResourceL( res ); + } + + aODT.SetOdtLanguage( tempLanguage ); + iTempFileName1.Zero(); + iTempFileName2.Zero(); + + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetResourceListL +// Retrieves the resource list from the repository. ODT-header given is a search mask. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsDefinitionRepository::GetResourceListL( const ChspsODT& aODT, CArrayPtrSeg& aResourceList ) + { + TInt errorCode = KErrNone; + GetPathL( aODT, EResourceODT ); + CFileStore* store = OpenFileStoreLC( *iPath ); + + if( !store ) + { + errorCode = KErrNotFound; + } + // Construct and open the root stream which contains the representation of our objects. + if( !errorCode ) + { + RStoreReadStream instream; + CleanupClosePushL( instream ); + + instream.OpenLC( *store, store->Root() ); + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + + odt->InternalizeHeaderL( instream ); + // consumes header delimiter + instream.ReadInt16L(); + odt->InternalizeResourceListL( instream ); + // destroy the direct file store object (closes the file) + for ( TInt i = 0; i < odt->ResourceCount(); i++ ) + { + aResourceList.AppendL( odt->ResourceL( i ).CloneL()); + } + + CleanupStack::PopAndDestroy( odt ); + + // Destroy the stream object and close the intstream + CleanupStack::PopAndDestroy( 2, &instream ); + + // Destroy the direct file store object (closes the file) + CleanupStack::PopAndDestroy( store ); + } + + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetRepositoryInfo +// Returns a refrence to a RArray-object containing changes in the repository system. +// It is a responsibilty of the caller to lock the repository for modifications. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::RegisterNotification( ThspsRepositoryInfo aRepositoryInfo ) + { + iRepositoryInfoQueue.Append( aRepositoryInfo ); + + for ( TInt i=0; i < iRepositoryInfoQueue.Count(); i++ ) + { + // take an info from the queue + ThspsRepositoryInfo info = iRepositoryInfoQueue[i]; + TBool consumed = EFalse; + // notify the observers until someone consumes the info + for ( TInt j=0; !consumed && j < iObservers.Count(); j++ ) + { + if ( iObservers[j]->HandleDefinitionRespositoryEvent( info ) ) + { + // observer has handled the event, stop this loop + consumed = ETrue; + } + } + // delete info from the queue + iRepositoryInfoQueue.Remove( i ); + } + iRepositoryInfoQueue.Compress(); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::RegisterObserverL +// Registers an observer. Observers will be notified when there are definition repository +// events available. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::RegisterObserverL + ( const MhspsDefinitionRepositoryObserver& aObserver ) + { + iObservers.Append( &aObserver ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::UnregisterObserver +// When an observer stops observation of definition repository events, it must +// unregister itself. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::UnregisterObserver + ( const MhspsDefinitionRepositoryObserver& aObserver ) + { + TInt found = iObservers.Find( &aObserver ); + if ( !( found == KErrNotFound )) + { + iObservers.Remove( found ); + } + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::Lock +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::Lock() + { + iLockSemaphore++; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::Lock() - semaphore increased to %d" ), + iLockSemaphore ); + } +#endif + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::Unlock +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::Unlock() + { + if (iLockSemaphore ) + { + iLockSemaphore--; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::Unlock() - semaphore decreased to %d" ), + iLockSemaphore ); + } +#endif + } + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::Locked +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TBool ChspsDefinitionRepository::Locked() const + { + return iLockSemaphore; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetODTPathLC +// Creates a path from the theme header information. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::GetODTPathL( const ChspsODT& aODT, TDes& aPath ) + { + GetPathL( aODT, EResourceODT ); + if ( iPath ) + { + aPath.Copy( iPath->Des() ); + } + else + User::Leave( KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::SetLogBus +// Set log bus. +// ----------------------------------------------------------------------------- +#ifdef HSPS_LOG_ACTIVE +EXPORT_C void ChspsDefinitionRepository::SetLogBus( void* aLogBus ) + { + iLogBus = (ChspsLogBus*)aLogBus; + } +#else +EXPORT_C void ChspsDefinitionRepository::SetLogBus( void* /*aLogBus*/ ) + { + } +#endif + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetPathL +// Creates a path from the theme header information. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::GetPathL( const ChspsODT& aODT, ThspsResourceType aResourceType ) + { + delete iPath; + iPath = NULL; + iPath = HBufC::NewL( KMaxFileName ); + TPtr pathPtr = iPath->Des(); + + TInt rootUid( aODT.RootUid() ); + TInt providerUid( aODT.ProviderUid() ); + TInt themeUid( aODT.ThemeUid() ); + + const TDesC& providerName = aODT.ProviderName(); + const TDesC& themeShortName = aODT.ThemeShortName(); + const TDesC& fileVersion = aODT.ThemeVersion(); + + User::LeaveIfError( iFs.PrivatePath( pathPtr )); + + AppendDesCIntoPathL( pathPtr, KThemesFolder ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + + if ( rootUid ) + { + // Append root uid + AppendNumIntoPathL( pathPtr, rootUid ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + if ( providerUid ) + { + // Append provider uid + AppendNumIntoPathL( pathPtr, providerUid ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + if ( themeUid ) + { + // Append configuration uid + AppendNumIntoPathL( pathPtr, themeUid ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + if ( fileVersion.Length() ) + { + // Append version + AppendDesCIntoPathL( pathPtr, fileVersion ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + + // path for source files + if ( aResourceType > EResourceODT ) + { + if ( aResourceType != EResourceXML ) + { + if ( aResourceType == EResourceDTD ) + { + // locales + AppendDesCIntoPathL( pathPtr, KLocaleFolder ); + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + AddLocalePathL( pathPtr, aODT.OdtLanguage() ); + } + else + { + // sources + AppendDesCIntoPathL( pathPtr, KSourceFolder ); + } + AppendDesCIntoPathL( pathPtr, KDoubleBackSlash ); + } + + } + + // resource source files do not need full path and filename + // because they must be stored as is + if ( aResourceType > EResourceNone && aResourceType < EResourceRES ) + { + if ( themeShortName.Length() ) + { + // Append configuration name + AppendDesCIntoPathL( pathPtr, themeShortName ); + } + else if ( themeUid ) + { + AppendNumIntoPathL( pathPtr, themeUid ); + } + + FileExtensionL( aResourceType, aODT.OdtLanguage() ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::AppendDesCIntoPathL +// Appends a descriptor into path. Leaves if fails. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::AppendDesCIntoPathL( TDes& aPath, const TDesC& aText ) + { + if ( ( KMaxFileName - aPath.Length() ) >= aText.Length() ) + { + aPath.Append( aText ); + } + else + { + User::Leave( KErrOverflow ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::AppendNumIntoPathL +// Appends a number into path. Leaves if fails. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::AppendNumIntoPathL( TDes& aPath, const TUint aNum ) + { + TInt len = 8; + if ( ( KMaxFileName - aPath.Length() ) >= len ) + { + aPath.AppendNum( aNum ); + } + else + { + User::Leave( KErrOverflow ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::FileExtensionL +// Returns a file extension for the given TDefRepFileExtension. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::FileExtensionL( ThspsResourceType aResourceType, + TInt /*aLanguage*/ ) + { + TPtr pathPtr = iPath->Des(); + switch ( aResourceType ) + { + case EResourceNone: + { + } + break; + case EResourceODT: + { + TBuf<6> extension( KODTFileExtension ); + AppendDesCIntoPathL( pathPtr, extension ); + } + break; + case EResourceDTD: + { + AppendDesCIntoPathL( pathPtr, KDTDFileExtension ); + } + break; + case EResourceXML: + { + AppendDesCIntoPathL( pathPtr, KXMLFileExtension ); + } + break; + case EResourceDAT: + { + AppendDesCIntoPathL( pathPtr, KDATFileExtension ); + } + break; + default: + { + User::Leave( KErrArgument ); + } + break; + }; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::PathExtensionL +// Returns a file extension for the given TDefRepFileExtension. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::AddLocalePathL( TDes& aPath, TInt aLanguage ) + { + TBuf<6> extension; + extension.AppendFormat( KFolderFormat, aLanguage ); + AppendDesCIntoPathL( aPath, extension ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::WriteToFileL +// Writes the ODT structure into file. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsDefinitionRepository::WriteToFileL( const ChspsODT& aODT ) + { + TInt errorCode = KErrNone; + errorCode = iFs.SetSessionToPrivate( EDriveC ); + if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, EDriveC ) ) + { + errorCode = KErrDiskFull; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::WriteToFileL(): - disk full." ) ); + } +#endif + } + + if ( !errorCode ) + { + // Create the directory structure + TInt err = iFs.MkDirAll( *iPath ); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + errorCode = err; + +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "ChspsDefinitionRepository::WriteToFileL(): - error %d." ), + err ); + } +#endif + } + + if ( !errorCode ) + { + // Create (replace) the direct file store + CFileStore* store = CDirectFileStore::ReplaceLC( iFs, *iPath, EFileWrite); + + // Must say what kind of file store. + store->SetTypeL( KDirectFileStoreLayoutUid ); + + // Construct the output stream. + RStoreWriteStream outstream; + CleanupClosePushL( outstream ); + + TStreamId id = outstream.CreateLC(*store); + + // Stream out the ChspsODT + outstream << aODT; + outstream.CommitL(); + + // Destroy the stream object and close the outstream + CleanupStack::PopAndDestroy( 2, &outstream ); + + // Set this stream id as the root + store->SetRootL(id); + store->CommitL(); + + // Destroy the direct file store object (closes the file), + CleanupStack::PopAndDestroy( store ); + } + } + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::ReadFromFileL +// Reads the ODT structure from the file. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsDefinitionRepository::ReadFromFileL( const TDesC& aPath, ChspsODT& aODT ) + { + TInt errorCode = KErrNone; + CFileStore* store = OpenFileStoreLC( aPath ); + if ( !store ) + { + errorCode = KErrNotFound; + } + // Construct and open the root stream which + // contains the representation of our objects. + if ( !errorCode ) + { + RStoreReadStream instream; + CleanupClosePushL( instream ); + + instream.OpenLC(*store,store->Root()); + + // Stream in the ODT + instream >> aODT; + + // Destroy the stream object and close the instream + CleanupStack::PopAndDestroy( 2, &instream ); + + // Destroy the direct file store object (closes the file), + CleanupStack::PopAndDestroy( store ); + } + + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::StreamHeaderFromFileL +// Streams the ODT header from the file into descriptor. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +HBufC8* ChspsDefinitionRepository::StreamHeaderFromFileL( const TDesC& aPath ) + { + HBufC8* dataStream( NULL ); + CFileStore* store( NULL ); + + store = OpenFileStoreLC( aPath ); + + if( store ) + { + // Construct and open the root stream, which + // contains the representation of our objects. + RStoreReadStream instream; + CleanupClosePushL( instream ); + + instream.OpenLC( *store, store->Root() ); + + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + + odt->InternalizeHeaderL( instream ); + + + dataStream = odt->MarshalHeaderL(); + + CleanupStack::PopAndDestroy( odt ); + + // Destroy the stream object and close the instream + CleanupStack::PopAndDestroy( 2, &instream ); + + // Destroy the direct file store object (closes the file) + CleanupStack::PopAndDestroy( store ); + } + + return dataStream; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::OpenFileStoreLC +// Searches and opens the CFileStore from the any drive. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +CFileStore* ChspsDefinitionRepository::OpenFileStoreLC( const TDesC& aPath ) + { + RFile file; + TDriveList drivelist; + CFileStore* store = NULL; + + TInt err( KErrNotFound ); + iFs.SetSessionToPrivate( EDriveC ); + err = file.Open(iFs, aPath, EFileShareReadersOnly ); + if ( !err ) + { + // if the file is empty CDirectFileStore::FromLC leaves. + TInt size(0); + file.Size(size); + if(size) + { + // Oownership of the file passes to the store + store = CDirectFileStore::FromLC( file ); + } + } + + if( err || !store ) + { + // Just for sanity + file.Close(); + } + + iLicenseDefault = EFalse; + + return store; + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::SelectFilesFromPathL +// Retrieves all the files from the given path. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::SelectFilesFromPathL( CDesCArraySeg& aFileList, const TDesC& aPath, + TEntryKey aSortFlag, const TDesC& aFileExtension ) + { + CDir* dirList; + User::LeaveIfError( iFs.GetDir( aPath, KEntryAttMaskSupported, aSortFlag, dirList )); + for ( TInt i = 0; i < dirList->Count(); i++) + { + if ( !(*dirList)[i].IsDir() ) + { + HBufC* path = HBufC::NewLC( aPath.Length() + (*dirList)[i].iName.Length() ); + TPtr pathPtr = path->Des(); + AppendDesCIntoPathL( pathPtr, aPath ); + AppendDesCIntoPathL( pathPtr, (*dirList)[i].iName ); + TParse p; + p.Set(pathPtr,NULL,NULL); + + // If the path is not pointing to the sources folder (e.g. is not a resource file) + if ( pathPtr.FindF( KSourceFolderWithSeperators ) == KErrNotFound ) + { + // If requested and parsed file extensions match + if ( !p.Ext().CompareF( aFileExtension ) ) + { + aFileList.AppendL( pathPtr ); + } + } + CleanupStack::PopAndDestroy( path ); + } + } + delete dirList; + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::CopyFileL +// Copies a file from the given location into path, +// which is stored in the iPath member variable. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsDefinitionRepository::CopyFileL( const TDesC& aSourceFile, const TDesC& aDestinationFile ) + { + TInt errorCode = KErrNone; + iFs.SetSessionToPrivate( EDriveC ); + // create the directory structure if one does not exist + TInt err = iFs.MkDirAll( aDestinationFile ); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + errorCode = err; + } + if ( !errorCode ) + { + + TEntry entry; + errorCode = iFs.Entry( aSourceFile, entry ); + if ( !errorCode && SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, entry.iSize, EDriveC ) ) + { + errorCode = KErrDiskFull; + } + + if ( !errorCode ) + { + CFileMan* fileMan = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileMan ); + errorCode = fileMan->Copy( aSourceFile, aDestinationFile, ( CFileMan::ERecurse | CFileMan::EOverWrite ) ); + errorCode = fileMan->Attribs( *iPath, KEntryAttNormal, + KEntryAttReadOnly | KEntryAttHidden, TTime(0) ); + CleanupStack::PopAndDestroy( fileMan ); + } + } + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::MatchingFoldersFromAllDrivesL +// Retrieves all the matching folders from the given path from every drive. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::MatchingFoldersFromAllDrivesL( const TDesC& aWildName, + const TDesC& aScanDir, CDesCArraySeg& aPathList ) + { + TFindFile fileFinder( iFs ); + CDir* fileList; + + // Exclude external and ROM drives from the following search + fileFinder.SetFindMask( KDriveAttExclude | KDriveAttRemovable |KDriveAttRemote |KDriveAttRom ); + + // Searches, using wildcards, for one or more files/directories in a specified directory. + // If no matching file is found in that directory, all available drives are searched in + // descending alphabetical order, from Y: to A:, and ending with the Z: drive. + // The search ends when one or more matching filenames are found, or when every available + // drive has been unsuccessfully searched. + // To begin searching again after a successful match has been made, use FindWild(). + TInt err = fileFinder.FindWildByDir( aWildName, aScanDir, fileList ); + while ( err == KErrNone ) + { + TInt i; + for ( i = 0; i < fileList->Count(); i++ ) + { + TPtrC name( (*fileList)[i].iName ); + if( (*fileList)[i].IsDir() + && KSourceFolder().CompareF( name ) != 0 + && KLocaleFolder().CompareF( name ) != 0 ) + { + TParse fullentry; + fullentry.Set( name, &fileFinder.File(), NULL); + + HBufC* path = HBufC::NewLC( fullentry.FullName().Length() + KDoubleBackSlash().Length() ); + TPtr pathPtr = path->Des(); + pathPtr.Append( fullentry.FullName() ); + pathPtr.Append( KDoubleBackSlash ); + aPathList.AppendL( pathPtr ); + CleanupStack::PopAndDestroy( path ); + } + }//for + delete fileList; + //Go trough all the drives a->z + err = fileFinder.FindWild( fileList ); + }//while + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::MatchingFoldersL +// Retrieves all the matching folders from the given path and drive. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsDefinitionRepository::MatchingFoldersL( const TDesC& aWildName, + const TDesC& aScanDir, CDesCArraySeg& aPathList ) + { + TInt foldersExists( KErrCancel ); + TFindFile fileFinder( iFs ); + CDir* fileList; + + TInt err = fileFinder.FindWildByDir( aWildName, aScanDir, fileList ); + if ( err == KErrNone ) + { + TInt i; + for ( i = 0; i < fileList->Count(); i++ ) + { + TPtrC name( (*fileList)[i].iName ); + if( (*fileList)[i].IsDir() + && KSourceFolder().CompareF( name ) != 0 + && KLocaleFolder().CompareF( name ) != 0 ) + { + foldersExists = KErrNone; + TParse fullentry; + fullentry.Set( name, &fileFinder.File(), NULL); + + HBufC* path = HBufC::NewLC( fullentry.FullName().Length() + KDoubleBackSlash().Length() ); + TPtr pathPtr = path->Des(); + pathPtr.Append( fullentry.FullName() ); + pathPtr.Append( KDoubleBackSlash ); + aPathList.AppendL( pathPtr ); + CleanupStack::PopAndDestroy( path ); + } + else + { + foldersExists = KErrNotFound; + } + }//for + delete fileList; + }//if + + return foldersExists; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::CopyFileL +// Copies a file from the given location into path, +// which is stored in the iPath member variable. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +TInt ChspsDefinitionRepository::CopyFileL( const TDesC& aSourceFile ) + { + TInt errorCode = KErrNone; + iFs.SetSessionToPrivate( EDriveC ); + // create the directory structure if one does not exist + TInt err = iFs.MkDirAll( *iPath ); + if ( err != KErrNone && err != KErrAlreadyExists ) + { + errorCode = err; + } + if ( !errorCode ) + { + TEntry entry; + errorCode = iFs.Entry( aSourceFile, entry ); + if ( !errorCode && SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, entry.iSize, EDriveC ) ) + { + errorCode = KErrDiskFull; + } + if ( !errorCode ) + { + CFileMan* fileMan = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileMan ); + errorCode = fileMan->Copy( aSourceFile, *iPath, CFileMan::EOverWrite ); + errorCode = fileMan->Attribs( *iPath, KEntryAttNormal, + KEntryAttReadOnly | KEntryAttHidden, TTime(0) ); + CleanupStack::PopAndDestroy( fileMan ); + } + } + return errorCode; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::RemoveDirectoryL +// Deletes the files and folders beneath the path, +// which is stored in the iPath member variable. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::RemoveDirectoryL() + { + TInt errorCode = KErrNone; + iFs.SetSessionToPrivate( EDriveC ); + CFileMan* fileMan = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileMan ); + TPtr pathPtr = iPath->Des(); + TInt err = fileMan->RmDir( pathPtr ); + if ( err != KErrNone && err != KErrPathNotFound ) + { + errorCode = err; // probably KErrInUse + } + else + { + //If the folder is empty -> remove it + TParsePtr path( pathPtr ); + TInt flag( ETrue ); + do + { + TInt err = path.PopDir(); + if ( !err ) + { + CDir* dirList; + err = iFs.GetDir( path.Path(), KEntryAttMaskSupported,ESortByName, dirList ); + if ( !err && dirList->Count() == 0 ) + { + err = fileMan->RmDir( path.Path() ); + } + else + { + flag = EFalse; + } + delete dirList; + } + } + while ( flag ); + } + CleanupStack::PopAndDestroy( fileMan ); + User::LeaveIfError( errorCode ); + } + + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::RestoreBackupConfiguration +// Restores defined configuration from backup folder +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C TInt ChspsDefinitionRepository::RestoreBackupConfiguration( + const ChspsODT& /*aODT*/ ) + { + TInt err( KErrNotFound ); + + return err; + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::BackupConfigurationL +// Copies defined configuration to theme backup folder +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::BackupConfigurationL( + const ChspsODT& aODT ) + { + HBufC* backupPath = HBufC::NewL( KMaxFileName ); + CleanupStack::PushL( backupPath ); + TPtr backupPathPtr = backupPath->Des(); + + User::LeaveIfError( iFs.PrivatePath( backupPathPtr )); + + AppendDesCIntoPathL( backupPathPtr, KBackupFolder ); + AppendDesCIntoPathL( backupPathPtr, KDoubleBackSlash ); + AppendDesCIntoPathL( backupPathPtr, KThemesFolder ); + AppendDesCIntoPathL( backupPathPtr, KDoubleBackSlash ); + + // Backup configuration file + GetPathL( aODT, EResourceODT ); + CopyFileL( iPath->Des(), backupPathPtr ); + + CleanupStack::PopAndDestroy( backupPath ); + + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::ClearBackupsL +// Clears previous backup data +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsDefinitionRepository::ClearBackupsL() + { + + HBufC* backupPath = HBufC::NewL( KMaxFileName ); + CleanupStack::PushL( backupPath ); + TPtr backupPathPtr = backupPath->Des(); + + User::LeaveIfError( iFs.PrivatePath( backupPathPtr )); + + AppendDesCIntoPathL( backupPathPtr, KBackupFolder ); + AppendDesCIntoPathL( backupPathPtr, KDoubleBackSlash ); + + RemoveDirectoryL( backupPathPtr ); + + CleanupStack::PopAndDestroy( backupPath ); + + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::GetOdtL +// Retrieves the odt-structure from the repository as a reference. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsDefinitionRepository::GetOdtL( + const TDes& aPath, + ChspsODT& aODT ) + { + User::LeaveIfError( ReadFromFileL( aPath, aODT ) ); + } + +// ----------------------------------------------------------------------------- +// ChspsDefinitionRepository::RemoveDirectoryL +// Deletes the defined directory ( files and folders recursively ) +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +void ChspsDefinitionRepository::RemoveDirectoryL( + TDesC& aDirPath ) + { + + iFs.SetSessionToPrivate( EDriveC ); + CFileMan* fileMan = CFileMan::NewL( iFs ); + CleanupStack::PushL( fileMan ); + TInt err = fileMan->RmDir( aDirPath ); + CleanupStack::PopAndDestroy( fileMan ); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresource/bwins/hspsresourceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresource/bwins/hspsresourceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,22 @@ +EXPORTS + ?CloneL@ChspsResource@@QAEPAV1@XZ @ 1 NONAME ; class ChspsResource * ChspsResource::CloneL(void) + ?ExternalizeL@ChspsResource@@QBEXAAVRWriteStream@@@Z @ 2 NONAME ; void ChspsResource::ExternalizeL(class RWriteStream &) const + ?FileName@ChspsResource@@QBEABVTDesC16@@XZ @ 3 NONAME ; class TDesC16 const & ChspsResource::FileName(void) const + ?InternalizeL@ChspsResource@@QAEXAAVRReadStream@@@Z @ 4 NONAME ; void ChspsResource::InternalizeL(class RReadStream &) + ?Language@ChspsResource@@QBEABW4TLanguage@@XZ @ 5 NONAME ; enum TLanguage const & ChspsResource::Language(void) const + ?LockingPolicy@ChspsResource@@QBE?AW4ThspsLockingPolicy@@XZ @ 6 NONAME ; enum ThspsLockingPolicy ChspsResource::LockingPolicy(void) const + ?MimeType@ChspsResource@@QBE?AVTDataType@@XZ @ 7 NONAME ; class TDataType ChspsResource::MimeType(void) const + ?NewL@ChspsResource@@SAPAV1@XZ @ 8 NONAME ; class ChspsResource * ChspsResource::NewL(void) + ?ResourceId@ChspsResource@@QBEABVTDesC16@@XZ @ 9 NONAME ; class TDesC16 const & ChspsResource::ResourceId(void) const + ?ResourceType@ChspsResource@@QBE?AW4ThspsResourceType@@XZ @ 10 NONAME ; enum ThspsResourceType ChspsResource::ResourceType(void) const + ?SetFileNameL@ChspsResource@@QAEXABVTDesC16@@@Z @ 11 NONAME ; void ChspsResource::SetFileNameL(class TDesC16 const &) + ?SetLanguage@ChspsResource@@QAEXABW4TLanguage@@@Z @ 12 NONAME ; void ChspsResource::SetLanguage(enum TLanguage const &) + ?SetLockingPolicy@ChspsResource@@QAEXW4ThspsLockingPolicy@@@Z @ 13 NONAME ; void ChspsResource::SetLockingPolicy(enum ThspsLockingPolicy) + ?SetMimeTypeL@ChspsResource@@QAEXVTDataType@@@Z @ 14 NONAME ; void ChspsResource::SetMimeTypeL(class TDataType) + ?SetResourceIdL@ChspsResource@@QAEXABVTDesC16@@@Z @ 15 NONAME ; void ChspsResource::SetResourceIdL(class TDesC16 const &) + ?SetResourceType@ChspsResource@@QAEXW4ThspsResourceType@@@Z @ 16 NONAME ; void ChspsResource::SetResourceType(enum ThspsResourceType) + ?SetConfigurationUid@ChspsResource@@QAEXH@Z @ 17 NONAME ; void ChspsResource::SetConfigurationUid(int) + ?ConfigurationUid@ChspsResource@@QBEHXZ @ 18 NONAME ; int ChspsResource::ConfigurationUid(void) const + ?SetTagsL@ChspsResource@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void ChspsResource::SetTagsL(class TDesC16 const &) + ?Tags@ChspsResource@@QBEABVTDesC16@@XZ @ 20 NONAME ; class TDesC16 const & ChspsResource::Tags(void) const + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresource/eabi/hspsresourceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresource/eabi/hspsresourceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +EXPORTS + _ZN13ChspsResource11SetLanguageERK9TLanguage @ 1 NONAME + _ZN13ChspsResource12InternalizeLER11RReadStream @ 2 NONAME + _ZN13ChspsResource12SetFileNameLERK7TDesC16 @ 3 NONAME + _ZN13ChspsResource12SetMimeTypeLE9TDataType @ 4 NONAME + _ZN13ChspsResource14SetResourceIdLERK7TDesC16 @ 5 NONAME + _ZN13ChspsResource15SetResourceTypeE17ThspsResourceType @ 6 NONAME + _ZN13ChspsResource16SetLockingPolicyE18ThspsLockingPolicy @ 7 NONAME + _ZN13ChspsResource4NewLEv @ 8 NONAME + _ZN13ChspsResource6CloneLEv @ 9 NONAME + _ZNK13ChspsResource10ResourceIdEv @ 10 NONAME + _ZNK13ChspsResource12ExternalizeLER12RWriteStream @ 11 NONAME + _ZNK13ChspsResource12ResourceTypeEv @ 12 NONAME + _ZNK13ChspsResource13LockingPolicyEv @ 13 NONAME + _ZNK13ChspsResource8FileNameEv @ 14 NONAME + _ZNK13ChspsResource8LanguageEv @ 15 NONAME + _ZNK13ChspsResource8MimeTypeEv @ 16 NONAME + _ZTI13ChspsResource @ 17 NONAME ; ## + _ZTV13ChspsResource @ 18 NONAME ; ## + _ZN13ChspsResource19SetConfigurationUidEi @ 19 NONAME + _ZNK13ChspsResource16ConfigurationUidEv @ 20 NONAME + _ZN13ChspsResource8SetTagsLERK7TDesC16 @ 21 NONAME + _ZNK13ChspsResource4TagsEv @ 22 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresource/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresource/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002-2004 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: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + + +PRJ_EXPORTS + +//Exporting new system headers: + +PRJ_MMPFILES +hspsresource.mmp + + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresource/group/hspsresource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresource/group/hspsresource.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2002-2004 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: Project definition for hspsResult +* +*/ + + +#include + +TARGET hspsresource.dll +TARGETTYPE dll + +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hspsresource.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY apmime.lib // MIME-library +LIBRARY bafl.lib +LIBRARY charconv.lib +LANG SC diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresource/src/hspsresource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresource/src/hspsresource.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,348 @@ +/* +* 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: Definition of a file resource +* +*/ + + +#include "hspsresource.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsResource::ChspsResource() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsResource::ChspsResource() + { + iLanguage = ELangTest; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsResource::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// ChspsResource::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsResource* ChspsResource::NewL() + { + ChspsResource* self = new( ELeave ) ChspsResource; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::CloneL() +// Returns an exact copy of this ChspsResource object. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsResource* ChspsResource::CloneL() + { + ChspsResource* clone = ChspsResource::NewL(); + CleanupStack::PushL( clone ); + clone->SetLockingPolicy( iLockingPolicy ); + clone->SetResourceType( iResourceType ); + clone->SetLanguage( iLanguage ); + clone->SetResourceIdL( *iResourceID ); + clone->SetFileNameL( *iFileName ); + clone->SetMimeTypeL( iMimeType ); + clone->SetConfigurationUid( iConfigurationUid ); + + CleanupStack::Pop( clone ); + return clone; + } + +// Destructor +ChspsResource::~ChspsResource() + { + delete iResourceID; + delete iFileName; + delete iTags; + } + + +// ----------------------------------------------------------------------------- +// ChspsResource::ExternalizeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteUint32L( iLockingPolicy ); + aStream.WriteUint32L( iResourceType ); + aStream.WriteUint32L( iLanguage ); + + if ( iResourceID ) + { + aStream << *iResourceID; + } + else + { + aStream << KNullDesC; + } + + if ( iFileName ) + { + aStream << *iFileName; + } + else + { + aStream << KNullDesC; + } + + + iMimeType.ExternalizeL(aStream); + + aStream.WriteUint32L( iConfigurationUid ); + + if ( iTags ) + { + aStream << *iTags; + } + else + { + aStream << KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsResource::InternalizeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::InternalizeL( RReadStream& aStream ) + { + iLockingPolicy = (ThspsLockingPolicy)aStream.ReadUint32L(); + iResourceType = (ThspsResourceType)aStream.ReadUint32L(); + iLanguage = (TLanguage)aStream.ReadUint32L(); + + delete iResourceID; + iResourceID = NULL; + iResourceID = HBufC::NewL(aStream, KMaxFileName ); + + delete iFileName; + iFileName = NULL; + iFileName = HBufC::NewL(aStream, KMaxFileName ); + + iMimeType.InternalizeL(aStream); + + iConfigurationUid = (TInt)aStream.ReadUint32L(); + + delete iTags; + iTags = NULL; + iTags = HBufC::NewL(aStream, KMaxTagsLength ); + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetLockingPolicy(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetLockingPolicy( ThspsLockingPolicy aLockingPolicy ) + { + iLockingPolicy = aLockingPolicy; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::LockingPolicy(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsLockingPolicy ChspsResource::LockingPolicy() const + { + return iLockingPolicy; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetResourceType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetResourceType( ThspsResourceType aResourceType ) + { + iResourceType = aResourceType; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::ResourceType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C ThspsResourceType ChspsResource::ResourceType() const + { + return iResourceType; + } + + +// ----------------------------------------------------------------------------- +// ChspsResource::SetResourceIdL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetResourceIdL( const TDesC& aResourceId ) + { + delete iResourceID; + iResourceID = NULL; + iResourceID = aResourceId.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsResource::ResourceId(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& ChspsResource::ResourceId() const + { + if ( iResourceID ) + { + return *iResourceID; + } + else + { + return KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetFileNameL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetFileNameL( const TDesC& aFileName ) + { + delete iFileName; + iFileName = NULL; + iFileName = aFileName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsResource::FileName(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& ChspsResource::FileName() const + { + if ( iFileName ) + { + return *iFileName; + } + else + { + return KNullDesC; + } + } + + +// ----------------------------------------------------------------------------- +// ChspsResource::SetMimeTypeL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetMimeTypeL( const TDataType aDataType ) + { + iMimeType = aDataType; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::MimeType(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TDataType ChspsResource::MimeType() const + { + return iMimeType; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetLanguage(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetLanguage( const TLanguage& aLanguage ) + { + iLanguage = aLanguage; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::Language(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TLanguage& ChspsResource::Language() const + { + return iLanguage; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetConfigurationUid(). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetConfigurationUid( const TInt aConfUid ) + { + iConfigurationUid = aConfUid; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::ConfigurationUid(). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsResource::ConfigurationUid() const + { + return iConfigurationUid; + } + +// ----------------------------------------------------------------------------- +// ChspsResource::SetTagsL(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResource::SetTagsL( const TDesC& aTag ) + { + delete iTags; + iTags = NULL; + iTags = aTag.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsResource::Tags(). +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC& ChspsResource::Tags() const + { + if ( iTags ) + { + return *iTags; + } + else + { + return KNullDesC; + } + } + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/bwins/hspsresultu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/bwins/hspsresultu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +EXPORTS + ?ExternalizeL@ChspsResult@@QBEXAAVRDesWriteStream@@@Z @ 1 NONAME ; void ChspsResult::ExternalizeL(class RDesWriteStream &) const + ?GetDataLength@ChspsResult@@QBEHXZ @ 2 NONAME ; int ChspsResult::GetDataLength(void) const + ?InternalizeL@ChspsResult@@QAEXAAVRDesReadStream@@@Z @ 3 NONAME ; void ChspsResult::InternalizeL(class RDesReadStream &) + ?NewL@ChspsResult@@SAPAV1@XZ @ 4 NONAME ; class ChspsResult * ChspsResult::NewL(void) + ?ResetData@ChspsResult@@QAEXXZ @ 5 NONAME ; void ChspsResult::ResetData(void) + ??0ChspsPluginIdList@@QAE@H@Z @ 6 NONAME ; ChspsPluginIdList::ChspsPluginIdList(int) + ??1ChspsPluginIdList@@UAE@XZ @ 7 NONAME ; ChspsPluginIdList::~ChspsPluginIdList(void) + ?ExternalizeL@ChspsPluginIdList@@QBEXAAVRDesWriteStream@@@Z @ 8 NONAME ; void ChspsPluginIdList::ExternalizeL(class RDesWriteStream &) const + ?InternalizeL@ChspsPluginIdList@@QAEXAAVRDesReadStream@@@Z @ 9 NONAME ; void ChspsPluginIdList::InternalizeL(class RDesReadStream &) + ?GetDataLength@ChspsPluginIdList@@QAEHXZ @ 10 NONAME ; int ChspsPluginIdList::GetDataLength(void) + ?ExternalizeL@ChspsRequestNotificationParams@@QBEXAAVRDesWriteStream@@@Z @ 11 NONAME ; void ChspsRequestNotificationParams::ExternalizeL(class RDesWriteStream &) const + ?GetDataLength@ChspsRequestNotificationParams@@QBEHXZ @ 12 NONAME ; int ChspsRequestNotificationParams::GetDataLength(void) const + ?InternalizeL@ChspsRequestNotificationParams@@QAEXAAVRDesReadStream@@@Z @ 13 NONAME ; void ChspsRequestNotificationParams::InternalizeL(class RDesReadStream &) + ?Name@ChspsRequestNotificationParams@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & ChspsRequestNotificationParams::Name(void) const + ?NewL@ChspsRequestNotificationParams@@SAPAV1@XZ @ 15 NONAME ; class ChspsRequestNotificationParams * ChspsRequestNotificationParams::NewL(void) + ?ResetData@ChspsRequestNotificationParams@@QAEXXZ @ 16 NONAME ; void ChspsRequestNotificationParams::ResetData(void) + ?SetNameL@ChspsRequestNotificationParams@@QAEXABVTDesC16@@@Z @ 17 NONAME ; void ChspsRequestNotificationParams::SetNameL(class TDesC16 const &) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/eabi/hspsresultu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/eabi/hspsresultu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +EXPORTS + _ZN11ChspsResult12InternalizeLER14RDesReadStream @ 1 NONAME + _ZN11ChspsResult4NewLEv @ 2 NONAME + _ZN11ChspsResult9ResetDataEv @ 3 NONAME + _ZNK11ChspsResult12ExternalizeLER15RDesWriteStream @ 4 NONAME + _ZNK11ChspsResult13GetDataLengthEv @ 5 NONAME + _ZTI11ChspsResult @ 6 NONAME ; ## + _ZTV11ChspsResult @ 7 NONAME ; ## + _ZN17ChspsPluginIdList12InternalizeLER14RDesReadStream @ 8 NONAME + _ZN17ChspsPluginIdListC1Ei @ 9 NONAME + _ZN17ChspsPluginIdListC2Ei @ 10 NONAME + _ZN17ChspsPluginIdListD0Ev @ 11 NONAME + _ZN17ChspsPluginIdListD1Ev @ 12 NONAME + _ZN17ChspsPluginIdListD2Ev @ 13 NONAME + _ZNK17ChspsPluginIdList12ExternalizeLER15RDesWriteStream @ 14 NONAME + _ZTI17ChspsPluginIdList @ 15 NONAME ; ## + _ZTV17ChspsPluginIdList @ 16 NONAME ; ## + _ZN17ChspsPluginIdList13GetDataLengthEv @ 17 NONAME + _ZN30ChspsRequestNotificationParams12InternalizeLER14RDesReadStream @ 18 NONAME + _ZN30ChspsRequestNotificationParams4NewLEv @ 19 NONAME + _ZN30ChspsRequestNotificationParams8SetNameLERK7TDesC16 @ 20 NONAME + _ZN30ChspsRequestNotificationParams9ResetDataEv @ 21 NONAME + _ZNK30ChspsRequestNotificationParams12ExternalizeLER15RDesWriteStream @ 22 NONAME + _ZNK30ChspsRequestNotificationParams13GetDataLengthEv @ 23 NONAME + _ZNK30ChspsRequestNotificationParams4NameEv @ 24 NONAME + _ZTI30ChspsRequestNotificationParams @ 25 NONAME ; ## + _ZTV30ChspsRequestNotificationParams @ 26 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* 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: ?Description +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW + + +PRJ_EXPORTS + +PRJ_MMPFILES +hspsresult.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/group/hspsresult.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/group/hspsresult.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2002-2004 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: Project definition for hspsResult +* +*/ + + +#include + +TARGET hspsresult.dll +TARGETTYPE dll + +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE hspsresult.cpp +SOURCE hspspluginidlist.cpp +SOURCE hspsreqnotifparam.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib + +LANG SC diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/src/hspspluginidlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/src/hspspluginidlist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,82 @@ +/* +* 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: Class ChspsPluginIdList is a HSPS utility class for passing +* plugin ids from a client process to the server process. +* +* +*/ + + +#include "hspspluginidlist.h" + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsPluginIdList::ChspsPluginIdList() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsPluginIdList::ChspsPluginIdList( TInt aGranularity ) : CArrayFixFlat( aGranularity ) + { + } + +// Destructor +EXPORT_C ChspsPluginIdList::~ChspsPluginIdList() + { + } + +// ----------------------------------------------------------------------------- +// ChspsPluginIdList::ExternalizeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsPluginIdList::ExternalizeL( RDesWriteStream& aStream ) const + { + const TInt count = Count(); + aStream.WriteUint32L( (TUint)count ); + for( TInt i=0; i< count; i++ ) + { + aStream.WriteUint32L( (TUint)At(i) ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsPluginIdList::InternalizeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsPluginIdList::InternalizeL( RDesReadStream& aStream ) + { + TInt count = aStream.ReadUint32L(); + for( TInt i=0; i< count; i++ ) + { + AppendL( aStream.ReadUint32L() ); + } + } + +// ----------------------------------------------------------------------------- +// ChspsPluginIdList::GetDataLength() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsPluginIdList::GetDataLength() + { + TInt len = sizeof( TUint ) + Count() * sizeof( TUint ); + return len; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/src/hspsreqnotifparam.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/src/hspsreqnotifparam.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2002-2004 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: Request Notification parameters +* +* +*/ + +#include "hspsdefinitionrepository.h" +#include "hspsreqnotifparam.h" + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::ChspsRequestNotificationParams() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsRequestNotificationParams::ChspsRequestNotificationParams() + { + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsRequestNotificationParams::ConstructL() + { + ResetData(); + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsRequestNotificationParams* ChspsRequestNotificationParams::NewL() + { + ChspsRequestNotificationParams* self = new( ELeave ) ChspsRequestNotificationParams; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +ChspsRequestNotificationParams::~ChspsRequestNotificationParams() + { + iPluginIds.Close(); + delete iName; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::ExternalizeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsRequestNotificationParams::ExternalizeL( RDesWriteStream& aStream ) const + { + aStream.WriteUint32L( (TUint)iEvent ); + aStream.WriteUint32L( (TUint)iAppUid ); + aStream.WriteUint32L( (TUint)iAppConfUid ); + aStream.WriteUint32L( (TUint)iOrigUid ); + aStream.WriteUint32L( (TUint)iPluginUid ); + aStream.WriteUint32L( (TUint)iCount ); + + for(TInt i =0; i < iCount; i++) + { + aStream.WriteUint32L( (TUint)iPluginIds[i] ); + } + + if ( iName ) + { + aStream << *iName; + } + else + { + aStream << KNullDesC; + } + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::InternalizeL +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsRequestNotificationParams::InternalizeL( RDesReadStream& aStream ) + { + iEvent = (TInt)aStream.ReadUint32L(); + iAppUid = (TInt)aStream.ReadUint32L(); + iAppConfUid = (TInt)aStream.ReadUint32L(); + iOrigUid = (TInt)aStream.ReadUint32L(); + iPluginUid = (TInt)aStream.ReadUint32L(); + iCount = (TInt)aStream.ReadUint32L(); + iPluginIds.Reset(); + for(TInt i=0; i < iCount; i++ ) + { + iPluginIds.AppendL((TInt)aStream.ReadUint32L()); + } + delete iName; + iName = NULL; + iName = HBufC::NewL(aStream, KMaxFileName ); + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::GetDataLength() +// Returns data length of ChspsRequestNotificationParams-object for streamin functions. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsRequestNotificationParams::GetDataLength() const + { + TInt len = sizeof( iEvent ); + len += sizeof(iAppUid); + len += sizeof(iAppConfUid); + len += sizeof(iPluginUid); + len += sizeof(iCount); + for(TInt i = 0; i < 0; i++) + { + len += sizeof(iPluginIds[i]); + } + + + if(iName) + { + len += KMaxFileName; + } + return len; + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::ResetData() +// Resets ChspsRequestNotificationParams's data members. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsRequestNotificationParams::ResetData() + { + iEvent = EhspsNoEvent; + iAppUid = 0; + iAppConfUid = 0; + iOrigUid = 0; + iPluginUid = 0; + iCount = 0; + iPluginIds.Reset(); + delete iName; + iName = NULL; + } +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::SetNameL +// Set Name +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C void ChspsRequestNotificationParams::SetNameL( const TDesC& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + } + +// ----------------------------------------------------------------------------- +// ChspsRequestNotificationParams::Name() +// Get Name +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +EXPORT_C const TDesC& ChspsRequestNotificationParams::Name() const + { + if ( iName ) + { + return *iName; + } + else + { + return KNullDesC; + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspsresult/src/hspsresult.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspsresult/src/hspsresult.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-2004 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: Class ChspsResult is a Xuikon utility class that defines Additional +* Return Code for Xuikon Application Theme Management Services on service +* request return. +* It is quaranteed that ChspsResult-object is always accessible after +* client request whether the result was successful or not. +* ChspsResult-class has attributes that informs the result as follows: +* - iSystemError - Symbian OS returned error code +* - iXuikonError - Xuikon defined error code in Xuikon error space +* - iIntValue1 - additional information relevant in the result. +* - iIntValue2 - additional information relevant in the result. +* +* +*/ + + +#include "hspsresult.h" + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ChspsResult::ChspsResult() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +ChspsResult::ChspsResult() + { + } + +// ----------------------------------------------------------------------------- +// ChspsResult::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void ChspsResult::ConstructL() + { + ResetData(); + } + +// ----------------------------------------------------------------------------- +// ChspsResult::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C ChspsResult* ChspsResult::NewL() + { + ChspsResult* self = new( ELeave ) ChspsResult; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +ChspsResult::~ChspsResult() + { + } + +// ----------------------------------------------------------------------------- +// ChspsResult::ExternalizeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResult::ExternalizeL( RDesWriteStream& aStream ) const + { + aStream.WriteUint32L( (TUint)iSystemError ); + aStream.WriteUint32L( (TUint)iXuikonError ); + aStream.WriteUint32L( (TUint)iIntValue1 ); + aStream.WriteUint32L( (TUint)iIntValue2 ); + } + +// ----------------------------------------------------------------------------- +// ChspsResult::InternalizeL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResult::InternalizeL( RDesReadStream& aStream ) + { + iSystemError = (TInt)aStream.ReadUint32L(); + iXuikonError = (TInt)aStream.ReadUint32L(); + iIntValue1 = (TInt)aStream.ReadUint32L(); + iIntValue2 = (TInt)aStream.ReadUint32L(); + } + +// ----------------------------------------------------------------------------- +// ChspsResult::GetDataLength() +// Returns data length of ChspsResult-object for streamin functions. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt ChspsResult::GetDataLength() const + { + TInt len = sizeof( iSystemError ); + len += sizeof(iXuikonError); + len += sizeof(iIntValue1); + len += sizeof(iIntValue2); + return len; + } + +// ----------------------------------------------------------------------------- +// ChspsResult::ResetData() +// Resets ChspsResult's data members. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void ChspsResult::ResetData() + { + iSystemError = 0; + iXuikonError = 0; + iIntValue1 = 0; + iIntValue2 = 0; + } + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/bwins/hspstools.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/bwins/hspstools.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +EXPORTS + ??0ChspsLogBus@@IAE@XZ @ 1 NONAME ; ChspsLogBus::ChspsLogBus(void) + ??1ChspsLiwDump@@UAE@XZ @ 2 NONAME ; ChspsLiwDump::~ChspsLiwDump(void) + ??1ChspsLogBus@@UAE@XZ @ 3 NONAME ; ChspsLogBus::~ChspsLogBus(void) + ??1ChspsLogBusFile@@UAE@XZ @ 4 NONAME ; ChspsLogBusFile::~ChspsLogBusFile(void) + ??1ChspsLogBusRDebug@@UAE@XZ @ 5 NONAME ; ChspsLogBusRDebug::~ChspsLogBusRDebug(void) + ?CreateLogFilename@ChspsLogBusFile@@SA?AV?$TBuf@$0BAA@@@ABVTDesC16@@@Z @ 6 NONAME ; class TBuf<256> ChspsLogBusFile::CreateLogFilename(class TDesC16 const &) + ?Dump@ChspsOdtDump@@SAXAAVChspsODT@@AAVChspsLogBus@@@Z @ 7 NONAME ; void ChspsOdtDump::Dump(class ChspsODT &, class ChspsLogBus &) + ?LogLiwListAsBinary@ChspsLiwDump@@QAEXAAVCLiwGenericParamList@@@Z @ 8 NONAME ; void ChspsLiwDump::LogLiwListAsBinary(class CLiwGenericParamList &) + ?LogLiwListAsText@ChspsLiwDump@@QAEXAAVCLiwGenericParamList@@@Z @ 9 NONAME ; void ChspsLiwDump::LogLiwListAsText(class CLiwGenericParamList &) + ?LogText@ChspsLogBus@@QAAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 10 NONAME ; void ChspsLogBus::LogText(class TRefByValue, ...) + ?LogText@ChspsLogBus@@QAAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 11 NONAME ; void ChspsLogBus::LogText(class TRefByValue, ...) + ?NewL@ChspsLiwDump@@SAPAV1@AAVChspsLogBus@@@Z @ 12 NONAME ; class ChspsLiwDump * ChspsLiwDump::NewL(class ChspsLogBus &) + ?NewL@ChspsLogBusFile@@SAPAV1@ABVTDesC16@@0@Z @ 13 NONAME ; class ChspsLogBusFile * ChspsLogBusFile::NewL(class TDesC16 const &, class TDesC16 const &) + ?NewL@ChspsLogBusRDebug@@SAPAV1@XZ @ 14 NONAME ; class ChspsLogBusRDebug * ChspsLogBusRDebug::NewL(void) + ?NewLC@ChspsLiwDump@@SAPAV1@AAVChspsLogBus@@@Z @ 15 NONAME ; class ChspsLiwDump * ChspsLiwDump::NewLC(class ChspsLogBus &) + ?NewLC@ChspsLogBusFile@@SAPAV1@ABVTDesC16@@0@Z @ 16 NONAME ; class ChspsLogBusFile * ChspsLogBusFile::NewLC(class TDesC16 const &, class TDesC16 const &) + ?NewLC@ChspsLogBusRDebug@@SAPAV1@XZ @ 17 NONAME ; class ChspsLogBusRDebug * ChspsLogBusRDebug::NewLC(void) + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/eabi/hspstools.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/eabi/hspstools.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +EXPORTS + _ZN11ChspsLogBus7LogTextE11TRefByValueIK6TDesC8Ez @ 1 NONAME + _ZN11ChspsLogBus7LogTextE11TRefByValueIK7TDesC16Ez @ 2 NONAME + _ZN11ChspsLogBusC2Ev @ 3 NONAME + _ZN11ChspsLogBusD0Ev @ 4 NONAME + _ZN11ChspsLogBusD1Ev @ 5 NONAME + _ZN11ChspsLogBusD2Ev @ 6 NONAME + _ZN12ChspsLiwDump16LogLiwListAsTextER20CLiwGenericParamList @ 7 NONAME + _ZN12ChspsLiwDump18LogLiwListAsBinaryER20CLiwGenericParamList @ 8 NONAME + _ZN12ChspsLiwDump4NewLER11ChspsLogBus @ 9 NONAME + _ZN12ChspsLiwDump5NewLCER11ChspsLogBus @ 10 NONAME + _ZN12ChspsLiwDumpD0Ev @ 11 NONAME + _ZN12ChspsLiwDumpD1Ev @ 12 NONAME + _ZN12ChspsLiwDumpD2Ev @ 13 NONAME + _ZN12ChspsOdtDump4DumpER8ChspsODTR11ChspsLogBus @ 14 NONAME + _ZN15ChspsLogBusFile17CreateLogFilenameERK7TDesC16 @ 15 NONAME + _ZN15ChspsLogBusFile4NewLERK7TDesC16S2_ @ 16 NONAME + _ZN15ChspsLogBusFile5NewLCERK7TDesC16S2_ @ 17 NONAME + _ZN15ChspsLogBusFileD0Ev @ 18 NONAME + _ZN15ChspsLogBusFileD1Ev @ 19 NONAME + _ZN15ChspsLogBusFileD2Ev @ 20 NONAME + _ZN17ChspsLogBusRDebug4NewLEv @ 21 NONAME + _ZN17ChspsLogBusRDebug5NewLCEv @ 22 NONAME + _ZN17ChspsLogBusRDebugD0Ev @ 23 NONAME + _ZN17ChspsLogBusRDebugD1Ev @ 24 NONAME + _ZN17ChspsLogBusRDebugD2Ev @ 25 NONAME + _ZTI11ChspsLogBus @ 26 NONAME ; ## + _ZTI12ChspsLiwDump @ 27 NONAME ; ## + _ZTI15ChspsByteBuffer @ 28 NONAME ; ## + _ZTI15ChspsLogBusFile @ 29 NONAME ; ## + _ZTI17ChspsLogBusRDebug @ 30 NONAME ; ## + _ZTV11ChspsLogBus @ 31 NONAME ; ## + _ZTV12ChspsLiwDump @ 32 NONAME ; ## + _ZTV15ChspsByteBuffer @ 33 NONAME ; ## + _ZTV15ChspsLogBusFile @ 34 NONAME ; ## + _ZTV17ChspsLogBusRDebug @ 35 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hspsodtdump.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsodtdump.h) +../inc/hspsliwdump.h MW_LAYER_PLATFORM_EXPORT_PATH(hspsliwdump.h) +../inc/hspslogbus.h MW_LAYER_PLATFORM_EXPORT_PATH(hspslogbus.h) +../inc/hspslogbusfile.h MW_LAYER_PLATFORM_EXPORT_PATH(hspslogbusfile.h) +../inc/hspslogbusrdebug.h MW_LAYER_PLATFORM_EXPORT_PATH(hspslogbusrdebug.h) + +PRJ_MMPFILES +hspstools.mmp diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/group/hspstools.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/group/hspstools.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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: Makefile of HSPSTools +* +*/ + + +#include + +TARGET hspstools.dll +TARGETTYPE dll +UID 0x1000008d 0x2001CB56 + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE +// SYSTEMINCLUDE /epoc32/include // Not needed since MW_LAYER_SYSTEMINCLUDE is used. + +MACRO HSPS_BUILD_LOG_IMPLEMENTATION // If this macro is not defined, then no logging functionality is built + // and only minimal class structure to fullfill exports are built. + // This way it is possible to remove unnecessary bits from code segment of + // this dll without breaking interface. DO NOT DEFINE IN PRODUCT RELEASE BUILD! + +SOURCEPATH ../src + +SOURCE hspstoolsdllmain.cpp hspslogbusfile.cpp hspslogbus.cpp hspslogbusrdebug.cpp hspsodtdump.cpp hspsliwdump.cpp hspsbytebuffer.cpp + +//By default, the build tools look for the WINSCW def file in a BWINS directory +//(at the same level as the directory containing the mmp file), +//the GCC ARM def file in a BMARM directory, and the ARMV5 def file in a EABI directory. +//If def files are stored in these locations, the project files does not need to specify +//the location of the def files explicitly. If you want to store the def files in some other +//location, you will need to specify in the project file where the .def files are using +//the deffile keyword. + +//The following commented out code shows how the build system uses the implicit +// location for defiles. To create the DEF files Choose Project > Freeze Exports from Carbide +// or run 'abld freeze' from the command-line +//#if defined (WINS) +// DEFFILE ../bwins/HSPSTools.def +//#elif defined (GCC32) +// DEFFILE ../bmarm/HSPSTools.def +//#else +// DEFFILE ../eabi/HSPSTools.def +//#endif + +nostrictdef + +LIBRARY euser.lib flogger.lib hspsdomdocument.lib liwservicehandler.lib estor.lib efsrv.lib hspsodt.lib charconv.lib hspsresource.lib + +#ifdef ENABLE_ABIV2_MODE +DEBUGGABLE +#endif + +// EXPORTUNFROZEN + +CAPABILITY ALL -TCB diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspsbytebuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspsbytebuffer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* 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: Header for ChspsByteBuffer. +* +*/ + +#ifndef HSPS_BYTEBUFFER_H +#define HSPS_BYTEBUFFER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** + * ChspsByteBuffer + * + */ +class ChspsByteBuffer : public CBase + { +public: + /** + * Destructor. + */ + ~ChspsByteBuffer(); + + /** + * Two-phased constructor. + * + * @param aSize Size of buffer. + */ + static ChspsByteBuffer* NewL( const TInt aSize ); + + /** + * Access data. + * + * @return TUint* Pointer to actual buffer. + */ + TUint8* Buffer(); + + /** + * Access size + * + * @return TInt Buffer size. + */ + TInt Size(); + +private: + /** + * Constructor for performing 1st stage construction + */ + ChspsByteBuffer(); + + /** + * EPOC default constructor for performing 2nd stage construction + * + * @param aSize Size of buffer. + */ + void ConstructL( const TInt aSize ); + +private: + /** + * Size of buffer. + */ + TInt iSize; + + /** + * Pointer to actual data. + */ + TUint8* iBuffer; + }; + +#endif // HSPS_BYTEBUFFER_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspsliwdump.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspsliwdump.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,186 @@ +/* +* 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: Header for ChspsLiwDump. +* +*/ + + +#ifndef HSPS_LIWDUMP_H +#define HSPS_LIWDUMP_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class ChspsLogBus; +class ChspsByteBuffer; + +// CLASS DECLARATION + +/** + * Helper class for dumping LIW to logging bus. + * + * @lib hspsTools.lib + * @since S60 5.0 + * @ingroup group_homescreenpluginservice_tools + */ +class ChspsLiwDump : public CBase + { +public: + /** + * Destructor. + */ + IMPORT_C ~ChspsLiwDump(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aLogBus ChspsLogBus to be used as output channel. + */ + IMPORT_C static ChspsLiwDump* NewL( ChspsLogBus& aLogBus ); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aLogBus ChspsLogBus to be used as output channel. + */ + IMPORT_C static ChspsLiwDump* NewLC( ChspsLogBus& aLogBus ); + + /** + * Write liw list as binary to specified log bus. + * + * @since S60 5.0 + * @param aLiwList A list to be printed. + */ + IMPORT_C void LogLiwListAsText( CLiwGenericParamList& aLiwList ); + + /** + * Write liw list as binary to specified log bus. + * + * @since S60 5.0 + * @param aLiwList A list to be printed. + */ + IMPORT_C void LogLiwListAsBinary( CLiwGenericParamList& aLiwList ); + +private: + + /** + * Constructor for performing 1st stage construction + * + * @param aLogBus ChspsLogBus to be used as output channel. + */ + ChspsLiwDump( ChspsLogBus& aLogBus ); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + + /** + * Write liw list as binary to specified log bus. + * + * @param aLiwList A list to be printed. + */ + void LogLiwListAsTextL( CLiwGenericParamList& aLiwList ); + + /** + * Write liw list as binary to specified log bus. + * + * @param aLiwList A list to be printed. + */ + void LogLiwListAsBinaryL( CLiwGenericParamList& aLiwList ); + + /** + * Parses the variant type. + * + * @param value Variant to be printed. + */ + void PrintVariantL( TLiwVariant value ); + + /** + * Prints liw map. + * + * @param value Map variant to be printed. + */ + void PrintMapL( TLiwVariant value ); + + /** + * Prints liw string variant. + * + * @param value String variant to be printed. + */ + void PrintStringL( TLiwVariant value ); + + /** + * Prints liw string variant. 8 bit variant. + * + * @param value String variant to be printed. + */ + void PrintString8L( TLiwVariant value ); + + /** + * Prints liw list variant. + * + * @param value List variant to be printed. + */ + void PrintListL( TLiwVariant value ); + + /** + * Appends indentation (delimiters) to the line of text. 8 bit variant. + * + * @param aText text to be printed. + * @param aDepth intendation depth. + * @param aDelim delimiter character or string. + */ + HBufC8* GetFixedText8LC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim ); + + /** + * Appends indentation (delimiters) to the line of text. + * + * @param aText text to be printed. + * @param aDepth intendation depth. + * @param aDelim delimiter character or string. + */ + HBufC* GetFixedTextLC( const TDesC& aText, + const TInt aDepth, + const TDesC& aDelim ); + + /** + * Appends indentation (delimiters) to the line of text. + * + * @param aBuffer ChspsByteBuffer instance containing + * source data for byte buffer. + * @return HBufC* Created c++ array. + */ + HBufC* CreateCPlusPlusDumpL( ChspsByteBuffer& aBuffer ) const; + +private: + /** + * Log bus to be used. + */ + ChspsLogBus& iLogBus; + + /** + * Depth level of indentation. + */ + TInt iDepth; + }; + +#endif // HSPS_LIWDUMP_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspslogbus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspslogbus.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Header for Base class for log busses. +* +*/ + + +#ifndef HSPS_LOGBUS_H +#define HSPS_LOGBUS_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** + * Base class for log busses. Not instanciable. + * + * @lib hspsTools.lib + * @since S60 5.0 + * @ingroup group_homescreenpluginservice_tools + */ +class ChspsLogBus : public CBase, TDes16Overflow, TDes8Overflow + { +public: + /** + * Destructor. + */ + IMPORT_C ~ChspsLogBus(); + + /** + * Log formattable 16bit string. + * + * @since S60 5.0 + * @param aFmt String to be logged. May contain format specifiers, but + * those must match with additional arguments given. + * ... Data to be inserted to formatted string. + */ + IMPORT_C void LogText( TRefByValue aFmt, ... ); + + /** + * Log formattable 8bit string. + * + * @since S60 5.0 + * @param aFmt String to be logged. May contain format specifiers, but + * those must match with additional arguments given. + * ... Data to be inserted to formatted string. + */ + IMPORT_C void LogText( TRefByValue aFmt, ... ); + +protected: + /** + * This method must be overwritten in inherited class (implementation). + * Implementation must log given string using logging channel of + * it's choice. + * + * @param aMessage Message to be logged. + */ + virtual void _LogText( const TDesC& aMessage ) = 0; + + /** + * This method is used to query max. line length from inheriting object. + * Default implementation returns 128. + * This value is used to crop descriptors before _LogText is called. + * + * @return TInt Max line length supported by this log bus. + */ + virtual TInt MaxLineLen() const; + + /** + * Constructor for performing 1st stage construction. + */ + IMPORT_C ChspsLogBus(); + +private: // Methods. + /** + * Create a heap descriptor using given arguments. + * + * @param aFmt Descriptor + * @param aList Variable length argument list. + * @return HBufC* Pointer to created heap descriptor. OWNERSHIP TRANSFERRED + * TO CALLER. + */ + HBufC* FormatMessage( TRefByValue aFmt, VA_LIST aList ); + + /** + * From TDes16Overflow. + * + * Handles the overflow. + + * This function is called when the TDes16::AppendFormat() + * variant that takes an overflow handler argument, fails. + * + * @param aDes The 16-bit modifiable descriptor whose overflow results in the + * call to this overflow handler. + * + */ + void Overflow( TDes16& aDes ); + + /** + * Create a heap descriptor using given arguments. + * + * @param aFmt Descriptor + * @param aList Variable length argument list. + * @return HBufC* Pointer to created heap descriptor. OWNERSHIP TRANSFERRED + * TO CALLER. + */ + HBufC* FormatMessage( TRefByValue aFmt, VA_LIST aList ); + + /** + * From TDes8Overflow. + * + * Handles the overflow. + + * This function is called when the TDes16::AppendFormat() + * variant that takes an overflow handler argument, fails. + * + * @param aDes The 16-bit modifiable descriptor whose overflow results in the + * call to this overflow handler. + * + */ + void Overflow( TDes8& aDes ); + + /** + * Crops text according to max line and then calls + * inherited class' _LogText. + * + * @param aText Message to be logged. + */ + void CropAndLogText( const TDesC& aText ); + +private: // Data. + /** + * Internal flag to indicate possible overflow. + */ + TBool iOverflow; + }; + +#endif // HSPS_LOGBUS_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspslogbusfile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspslogbusfile.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,119 @@ +/* +* 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: Header for ChspsLogBusFile. +* +*/ + + +#ifndef HSPS_LOGBUSFILE_H +#define HSPS_LOGBUSFILE_H + +// INCLUDES +#include +#include +#include +#include + +// CLASS DECLARATION + +/** + * ChspsLogBus implementation that logs into RFileLogger. + * + * @lib hspsTools.lib + * @since S60 5.0 + * @ingroup group_homescreenpluginservice_tools + */ +class ChspsLogBusFile : public ChspsLogBus + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~ChspsLogBusFile(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aLoggingFile Target file name. + * @param aLoggingDirectory Target folder. + */ + IMPORT_C static ChspsLogBusFile* NewL( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory = KNullDesC() ); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aLoggingFile Target file name. + * @param aLoggingDirectory Target folder. + */ + IMPORT_C static ChspsLogBusFile* NewLC( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory = KNullDesC() ); + + /** + * Create log file name easily with format "baseline_.log" + * + * @since S60 5.0 + * @param aBaseline Baseline text. + * @return TFileName Newly created file name. + */ + IMPORT_C static TFileName CreateLogFilename( const TDesC& aBaseline ); + +private: // Methods. + /** + * From ChspsLogBus. + * + * This method must be overwritten in inherited class (implementation). + * Implementation must log given string using logging channel of + * it's choice. + * + * @param aMessage Message to be logged. + */ + virtual void _LogText( const TDesC& aMessage); + + /** + * Constructor for performing 1st stage construction + */ + ChspsLogBusFile(); + + /** + * EPOC default constructor for performing 2nd stage construction + * + * @param aLoggingFile Target file name. + * @param aLoggingDirectory Target folder. + */ + void ConstructL( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory ); + +private: // Data. + /** + * Handle to file logger. + */ + RFileLogger iFileLogger; + + /** + * Name of logging file. + */ + HBufC* iLoggingFile; + + /** + * Name of logging directory. + */ + HBufC* iLoggingDirectory; + }; + +#endif // HSPS_LOGBUSFILE_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspslogbusrdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspslogbusrdebug.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef HSPS_LOGBUSRDEBUG_H +#define HSPS_LOGBUSRDEBUG_H + +// INCLUDES +#include +#include +#include + +// CLASS DECLARATION + +/** + * ChspsLogBus implementation that logs into RDebug. + * + * @lib hspsTools.lib + * @since S60 5.0 + * @ingroup group_homescreenpluginservice_tools + */ +class ChspsLogBusRDebug : public ChspsLogBus + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~ChspsLogBusRDebug(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsLogBusRDebug* NewL(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsLogBusRDebug* NewLC(); + +private: // Methods. + /** + * From ChspsLogBus. + * + * This method must be overwritten in inherited class (implementation). + * Implementation must log given string using logging channel of + * it's choice. + * + * @param aMessage Message to be logged. + */ + virtual void _LogText( const TDesC& aMessage); + + /** + * Constructor for performing 1st stage construction + */ + ChspsLogBusRDebug(); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + }; + +#endif // HSPS_LOGBUSRDEBUG_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/inc/hspsodtdump.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/inc/hspsodtdump.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Header for ChspsOdtDump. +* +*/ + + +#ifndef HSPS_ODTDUMP_H +#define HSPS_ODTDUMP_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class ChspsDomNode; +class ChspsODT; +class ChspsLogBus; + +// CLASS DECLARATION + +/** + * Static helper class for dumping DOM model to a textual logging bus. + * + * @lib hspsTools.lib + * @since S60 5.0 + * @ingroup group_homescreenpluginservice_tools + */ +class ChspsOdtDump : public CBase + { +public: // Methods for public usage. + /** + * Dumps DOM document and resources contained in given ODT. + * + * @since S60 5.0 + * @param aOdt ODT object that contains DOM document and resources. + * @param aLogBus Target logging channel to be used as output. + */ + IMPORT_C static void Dump( ChspsODT& aOdt, ChspsLogBus& aLogBus ); + +private: // Internal. + /** + * Dumps DOM document and resources contained in given ODT. + * + * @param aDomDocument Document to be dumped. + * @param aLogBus Target logging channel to be used as output. + */ + static void DumpL( ChspsODT& aOdt, ChspsLogBus& aLogBus ); + + /** + * Get depth of node. + * + * @param aNode Source node. + * @return TInt Depth of node. + */ + static TInt GetNodeDepth( ChspsDomNode *aNode ); + + /** + * String helper method. + * + * @param aText Source text. + * @param aDepth Depth. + * @param aDelim Delimiter. + * @param aShowHighlight Show highlight. + * @return HBufC8* Resulted text. + */ + static HBufC8* GetFixedTextLC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim, + TBool aShowHighlight ); + }; + +#endif // HSPS_DOMDUMP_H diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspsbytebuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspsbytebuffer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Implementation of ChspsByteBuffer. +* +*/ + + +#include "hspsbytebuffer.h" + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::~ChspsByteBuffer +// ---------------------------------------------------------------------------- +// +ChspsByteBuffer::~ChspsByteBuffer() + { + delete[] iBuffer; + iBuffer = NULL; + } + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::NewL +// ---------------------------------------------------------------------------- +// +ChspsByteBuffer* ChspsByteBuffer::NewL( const TInt aSize ) + { + ChspsByteBuffer* self = new (ELeave) ChspsByteBuffer(); + CleanupStack::PushL( self ); + self->ConstructL( aSize ); + CleanupStack::Pop( self ); + return self; + } + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::Buffer +// ---------------------------------------------------------------------------- +// +TUint8* ChspsByteBuffer::Buffer() + { + return iBuffer; + } + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::Size +// ---------------------------------------------------------------------------- +// +TInt ChspsByteBuffer::Size() + { + return iSize; + } + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::ChspsByteBuffer +// ---------------------------------------------------------------------------- +// +ChspsByteBuffer::ChspsByteBuffer() + { + // No implementation required + } + +//---------------------------------------------------------------------------- +// ChspsByteBuffer::ConstructL +// ---------------------------------------------------------------------------- +// +void ChspsByteBuffer::ConstructL( const TInt aSize ) + { + if( aSize <= 0 ) + { + User::Leave( KErrArgument ); + } + + iBuffer = new (ELeave) TUint8[ aSize ]; + iSize = aSize; + } diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspsliwdump.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspsliwdump.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,433 @@ +/* +* 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: Implementation of ChspsLiwDump. +* +*/ + + +#include "hspsbytebuffer.h" +#include "hspsliwdump.h" +#include "hspslogbus.h" +#include +#include + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +// indentation delimiter +_LIT8 (KDelim8, "\t" ); +_LIT( KDelim, "\t" ); +_LIT( KCPlusPlusArrayStart, "const TUint8 liwDump[] = {" ); +_LIT( KCPlusPlusArrayEnd, "};" ); +const TInt KCPlusPlusArraySanityLimit = 16384; // 16kb. +_LIT( KByteFormat, "0x%02x" ); +_LIT( KLiwListBinaryDumpStartTag, "#LIW LIST BINARY DUMP START" ); +_LIT( KLiwListBinaryDumpEndTag, "#LIW LIST BINARY DUMP END" ); +_LIT( KLiwListTextDumpStartTag, "#LIW LIST TEXT DUMP START" ); +_LIT( KLiwListTextDumpEndTag, "#LIW LIST TEXT DUMP END" ); +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::~ChspsLiwDump +//------------------------------------------------------------------------------ +EXPORT_C ChspsLiwDump::~ChspsLiwDump() + { + } + +//------------------------------------------------------------------------------ +// ChspsLiwDump::NewLC +//------------------------------------------------------------------------------ +EXPORT_C ChspsLiwDump* ChspsLiwDump::NewLC( ChspsLogBus& aLogBus ) + { + ChspsLiwDump* self = new (ELeave)ChspsLiwDump( aLogBus ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +//------------------------------------------------------------------------------ +// ChspsLiwDump::NewL +//------------------------------------------------------------------------------ +EXPORT_C ChspsLiwDump* ChspsLiwDump::NewL( ChspsLogBus& aLogBus ) + { + ChspsLiwDump* self = ChspsLiwDump::NewLC( aLogBus ); + CleanupStack::Pop( self ); // self; + return self; + } + +//------------------------------------------------------------------------------ +// ChspsLiwDump::LogLiwListAsText +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C void ChspsLiwDump::LogLiwListAsText( CLiwGenericParamList& aLiwList ) + { + TRAP_IGNORE( LogLiwListAsTextL( aLiwList ); ); + } +#else +EXPORT_C void ChspsLiwDump::LogLiwListAsText( CLiwGenericParamList& /*aLiwList*/ ) + { + } +#endif + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +//------------------------------------------------------------------------------ +// ChspsLiwDump::LogLiwListAsBinary +//------------------------------------------------------------------------------ +EXPORT_C void ChspsLiwDump::LogLiwListAsBinary( CLiwGenericParamList& aLiwList ) + { + TRAP_IGNORE( LogLiwListAsBinaryL( aLiwList ); ); + } +#else +EXPORT_C void ChspsLiwDump::LogLiwListAsBinary( CLiwGenericParamList& /*aLiwList*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::ChspsLiwDump +//------------------------------------------------------------------------------ +ChspsLiwDump::ChspsLiwDump( ChspsLogBus& aLogBus ) : iLogBus( aLogBus ) + { + iDepth = 0; + } + +//------------------------------------------------------------------------------ +// ChspsLiwDump::ConstructL +//------------------------------------------------------------------------------ +void ChspsLiwDump::ConstructL() + { + } + +//------------------------------------------------------------------------------ +// ChspsLiwDump::LogLiwListAsTextL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::LogLiwListAsTextL( CLiwGenericParamList& aLiwList ) + { + iLogBus.LogText( KLiwListTextDumpStartTag ); + + // implementation for GetActiveAppConf and GetPluginConf that has map + // as base root. + iDepth = 0; + TInt count = aLiwList.Count(); + for( TInt i = 0; i < count; i++ ) + { + //get Generic param and check for param id and name. + TLiwGenericParam param = aLiwList[i]; + //Check for the param identifier: + LIW::TGenericParamId identifier = param.SemanticId(); + //print semanticId: + iLogBus.LogText( _L8(" SemanticId: %d"), identifier ); + if( identifier == LIW::EGenericParamError ) + { + iLogBus.LogText( _L8(" ERROR: EGenericParamError") ); + } + //get generic param name. + //print name. + iLogBus.LogText( param.Name() ); + //get Variant + TLiwVariant value = param.Value(); + //get variant type. + PrintVariantL( value ); + } + + iLogBus.LogText( KLiwListTextDumpEndTag ); + } +#else +void ChspsLiwDump::LogLiwListAsTextL( CLiwGenericParamList& /*aLiwList*/ ) + { + } +#endif + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +//------------------------------------------------------------------------------ +// ChspsLiwDump::LogLiwListAsBinaryL +//------------------------------------------------------------------------------ +void ChspsLiwDump::LogLiwListAsBinaryL( CLiwGenericParamList& aLiwList ) + { + iLogBus.LogText( KLiwListBinaryDumpStartTag ); + + const TInt byteSize = aLiwList.Size(); + if( byteSize <= 0 ) + { + User::Leave( KErrArgument ); + } + + // Create memory buffer. + ChspsByteBuffer* buffer = ChspsByteBuffer::NewL( byteSize ); + CleanupStack::PushL( buffer ); + + // Wrap buffer using memory stream. + RMemWriteStream stream; + stream.Open( buffer->Buffer(), byteSize ); + stream.PushL(); + + // Use stream that wraps buffer to enable direct-to-RAM + // streaming from CLiwGenericParamList. + aLiwList.ExternalizeL( stream ); + stream.CommitL(); + + // Clean stream wrapper. + stream.Release(); + stream.Close(); + stream.Pop(); + + // Create C++ array and print it. + HBufC* cplusplusDump = CreateCPlusPlusDumpL( *buffer ); + iLogBus.LogText( *cplusplusDump ); + delete cplusplusDump; + cplusplusDump = NULL; + + // Clean memory buffer + CleanupStack::PopAndDestroy( buffer ); + + iLogBus.LogText( KLiwListBinaryDumpEndTag ); + } +#else +void ChspsLiwDump::LogLiwListAsBinaryL( CLiwGenericParamList& /*aLiwList*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::PrintVariantL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::PrintVariantL( TLiwVariant value ) + { + LIW::TVariantTypeId variantId = value.TypeId(); + if( variantId == LIW::EVariantTypeDesC8 ) + { + PrintString8L( value ); + } + else if( variantId == LIW::EVariantTypeDesC ) + { + PrintStringL( value ); + } + else if ( variantId == LIW::EVariantTypeMap ) + { + HBufC* text = GetFixedTextLC( _L(""), iDepth, KDelim ); + iLogBus.LogText( *text ); + CleanupStack::PopAndDestroy( text ); + PrintMapL( value ); + } + else if ( variantId == LIW::EVariantTypeList ) + { + HBufC* text = GetFixedTextLC( _L(""), iDepth, KDelim ); + iLogBus.LogText( *text ); + CleanupStack::PopAndDestroy( text ); + PrintListL( value ); + } + else + { + iLogBus.LogText( _L8("--- TODO: Unknown --- ")); + } + } +#else +void ChspsLiwDump::PrintVariantL( TLiwVariant /*value*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::PrintMapL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::PrintMapL( TLiwVariant value ) + { + //get map from the variant. + //get map values. + const CLiwMap* map = value.AsMap(); + TInt count = map->Count(); + for( TInt i = 0; i < count; i++ ) + { + HBufC* index = GetFixedTextLC( _L("---"), iDepth, KDelim ); + iLogBus.LogText( *index ); + CleanupStack::PopAndDestroy( index ); + TBuf8<100> buf; + map->AtL( i, buf); + HBufC8* text = GetFixedText8LC( buf, iDepth, KDelim8 ); + iLogBus.LogText( *text ); + CleanupStack::PopAndDestroy( text ); + TLiwVariant value; + map->FindL( buf, value ); + PrintVariantL( value ); + value.Reset(); + } + } +#else +void ChspsLiwDump::PrintMapL( TLiwVariant /*value*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::PrintStringL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::PrintStringL( TLiwVariant value ) + { + TPtrC textValue = value.AsDes(); + HBufC* text = GetFixedTextLC( textValue, iDepth, KDelim ); + iLogBus.LogText( *text ); + CleanupStack::PopAndDestroy( text ); + } +#else +void ChspsLiwDump::PrintStringL( TLiwVariant /*value*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::PrintString8L +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::PrintString8L( TLiwVariant value ) + { + TPtrC8 textValue = value.AsData(); + HBufC8* text = GetFixedText8LC( textValue, iDepth, KDelim8 ); + iLogBus.LogText( *text ); + CleanupStack::PopAndDestroy( text ); + } +#else +void ChspsLiwDump::PrintString8L( TLiwVariant /*value*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::PrintListL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLiwDump::PrintListL( TLiwVariant value ) + { + iDepth++; + const CLiwList* list = value.AsList(); + TInt count = list->Count(); + for( TInt i = 0; i < count; i++ ) + { + HBufC* index = GetFixedTextLC( _L("---"), iDepth, KDelim ); + iLogBus.LogText( *index ); + CleanupStack::PopAndDestroy( index ); + TLiwVariant value; + list->AtL( i, value ); + PrintVariantL( value ); + value.Reset(); + } + iDepth--; + } +#else +void ChspsLiwDump::PrintListL( TLiwVariant /*value*/ ) + { + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::GetFixedText8LC +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC8* ChspsLiwDump::GetFixedText8LC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim ) + { + HBufC8 *buf = HBufC8::NewLC( aDepth * aDelim.Length() + aText.Length() + 1 ); + TInt i = 0; + for( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + buf->Des().Append( aText ); + return buf; + } +#else +HBufC8* ChspsLiwDump::GetFixedText8LC( const TDesC8& /*aText*/, + const TInt /*aDepth*/, + const TDesC8& /*aDelim*/ ) + { + return NULL; + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::GetFixedTextLC +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC* ChspsLiwDump::GetFixedTextLC( const TDesC& aText, + const TInt aDepth, + const TDesC& aDelim ) + { + HBufC *buf = HBufC::NewLC( aDepth * aDelim.Length() + aText.Length() + 1 ); + TInt i = 0; + for( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + buf->Des().Append( aText ); + return buf; + } +#else +HBufC* ChspsLiwDump::GetFixedTextLC( const TDesC& /*aText*/, + const TInt /*aDepth*/, + const TDesC& /*aDelim*/ ) + { + return NULL; + } +#endif + +//------------------------------------------------------------------------------ +// ChspsLiwDump::CreateCPlusPlusDumpL +//------------------------------------------------------------------------------ +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC* ChspsLiwDump::CreateCPlusPlusDumpL( ChspsByteBuffer& aBuffer ) const + { + if( aBuffer.Size() <= 0 ) + { + User::Leave( KErrArgument ); + } + + if( aBuffer.Size() > KCPlusPlusArraySanityLimit ) + { + User::Leave( KErrArgument ); + } + + // Calcute required space. + const TInt KOneByteFootprint = 5; // hex is like 0x00 = 4 bytes, then trailing ',' for each one. + const TInt KRequiredSpace = KCPlusPlusArrayStart().Length() + + ( aBuffer.Size() * KOneByteFootprint ) + + KCPlusPlusArrayEnd().Length(); + + // Create descriptor. + HBufC* descriptor = HBufC::NewLC( KRequiredSpace ); + TPtr16 pointer = descriptor->Des(); + pointer.Append( KCPlusPlusArrayStart ); + for( TInt i = 0; i < aBuffer.Size(); i++ ) + { + TUint byte = ( TUint ) ( ( aBuffer.Buffer() )[i] ); + pointer.AppendFormat( KByteFormat, byte ); + + // Add ',' for all but the last element. + if( i != ( aBuffer.Size() - 1 ) ) + { + pointer.Append( TChar( ',' ) ); + } + } + pointer.Append( KCPlusPlusArrayEnd ); + + CleanupStack::Pop( descriptor ); + return descriptor; + } +#else +HBufC* ChspsLiwDump::CreateCPlusPlusDumpL( ChspsByteBuffer& /*aBuffer*/ ) const + { + return NULL; + } +#endif diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspslogbus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspslogbus.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,307 @@ +/* +* 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: Implementation of ChspsLogBus. +* +*/ + + +#include "hspslogbus.h" + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +const TInt KMessageGranularity = 256; // initial size and grow-by factor. +const TInt KMessageSanityLimit = 16384; // 16kb. +_LIT( KLogError, "Warning: Logging failed." ); +const TInt KDefaultMaxLineLen = 128; +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::~ChspsLogBus +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBus::~ChspsLogBus() + { + } + +//---------------------------------------------------------------------------- +// ChspsLogBus::LogText +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C void ChspsLogBus::LogText( TRefByValue aFmt, ... ) + { + VA_LIST list; + VA_START( list, aFmt ); + + HBufC* formatted = FormatMessage( aFmt, list ); + if( formatted ) + { + CropAndLogText( *formatted ); + delete formatted; + formatted = NULL; + } + else + { + _LogText( KLogError() ); + } + + VA_END( list ); + } +#else +EXPORT_C void ChspsLogBus::LogText( TRefByValue /*aFmt*/, ... ) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::LogText +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C void ChspsLogBus::LogText( TRefByValue aFmt, ... ) + { + VA_LIST list; + VA_START( list, aFmt ); + + HBufC* formatted = FormatMessage( aFmt, list ); + if( formatted ) + { + CropAndLogText( *formatted ); + delete formatted; + formatted = NULL; + } + else + { + _LogText( KLogError() ); + } + + VA_END( list ); + } +#else +EXPORT_C void ChspsLogBus::LogText( TRefByValue /*aFmt*/, ... ) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::ChspsLogBus +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +TInt ChspsLogBus::MaxLineLen() const + { + return KDefaultMaxLineLen; + } +#else +TInt ChspsLogBus::MaxLineLen() const + { + return KErrNotSupported; + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::ChspsLogBus +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBus::ChspsLogBus() + { + // No implementation required + } + +//---------------------------------------------------------------------------- +// ChspsLogBus::FormatMessage +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC* ChspsLogBus::FormatMessage( TRefByValue aFmt, VA_LIST aList ) + { + HBufC* message = NULL; + + TInt messageSize = KMessageGranularity; + + while( ETrue ) + { + TRAPD( err, message = HBufC::NewL( messageSize ) ); + if( err != KErrNone ) + { + delete message; + message = NULL; + + break; + } + + iOverflow = EFalse; + message->Des().AppendFormatList( aFmt, aList, this ); + if( !iOverflow ) + { + // All ok. + break; + } + else + { + messageSize *= 2; + + delete message; + message = NULL; + + // Sanity check. + if( messageSize > KMessageSanityLimit ) + { + break; + } + } + } + + return message; + } +#else +HBufC* ChspsLogBus::FormatMessage( TRefByValue /*aFmt*/, VA_LIST /*aList*/ ) + { + return NULL; + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::Overflow +// ---------------------------------------------------------------------------- +// +void ChspsLogBus::Overflow( TDes16& /*aDes*/ ) + { + iOverflow = ETrue; + } + +//---------------------------------------------------------------------------- +// ChspsLogBus::FormatMessage +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC* ChspsLogBus::FormatMessage( TRefByValue aFmt, VA_LIST aList ) + { + HBufC8* message8bit = NULL; + + TInt messageSize = KMessageGranularity; + + while( ETrue ) + { + TRAPD( err, message8bit = HBufC8::NewL( messageSize ) ); + if( err != KErrNone ) + { + delete message8bit; + message8bit = NULL; + + break; + } + + iOverflow = EFalse; + message8bit->Des().AppendFormatList( aFmt, aList, this ); + if( !iOverflow ) + { + // All ok. + break; + } + else + { + messageSize *= 2; + + delete message8bit; + message8bit = NULL; + + // Sanity check. + if( messageSize >= KMessageSanityLimit ) + { + break; + } + } + } + + // Convert 8bit to 16bit for logging. + HBufC* message16bit = NULL; + if( message8bit && message8bit->Length() > 0 ) + { + TRAPD( err, message16bit = HBufC::NewL( message8bit->Length() )); + if( err == KErrNone ) + { + message16bit->Des().Copy( *message8bit ); + } + else + { + delete message16bit; + message16bit = NULL; + } + } + else if( message8bit && message8bit->Length() == 0 ) + { + // Source is empty. + TRAP_IGNORE( message16bit = KNullDesC().AllocL() ); + } + + delete message8bit; + message8bit = NULL; + + return message16bit; + } +#else +HBufC* ChspsLogBus::FormatMessage( TRefByValue /*aFmt*/, VA_LIST /*aList*/ ) + { + return NULL; + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBus::Overflow +// ---------------------------------------------------------------------------- +// +void ChspsLogBus::Overflow( TDes8& /*aDes*/ ) + { + iOverflow = ETrue; + } + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLogBus::CropAndLogText( const TDesC& aText ) + { + const TInt KLineMax = MaxLineLen(); + + // Fits to one line. + if( aText.Length() <= KLineMax ) + { + _LogText( aText ); + return; + } + + // Does not fit. Log cropped. + TPtrC ptr = aText; + while( ETrue ) + { + const TInt KRemainingLen = ptr.Length(); + if( KRemainingLen == 0 ) + { + break; + } + + if( KRemainingLen <= KLineMax ) + { + _LogText( ptr ); + break; + } + else + { + _LogText( ptr.Left( KLineMax ) ); + ptr.Set( ptr.Right( ptr.Length() - KLineMax ) ); + } + } + } +#else +void ChspsLogBus::CropAndLogText( const TDesC& /*aText*/ ) + { + } +#endif diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspslogbusfile.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,170 @@ +/* +* 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: Implementation of ChspsLogBusFile. +* +*/ + + +#include "hspslogbusfile.h" +#include "e32debug.h" + +// Constants + +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +_LIT( KDefaultLoggingDirectory, "hsps" ); +_LIT( KTimeFormatAndExtension, "%F%D_%M_%Y_%H_%T_%C.log"); // F=FORCE, dd_mm_yyyy_hh_mm_mmmmmm +const TInt KTimeFormatAndExtensionMaxLength = ( 2 + 1 ) + // 'dd_' + ( 2 + 1 ) + // 'mm_' + ( 4 + 1 ) + // 'yyyy_' + ( 2 + 1 ) + // 'hh_' + ( 2 + 1 ) + // 'mm_' + ( 6 + 1 ) + // 'mmmmmm_' + ( 4 ) + // '.log' + ( 16 ) ; // overflow protection +#endif + +// Methods + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::~ChspsLogBusFile +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C ChspsLogBusFile::~ChspsLogBusFile() + { + iFileLogger.CloseLog(); + iFileLogger.Close(); + + delete iLoggingFile; iLoggingFile = NULL; + delete iLoggingDirectory; iLoggingDirectory = NULL; + } +#else +EXPORT_C ChspsLogBusFile::~ChspsLogBusFile() + { + } +#endif +//---------------------------------------------------------------------------- +// ChspsLogBusFile::NewL +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBusFile* ChspsLogBusFile::NewL( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory ) + { + ChspsLogBusFile* self = ChspsLogBusFile::NewLC( aLoggingFile, aLoggingDirectory ); + CleanupStack::Pop(); // self; + return self; + } + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::NewLC +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBusFile* ChspsLogBusFile::NewLC( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory ) + { + ChspsLogBusFile* self = new (ELeave)ChspsLogBusFile(); + CleanupStack::PushL(self); + self->ConstructL( aLoggingFile, aLoggingDirectory ); + return self; + } + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::CreateLogFilename +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C TFileName ChspsLogBusFile::CreateLogFilename( const TDesC& aBaseline ) + { + TFileName fileName; + + // Append baseline and trailing '_'. + fileName.Append( aBaseline ); + fileName.Append( TChar('_') ); + + // Append Timestamp (formatting string contains extension). + TTime time; + time.HomeTime(); + TBuf timestampAndExtension; + TRAPD( err, time.FormatL( timestampAndExtension, KTimeFormatAndExtension() ) ); + if( err == KErrNone && + ( fileName.MaxLength() - fileName.Length() ) > timestampAndExtension.Length() ) + { + fileName.Append( timestampAndExtension ); + } + + // Return created descriptor. + return fileName; + } +#else +EXPORT_C TFileName ChspsLogBusFile::CreateLogFilename( const TDesC& /*aBaseline*/ ) + { + return KNullDesC(); + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::_LogText +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLogBusFile::_LogText( const TDesC& aMessage) + { + iFileLogger.Write( aMessage ); + } +#else +void ChspsLogBusFile::_LogText( const TDesC& /*aMessage*/ ) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::ChspsLogBusFile +// ---------------------------------------------------------------------------- +// +ChspsLogBusFile::ChspsLogBusFile() + { + iLoggingFile = NULL; + iLoggingDirectory = NULL; + } + +//---------------------------------------------------------------------------- +// ChspsLogBusFile::ConstructL +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLogBusFile::ConstructL( const TDesC& aLoggingFile, + const TDesC& aLoggingDirectory ) + { + iLoggingFile = aLoggingFile.AllocL(); + if( aLoggingDirectory != KNullDesC() ) + { + iLoggingDirectory = aLoggingDirectory.AllocL(); + } + else + { + iLoggingDirectory = KDefaultLoggingDirectory().AllocL(); + } + + User::LeaveIfError( iFileLogger.Connect() ); + iFileLogger.CreateLog( *iLoggingDirectory, + *iLoggingFile, + EFileLoggingModeOverwrite ); + iFileLogger.SetDateAndTime( EFalse, ETrue ); + } +#else +void ChspsLogBusFile::ConstructL( const TDesC& /*aLoggingFile*/, + const TDesC& /*aLoggingDirectory*/ ) + { + } +#endif diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspslogbusrdebug.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspslogbusrdebug.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* 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: Implementation of ChspsLogBusRDebug. +* +*/ + + +#include "hspslogbusrdebug.h" +#include + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::~ChspsLogBusRDebug +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBusRDebug::~ChspsLogBusRDebug() + { + } + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::NewL +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBusRDebug* ChspsLogBusRDebug::NewL() + { + ChspsLogBusRDebug* self=ChspsLogBusRDebug::NewLC(); + CleanupStack::Pop(); // self; + return self; + } + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::NewLC +// ---------------------------------------------------------------------------- +// +EXPORT_C ChspsLogBusRDebug* ChspsLogBusRDebug::NewLC() + { + ChspsLogBusRDebug* self = new (ELeave)ChspsLogBusRDebug(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::_LogText +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsLogBusRDebug::_LogText( const TDesC& aMessage) + { + RDebug::Print( aMessage ); + } +#else +void ChspsLogBusRDebug::_LogText( const TDesC& /*aMessage*/) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::ChspsLogBusRDebug +// ---------------------------------------------------------------------------- +// +ChspsLogBusRDebug::ChspsLogBusRDebug() + { + // No implementation required + } + +//---------------------------------------------------------------------------- +// ChspsLogBusRDebug::ConstructL +// ---------------------------------------------------------------------------- +// +void ChspsLogBusRDebug::ConstructL() + { + } diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspsodtdump.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspsodtdump.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,188 @@ +/* +* 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: Implementation of ChspsOdtDump. +* +*/ + + +#include "hspsodtdump.h" +#include "hspslogbus.h" +#include +#include +#include +#include +#include +#include +#include +#include + +//---------------------------------------------------------------------------- +// ChspsOdtDump::Dump() +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +EXPORT_C void ChspsOdtDump::Dump( ChspsODT& aOdt, ChspsLogBus& aLogBus ) + { + TRAP_IGNORE( DumpL( aOdt, aLogBus ) ); + } +#else +EXPORT_C void ChspsOdtDump::Dump( ChspsODT& /*aOdt*/, ChspsLogBus& /*aLogBus*/ ) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsOdtDump::DumpL() +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +void ChspsOdtDump::DumpL( ChspsODT& aOdt, ChspsLogBus& aLogBus ) + { + __UHEAP_MARK; + ChspsDomDocument& domDocument = aOdt.DomDocument(); + + aLogBus.LogText( _L( "### DOM DUMP START ###" ) ); + + TInt attrCount(0); + // TInt propCount(0); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( *domDocument.RootNode() ); + CleanupStack::PushL( iter ); + + _LIT8(KDelim, "\t" ); + ChspsDomNode* nodeParent( NULL ); + ChspsDomNode* node = iter->First(); + while ( node ) + { + const TInt depth = GetNodeDepth( node ); + + HBufC8 *nameBuf = GetFixedTextLC( node->Name(), depth, KDelim, ETrue ); + CleanupStack::PushL( nameBuf ); + const TDesC8& name = nameBuf->Des(); + + aLogBus.LogText( _L8("%S\n"), &name ); + + ChspsDomList& attrList = node->AttributeList(); + TInt length( attrList.Length() ); + attrCount += length; + //_LOGTFRM1(_L8(" Attribute count: %d\n"), length ); + for( TInt i=0; i( attrList.Item(i) ); + + HBufC8 *attrBuf = GetFixedTextLC( attr->Name(), depth, KDelim, EFalse ); + CleanupStack::PushL( attrBuf ); + const TDesC8& attrName = attrBuf->Des(); + + const TDesC8& attrValue = attr->Value(); + + aLogBus.LogText( _L8("%S=%S\n"), &attrName, &attrValue ); + + CleanupStack::PopAndDestroy( attrBuf ); + } + + if ( node->Parent() ) + { + nodeParent = node; + } + if ( node != nodeParent ) + { + + } + node = iter->NextL(); + + CleanupStack::PopAndDestroy( nameBuf ); + } + CleanupStack::PopAndDestroy( iter ); + + aLogBus.LogText( _L( "### DOM DUMP END ###" ) ); + + aLogBus.LogText( _L8("**** Resources: ") ); + + for( TInt index=0; index < aOdt.ResourceCount(); index++ ) + { + ChspsResource* r = &aOdt.ResourceL(index); + TBuf8<512> name; + CnvUtfConverter::ConvertFromUnicodeToUtf8( name, r->FileName() ); + aLogBus.LogText( _L8( "%D) %S\n" ), index, &name ); + } + + aLogBus.LogText( _L8("**** Resources END ") ); + + __UHEAP_MARKEND; + } +#else +void ChspsOdtDump::DumpL( ChspsODT& /*aOdt*/, ChspsLogBus& /*aLogBus*/ ) + { + } +#endif + +//---------------------------------------------------------------------------- +// ChspsOdtDump::GetNodeDepth() +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +TInt ChspsOdtDump::GetNodeDepth( ChspsDomNode *aNode ) + { + TInt depth = 0; + ChspsDomNode* node( aNode ); + while( node ) + { + node = node->Parent(); + if ( node ) + { + depth++; + } + } + return depth; + } +#else +TInt ChspsOdtDump::GetNodeDepth( ChspsDomNode* /*aNode*/ ) + { + return 0; + } +#endif + +//---------------------------------------------------------------------------- +// ChspsOdtDump::GetFixedTextLC() +// ---------------------------------------------------------------------------- +// +#ifdef HSPS_BUILD_LOG_IMPLEMENTATION +HBufC8* ChspsOdtDump::GetFixedTextLC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim, + TBool aShowHighlight ) + { + HBufC8 *buf = HBufC8::NewL( aDepth * aDelim.Length() + aText.Length() + 1 + 1 ); + TInt i = 0; + for( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + if ( !aShowHighlight ) + { + buf->Des().Append( _L("*") ); + } + buf->Des().Append( aText ); + return buf; + } +#else +HBufC8* ChspsOdtDump::GetFixedTextLC( const TDesC8& /*aText*/, + const TInt /*aDepth*/, + const TDesC8& /*aDelim*/, + TBool /*aShowHighlight*/ ) + { + return NULL; + } +#endif diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/hspstools/src/hspstoolsdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/hspstools/src/hspstoolsdllmain.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* 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: Implementation of common dll methods. +* +*/ + + +// Include Files + +#include // GLDEF_C + +// Exported Functions + +//---------------------------------------------------------------------------- +// E32Dll +// ---------------------------------------------------------------------------- +// +#ifndef EKA2 // for EKA1 only +EXPORT_C TInt E32Dll(TDllReason /*aReason*/) +// Called when the DLL is loaded and unloaded. Note: have to define +// epoccalldllentrypoints in MMP file to get this called in THUMB. + + { + return KErrNone; + } +#endif + diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hsps_builds_cfg.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hsps_builds_cfg.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,81 @@ +/* +* 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: Build-flag definition file for HSPS R&D. Should be deleted in product. +* +*/ + + +#ifndef __HSPS_BUILDS_HRH__ +#define __HSPS_BUILDS_HRH__ + +#include + +// Define following build flag if you are building internal test builds. +// By default, should be undefined in official production builds. +#undef _hsps_INTERNAL_ + +// If ____HSPS_CFG_LOG_ON____ is defined, then logging is on. +// By default, should be undefined in official production builds. +#undef ____HSPS_CFG_LOG_ON____ + +// Controls whether access right should be eneabled. +// Thus an application can access configurations with specific uids only. +// By default, should be defined in official production builds +#undef _hsps_SECURITY_NOT_IN_USE_ + +// Controls whether an test application should be built. +// By default, should be undefined in official production builds. +#undef _HSPS_TESTAPP_ + +// Controls whether internal test themes should be installed into the ROM drive. +// By default, should be undefined in official production builds. +#undef _HSPS_AUTOINSTALL_TEST_THEMES_ + +// Controls whether old RDebug-prints should be processed. +// By default, should be undefined in official production builds. +#undef _hsps_DEBUG_ + +// Controls whether performace tests should be logged +// By default, should be undefined in official production builds. +#undef _hsps_PERFORMANCE_TEST_ + +// Control support for detecting file changes in emulator +// By default, should be undefined in official production builds. +#undef _hsps_EMULATOR_SUPPORT_ + +// Define this macro to enable server shutdown. If not defined, then server +// will be up until phone is restarted. +#undef _hsps_SERVER_SHUTDOWN_ENABLED_ + + + +// *********************************************** +// Override definitions for internal test builds +// *********************************************** +#ifdef _hsps_INTERNAL_ + #define ____HSPS_CFG_LOG_ON____ + #define _HSPS_TESTAPP_ + #define _HSPS_AUTOINSTALL_TEST_THEMES_ + #define _hsps_DEBUG_ + #define _hsps_SERVER_SHUTDOWN_ENABLED_ + + #ifdef _hsps_DEBUG_ + #define _hsps_PERFORMANCE_TEST_ + #if defined(WINSCW) || defined(__WINS__) + #define _hsps_EMULATOR_SUPPORT_ + #endif + #endif +#endif // _hsps_INTERNAL_ + +#endif// __HSPS_BUILDS_HRH__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hsps_log_cfg.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hsps_log_cfg.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002-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: homescreenpluginservice logging helper hrh. Only to be included +* in mmp files. +* +*/ + + +#ifndef __HSPS_LOG_CFG_HRH__ +#define __HSPS_LOG_CFG_HRH__ + +#include "hsps_builds_cfg.hrh" + +// Following contains actual lines included into target mmp's by c preprocessor. +// These should not be touched when enabling or disabling logging. Edit hsps_builds_cfg.hrh +// instead. +#ifdef ____HSPS_CFG_LOG_ON____ + // HSPS_LOG_ACTIVE is visible to all c files in target project. This definition + // Should be used to restrict logging code from production code. + MACRO HSPS_LOG_ACTIVE + + // Link to hspsTools which contains all logging functionality hsps is using. + LIBRARY hspsTools.lib +#endif // ____HSPS_CFG_LOG_ON____ + +#endif // __HSPS_LOG_CFG_HRH__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,557 @@ +/* +* 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: +* +* ChspsClient is a client-side implementation of MhspsInstallationService and MhspsMaintenanceService +* interface definitions of Homescreen Plugin Configuration Managament Services APIs. Installation and +* Maintenance Services are intended to serve Homescreen as well as S60 legacy applications - especially +* the Personalisation Application - with the plugin installation and maintenance +* functionality. Typical use-case is that client application initiates ChspsClient-object, connects +* to hspsThemeServer with its application UID, and commences installation and maintenance service +* requests. +* +* Security in using services is quarantied by controlling the rights to see Application Themes +* and operate with hsps Theme Server. This control is based on SECUREID of application process. +* Security is maintained behind the curtain by means of Symbian EKA2 Kernel services for Platform +* Security. +* +* ChspsClient offers high- and low-level API-functionality. High-level and low-level calls are +* diffrentiated by their parametrization. High-level parametrization is directed to the be used by +* applications which need human readable data and offer a user interface. Low-level parametrization +* is directed to the machine-originated requestors like OTA Push or DM (Device Management) +* sub-systems where data is not needed to understand semanticly. +* ChspsClient delegates server messages to its client application by +* MhspsThemeManagementServiceObserver::HandlehspsClientMessage() call-back to be implemented by the +* client application. +* +* Theme Installation Services +* =========================== +* Processing a installation task works in asynchronous mode, however, synchronous mode is applied +* everytime the installation is initiated. After checking installation rights and files validities, +* hsps Theme Server will allow actual installation. Client application must call actual +* installation by commencing next phase execution explicitly. First call of installation returns +* the ODT-header of the theme to be installed. This is to enable previewing information about +* a theme to be installed. In this point, user can accept or decline the installation. +* Installation preview feature is useful especially in OTA-service cases when user acception on +* theme installation might be selected a a part of user policy settings. +* A theme can include resources that can be imported to the target system as such like some audio +* files etc., however, most of the images must be fitted on to the target device's color depth and +* pixel density. In these cases, the needed conversions will be executed asynchronously on +* server-side. Asynchronous installation is executed in phases - resource by resource. +* Installation phases are promoted automaticly, however, client application can control and +* monitor installation phases, and also cancel installation at any time. If installation is +* cancelled, hspsThemeServer initiates roll-back functionality removing inconsistent installation. +* +* Theme Maintenanace Services: +* ============================ +* Most of the maintenance functions are synchronous, only one is asynchronous; hspsGetNextHeader(). +* Others functions are straightforward to use. They are explained in the class declaration section +* below. The asynchronous service is applied only in theme listing service calls. +* Client application initiates the theme listing by calling synchronous function +* hspsGetListHeaders(). This call initiates the query. Client application should call +* hspsGetNextHeader() after checking that any themes matching on current query is found or that query +* is valid at least. This action is called a subscription. To receive actual theme listing, the +* client application must start to listen call-back messages from the server about list delivery. +* The headers matching on query will be delivered immediately. Query remains until +* hspsCancelGetListHeaders() is called by client. If a new Application Theme exist in repository, +* it will be delivered if the query concers it. +* +* +* +*/ + + +#ifndef __ChspsCLIENT_H__ +#define __ChspsCLIENT_H__ + +#include + +#include "hspsthememanagement.h" +#include "hspsclientsession.h" +#include "hspsresult.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +/** hspsClient Panic Category. */ +_LIT( KhspsClient, "hspsClient" ); + +/** hspsClient panic codes: */ +enum ThspsClientPanics + { + EhspsClientBadState + }; + +class RhspsClientSession; +class MhspsInstallationService; +class MhspsMaintenanceService; +class MhspsThemeManagementServiceObserver; +class ChspsODT; +class ChspsResult; + +/** + * ChspsClient. + * ChspsClient performs all client-side theme installation and maintenance related functionality. + * Theme maintenance services includes theme listings, theme activation, theme removal, and default + * theme restoring functionality. + * + * Class inheritance: + * ================== + * ChspsClient derives CActive for asynchronous request handling, and MhspsInstallationService and + * MhspsMaintenanceService from Homescreenpluginservices. + * + * Theme installation functionality: + * ================================= + * Client application must call hspsInstallNextPhaseL() after testing that the synchronous call + * hspsInstallTheme() has returned EhspsInstallPhaseSuccess return code signalling that actual + * installation is allowed. The rest of the installation phases will be executed automatically, + * however, installation can be interrupted by calling hspsCancelInstallTheme() at any time. + * If installation is canceled, hspsThemeServer initiates roll-back functionality removing + * inconsistent installation. + * Installation service uses specific manifest-file format to get informed about the xml, css, + * dtd, and resource files to be installed. Resource files might be locale-specific or generic + * as well. + * hspsThemeServer takes care of saving everything on their appropriate places in the target device's + * user disk. Theme storage is located in hspsThemeServer's private-folder. + * Locales are instructed in manifest file also. Manifest file's file-extension must be .dat, + * but actually, the file-name can be whatever, however, when low-level parametrization is used, + * the name must be "manifest.dat" and it must be the last file extracted from the installation + * package. + * For more information of manifest-file format, see Homescreen wikipages. + * + * Installation functions can return one of the following ThspsServiceCompletedMessage-codes: + * - EhspsInstallThemeSuccess, + * - EhspsInstallPhaseSuccess, or + * - EhspsInstallThemeFailed. + * + * Client application must implement MhspsThemeManagementServiceObserver-interface and listen these + * messages mentioned. Let it be emphasised that both synchronous and asynchronous calls can return + * the codes above. Installation functions may also return one of the following codes: + * - EhspsServiceRequestSheduled, or + * - EhspsServiceRequestError. + * + * For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. + * + * Theme maintenance functionality: + * ================================ + * Most of the maintenance functions are synchronous, only one is asynchronous; hspsGetNextHeader(). + * Others functions are straightforward to use but hspsGetListHeaders(). This will be explained next; + * synchronous call hspsGetListHeaders() initiates the theme header listing by passing search mask + * to HSPS Server's Maintenance Service. This search mask is called a query. It also passes + * a list object in where maintenance service should append theme-header objects (type of + * ChspsODT-class without DOM-document) when one is retrieved asychronously. Search mask should be + * filled with proper parameters matching the need in hand. If no parameters are given, all headers + * of Application Themes available in Definition Repository will be delivered, otherwise, + * only sub-set of theme-headers will be delivered. After the query-call hspsGetListHeaders(), the + * delivering of the theme-headers is asynchronous. Asynchronous service must be initiated by + * calling hspsGetNextHeader() after checking that any theme matching on current query is found or + * that query is valid anyway. This action is called a subscription. To receive theme + * listing, the client application must implement MhspsThemeManagementServiceObserver-interface and + * start to listen call-back messages. + * The headers matching on query will be delivered immediately. Query remains until + * hspsCancelGetListHeaders() is called by client. If a new Application Theme exist in repository, it + * will be delivered. As mentioned, when hspsGetListHeaders() returns, the return value must be checked. + * Return value could be one of the following: + * - EhspsGetListHeadersSuccess - there is at least one Application Theme available matching on query. + * Call first hspsGetNextHeader() to get the headers. Same call will set + * the subscribtion of new ones possible coming available later. + * - EhspsGetListHeadersEmpty - there is no themes matching on the query available at the time, + * however, some might be exist later in due to installations. + * Client application should retain the subcription. + * - EhspsGetListHeadersFailed - service request failed for some reason. Possible reasons are for e.g. + * the missing rights to list headers queried. + * + * Additional Return Code Support (ChspsResult) will express for e.g. the number of headers to be + * delivered or possible system error code in failed cases. + * + * By MhspsServiceObserver::HandlehspsServiceMessage() call-back function implementation, client + * application must listen the following ThspsServiceCompletedMessage-messages: + * + * - EhspsGetListHeadersUpdate - header list on the client side has a new object appended at the end + * of the list, + * - EhspsGetListHeadersRestart - header list on server side has changed so much that the client must + * empty the list printed on screen. New list will be delivered + * immediately. The subscription stands. + * - EhspsGetListHeadersEmpty - header list on server side is now empty. The client must empty + * the list on screen if printed. The subscription stands. + * - EhspsGetListHeadersFailed - operation has failed. Client should cancel request and restart. + * + * Maintenanace functions may also return one of the following codes: + * - EhspsServiceRequestSheduled, or + * - EhspsServiceRequestError. + * + * For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. + * + * + * @lib hspsClient.lib + * @since S60 5.0 + * @ingroup group_hspsclients + */ +class ChspsClient : public CActive, public MhspsInstallationService, public MhspsMaintenanceService + { + public: // Constructors and destructors + /** + * NewL. + * + * Two-phased constructor. + * Creates a ChspsClient object using two phase construction, + * and return a pointer to the created object. + * + * @since S60 5.0 + * @param aObserver The object to be used to handle updates from the server. + */ + IMPORT_C static ChspsClient* NewL(MhspsThemeManagementServiceObserver& aObserver ); + + /** + * NewLC. + * + * Two-phased constructor. + * Creates a ChspsClinet object using two phase construction, + * and return a pointer to the created object. + * + * @since S60 5.0 + * @param aObserver The object to be used to handle updates from the server. + */ + IMPORT_C static ChspsClient* NewLC( MhspsThemeManagementServiceObserver& aObserver ); + + /** + * ~ChspsClient. + * + * Destructor. + * Destroys the object and release all memory objects. + */ + virtual ~ChspsClient(); + + public: // New functions + + /** + * From MhspsInstallationService. + */ + + IMPORT_C ThspsServiceCompletedMessage hspsInstallTheme(const TDesC& aManifestFileName, + ChspsODT& aHeader); + + /** + * From MhspsInstallationService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsInstallTheme(const TDesC& aManifestFileName, + TDes8& aHeaderData); + + /** + * From MhspsInstallationService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsInstallNextPhaseL(ChspsODT& aHeader); + + /** + * From MhspsInstallationService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsInstallNextPhaseL(TDes8& aHeaderData); + + /** + * From MhspsInstallationService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsCancelInstallTheme(); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask, + CArrayPtrFlat& aHeaderList); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetListHeaders(const TDesC8& aSearchMaskData, + CArrayPtrSeg& aHeaderDataList); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetNextHeader(); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsCancelGetListHeaders(); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsSetActiveTheme(const ChspsODT& aSetMask, + ChspsODT& aHeader); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsSetActiveTheme(const TDesC8& aSetMaskData, + TDes8& aHeaderData); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsRestoreDefault(const ChspsODT& aSetMask, + ChspsODT& aHeader); + + /** + * From MhspsMaintenanceService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsRemoveThemeL(const ChspsODT& aSetMask); + + /** + * GethspsResult + * + * @since S60 5.0 + * @param aResult is a ChspsResult object containing additional information of query result. + */ + IMPORT_C void GethspsResult(ChspsResult& aResult); + + /** + * Returns ODT header list according to the defined search mask + * + * @since S60 5.0 + * @param aSearchMask is ChspsODT-object which attributes are filled to present search + * parameters for theme set queried by client. This parametrisation follows + * the high-level schema. + * @param aHeaderList is an list object able to carry ChspsODT-objects. + * @return Error code + */ + IMPORT_C TInt hspsGetHeaders(const ChspsODT& aSearchMask, + CArrayPtrFlat& aHeaderList); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsAddPlugin( + const TInt aAppUid, + const TInt aConfId, + const TInt aPluginUid, + const TInt aPosition, + TInt& aAddedPluginId + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsRemovePlugin( + const TInt aAppUid, + const TInt aPluginId + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsSetActivePlugin( + const TInt aAppUid, + const TInt aPluginId + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsSetPluginSettings( + const ChspsODT& aHeader, + const TInt aPluginId, + ChspsDomDocument& aDom, + const TBool aPluginStoringStatus + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetPluginOdtL( + const TInt aAppUid, + const TInt aPluginUid, + ChspsODT* aPluginOdt ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsMovePluginsL( + const TInt aAppUid, + const TInt aConfId, + const CArrayFixFlat& aPluginIdList + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsSetConfState( + const TInt aAppUid, + const TInt aConfId, + const ThspsConfigurationState aState, + const ThspsConfStateChangeFilter aFilter + ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsRestoreActiveAppConf( + const TInt aAppUid, + const TInt aConfUid ); + + /** + * Updates plugin configuration in all application configuration + * + * @since S60 5.0 + * @param apluginUid identifies the plugin configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + IMPORT_C ThspsServiceCompletedMessage hspsPluginUpdateL( + const ChspsODT& /* aOdt */ ); + + /** + * Reinstalls requested configuration + * + * @since S60 5.0 + * @param aAppUid is interface. + * @param aConfUid is ID of the reinstalled configuration. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + IMPORT_C ThspsServiceCompletedMessage hspsReinstallConf( + TInt aAppUid, + TInt aConfUid ); + + /** + * Internal log bus setter. Empty method in product builds. + * + * @since S60 5.0 + * @param aLogBus Log bus to be set. + */ + IMPORT_C void SetLogBus( void* aLogBus ); + + /** + * From MhspsMaintenanceService + */ + IMPORT_C ThspsServiceCompletedMessage hspsReplacePlugin( + const TInt aAppUid, + const TInt aPluginId, + const TInt aConfUid ); + + protected: // Functions from base classes + + /** + * From CActive, RunL. + * Callback function. + * Invoked to handle responses from the server. + */ + void RunL(); + + /** + * From CActive, DoCancel. + * Cancels any outstanding operation. + */ + void DoCancel(); + + /** + * From CActive Called when asynchronous request has failed + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + + private: + + /** + * Updates iResult + * @param aResultData Result data + */ + void UpdatehspsResult( TDesC8& aResultData ); + + /** + * Creates a header object from header data (iHeaderData) + * and adds created header to the header list (iHeaderList) + * @param aHeaderData Header data + */ + void AppendHeaderListL( TDesC8& aHeaderData ); + + /** + * Gets file handle and streams odt from the file. + * @since S60 5.0 + * + * @param aOdtPath - odt file path + * @param aAppUid - application uid for accessing to the file + * @param aPluginOdt - odt for streaming + * @return error code + */ + TInt StreamOdtL( TDes& aOdtPath, + const TInt aAppUid, ChspsODT* aPluginOdt ); + + private: // Constructors and destructors + + /** + * ChspsClient. + * Performs the first phase of two phase construction. + * @param aObserver The object to be used to handle updates from the server. + */ + ChspsClient( MhspsThemeManagementServiceObserver& aObserver); + + /** + * ConstructL. + * Performs the second phase construction of a ChspsClient object. + */ + void ConstructL(); + + + private: // Members + + /** + * iSession, the theme server session. + */ + RhspsClientSession iSession; + + /** + * iObserver, observer which handles updates from the server. + */ + MhspsThemeManagementServiceObserver& iObserver; + + /** + * Message to cancel outstanding request. + */ + ThspsServiceRequestMessage iCancelRequestMessage; + + private: // Data + + /** + * An pointer array given by service requester to be filled with headers. + */ + CArrayPtrSeg* iHeaderDataList; + + CArrayPtrFlat* iHeaderList; + + TBuf8 iHeaderData; + TBuf8 iResultData; + + TBool iODTMode; + + ChspsODT* iOdt; + ChspsODT* iHeader; + + HBufC8* iSearchMaskData; + HBufC8* iSetMaskData; + ChspsResult* iResult; + TBool iSubscription; + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //__ChspsCLIENT_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsclientsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsclientsession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,358 @@ +/* +* 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: RhspsClientSession. RhspsClientSession is RSession for the hspsThemeServer. +* RhspsClientSession-implementation is a low-level connection library. +* It is used by Xuikon Client-side API-implementations, namely +* hspsClient and hspsRequestClient. It is not intended to be used by any +* Xuikon service users. +* Some of the functions are synchronous and same asynchronous when the nature +* of the request requiers. +* +* +*/ + + +#ifndef __hspsCLIENTSESSION_H__ +#define __hspsCLIENTSESSION_H__ + +#include + +/** + * Server session. + * + * @lib hspsclientsession.lib + * @since S60 5.0 + * @ingroup group_hspsclients + */ +class RhspsClientSession : public RSessionBase + { + protected: + /** + * Connect. + * + * @since S60 5.0 + * @return Symbian error code. + */ + IMPORT_C TInt Connect(); + + /** + * Close. + * + * @since S60 5.0 + */ + IMPORT_C void Close(); + + /** + * InstallTheme. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aManifestFileName Manifest file name. + * @param aHeaderData Header data. + * @return Symbian error code. + */ + IMPORT_C TInt InstallTheme(TDes8& aResultData, const TDesC& aManifestFileName, + TDes8& aHeaderData); + + /** + * InstallNextPhase. + * Asynchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aHeaderData Header data. + * @param aStatus Request status. + */ + IMPORT_C void InstallNextPhase(TDes8& aResultData, TDes8& aHeaderData, + TRequestStatus& aStatus); + + /** + * GetListHeaders. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aSearchMaskData Search mask data. + * @param aHeaderData Header data. + * @return Symbian error code. + */ + IMPORT_C TInt GetListHeaders(TDes8& aResultData, const TDesC8& aSearchMaskData, + TDes8& aHeaderData); + + /** + * SetActiveTheme. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aSetMaskData Mask data. + * @param aHeaderData Header data. + * @return Symbian error code. + */ + IMPORT_C TInt SetActiveTheme(TDes8& aResultData, const TDesC8& aSetMaskData, + TDes8& aHeaderData); + + /** + * RemoveTheme. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aSetMaskData Mask data. + * @return Symbian error code. + */ + IMPORT_C TInt RemoveTheme(TDes8& aResultData, const TDesC8& aSetMaskData); + + /** + * RestoreDefault. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aSetMaskData Mask data. + * @param aHeaderData Header data. + * @return Symbian error code. + */ + IMPORT_C TInt RestoreDefault(TDes8& aResultData, const TDesC8& aSetMaskData, + TDes8& aHeaderData); + + /** + * GetNextHeader. + * Asynchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aHeaderData Header data. + * @param aStatus Request status. + */ + IMPORT_C void GetNextHeader(TDes8& aResultData, TDes8& aHeaderData, + TRequestStatus& aStatus); + + /** + * GetODT. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData ResultData. + * @param aConfiguration Configuration. + * @param aRequestData Request data. + * @param aODTPath Odt path. + * @return Symbian error code. + */ + IMPORT_C TInt GetODT(TDes8& aResultData, const ThspsConfiguration& aConfiguration, + const TDesC8& aRequestData, TDes& aODTPath); + + /** + * AccessResourceFile. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData ResultData. + * @param aConfiguration Configuration. + * @param aFileName File name. + * @param aFileHandle File handle. + * @return Symbian error code. + */ + IMPORT_C TInt AccessResourceFile(TDes8& aResultData, const ThspsConfiguration& aConfiguration, + const TDesC& aFileName, TInt& aFileHandle); + + /** + * GetODTUpdate. + * Asynchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aRequestNotifyData Request notify data. + * @param aHeaderData Header data. + * @param aStatus Request status. + */ + IMPORT_C void GetODTUpdate(TDes8& aResultData, TDes8& aRequestNotifyData, TDes8& aHeaderData, + TRequestStatus& aStatus); + + + /** + * Reads Odt from given path (aODTPath) and copies its resource files + * to destination folder (note that given destination folder is only + * prefix for actual destination folder). + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aODTPath odt path to be read. + * @param aDestinationPath target directory. + * @return Symbian error code. + **/ + IMPORT_C TInt CopyResourceFiles( TDes8& aResultData, TDesC& aODTPath, + TDesC& aDestinationPath ); + + /** + * CancelRequest. + * Synchronous service call. + * + * @since S60 5.0 + * @param aCancelRequestMessage Cancel request message. + * @param aResultData Result data. + * @param aAppUid AppUid. + */ + IMPORT_C void CancelRequest(TInt aCancelRequestMessage, TDes8& aResultData, + TInt aAppUid = 0 ); + + /** + * GetNextHeader. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aHeaderData Header data. + * @return Symbian error code. + */ + IMPORT_C TInt GetNextHeader( TDes8& aResultData, TDes8& aHeaderData ); + + /** + * AddPlugin. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @param aNewPluginId New plugin id. + * @return Symbian error code. + */ + IMPORT_C TInt AddPlugin( TDes8& aResultData, + const ThpsParamAddPlugin& aParams, + TInt& aNewPluginId); + + /** + * RemovePlugin. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt RemovePlugin( TDes8& aResultData, + const ThpsParamRemovePlugin& aParams ); + + /** + * SetActivePlugin. + * Set plugin configuration active. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt SetActivePlugin( TDes8& aResultData, + const ThpsParamSetActivePlugin& aParams ); + + /** + * GetPluginOdt. + * Synchronous service call to get plugin's odt path. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @param aOdtPath Odt path. + * @return Symbian error code. + */ + IMPORT_C TInt GetPluginOdt( TDes8& aResultData, + const ThspsParamGetPluginOdt& aParams, + TDes& aOdtPath ); + + /** + * SetPluginSettings. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aSearchMaskData Search mask data. + * @param aPluginIdData Plugin id data. + * @param aDomData Dom data. + * @return Symbian error code. + */ + IMPORT_C TInt SetPluginSettings( TDes8& aResultData, + TDes8& aSearchMaskData, + ThspsParamSetPluginSettings aParams, + TDes8& aDomData ); + + + /** + * MovePlugins. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt MovePlugins( TDes8& aResultData, const ThpsParamMovePlugins& aParams ); + + /** + * SetConfState. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt SetConfState( + TDes8& aResultData, + const ThspsParamSetConfState& aParams ); + + /** + * ReinstallConf. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt ReinstallConf( + TDes8& aResultData, + const ThspsParamReinstallConf& aParams ); + + /** + * RestoreActiveAppConf + * Synchronous service call. + * @param aResultData Operation result + * @param aParams Operation parameters + * @since S60 5.0 + */ + IMPORT_C TInt RestoreActiveAppConf( + TDes8& aResultData, + const ThspsParamRestoreActiveAppConf& aParams ); + + /** + * ReplacePlugin. + * Synchronous service call. + * + * @since S60 5.0 + * @param aResultData Result data. + * @param aParams Params. + * @return Symbian error code. + */ + IMPORT_C TInt ReplacePlugin( + TDes8& aResultData, + const ThspsParamReplacePlugin& aParams ); + + public: + + friend class ChspsClient; + friend class ChspsRequestClient; + }; + +#endif //__hspsCLIENTSESSION_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdefinitionengineinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdefinitionengineinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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: DefinitionEngine class interface +* +*/ + + +#ifndef C_hspsDEFINITIONENGINEINTERFACE_H +#define C_hspsDEFINITIONENGINEINTERFACE_H + +#include + +// CLASS FORWARD +class RFs; +class ChspsODT; + + +// CLASS DECLARATION +/** + * Definition Enginen plugin interface class. + * + * @lib hspsdefinitionengineinterface.lib + * @since S60 5.0 + * @ingroup group_hspsdefinitionengine + */ +class ChspsDefinitionEngineInterface : public CBase + { + public: + struct TError + { + TInt iDefEngError; + TInt iSubComponentError; + }; + + public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aPluginId Name of implementation. + */ + IMPORT_C static ChspsDefinitionEngineInterface* NewL(const TDesC8& aPluginId ); + + /** + * Destructor + */ + IMPORT_C virtual ~ChspsDefinitionEngineInterface(); + + + public: // New functions + /** + * Parses the given XML file. Inserts all nodes to DOM tree, + * parses the CSS file and assignes all properties to the nodes + * @since Series 60 3.1 + * @param aFsSession: file server session + * @param aXMLFileName: XML file to parse + * @param ahspsOdt: ODT structure, which contains the DomDocument + * @return: Error code + */ + virtual TError CreateDOM( + RFs& aFsSession, + const TDesC& aXMLFileName, + ChspsODT& ahspsOdt )=0; + + /** + * Parses the given DTD file. Replaces all entity referencies + * in the skeleton DOM tree. Returns Localized DOM if it was successfull + * @since Series 60 3.1 + * @param aFsSession: file server session + * @param aDTDFileName: Input DTD file for a certain language + * @param ahspsOdt: Input/Output ODT structure, which contains the DomDocument. + */ + virtual void ApplyLanguageL( + RFs& aFsSession, + const TDesC& aDTDFileName, + ChspsODT& ahspsOdt )=0; + + private: + TUid iDtorKey; + + }; + +#endif + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdefinitionrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdefinitionrepository.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,499 @@ +/* +* 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: Service for storing configurations into the file system + +* +*/ + + + +#ifndef C_hspsDEFINITIONREPOSITORY_H +#define C_hspsDEFINITIONREPOSITORY_H + +// INCLUDES +#include +#include +#include +#include + +#include "hspsresource.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +/** +* ThspsRepositoryEvent. +* Events used in ThspsRepositoryInfo. +**/ + +enum ThspsRepositoryEvent + { + EhspsODTActivated = 0x00, // active application configuration changed + EhspsODTAdded = 0x01, //new configuration installed + EhspsODTUpdated = 0x02, //installing new version of plugin + EhspsODTRemoved = 0x04, // plugin removed from configuration + EhspsODTModified = 0x08, // plugin added to configuration + EhspsCacheUpdate = 0x10, // forces full cache update + EhspsClean = 0x20, // destructors&unstalling plugin + EhspsSettingsChanged = 0x40, // settings changed + EhspsPluginsMoved = 0x80, //plugins moved + EhspsPluginActivated = 0x100, + EhspsPluginReplaced = 0x200, + EhspsNoEvent = 0x800 + }; + +/** +* ThspsRepositoryInfo. +* The Definitionrepository can inform client observers of changes to repository: +* theme has been updated, theme added etc. A client needs to register to repository +* (RegisterObserverL) to receive repository events. The client will receive the +* events via callback function HandleDefinitionRespositoryEvent(). +* If observer handles the event, it must return ETrue, else, it must return EFalse. +*/ +class ThspsRepositoryInfo + { + public: + ThspsRepositoryInfo( + ThspsRepositoryEvent aEventType, + TUint aAppUid = 0, + TUint aAppConfUid = 0, + TUint aSecureId = 0, + TUint aAppConfProviderUid = 0, + TUint aPluginIfUid = 0, + TUint aPluginProviderUid = 0, + TUint aPluginUid = 0, + TUint aPluginId = 0, + TBool aLastNotification = ETrue, + TPtrC aName = KNullDesC(), + TLanguage aLanguage = ELangTest ) + { + iEventTime.HomeTime(); + iEventType = aEventType; + iAppUid = aAppUid; + iAppConfUid = aAppConfUid; + iSecureId = aSecureId; + iAppConfProviderUid = aAppConfProviderUid; + iPluginIfUid = aPluginIfUid; + iPluginProviderUid = aPluginProviderUid; + iPluginUid = aPluginUid; + iPluginId = aPluginId; + iLastNotification = aLastNotification; + iName = aName; + iLanguage = aLanguage; + } + public: + TTime iEventTime; + ThspsRepositoryEvent iEventType; + TUint iAppUid; + TUint iAppConfUid; + TUint iSecureId; + TUint iAppConfProviderUid; + TUint iPluginIfUid; + TUint iPluginProviderUid; + TUint iPluginUid; + TUint iPluginId; + TBool iLastNotification; + TBuf iName; + TLanguage iLanguage; + }; + +/** +* MhspsDefinitionRepositoryObserver is an interface definition to be implemented by the repository events +* observers. +*/ +class MhspsDefinitionRepositoryObserver + { + /** + * Definition repository callback + * + * @since S60 5.0 + * @param aRepositoryInfo Repository callback info. + */ + public: + virtual TBool HandleDefinitionRespositoryEvent( ThspsRepositoryInfo aRepositoryInfo ) = 0; + }; + +// FORWARD DECLARATIONS +class ChspsODT; +class RWriteStream; +class RReadStream; +class CFileStore; +class ChspsDomDocument; + +_LIT(KROMDrive,"z:"); +_LIT(KCDrive,"c:"); + +/** + * hspsDefinitionRepository is a common and secure place to store the HSPS's + * definition files. + * + * Class provides the APIs to store and retrieve all the definition files: + * locale, style, structure and resource files. + * + * Repository can store disk space limited number of ODT data structures and + * definition files (themes) for every application. Themes are identified by + * application uid, vendor name, theme name and theme version. Localisation is + * supported by naming the ODT for each language variant uniquely. TLanguage + * enumeration is used in the ODT header to specify the variant. The ODT can be + * retrieved from the repository as a fully constructed object or a descriptor + * stream. + * + * Existing themes can be queried from the repository for managing purposes. + * Same method can be used to avoid accidental overwrites. If the query returns + * zero count for the appropriate ODT the new theme can be safely installed. + * Themes can be also removed with the valid header information. When the theme + * is removed also all the definition files will be deleted. + * + * + * @lib hspsDefRep.dll + * @since S60 5.0 + * @ingroup group_hspspluginregistry + */ +class ChspsDefinitionRepository : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsDefinitionRepository* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsDefinitionRepository(); + + public: // New functions + + /** + * Saves the localisation file into repository. ODT must contain the valid + * header information, which is used to define the location for the file. + * Updates resource object with the new location. + * Leaves if original file does not exist or information is not valid. + * + * @since S60 5.0 + * @param aODT Contains the header information. + * @param aResource The resource file to be saved. + */ + IMPORT_C TInt SetLocaleL( ChspsODT& aODT, ChspsResource& aResource ); + + /** + * Creates a path for the ODT to be stored on repository. + * ODT-header information works as a set mask. + * + * @since S60 5.0 + * @param aODT Contains the header information. Works as a set mask. Leaves if invalid data. + * @param aResource A ChspsResource-object filled with the new path is returned to caller. + */ + IMPORT_C void MakeODTPathL( ChspsODT& aODT, ChspsResource& aResource ); + + /** + * Saves the ODT data structure into the repository. The location of the data is + * defined from the ODT's header information. + * + * @since S60 5.0 + * @param aODT The actual data to be stored. + */ + IMPORT_C TInt SetOdtL( const ChspsODT &aODT ); + + /** + * Retrieves the ODT from the repository. The ODT must contain the valid header + * information, which is used to locate the correct data. Leaves if ODT not found. + * + * @since S60 5.0 + * @param aODT A reference to ODT object, which is filled with data from the repository. + */ + IMPORT_C TInt GetOdtL( ChspsODT& aODT ); + + /** + * Retrieves the ODT header from the repository. The aPath variable must contain + * the valid path. Leaves if path not found. + * + * @since S60 5.0 + * @param aPath The path where the theme is located. + * @param aLang Informs the correct language version. + * @param aODT A reference to ODT header object, which is filled with data from the repository. + */ + IMPORT_C TInt GetOdtHeaderL( TDes& aPath, TLanguage aLang, ChspsODT& aODT ); + + + /** + * Retrieves the exact path of the repository object. + * Does not check whether the object is really existing on repository or not. + * + * @since S60 5.0 + * @param aODT Contains the header information. Works as a search mask. Leaves if invalid data. + * @param aResourceType resource type to search for. + * @param aFilePath A file path returned to caller. + */ + IMPORT_C void GetResourcePathL( const ChspsODT& aODT, ThspsResourceType aResourceType, TDes& aFilePath ); + + + /** + * Retrieves the list of installed themes in an array. ODT header information works + * as a search mask. If all the information is available in the header a function + * can be used to query the theme's existence. This is useful when the accidental + * overwrites needs to be avoided e.g. when installing a new theme. + * + * @since S60 5.0 + * @param aThemeList A reference to an array, which is filled with the theme paths. + * @param aODT Contains the header information. Works as a search mask. Leaves if invalid data. + */ + IMPORT_C void GetThemePathListL( CDesCArraySeg& aThemeList, const ChspsODT& aODT ); + + /** + * Retrieves the list of installed themes as a streams in an array. ODT header information + * works as a search mask. + * + * @since S60 5.0 + * @param aThemeList A reference to an array, which contains internalized theme headers. + * @param aODT Contains the header information. Works as a search mask. Leaves if invalid data. + */ + IMPORT_C void GetThemeListAsStreamL( CArrayPtrSeg& aThemeList, const ChspsODT& aODT ); + + /** + * Removes the theme specific ODT and definition files from the repository. + * ODT header information works as a mask, which defines the level of removal. + * A single theme, all themes from a provider or all application specific + * themes can be removed at once. + * + * @since S60 5.0 + * @param aODT Contains the header information. Leaves if information is not valid. + */ + IMPORT_C void RemoveThemeL( const ChspsODT& aODT ); + + /** + * Get a path for resource to be stored. + * + * @since S60 5.0 + * @param aODT Contains the header information. + * @param aResource resource where path is stored. + * Leaves if path could not be defined. + */ + IMPORT_C void MakeResourcePathL( const ChspsODT& aODT, ChspsResource& aResource ); + + /** + * Saves the resource into the repository. + * + * @since S60 5.0 + * @param aODT Contains the header information. + * @param aFbsBitmap bitmap to store to repository. + * @param aResource resource where path is stored. + * Leaves if original file does not exist. + */ + IMPORT_C TInt SetResourceL( const ChspsODT& aODT, const CFbsBitmap& aFbsBitmap, ChspsResource& aResource ); + + /** + * Stores the resource list to the repository. Every registered resource has an + * own entry in the array. + * Leaves if the repository is corrupted. Use RemoveThemeL to remove the + * corrupted repository. + * + * @since S60 5.0 + * @param aODT Contains the header information. + * @param aResourceList resource list to store to repository. + */ + IMPORT_C TInt SetResourceListL( ChspsODT& aODT, const CArrayPtrSeg& aResourceList ); + + + /** + * Retrieves the resource list in an array. Every registered resource has an + * own entry in the array. + * Leaves if the repository is corrupted. Use RemoveThemeL to remove the + * corrupted repository. + * + * @since S60 5.0 + * @param aODT contains the theme header associated to this resourcelist. + * @param aResourceList destination resource list where resource are read from repository. + * @return a resource list. + */ + IMPORT_C TInt GetResourceListL( const ChspsODT& aODT, CArrayPtrSeg& aResourceList ); + + /** + * GetRepositoryInfo + * Register a ThspsRepositoryInfo-object to the repository. Repository's responsibility is + * to notify its observers about the notification. + * + * @since S60 5.0 + * @param aRepositoryInfo is aThspsRepositorynfo-object to be registered. + */ + IMPORT_C void RegisterNotification( ThspsRepositoryInfo aRepositoryInfo ); + + /** + * RegisterObserverL ( ) + * Returns a refrence to a RArray-object containing changes in repository system. + * It is a responsibilty of the caller to lock the repository for modifications. + * + * @since S60 5.0 + * @param aObserver is a MhspsDefinitionRepositoryObserver-object to be registered. + */ + IMPORT_C void RegisterObserverL( const MhspsDefinitionRepositoryObserver& aObserver ); + + /** + * UnregisterObserver + * Returns a refrence to a RArray-object containing changes in repository system. + * It is a responsibilty of the caller to lock the repository for modifications. + * + * @since S60 5.0 + * @param aObserver is a MhspsDefinitionRepositoryObserver-object to be unregistered. + */ + IMPORT_C void UnregisterObserver( const MhspsDefinitionRepositoryObserver& aObserver ); + + /** + * Increases the semaphore controlling repository locking. + * Locking semaphore is increased explicitly by clients that + * going to write data to repository.. + * Lockin semaphore revents reading repository as long as there + * are writers. + * + * @since S60 5.0 + */ + IMPORT_C void Lock(); + + /** + * Decreases the semaphore controlling repository locking. + * Semaphore minimun value is 0 meaning unlocked situation. + * + * @since S60 5.0 + */ + IMPORT_C void Unlock(); + + /** + * Returns repository locking status + * + * @since S60 5.0 + * @returns ETrue if repository is locked otherwise EFalse + */ + IMPORT_C TBool Locked() const; + + /** + * Creates a path from the header information. Results are stored into the iPath member. + * + * @since S60 5.0 + * @param aODT An ODT whose path is being requested + * @param aPath Relative path without a drive letter + */ + IMPORT_C void GetODTPathL( const ChspsODT& aODT, TDes& aPath ); + + /** + * Set log bus. + * Empty implementation if non HSPS_LOG_ACTIVE build. + * + * @since S60 5.0 + * @param aLogBus Log bus to be set. + */ + IMPORT_C void SetLogBus( void* aLogBus ); + + /** + * Restores a defined configuration from backup folder + * @since S60 5.0 + * @param aODT ODT header defining the configuration to be restored + * @return Operation status + * KErrNone if backup configuration is found and it is restored + * KErrNotFound if backup configuration is not found + */ + IMPORT_C TInt RestoreBackupConfiguration( const ChspsODT& aODT ); + + /** + * Copies a defined configuration to theme backup folder + * @since S60 5.0 + * @param aODT ODT header defining the configuration to be copied + */ + IMPORT_C void BackupConfigurationL( const ChspsODT& aODT ); + + /** + * Clears previous backup data + * @since S60 5.0 + */ + IMPORT_C void ClearBackupsL(); + + /** + * Retrieves the ODT from the repository. The aPath variable must contain + * the valid path. Leaves if path not found. + * @since S60 5.0 + * @param aPath The path where the theme is located. + * @param aODT A reference to ODT object, which is filled with data from the repository. + */ + IMPORT_C void GetOdtL( const TDes& aPath, ChspsODT& aODT ); + + private: + + /** + * C++ default constructor. + */ + ChspsDefinitionRepository(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + void SelectFilesFromPathL( CDesCArraySeg& aFileList, const TDesC& aPath, TEntryKey aSortFlag, const TDesC& aFileExtension ); + + void GetPathL( const ChspsODT& aODT, ThspsResourceType aResourceType ); + + void AppendDesCIntoPathL( TDes& aPath, const TDesC& aText ); + void AppendNumIntoPathL( TDes& aPath, const TUint aNum ); + void FileExtensionL( ThspsResourceType aResourceType, TInt aLanguage ); + void AddLocalePathL( TDes& aPath, TInt aLanguage ); + + TInt WriteToFileL( const ChspsODT& aODT ); + + TInt ReadFromFileL( const TDesC& aPath, ChspsODT& aODT ); + + HBufC8* StreamHeaderFromFileL( const TDesC& aPath ); + CFileStore* OpenFileStoreLC( const TDesC& aPath ); + + void MatchingFoldersFromAllDrivesL(const TDesC& aWildName, const TDesC& aScanDir, CDesCArraySeg& aThemeList ); + TInt MatchingFoldersL(const TDesC& aWildName, const TDesC& aScanDir, CDesCArraySeg& aThemeList ); + + TInt CopyFileL( const TDesC& aSourceFile ); + TInt CopyFileL( const TDesC& aSourceFile, const TDesC& aDestinationFile ); + void RemoveDirectoryL(); + void RemoveDirectoryL( TDesC& aDirPath ); + + private: // Data + + RArray iRepositoryInfoQueue; + + // Array of observers + RPointerArray iObservers; + + //Handle to a file server session + RFs iFs; + + //Holds the path information, owned + HBufC* iPath; + + TBool iLicenseDefault; + TInt iLockSemaphore; + + // Contains a temporary filepath + TFileName iTempFileName1; + + // Contains a temporary filepath + TFileName iTempFileName2; + +#ifdef HSPS_LOG_ACTIVE + // Log bus. Not owned. + ChspsLogBus* iLogBus; +#endif + }; + +#endif // C_hspsDEFINITIONREPOSITORY_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomattribute.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomattribute.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,177 @@ +/* +* 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: Represent single xmluiml attribute +* +*/ + + + +#ifndef hsps_DOM_ATTRIBUTE_H +#define hsps_DOM_ATTRIBUTE_H + +// INCLUDES +#include +#include +#include "mhspsdomlistitem.h" + +//CLASS FORWARD + +class ChspsDomStringPool; + +// CLASS DECLARATION + +/** + * Represent attribute name and value as strings. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_group_hspsdom + */ +class ChspsDomAttribute : public CBase, public MhspsDomListItem + { + public: // Constructors and destructor + + /** + * Two-phased constructor 8 bit. + * + * @since S60 5.0 + * @param aName Name of attribute. + * @param aStringPool Attached string pool. + */ + IMPORT_C static ChspsDomAttribute* NewL( + const TDesC8& aName, + ChspsDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + * + * @since S60 5.0 + * @param aStream Source stream. + * @param aStringPool Attached string pool. + */ + static ChspsDomAttribute* NewL( + RReadStream& aStream, + ChspsDomStringPool& aStringPool ); + + /** + * Destructor. + */ + IMPORT_C virtual ~ChspsDomAttribute(); + + public: // New functions + /** + * Makes a copy from original attribute. + * + * @since S60 5.0 + * @return Pointer to attribute. Attribute ownership is transferred to a caller. + */ + IMPORT_C ChspsDomAttribute* CloneL(); + + /** + * Makes a copy from original property. + * + * @since S60 5.0 + * @param aStringPool Original string pool clone. + * @return Pointer to an attribute. Ownership is transferred to a caller. + */ + ChspsDomAttribute* CloneL( ChspsDomStringPool& aStringPool ); + + /** + * Get the attribute value. + * + * @since S60 5.0 + * @return Pointer to a attribute value string. If value is not set KNullDesC8 is returned. + */ + IMPORT_C const TDesC8& Value(); + + /** + * Set attribute value. + * + * @since S60 5.0 + * @param aValue Attribute string value. + */ + IMPORT_C void SetValueL( const TDesC8& aValue ); + + /** + * Get the attributes name string pool index. + * + * @since S60 5.0 + * @return String pool index. + */ + IMPORT_C TInt16 NameStringPoolIndex()const; + + /** + * Get the attributes value string pool index. + * + * @since S60 5.0 + * @return String pool index. + */ + IMPORT_C TInt16 ValueStringPoolIndex()const; + + public: //From ChspsDomListItem + + /** + * Documented in ChspsDomListItem::Size + * + * @since S60 5.0 + * @return Name. + */ + IMPORT_C const TDesC8& Name(); + + + /** + * Documented in ChspsDomListItem::Size. + */ + TInt Size() const; + + /** + * Documented in ChspsDomListItem::Size. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize property. + * + * @since S60 5.0 + * @param aStream Input stream. + */ + void InternalizeL( RReadStream& aStream ); + private: + + /** + * C++ default constructor. + */ + ChspsDomAttribute( ChspsDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC8& aName ); + + + private: // Data + //String pool to get string for references, not owned. + ChspsDomStringPool& iStringPool; + + //Attribute name reference. + TInt16 iNameRef; + + //Attribute value reference. + TInt16 iValueRef; + + }; + +#endif // hsps_DOM_ATTRIBUTE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomdepthiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomdepthiterator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: Depth iterator walks the dom tree by depth first. +* +*/ + + + +#ifndef hsps_DOM_DEPTH_ITERATOR_H +#define hsps_DOM_DEPTH_ITERATOR_H + +// INCLUDES +#include +#include "mhspsdomiterator.h" + + +// FORWARD DECLARATIONS +class ChspsDomNode; + + +// CLASS DECLARATION + +/** + * Depth iterator walks through the dom tree using the depth first + * principle. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_hspsdom +*/ +class ChspsDomDepthIterator: public CBase, public MhspsDomIterator + { + public: // Destructor + /** + * Symbian constructor + * + * @since S60 5.0 + * @param aRootNode Root node. + */ + IMPORT_C static ChspsDomDepthIterator* NewL( ChspsDomNode& aRootNode ); + + /** + * Destructor. + */ + IMPORT_C virtual ~ChspsDomDepthIterator(); + + public: // Adding and removing + /** + * From MhspsDomIterator. + */ + IMPORT_C ChspsDomNode* First(); + + /** + * From MhspsDomIterator. + */ + IMPORT_C ChspsDomNode* NextL(); + + /** + * From MhspsDomIterator. + */ + IMPORT_C ChspsDomNode* NextSibling( ChspsDomNode& aNode ); + + private: + /** + * C++ default constructor + */ + ChspsDomDepthIterator( ChspsDomNode& aRootNode ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Push node to stack. + * @param aNode Node to push + */ + void PushL( ChspsDomNode& aNode ); + + /** + * Pop node from the stack. + * @return Pointer to node + */ + ChspsDomNode* Pop(); + + private: + // Follow tree hierarchy with stack + RPointerArray iDepthLevel; + // First node + ChspsDomNode* iFirst; + //Current node + ChspsDomNode* iCurrent; + + }; + +#endif // hsps_DOM_DEPTH_ITERATOR_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomdocument.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,189 @@ +/* +* 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: Represents the entire xmluiml specific xml and css data. +* +*/ + + + +#ifndef hsps_DOM_DOCUMENT_H +#define hsps_DOM_DOCUMENT_H + +// INCLUDES +#include +#include + + +//FORWARD DECLARATIONS +class ChspsDomStringPool; +class ChspsDomNode; +// CLASS DECLARATION + +/** + * Provides the primary access to the document's data. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_hspsdom +*/ +class ChspsDomDocument: public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsDomDocument* NewL(); + + /** + * Two-phased stream constructor. + * + * @since S60 5.0 + * @param aStream Source stream. + */ + IMPORT_C static ChspsDomDocument* NewL( RReadStream& aStream ); + + /** + * Construct ChspsDomDocument from streamed HBufC8. + * + * @since S60 5.0 + * @param aBufStream Source buffer stream. + */ + IMPORT_C static ChspsDomDocument* NewL( const HBufC8* aBufStream ); + + /** + * Destructor. + */ + IMPORT_C virtual ~ChspsDomDocument(); + + public: // New functions + /** + * Makes a clone of this document. + * + * @since S60 5.0 + * @return Pointer to a document. Caller has the ownership. + */ + IMPORT_C ChspsDomDocument* CloneL(); + + /** + * Factory method to create node elements, because elements cannot exist outside + * the context of a document. + * + * @since S60 5.0 + * @param aName UTF-8 encoded Element name. + * @param aNamespace UTF-8 encoded Element namespace. + * @return A new ChspsDomNode type instance. Ownership is transferred to caller. + */ + IMPORT_C ChspsDomNode* CreateElementNSL( const TDesC8& aName, const TDesC8& aNamespace ); + + /** + * Set the root of the document tree. Root node provides primary access to + * document data. This class owns root node. + * + * @since S60 5.0 + * @param aRootNode Documents's root node. Document takes ownership. + */ + IMPORT_C void SetRootNode( ChspsDomNode* aRootNode ); + + /** + * Get the root node of the document. + * + * @since S60 5.0 + * @return Pointer to ChspsDomNode type node. + */ + IMPORT_C ChspsDomNode* RootNode() const; + + /** + * Get the last node of the document. + * + * @since S60 5.0 + * @return Pointer to ChspsDomNode type node. + */ + IMPORT_C ChspsDomNode* LastNode() const; + + /** + * Get the size of the document's data. + * + * @since S60 5.0 + * @return Document's data size. + */ + IMPORT_C TInt Size() const; + + /** + * Get document node count. + * + * @since S60 5.0 + * @return Count of all nodes in a document. + */ + IMPORT_C TInt DomNodeCount() const; + + /** + * Externalize document's data. + * + * @since S60 5.0 + * @param aStream Output stream. + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize document's data. + * + * @since S60 5.0 + * @param aStream Input stream. + */ + IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Returns document's data as a streamed buffer. + * + * @since S60 5.0 + * @return Pointer to a new HBufC8 buffer which holds streamed document. + * Ownership is transferred to a caller. + */ + IMPORT_C HBufC8* MarshallL(); + + /** + * Get reference to string pool. + * + * @since S60 5.0 + * @return Reference to string pool implementation. + */ + IMPORT_C ChspsDomStringPool& StringPool() const; + private: + + /** + * C++ default constructor. + */ + ChspsDomDocument(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + //Document owns the root node. + ChspsDomNode* iRootNode; + + //Namespace map stores namespaces used in dom + ChspsDomStringPool* iDomStringPool; + + + }; + +#endif // hsps_DOM_DOCUMENT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomlist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,255 @@ +/* +* 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: List class to hold MhspsDomListItem objects. +* +*/ + + + +#ifndef hsps_DOM_LIST_H +#define hsps_DOM_LIST_H + +// INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class MhspsDomListItem; +class ChspsDomStringPool; + +// CLASS DECLARATION + +/** + * Represents streamable list object, which holds MhspsDomListItem objects. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_hspsdom + */ +class ChspsDomList : public CBase + { + public: + enum TListType + { + ENodeList=0, + EAttributeList + }; + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsDomList* NewL( TListType aListType, ChspsDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + */ + static ChspsDomList* NewL( + RReadStream& aStream, + ChspsDomStringPool& aStringPool ); + + /** + * Destructor. + */ + virtual ~ChspsDomList(); + + public: // Adding and removing + + /** + * Frees memory allocated for all items in a list. + * + * @since S60 5.0 + */ + IMPORT_C void Reset(); + + /** + * List owns items. + * + * @since S60 5.0 + * @param aListItem to add. + */ + IMPORT_C void AddItemL( MhspsDomListItem* aListItem ); + + /** + * List owns items. + * + * @since S60 5.0 + * @param aListItem to add. + * @param aIndex Index in list where the item is added. + */ + IMPORT_C void AddItemL( MhspsDomListItem* aListItem, TInt aIndex ); + + /** + * Remove item from list. + * + * @since S60 5.0 + * @param aIndex to aList item to remove. + */ + IMPORT_C void RemoveItem( TInt aIndex ); + + /** + * Delete item from list. + * + * @since S60 5.0 + * @param aIndex Item to delete. + */ + IMPORT_C void DeleteItem( TInt aIndex ); + + /** + * Remove item from list. + * + * @since S60 5.0 + * @param aItem Item to remove. + */ + IMPORT_C void RemoveItem( MhspsDomListItem* aItem ); + + /** + * Delete item from list. + * + * @since S60 5.0 + * @param aItem item to delete. + */ + IMPORT_C void DeleteItem( MhspsDomListItem* aItem ); + + public: // Accessing + /** + * List items are accessed by index, i.e like arrays + * + * @since S60 5.0 + * @param aIndex list item index. + * @return Pointer to a a list item. + */ + IMPORT_C MhspsDomListItem* Item( TInt aIndex )const; + + /** + * Number of items in a list. + * + * @since S60 5.0 + * @return Item count. + */ + IMPORT_C TInt Length() const; + + /** + * Get the first item in a list. + * + * @since S60 5.0 + * @return Pointer to the first item in a list. + */ + IMPORT_C MhspsDomListItem* First(); + + /** + * The last item in a list + * + * @since S60 5.0 + * @return Pointer to the last item in a list. + */ + IMPORT_C MhspsDomListItem* Last(); + + /** + * Find list item by item name. Searches list items + * which have name attribute. + * + * @since S60 5.0 + * @param aName UTF8 encoded item's name to be searched + * @return Pointer to the list item, NULL if not exist. + */ + IMPORT_C MhspsDomListItem* FindByName( const TDesC8& aName ); + + /** + * Get item index + * + * @since S60 5.0 + * @param aItem Item to be searched. + * @return Item index or KErrNotFound if not found. + */ + IMPORT_C TInt ItemIndex( const MhspsDomListItem& aItem )const; + + /** + * Get reference to the dom's string pool. + * + * @since S60 5.0 + * @return Reference to string pool. + */ + IMPORT_C ChspsDomStringPool& StringPool() const; + + /** + * Count items in a list. + */ + TInt Count() const; + public: // Serializing + + /** + * Get list's data size in bytes. + * @since Series 60 3.1 + * @return Data size in bytes + */ + TInt Size() const; + + /** + * Externalize list's data. + * @since Series 60 3.1 + * @param aStream Output stream + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize list's data. + * @since Series 60 3.1 + * @param aStream Input stream + */ + void InternalizeL( RReadStream& aStream ); + + public: //Utility + + /** + * Get list item type. + * @since Series 60 3.1 + * @return List item type + */ + TListType Type() const + { + return iListType; + } + + + private: + + /** + * C++ default constructor. + */ + ChspsDomList( TListType aListType, ChspsDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + protected: + //List type + TListType iListType; + + //Items are stored into a segmented array + RPointerArray iList; + + private: // Data + // StringPool, not owned + ChspsDomStringPool& iStringPool; + + + }; + +#endif // hsps_DOM_LIST_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomnode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomnode.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,392 @@ +/* +* 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: Primary datatype for the entire Document Object Model. +* +*/ + + + +#ifndef hsps_DOM_NODE_H +#define hsps_DOM_NODE_H + +// INCLUDES +#include +#include +#include "mhspsdomlistitem.h" + +// FORWARD DECLARATIONS +enum TContentType + { + EEmpty = 0, + EAny, + EPCData + }; + +class ChspsDomList; +class ChspsDomStringPool; +class ChspsNode; + +// CLASS DECLARATION + +/** + * Class represents a single node in the document tree. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_hspsdom + */ +class ChspsDomNode : public CBase, public MhspsDomListItem + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aName Name of node. + * @param aNS Namespace. + * @param aStringPool Attached string pool. + */ + static ChspsDomNode* NewL( + const TDesC8& aName, + const TDesC8& aNS, + ChspsDomStringPool& aStringPool ); + + /** + * Two-phased stream constructor. + * + * @since S60 5.0 + * @param aStream Source stream. + * @param aStringPool Attached string pool. + */ + static ChspsDomNode* NewL( RReadStream& aStream, ChspsDomStringPool& aStringPool ); + + /** + * Destructor. + */ + virtual ~ChspsDomNode(); + + public: // New functions + /** + * Makes a clone from this node and it's child nodes. + * + * @since S60 5.0 + * @param aStringPool A new string pool. + * @return Pointer to a clone node. Caller has the ownership. + */ + IMPORT_C ChspsDomNode* CloneL( ChspsDomStringPool& aStringPool ); + + /** + * Makes a clone only from this node. + * + * @since S60 5.0 + * @param aStringPool A new string pool. + * @return Pointer to a clone node. Caller has the ownership. + */ + IMPORT_C ChspsDomNode* CloneWithoutKidsL( ChspsDomStringPool& aStringPool ); + + /** + * Contructs a ref node from this node and its child's. + * + * @since S60 5.0 + * @return Pointer to a ref node. Caller has the ownership. + */ + IMPORT_C ChspsDomNode* CreateRefNodeL(); + + /** + * Get the namespace of this node. + * + * @since S60 5.0 + * @return Pointer to the namespace buffer. + */ + IMPORT_C const TDesC8& Namespace(); + + /** + * Node's attributes exist in a list. + * + * @since S60 5.0 + * @return Reference to a attribute list. + */ + IMPORT_C ChspsDomList& AttributeList()const; + + /** + * Node need to know it's parent. + * + * @since S60 5.0 + * @param aParent Pointer to this node parent. + */ + IMPORT_C void SetParent( ChspsDomNode* aParent ); + + /** + * Node's parent is enquered e.g to traverse the document. + * + * @since S60 5.0 + * @return Pointer to a parent node. + */ + IMPORT_C ChspsDomNode* Parent() const; + + /** + * Node id is for a uiengine use. + * + * @since S60 5.0 + * @param aNodeId Unique identifier. + */ + IMPORT_C void SetNodeId( const TInt aNodeId ); + + /** + * Get the node unique identifier. + * + * @since S60 5.0 + * @return Node unique identifier. + */ + IMPORT_C TInt NodeId() const; + + /** + * Get the node unique identifier. + * + * @since S60 5.0 + * @return Node unique identifier. + */ + IMPORT_C TInt ItemIndex( const MhspsDomListItem& aItem )const; + + /** + * Access to child nodes. + * + * @since S60 5.0 + * @return Pointer to a list of child nodes. + */ + IMPORT_C ChspsDomList& ChildNodes(); + + /** + * Child nodes of this node are needed to be able to + * traverse the document. + * + * @since S60 5.0 + * @param aNode Node owns it's childs. + */ + IMPORT_C void AddChildL( ChspsDomNode* aNode ); + + /** + * Child nodes of this node are needed to be able to + * traverse the document. + * + * @since S60 5.0 + * @param aNode Node owns it's childs. + * @param aIndex Index in list where the node is added. + */ + IMPORT_C void AddChildL( ChspsDomNode* aNode, TInt aIndex ); + + /** + * Removes node from the child list and frees memory allocated + * for a child node and it descendants. + * + * @since S60 5.0 + * @param aNode Node to be released. + */ + IMPORT_C void DeleteChild( ChspsDomNode* aNode ); + + /** + * Replaces a child node with the other node. Memory allocated for + * the node is freed. + * + * @since S60 5.0 + * @param aNode Node to be replaced. + * @param aNewNode New node. + */ + IMPORT_C void ReplaceChildL( ChspsDomNode* aNode, ChspsDomNode* aNewNode ); + + /** + * Get the character data. + * + * @since S60 5.0 + * @return Reference to a buffer. + */ + IMPORT_C const TDesC8& PCData(); + + /** + * Append PCData into node. Thus it is possible to have + * "a c e " PCData. + * + * @since S60 5.0 + * @param aPCData UTF-8 encoded parsed character data. + */ + IMPORT_C void AppendPCDataL( const TDesC8& aPCData ); + + /** + * Set parsed character data. + * + * @since S60 5.0 + * @param aPCData UTF-8 encoded parsed character data. + */ + IMPORT_C void SetPCDataL( const TDesC8& aPCData ); + + /** + * Set content type. + * + * @since S60 5.0 + * @return content type. + */ + IMPORT_C const TContentType& ContentType(); + + /** + * Get content type. + * + * @since S60 5.0 + * @param aContentType content type. + */ + IMPORT_C void SetContentType( const TContentType& aContentType ); + + /** + * Recursive function to count all child nodes belonging + * to this node. + * + * @since S60 5.0 + * @return This node and it's all childs count. + */ + IMPORT_C TInt DescendantCount() const; + + /** + * Get reference to the dom's string pool. + * + * @since S60 5.0 + * @return Reference to string pool. + */ + IMPORT_C ChspsDomStringPool& StringPool() const; + + /** + * Mark this node as a reference node. + * + * @since S60 5.0 + * @param aRefNode ETrue if node is a reference node. + */ + IMPORT_C void SetRefNode( TBool aRefNode=ETrue ); + + /** + * Check if this node is referring to some global node. + * + * @since S60 5.0 + * @return ETrue if this is a reference node. + */ + IMPORT_C TBool IsRefNode() const; + + /** + * Deletes attributes when they are not needed anymore. + * I.e. UIEngine has copied them into property list. + * + * @since S60 5.0 + */ + IMPORT_C void DeleteAttributeList(); + + /** + * Returns value of given attribute. + * + * @param aAttribute Name of the attribute. + * @since S60 5.0 + * @return Value of an attribute. + */ + IMPORT_C const TDesC8& AttributeValue(const TDesC8& aAttribute) const; + + public: //From MhspsDomListItem + + + /** + * Documented in ChspsDomListItem::Size + */ + TInt Size() const; + + /** + * Documented in ChspsDomListItem::ExternalizeL + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Documented in ChspsDomListItem::InternalizeL + */ + void InternalizeL( RReadStream& aStream ); + + + /** + * Documented in ChspsDomListItem::Name + */ + IMPORT_C const TDesC8& Name(); + + + public: + + /** + * Sets pointer to associated layout node. + * + * @since S60 5.0 + * @param aNode Pointer to associated layout node. + */ + IMPORT_C void SetLayoutNode(ChspsNode* aNode); + + /** + * Returns pointer to associated layout node. + * + * @since S60 5.0 + * @return Pointer to associated layout node. + */ + IMPORT_C ChspsNode* LayoutNode(); + private: + /** + * C++ default constructor. + */ + ChspsDomNode( ChspsDomStringPool& aStringPool ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const TDesC8& aName, const TDesC8& aNS ); + + private: // Data + + //iNameRef refers to a name string in a string pool + TInt iNameRef; + + //iNSRef refers to a namespace string in a string pool + TInt iNSRef; + + //iStringPool is used to resolve strings based on references + ChspsDomStringPool& iStringPool; + + //Type of the elements content + TContentType iContentType; + + //Parsed character data + HBufC8* iPCData; + + //Node's parent pointer + ChspsDomNode* iParentNode; + + //Node unique identifier + TInt iNodeId; + + //Node's childs are collected into a list. Childs are owned by node + ChspsDomList* iChildList; + + //Node is the owner of the attributes + ChspsDomList* iAttributeList; + + //Flag is set if this node is reference node + TBool iRefNode; + + // Not owned + ChspsNode* iLayoutNode; + }; + +#endif // hsps_DOM_NODE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsdomstringpool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsdomstringpool.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Flyweigth pattern implementation for dom strings. +* +*/ + + + +#ifndef hsps_DOM_STRING_POOL_H +#define hsps_DOM_STRING_POOL_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** + * Class utilize flyweight pattern. Dom strings are stored once + * and referred with index. Class can be serialized. + * + * @lib hspsdomdocument.lib + * @since S60 5.0 + * @ingroup group_hspsdom + */ +class ChspsDomStringPool : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + static ChspsDomStringPool* NewL(); + + /** + * Two-phased stream constructor. + * + * @since S60 5.0 + * @param aStream Source stream. + */ + static ChspsDomStringPool* NewL( RReadStream& aStream ); + + /** + * Destructor. + */ + virtual ~ChspsDomStringPool(); + + public: + /** + * Make a copy from original StringPool. + * @since Series 60 3.1 + * @return Pointer to a string pool. Ownership is transferred to a caller. + */ + ChspsDomStringPool* CloneL(); + public: //Adding + + /** + * Set dom string into string pool. + * + * @since S60 5.0 + * @param aString String to add to string pool + * @return Index (reference) to string pool + */ + IMPORT_C TInt AddStringL( const TDesC8& aString ); + + public: //Accessing + /** + * Get pointer to the node element name. + * @param aStringRef StringRef. + * @return Pointer to the name + */ + const TDesC8& String( const TInt aStringRef ); + + /** + * Get object's data size in bytes. + * @return Data size in bytes + */ + TInt Size() const; + + /** + * Externalize object + * @param aStream Output stream + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize object + * @param aStream Input stream + */ + void InternalizeL( RReadStream& aStream ); + + private: + + /** + * C++ default constructor. + */ + ChspsDomStringPool(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + //String pool + RPointerArray iStringPool; + + + }; + +#endif // hsps_DOM_STRING_POOL_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsodt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsodt.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,533 @@ +/* +* 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: Class represents an ODT (Object Description Tree). +* +*/ + + +#ifndef hspsODT_H +#define hspsODT_H + +#include + +class RWriteStream; +class RReadStream; +class ChspsDomDocument; +class ChspsResource; + +const TInt KArrayGranularity = 5; +const TInt KHeaderDataLength = KMaxFileName; +const TInt KMaxDescLength = 255; + +/** +* Class represents an Object Description Tree of HSPS. +* ODT is cabable of marshaling itself into HBufC8 descriptor and unmarshaling +* from descriptor stream. +* A Header is an ODT instance which has not internalized it's resources +* nor it's DOM (XML payload). +* +* @lib hspsODT.lib +* @since S60 5.0 +* @ingroup group_hspsodt +*/ +class ChspsODT : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsODT* NewL(); + + /** + * Two-phased constructor. + * + * @since S60 5.0 + * @param aStreamData The read stream. + */ + IMPORT_C static ChspsODT* NewLC( const TDesC8& aStreamData ); + + /** + * Destructor. + */ + virtual ~ChspsODT(); + + public: + /** + * Externalizes the object. + * + * @since S60 5.0 + * @param aStream The write stream. + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream) const; + + /** + * Internalizes the object. + * + * @since S60 5.0 + * @param aStream The read stream. + */ + IMPORT_C void InternalizeL( RReadStream& aStream); + + public: // New functions + + /** + * Marshals the ODT header into descriptor stream. + * + * @since S60 5.0 + * @return HBufC8* A descriptor object containing the ODT header. + */ + IMPORT_C HBufC8* MarshalHeaderL() const; + + /** + * Unmarshals the header information from the stream and returns + * ODT instance. + * + * @since S60 5.0 + * @param aStreamData Descriptor stream containing the ODT header data. + * @return ChspsODT* An ODT object prefilled with the header information. + */ + IMPORT_C static ChspsODT* UnMarshalHeaderLC( const TDesC8& aStreamData ); + + /** + * Unmarshals the header information from the stream and saves the data + * into same instance. + * + * @since S60 5.0 + * @param aStreamData Descriptor stream containing the ODT header data. + */ + IMPORT_C void UnMarshalHeaderL( const TDesC8& aStreamData ); + + /** + * Externalizes the ODT header. + * + * @since S60 5.0 + * @param aStream The read stream. + */ + IMPORT_C void ExternalizeHeaderL( RWriteStream& aStream ) const; + + /** + * Internalizes the ODT header. + * + * @since S60 5.0 + * @param aStream The read stream. + */ + IMPORT_C void InternalizeHeaderL( RReadStream& aStream ); + + /** + * Adds a resource-object into ODT. + * + * @since S60 5.0 + * @param aResource ChspsResource to add. ODT takes ownership. + */ + IMPORT_C void AddResourceL( ChspsResource* aResource ); + + /** + * Checks duplicates. + * + * @since S60 5.0 + * @param aResource ChspsResource to check. + * @return 0 if there were no duplicate resources, index otherwise. + */ + TInt CheckResourceL( ChspsResource* aResource ); + + /** + * Deletes a resource from the ODT. + * + * @since S60 5.0 + * @param aIndex Index of the resource to be deleted. + */ + IMPORT_C void DeleteResourceL( TInt aIndex ); + + /** + * Gets a resource. + * + * @since S60 5.0 + * @param aIndex Index of the resource to be retrieved. + * @return A ChspsResource-object to be accessed. Ownership remains. + */ + IMPORT_C ChspsResource& ResourceL( TInt aIndex ) const; + + /** + * Amount of resources in ODT. + * + * @since S60 5.0 + * @return TInt Amount of elements. + */ + IMPORT_C TInt ResourceCount() const; + + /** + * Externalizes the Resource List. + * + * @since S60 5.0 + * @param aStream The read stream. + */ + IMPORT_C void ExternalizeResourceListL( RWriteStream& aStream ) const; + + /** + * Internalizes the Resource List. + * + * @since S60 5.0 + * @param aStream The read stream. + */ + IMPORT_C void InternalizeResourceListL( RReadStream& aStream ); + + + /** + * Set Uid of the application or interface, which uses the theme. + * + * @since S60 5.0 + * @param aUid The root UID. + */ + IMPORT_C void SetRootUid( TInt aUid ); + + /** + * Get RootUid. + * + * @since S60 5.0 + * @return TInt The root UID. + */ + IMPORT_C TInt RootUid() const; + + /** + * Set providerUid. + * + * @since S60 5.0 + * @param aUid The UID of the theme provider. + */ + IMPORT_C void SetProviderUid( TInt aUid ); + + /** + * Get ProviderUid + * + * @since S60 5.0 + * @return TInt The UID of the theme provider. + */ + IMPORT_C TInt ProviderUid() const; + + /** + * Set ThemeUid. + * + * @since S60 5.0 + * @param aUid Theme UID. + */ + IMPORT_C void SetThemeUid( TInt aUid ); + + /** + * Get ThemeUid. + * + * @since S60 5.0 + * @return TInt Theme UID. + */ + IMPORT_C TInt ThemeUid() const; + + /** + * Set ProviderName. + * + * @since S60 5.0 + * @param aName The name of the theme provider. + */ + IMPORT_C void SetProviderNameL( const TDesC& aName ); + + /** + * Get ProviderName. + * + * @since S60 5.0 + * @return TDesC& The name of the theme provider. + */ + IMPORT_C const TDesC& ProviderName() const; + + /** + * Set ThemeFullName. + * + * @since S60 5.0 + * @param aName Themes' name. + */ + IMPORT_C void SetThemeFullNameL( const TDesC& aName ); + + /** + * Get ThemeFullName. + * + * @since S60 5.0 + * @return TDesC& The name of the theme. + */ + IMPORT_C const TDesC& ThemeFullName() const; + + /** + * Set ThemeShortName. + * + * @since S60 5.0 + * @param aName Themes' short name. + */ + IMPORT_C void SetThemeShortNameL( const TDesC& aName ); + + /** + * Get ThemeShortName + * + * @since S60 5.0 + * @return TDesC& The short name of the theme. + */ + IMPORT_C const TDesC& ThemeShortName() const; + + /** + * Set ThemeVersion. + * + * @since S60 5.0 + * @param aVersion Themes' version. + */ + IMPORT_C void SetThemeVersionL( const TDesC& aVersion ); + + /** + * Get ThemeVersion. + * @since S60 5.0 + * @return TDesC& The version of the theme. + */ + IMPORT_C const TDesC& ThemeVersion() const; + + /** + * Set OdtLanguage. + * + * @since S60 5.0 + * @param aLanguage Themes' language. + */ + IMPORT_C void SetOdtLanguage( TInt aLanguage ); + + /** + * Get OdtLanguage. + * + * @since S60 5.0 + * @return TInt OdtLanguage. + */ + IMPORT_C TInt OdtLanguage() const; + + /** + * Set status flag-definitions for themes. + * + * @since S60 5.0 + * @param aFlags Flags to be set. + */ + IMPORT_C void SetFlags( TUint aFlags ); + + /** + * Get status flag-definitions for themes. + * + * @since S60 5.0 + * @return TUint status flag-definitions. + */ + IMPORT_C TUint Flags() const; + + /** + * Get the DomDocument. + * + * @since S60 5.0 + * @return ChspsDomDocument& Dom document. + */ + IMPORT_C ChspsDomDocument& DomDocument() const; + + + /** + * Clones this ChspsODT. + * + * @since S60 5.0 + * @return ChspsODT* pointer to the cloned ODT. + */ + IMPORT_C ChspsODT* CloneL(); + + + /** + * Clones the aDom and sets it as this ChspsODT's DomDocument. + * + * @since S60 5.0 + * @param aDom Dom to be cloned. + */ + IMPORT_C void CopyDomDocumentL( ChspsDomDocument& aDom ); + + /** + * Set configurationt type. + * + * @since S60 5.0 + * @param aType Type. + */ + IMPORT_C void SetConfigurationType( TUint aType ); + + /** + * Get configuration type. + * + * @since S60 5.0 + * @return TUint configuration type. + */ + IMPORT_C TUint ConfigurationType() const; + + /** + * Set package version. + * + * @since S60 5.0 + * @param aVersion Version. + */ + IMPORT_C void SetPackageVersionL( const TDesC& aVersion ); + + /** + * Get configuration type. + * + * @since S60 5.0 + * @return TDesC package version + */ + IMPORT_C const TDesC& PackageVersion() const; + + /** + * Set family. + * Identifies the resolution and user interface for which + * the resource/widget was designed for (e.g. vga, qhd_tch). + * + * @since S60 5.0 + * @param aFamily Family mask (supported resolution bits set) + */ + IMPORT_C void SetFamily( const TUint32 aFamilyMask ); + + /** + * Get family. + * + * @since S60 5.0 + * @return The family mask + */ + IMPORT_C TUint32 Family() const; + + /** + * Set Widget instance count + * + * @since S60 5.0 + * @param aMultiInstance multiinstance. + */ + IMPORT_C void SetMultiInstance( TInt aMultiInstance ); + + /** + * Get Widget instance count + * + * @since S60 5.0 + * @return TInt multiinstance. + */ + IMPORT_C TInt MultiInstance() const; + + /** + * Sets description of the widget + * @since S60 5.0 + * @param aDesc Text + */ + IMPORT_C void SetDescriptionL( const TDesC& aDesc ); + + /** + * Gets description of the widget + * @since S60 5.0 + * @return text + */ + IMPORT_C const TDesC& Description() const; + + /** + * Sets path of the logo file + * @since S60 5.0 + * @param aPath Path to the file + */ + IMPORT_C void SetLogoFileL( const TDesC& aPath ); + + /** + * Gets path to the logo file + * @since S60 5.0 + * @return path + */ + IMPORT_C const TDesC& LogoFile() const; + + /** + * Sets path of the preview file + * @since S60 5.0 + * @param aPath Path to the file + */ + IMPORT_C void SetPreviewFileL( const TDesC& aPath ); + + /** + * Gets path to the preview file + * @since S60 5.0 + * @return path + */ + IMPORT_C const TDesC& PreviewFile() const; + + private: + + /** + * C++ default constructor. + */ + ChspsODT(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // Family mask (bits for e.g. vga, qhd_tch etc resolutions) + TUint32 iFamilyMask; + + // Configuration type + TUint iConfigurationType; + + // Application or interface uid + TUint iRootUid; + + // The publisher + TUint iProviderUid; + + // Identifies specific configuration + TUint iThemeUid; + HBufC* iProviderName; + HBufC* iThemeFullName; + HBufC* iThemeShortName; + + // Revision number + HBufC* iThemeVersion; + + // Indicates whether we are able to internalize the instance + HBufC* iPackageVersion; + + // Language of the ODT instance + TInt iLanguage; + + // Multiple instances allowed/not + TInt iMultiInstance; + + // Description of the widget + HBufC* iDescription; + + // Path to the logo file + HBufC* iLogoFile; + + // Path to the preview file + HBufC* iPreviewFile; + + // ThspsThemeStatus + TUint iFlags; + + // Pointer to list of unlocalized resources + CArrayPtrSeg* iResourceList; + + ChspsDomDocument* iDomDocument; + + // Reserved pointer for future extension + TAny* iReserved; + }; + +#endif // hspsODT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspspluginidlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspspluginidlist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,93 @@ +/* +* 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: +* +* HSPS ChspsPluginIdList-class defines all information what is needed to maintain +* resources of Application Theme. Every ChspsPluginIdList-objects defines just one +* resource source, however, the same resource source could be referenced +* multiple times inside a theme - resources are usually shared. +* HSPS Application Theme Management system supports theme resourcing by +* offering resource conversations and storing services, and offering Rendering +* Engines the following services: +* 1) the way to match a resource quoted in xml- or css-module to the +* corresponding resource source, and 2) a secure way to access a resource +* through the Symbian Platform Security's process separation wall. +* +* +*/ + + +#ifndef hspsPLUGINIDLIST_H +#define hspsPLUGINIDLIST_H + +#include +#include // streams + +/** +* ChspsPluginIdList is HSPS-utility class for passing IPC data +* +* @lib hspsResource.lib +* @since S60 5.0 +* @ingroup group_hspsresult +*/ +class ChspsPluginIdList : public CArrayFixFlat + { + public: // Constructors and destructor + + /** + * C++ default constructor. + * + * @since S60 5.0 + * @param aGranularity List granularity. + */ + IMPORT_C ChspsPluginIdList( TInt aGranularity ); + + /** + * Destructor. + */ + IMPORT_C virtual ~ChspsPluginIdList(); + + public: // New functions + + /** + * Externalizes ChspsResource-object's member data. + * + * @since S60 5.0 + * @param aStream is a write stream given. + */ + IMPORT_C void ExternalizeL( RDesWriteStream& aStream ) const; + + /** + * Internalizes ChspsResource-object's member data. + * + * @since S60 5.0 + * @param aStream is data read stream given. + */ + IMPORT_C void InternalizeL( RDesReadStream& aStream ); + + /** + * Calculates data length of the ChspsPluginIdList object. + * + * @since S60 5.0 + * @return Data length. + */ + IMPORT_C TInt GetDataLength(); + + private: // Data + + }; + +#endif // hspsPLUGINIDLIST_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsreqnotifparam.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsreqnotifparam.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2002-2004 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: Request Notification parameters +* +* +*/ + + +#ifndef hspsREQNOTIFPARAM_H +#define hspsREQNOTIFPARAM_H + +#include + +const TInt KMaxReqNotifDataLength8 = 5*sizeof(TUint32)+sizeof(TBool)+KMaxFileName; + +class RDesReadStream; +class RDesWriteStream; + +/** + * ChspsRequestNotificationParams is HSPS class for asuynchronous client's notification handling. + * + * @lib hspsResult.lib + * @since S60 5.0 + * @ingroup group_hspsresult + */ +class ChspsRequestNotificationParams : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsRequestNotificationParams* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsRequestNotificationParams(); + + public: // New functions + + /** + * ExternalizeL() writes ChspsRequestNotificationParams object to a given stream. + * + * @since S60 5.0 + * @param aStream a write stream given. + */ + IMPORT_C void ExternalizeL( RDesWriteStream& aStream) const; + + /** + * InternalizeL() reads ChspsRequestNotificationParams from given stream. + * + * @since S60 5.0 + * @param aStream is astream given. + */ + IMPORT_C void InternalizeL( RDesReadStream& aStream); + + /** + * GetDataLenght() calculates data length of ChspsRequestNotificationParam object. + * + * @since S60 5.0 + * @return Length of the data in ChspsRequestNotificationParam object. + */ + IMPORT_C TInt GetDataLength() const; + + /** + * Resets hspsRequestNotificationParam data members. + * + * @since S60 5.0 + */ + IMPORT_C void ResetData(); + + /** + * Set Name. + * + * @since S60 5.0 + * @param aName Themes' name. + */ + IMPORT_C void SetNameL( const TDesC& aName ); + + /** + * Get Name. + * + * @since S60 5.0 + * @return TDesC& The name of the theme. + */ + IMPORT_C const TDesC& Name() const; + + private: + + /** + * C++ default constructor. + */ + ChspsRequestNotificationParams(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + // Event that are notified + TInt iEvent; + // AppUid of the application that notification concerns + TInt iAppUid; + // AppUid of the application that notification concerns + TInt iAppConfUid; + // AppUid of the originator requested the configuration change + TUint iOrigUid; + // PluginUid of the plugin that notification concerns. + TInt iPluginUid; + // Count of the plugins that notifications concerns; + TInt iCount; + // PluginIds of the plugins that notification concerns. + RArray iPluginIds; + // Plugin name of the plugin that notification concerns + HBufC* iName; + + private: // Data + + // Reserved pointer for future extension + TAny* iReserved; + }; + +#endif // hspsRESULT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsrequestclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsrequestclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2002-2004 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: +* +* ChspsRequestClient is a client-side implementation of MhspsClientRequestService API-definition +* of Homescreen Plugin Configuration Management Services. +* ChspsRequestClient is intended to serve Rendering Engines with Application configuartion and plugin configurations +* and their associated resources. ChspsRequestClient will provide access to Homescreen Plugin configuration +* database maintained by hspsThemeServer. +* Typical use-case in using ChspsRequestClient is that there is HSPS SAPI user with a instance of +* CHspsConfigurationService. When Homescreen application is starting up, the provider of teh HSPS Sapi is created +* with instance of ChspsConfigurationService. ChspsConfigurationService calls hspsGetODT() and retrieves application +* configuartion. When request exists on server-side, the right one application configuration is delivered to client process. +* Theme may include resources. Resourses are listed on Resource List which is delivered too by +* the same request. hspsThemeServer uses Symbian Central Repository to get match theme on the +* request. ChspsRequestClient serves also resource accesses. In using file handle passing introduced +* by Symbian Platform Security, it deliver a resource access to the client process. +* +* ChspsRequestClient includes asynchronous service for subscribing the changes of current theme. +* These changes could be for e.g. theme status change (another theme is activated for the +* application) or a theme update. Change-events must be subsribed by calling hspsGetODTUpdate(). +* CHspsConfigurationService who was initiated ChspsRequestClient, must listen to +* the hspsThemeServer call-back events. Call-back events are delivered through +* MhspsClientRequestServiceObserver::HandlehspsRequestClientMessage() function. +* Subscribtion can be canceled by hspsCancelGetODTUpdate() at any time. ChspsRequestClient cancels +* subscription automaticly on some cases, for instance, on theme status change; there is no reason +* to continue subscription of changes of the theme which is not active any more - host application +* must reload the theme and then initiate the subscription again. +* +* For more information, see HSPS Theme Management Service APIs documentation +* and hspsThemeManagement.h, where MhspsClientRequestService API implemented by this class are defined. +* +* Version : %version: 1 % +* +*/ + + +#ifndef __ChspsREQUESTCLIENT_H__ +#define __ChspsREQUESTCLIENT_H__ + +#include + +#include "hspsthememanagement.h" +#include "hspsclientsession.h" +#include "hspsresult.h" +#include "hspsreqnotifparam.h" + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +#endif + +/** hspsRequestClient Panic Category. */ +_LIT( KhspsRequestClient, "hspsRequestClient" ); + +/** hspsRequestClient panic codes: */ +enum ThspsRequestClientPanics + { + EhspsRequestClientBadState + }; + +class ChspsODT; +class ChspsResource; +class RhspsClientSession; +class MhspsClientRequestService; +class MhspsClientRequestServiceObserver; +class ChspsResult; +class ChspaRequestNotificationParams; + +/** + * Request client + * + * @lib hspsrequestclient.lib + * @since S60 5.0 + * @ingroup group_hspsclients + */ +class ChspsRequestClient : public CActive, public MhspsClientRequestService + { + + public: // Constructors and destructors + /** + * NewL. + * Two-phased constructor. + * Creates a ChspsClient object using two phase construction, + * and return a pointer to the created object. + * + * @since S60 5.0 + * @param aObserver The object to be used to + * handle updates from the server. + */ + IMPORT_C static ChspsRequestClient* NewL(MhspsClientRequestServiceObserver& aObserver ); + + /** + * NewLC. + * Two-phased constructor. + * Creates a ChspsRequestClient object using two phase construction, + * and return a pointer to the created object. + * + * @since S60 5.0 + * @param aObserver The object to be used to + * handle updates from the server. + */ + IMPORT_C static ChspsRequestClient* NewLC( MhspsClientRequestServiceObserver& aObserver ); + + /** + * ~ChspsRequestClient. + * + * Destructor. + * Destroys the object and release all memory objects. + */ + virtual ~ChspsRequestClient(); + + public: // New functions + + /** + * From MhspsClientRequestService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetODT(TInt aAppUid, ChspsODT& aODT); + + /** + * From MhspsClientRequestService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsGetODTUpdate(); + + /** + * From MhspsClientRequestService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsCancelGetODTUpdate(); + + /** + * From MhspsClientRequestService. + */ + IMPORT_C ThspsServiceCompletedMessage hspsAccessResourceFile( + const TDesC& aResourceFileName, + const ThspsConfiguration& aConfiguration, + RFile& aFile); + + /** + * GethspsResult. + * + * @since S60 5.0 + * @param aResult is a ChspsResult object containing additional information of query result. + */ + IMPORT_C void GethspsResult(ChspsResult& aResult); + + /** + * Sets a log bus when debugging has been enabled. + * Empty implementation if non HSPS_LOG_ACTIVE build. + * + * @since S60 5.0 + * @param aLogBus Log bus to be set. + */ + IMPORT_C void SetLogBus( void* aLogBus ); + + protected: // Functions from base classes + + /** + * From CActive, RunL. + * Callback function. + * Invoked to handle responses from the server. + */ + void RunL(); + + /** + * From CActive, DoCancel. + * Cancels any outstanding operation. + */ + void DoCancel(); + + /** + * From CActive Called when asynchronous request has failed + * @since S60 3.1 + */ + TInt RunError( TInt aError ); + + protected: + /** + * Sends a request to the server, retrieves a file path, internalizes the file + * and copies resources from the server to client's private folder + * @since S60 5.0 + */ + void CallGetOdtInFileL( + const ThspsConfiguration& aConfiguration, + ChspsODT& aODT ); + + /** + * UpdatehspsResult. Updates iResult with latest result data coming on client request return. + */ + void UpdatehspsResult(); + + /** + * UpdatehspsReqNotifParams. Updates iReqNotifParams with latest notification data coming on client request return. + */ + void UpdatehspsReqNotifParams(); + + private: // Constructors and destructors + + /** + * ChspsRequestClient. + * Performs the first phase of two phase construction. + * @param aObserver The object to be used to + * handle updates from the server. + */ + ChspsRequestClient( MhspsClientRequestServiceObserver& aObserver); + + /** + * ConstructL. + * Performs the second phase construction + * ChspsRequestClient object. + */ + void ConstructL(); + + private: // Members + + /** + * iSession, the time server session. + */ + RhspsClientSession iSession; + + /** + * iObserver, observer which handles updates from the server. + */ + MhspsClientRequestServiceObserver& iObserver; + + private: // Data + TBuf8 iHeaderData; + HBufC8* iElement; + TBuf8 iResultData; + ChspsResult* iResult; + ChspsRequestNotificationParams* iReqNotifParams; + TBuf8 iReqNotifData; + ChspsODT* iODT; + TBool iODTValid; + CArrayPtrSeg* iResourceList; + +#ifdef HSPS_LOG_ACTIVE + // Log bus. Not owned. + ChspsLogBus* iLogBus; +#endif + }; + + +#endif //__ChspsCLIENT_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsresource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsresource.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,307 @@ +/* +* 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: Declaration of a file resource +* +*/ + + +#ifndef hspsRESOURCE_H +#define hspsRESOURCE_H + +#include +#include // MIME +#include // streams + +const TInt KMaxTagsLength = 50; + +/** +* ThspsLockingPolicy +* Locking policy flag-definitions for HSPS. These are bit-masked. +*/ +enum ThspsLockingPolicy + { + EhspsUnlocked = 0x0000, //0b0000000000000000, Resource is replaceable + EhspsLocked = 0x0001 //0b0000000000000001, The resource is always fetched from ROM and it cannot be replaced + }; + +/** + * Resource file extension definitions for HSPS. + */ +_LIT(KODTFileExtension, ".o0000"); +_LIT(KDTDFileExtension, ".dtd"); +_LIT(KXMLFileExtension, ".xml"); +_LIT(KDATFileExtension, ".dat"); + + +/** +* ThspsResourceType +* Resource-type definitions for HSPS. +*/ +enum ThspsResourceType + { + /** + * EResourceNone. No type at all - juts a file path. + */ + EResourceNone, + + /** + * EResourceODT. Resource is ODT (HSPS Application Theme's binary format) + */ + EResourceODT, + + /** + * EResourceDTD. + */ + EResourceDTD, + + /** + * EResourceXML. + */ + EResourceXML, + + /** + * EResourceDAT. + */ + EResourceDAT, + + /** + * EResourceRES. Resource is some media content. + */ + EResourceRES, + + /** + * EResourceOther. Other extension. + */ + EResourceOther + + }; + + +/** + * ChspsResource is HSPS-utility class defining resource-structure. + * + * @lib hspsResource.lib + * @since S60 5.0 + * @ingroup group_hspsresource + */ +class ChspsResource : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsResource* NewL(); + + + /** + * Makes a clone of this class. + * + * @since S60 5.0 + */ + IMPORT_C ChspsResource* CloneL(); + + /** + * Destructor. + */ + virtual ~ChspsResource(); + + public: // New functions + + /** + * Sets value of iLockingPolicy data member. + * + * @since S60 5.0 + * @param aLockingPolicy is new value for iLockingPolicy data member. + */ + IMPORT_C void SetLockingPolicy( ThspsLockingPolicy aLockingPolicy ); + + /** + * Gets value of iLockingPolicy data member. + * + * @since S60 5.0 + * @return ThspsLockingPolicy iLockingPolicy. + */ + IMPORT_C ThspsLockingPolicy LockingPolicy() const; + + /** + * Sets value of iResourceType data member. + * + * @since S60 5.0 + * @param aResourceType is new value of iResourceType data member. + */ + IMPORT_C void SetResourceType( ThspsResourceType aResourceType ); + + /** + * Gets value of iResourceType data member. + * + * @since S60 5.0 + * @return ThspsResourceType iResourceType. + */ + IMPORT_C ThspsResourceType ResourceType() const; + + /** + * Sets value of iResourceId data member. + * + * @since S60 5.0 + * @param aResourceId is new value of iResourceId data member. + */ + IMPORT_C void SetResourceIdL( const TDesC& aResourceId ); + + /** + * Gets value of iResourceId data member. + * + * @since S60 5.0 + * @return TDesC& iResourceId. + */ + IMPORT_C const TDesC& ResourceId() const; + + /** + * Sets value of iFileName data member. + * + * @since S60 5.0 + * @param aFileName is new iFileName value. + */ + IMPORT_C void SetFileNameL( const TDesC& aFileName ); + + /** + * Gets value of iFileName data member. + * + * @since S60 5.0 + * @return TDes& iFileName. + */ + IMPORT_C const TDesC& FileName() const; + + /** + * Sets value of iMimeType data member. + * + * @since S60 5.0 + * @param aDataType is a new value of iMimeType. + */ + IMPORT_C void SetMimeTypeL( const TDataType aDataType ); + + /** + * Get iMimeType of this ChspsResource-object. + * + * @since S60 5.0 + * @return TDataType iMimeType. + */ + IMPORT_C TDataType MimeType() const; + + /** + * Externalizes ChspsResource-object's member data. + * + * @since S60 5.0 + * @param aStream is a write stream given. + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream) const; + + /** + * Internalizes ChspsResource-object's member data. + * + * @since S60 5.0 + * @param aStream is data read stream given. + */ + IMPORT_C void InternalizeL( RReadStream& aStream); + + /** + * Set to ELangNone if the resource is common to all locales, + * otherwise it's language specific. + * + * @since S60 5.0 + * @param aLanguage is new value of iLanguage data member. + */ + IMPORT_C void SetLanguage( const TLanguage& aLanguage ); + + /** + * Gets value of iLanguage data member. + * + * @since S60 5.0 + * @return TLanguage& iLanguage. + */ + IMPORT_C const TLanguage& Language() const; + + /** + * Sets value of the iConfigurationUid member + * @since S60 5.0 + * @param aConfUid Configuration UID + */ + IMPORT_C void SetConfigurationUid( const TInt aConfUid ); + + /** + * Gets value of the iConfigurationUid member + * @since S60 5.0 + * @return UID + */ + IMPORT_C TInt ConfigurationUid() const; + + /** + * Sets value of the iTags member + * @since S60 5.0 + * @param aTag Tags + */ + IMPORT_C void SetTagsL( const TDesC& aTag ); + + /** + * Gets value of the iTags member + * @since S60 5.0 + * @return tags descriptor + */ + IMPORT_C const TDesC& Tags() const; + + private: + + /** + * C++ default constructor. + */ + ChspsResource(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // Not used? + ThspsLockingPolicy iLockingPolicy; + + // Resource type + ThspsResourceType iResourceType; + + // Language of the resource + TLanguage iLanguage; + + // Identifies the configuration that owns the resource + TInt iConfigurationUid; + + // Filename without the extension + TDesC* iResourceID; + + // Full path and name + TDesC* iFileName; + + TDataType iMimeType; + + // Tags seperated with a colon + TDesC* iTags; + + // Reserved pointer for future extension + TAny* iReserved; + }; + +#endif // hspsRESOURCE_H +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsresult.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsresult.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,127 @@ +/* +* 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: Class ChspsResult is a Xuikon utility class that defines Additional +* Return Code for Xuikon Application Theme Management Services on service +* request return. +* It is quaranteed that ChspsResult-object is always accessible after +* client request whether the result was successful or not. +* ChspsResult-class has attributes that informs the result as follows: +* - iSystemError - Symbian OS returned error code +* - iXuikonError - Xuikon defined error code in Xuikon error space +* - iIntValue1 - additional information relevant the result. +* - iIntValue2 - additional information relevant the result. +* +* For more information about Xuikon errors, see hspsUIManagerErrorCodes.h. +* +* +*/ + + +#ifndef hspsRESULT_H +#define hspsRESULT_H + +#include + +const TInt KMaxResultDataLength8 = 4*sizeof(TUint32); + +class RDesReadStream; +class RDesWriteStream; + +/** + * ChspsResult is utility class serving in error handling. + * + * @lib hspsResult.lib + * @since S60 5.0 + * @ingroup group_hspsresult + */ +class ChspsResult : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static ChspsResult* NewL(); + + /** + * Destructor. + */ + virtual ~ChspsResult(); + + public: // New functions + + /** + * ChspsResult::ExternalizeL() writes ChspsResult object to a given stream. + * + * @since S60 5.0 + * @param aStream Stream to write to. + */ + IMPORT_C void ExternalizeL( RDesWriteStream& aStream ) const; + + /** + * ChspsResult::InternalizeL() reads ChspsResult from given stream. + * + * @since S60 5.0 + * @param aStream Stream to read from. + */ + IMPORT_C void InternalizeL( RDesReadStream& aStream ); + + /** + * ChspsResult::GetDataLenght() calculates data length of ChspsResult object. + * + * @since S60 5.0 + * @return Length of the data in ChspsResult object. + */ + IMPORT_C TInt GetDataLength() const; + + /** + * Resets ChspsResult data members. + * + * @since S60 5.0 + */ + IMPORT_C void ResetData(); + + private: + + /** + * C++ default constructor. + */ + ChspsResult(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + // Symbian OS returned error code + TInt iSystemError; + // Xuikon defined error code in Xuikon error space + TInt iXuikonError; + // Additional information relevant the result. + TInt iIntValue1; + // Additional information relevant the result. + TInt iIntValue2; + + private: // Data + + // Reserved pointer for future extension + TAny* iReserved; + }; + +#endif // hspsRESULT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspsthememanagement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspsthememanagement.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1641 @@ +/* +* 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: +* +* HSPS Application Theme Management Service APIs +* ************************************************ +* This file introduces the definitions of the interfaces and constanst to be a base of the +* implementations of HSPS Application Theme Management services. +* HSPS Application Theme Management Service APIs are introduced by defining Symbian M-classes +* for each API-functionality groups. These functionality groups and their correcponding M-classes +* are the following: +* - MhspsInstallationService - defines services for Application Theme +* installations, +* - MhspsMaintenanceService - defines services for listing, activation, +* removing and restoring themes set as default, +* - MhspsClientRequestService - defines services for usage of Application Themes, +* +* - MhspsThemeManagementServiceObserver - a generic call-back service API to be utilized by client +* applications of HSPS Theme Management Services, and +* - MhspsClientRequestServiceObserver - a dedicated interface to define the call-back service to be +* utilized by clients of HSPS Client Request Service. Typical client of the request service is +* some rendering engine implementation like HSPS UI Engine. +* +* Typical HSPS Application Theme Management Service use-cases +* ============================================================= +* Usage of Application Theme is requested by Rendering Engines. Theme rendering happens when +* Application's UI (user interface) is shown on the screen of the target device. Principal +* requestor of Installation and Maintenanace Service APIs is S60 Personalisation Application. +* Personalisation UI will present theme installation and activation functionality to the end-user. +* Also, HSPS-application itself may want to offer some installation and maintenance +* functionality on their menus, for e.g. allow a user select the theme to be used - theme +* activation (or hot-swap). Some system services of target devices, like OTAPush or DM (Device +* Management), may also use installation and maintenance APIs. +* This supports operators related use-cases where they want to maintain the customisation of mobile +* phone applications on-line. +* +* HSPS UI Manager +* ***************** +* UI Manager is a Symbian Client/Server system which is intended to serve HSPS native +* applications - as well as S60-legacy applications - with Application Theme installation, +* maintenance and usage related services. UI Manager implements HSPS Application Theme Management +* Service APIs. +* +* Client-side functionality and APIs +* ================================== +* In Client/Server system, only Client-side APIs are meaningful to the client +* applications. Offered client-side APIs are divided in two categories; +* hspsClient API and hspsRequestClient API. Both clients run basicly in +* asynchronous mode. however, they offers synchronic services also when +* appropriate. Clients are are able to delegate server messages to their +* client applications. hspsClient API offers application theme installation +* and maintenance related services, meanwhile hspsRequestClient API offers +* services related to the usage of Application Themes. +* +* Server-side functionality and APIs +* ================================== +* +* +* Security +* ======== +* Security in using services is quarantied by controlling the rights to list +* information of the theme set installed as well as to load individual themes. +* The access control is based on SECUREID of application process. +* Security is maintained behind the curtain by means of Symbian EKA2 Kernel +* services for Platform Security. +* +* Scalability +* =========== +* Architecture of UI Manager supports scalability in next way: Services +* provided on server-side reflects the client-side APIs. Client-side objects +* implements exactly the same APIs than services on server-side. This approach +* is selected to support scalability of the theme management system; +* small and one-application systems, for e.g. MP3-player, all services could +* be implemented on client-side, meanwhile large systems can increase their +* performance and features providing powerful and centralised server-side +* theme handling operations like OTA Push, theme caching, theme editing etc. +* HSPS UI Manager implementation is targeted for medium-wide systems running +* on Symbian OS 9.x, typically serving multiple applications and operators +* on-line operations customization on single smartphone. +* +* HSPS Utility Classes +* ====================== +* HSPS Utility Classes are used as parameters in HSPS Application Theme +* Management service calls. They are owned by serveice caller. Utility +* classes are kind of data objects and therefore they are not defined with +* specific interface (M-classes). Utility classes are the following: +* - ChspsODT, and +* - ChspsResource. +* +* ChspsODT +* ------ +* HSPS ChspsODT-class, nick-named ODT (Object Description Tree), class is a +* base unit of information exchanged in HSPS Application Theme Management +* operations. +* ODT consist of an header-part and its associated DOM-document member class +* on which it has a dependency. The header contains all information what is +* needed to distinquish application themes from each others. +* HSPS Application Theme Management services handles mainly these +* ODT-headers, however, the DOM-document is accessed for applying theme +* updates by Installation Handler and to serve the theme usage requests from +* Rendering Engines. For more information, see ChspsODT documentation. +* +* ChspsResource +* ----------- +* HSPS ChspsResource-class defines all information what is needed to maintain +* resources of Application Theme. Every ChspsResource-objects defines just one +* resource source, however, the same resource source coud be referenced +* multible times inside a theme - resources are usually shared. +* HSPS Application Theme Management system supports theme resourcing by +* offering resource conversations and storing services, and offering Rendering +* Engines the following services: +* 1) the way to match a resource quoted in xml- or css-module to the +* corresponding resource source, and 2) a secure way to access a resource +* through the Symbian Platform Security's process separation wall. +* +* ChspsResult +* --------- +* HSPS ChspsResult-class defines feature called Additional Return Code support +* for HSPS Application Theme Management Services on service request return. +* It is quaranteed that ChspsResult-object is always accessible after +* client request whether the result was successful or not. +* ChspsResult-class has attributes that informs the result as follows: +* - iSystemError - Symbian OS returned error code +* - iHSPSError - HSPS defined error code in HSPS error space +* - iIntValue1 - additional information relevant the result. +* - iIntValue2 - additional information relevant the result. +* +* +* +*/ + + +#ifndef __hspsTHEMEMANAGEMENT_H__ +#define __hspsTHEMEMANAGEMENT_H__ + +#include // RFile +#include // descriptors + +// -------------------- +const TUid KSecureId_Psln = {0x10005A32}; // from S60 3.1 Plsn +const TUid KSecureId_RDAS = {0x10210EA1}; // 270601889 from S60 3.1 R&D AppShell for Xuikon +const TUid KSecureId_hspsAS = {0x101F4CD2}; // 270486738 from S60 3.1 Xuikon AppShell in 3.1 product. +const TUid KSecureId_hsps = {0x200159C6}; // HSPS configuration installer (ThemeInstallerCons.exe) +const TUid KSecureId_LE = {0x102049AD}; +const TUid KSecureId_XTA = {0x1020747D}; // Xuikon Test Automation +const TUid KSecureId_XKON = {0x102049AF}; // Xuikon Demo +const TUid KSecureId_hspsAI = {0x102750F0}; // 271012080 support for Xuikon-based ActiveIdle +const TUid KSecureId_GS = {0x100058EC}; // S60 3.1 GS-application(General Settings). +const TUid KSecureId_HUIMenu = {0x102828BD}; +const TUid KSecureId_EUnit = {0x20000FB1}; +const TUid KSecureId_Test = {0x200159C5}; // HSPS ThemeManager Testapp (internal folder) + + +// ----------------- + +/** Nokia VID: = VID_DEFAULT */ +const TInt Nokia_VID = 0x101FB657; + +/** +* KhspsThemeStatusRepositoryUid. +* Central repository entry for HSPS. +*/ +const TUid KhspsThemeStatusRepositoryUid = {0x200159C9}; + +/** +* KMaxHeaderDataLength8. Maximun number of data bytes reserved for ODT-header. +* This is same as the maximum file path length expressed in unicode chars +*/ +const TInt KMaxHeaderDataLength8=512; + +/** KHeaderListGranularity. List granularity used in header listing operations: */ +const TInt KHeaderListGranularity = 4; + +/** +* KHeaderListUpdatePollingTimeSpan. The time between the subsequent +* request to check changes in Definition Repository. +* The value is expressed in microseconds. +*/ +const TInt KHeaderListUpdatePollingTimeSpan = 1000000; + +/** +* @deprecated KMaxElementDataLength. The maximum size of buffer reserved to +* internalize theme. +*/ +const TInt KMaxElementDataLength = 1048576; + +/** +* KPathListGranularity. Controls the granularity of the path list retrieved +* from Definition Repository. +*/ +const TInt KPathListGranularity = 4; + + +/** +* KMahspsumberOfThemeLoadRepeats. Controls the maximum number of repeats when delivering +* the application theme and its resource list data in memory chunk +* from the server side to the client size. Value 0 means infinite repeats. +*/ +const TInt KMahspsumberOfThemeLoadRepeats = 10; // value 0 means infinite repeats. + +/** +* KThemeLoadRepeatWaitTime. Controls the time to wait between the +* tryes to delivere application theme and its resource list data from the server +* side to the client size. +*/ +const TInt KThemeLoadRepeatWaitTime = 5000000; // 5 seconds + +/** +* KActiveThemeUpdatePollingTimeSpan. +* Constant KActiveThemeUpdatePollingTimeSpan controls the time slice +* between the checking the theme status change theme and/or resource updates. +* The value is expressed in microseconds. +*/ +const TInt KActiveThemeUpdatePollingTimeSpan = 1000000; // 1 second + +const TInt KMaxPluginIdLenght = 8; + +/** +* KThemeInvalidatedTimeSpan +* Controls the time to wait for client application to notify it has rendered the theme +* successfully. If the notification is not received in time (or clientsession crashes) +* the default operator or licensee theme is restored. +* +* When client app. starts it requests theme with GetOdt-request +* After the client receives the theme it starts rendering it. +* After succesfull rendering the client app subscribes for theme updates +* with GetODTUpdate-request. ThemeServer starts a timer when receiving +* GetODT and if no GetODTUpdate- request if received before the timer expires +* the default operator or licensee theme is restored. +* +*/ +const TInt KThemeInvalidatedTimeSpan = 120000000; + +/** + * Client initiated service requests: an enumeration of function indexes + * + * NOTE: hspsThemeRanges array in hspsThemeServer.h file needs to be in sync with the following enumerations, + * failing to do so results in -5 (Not supported) errors. + * + */ +enum ThspsServiceRequestMessage + { + + /************************************** + * Installation related requests: + *************************************/ + EhspsInstallationBase = 0, + + /** + * EhspsInstallTheme. + * Initiates synchronous and asynhronous theme installation process. + */ + EhspsInstallTheme = EhspsInstallationBase, + + /** + * EhspsInstallNextPhase: + * Promotes subsequent asyncronous installation phases + * and offers client process a point to cancel installation. + */ + EhspsInstallNextPhase, + + /** + * EhspsCancelInstallTheme: + * Cancels asynchronous installation process. + */ + EhspsCancelInstallTheme, + + /** + * EhspsReinstallConf: + * Initiates synchronous configuration's reinstallation process + */ + EhspsReinstallConf, + + + /************************************** + * Maintenance related requests: + *************************************/ + EhspsMaintenanceBase, + + /** + * EhspsGetListHeaders. + * Initiates listings of theme headers by setting a query on server. + */ + EhspsGetListHeaders = EhspsMaintenanceBase, + + /** + * EhspsGetNextHeader: + * Subscribes updates for received header list. + */ + EhspsGetNextHeader, + + /** + * EhspsCancelGetListHeaders. + * Cancels a subscription of header list updates. + */ + EhspsCancelGetListHeaders, + + /** + * EhspsSetActiveTheme. + * Theme activation. + */ + EhspsSetActiveTheme, + + /** + * EhspsRestoreDefault. + * Restores the default theme in next order: + * 1. Restore the user default theme if one exists. + * 2. Restore the operatot default theme if one exist. + * 3. Finally, as the last resource, restore the licensee default theme. + * Licencee default theme is located on ROM (Z-drive), therefore it is + * quaranteed that application is in working condition allways. + */ + EhspsRestoreDefault, + + /** + * EhspsRemoveTheme. + * Removes a given theme with all its dependent files and + * settings. Does not remove the theme which is currently active. + * Cannot remove the licencee default theme located on ROM, however, it can + * remove possible updates on the licencee default them if not active. + */ + EhspsRemoveTheme, + + /** + * EhspsAddPlugin. + * Adds a plug-in configuration into active application configuration. + */ + EhspsAddPlugin, + + /** + * EhspsRemovePlugin. + * Removes a plug-in configuration from active application configuration. + */ + EhspsRemovePlugin, + + /** + * EhspsSetActivePlugin. + * Set active plugin. + */ + EhspsSetActivePlugin, + + /** + * EhspsReplacePlugin. + * Replaces a plug-in in an active application configuration. + */ + EhspsReplacePlugin, + + /** + * EhspsSetSettings. + * Sets settings of plugin in active configuration + */ + EhspsSetPluginSettings, + + /** + * EhspsGetPluginOdt. + * Gets plugin odt by UID + */ + EhspsGetPluginOdt, + + /** + * EhspsMovePlugins + * Updates plugin positions within a configuration + */ + EhspsMovePlugins, + + /** EhspsSetConfState + * Updates configuration's state. + */ + EhspsSetConfState, + + /** EhspsRestoreActiveAppConf + * Restore active application configuration in following order + * 1) Restore application configuration from backup folder + * 2) Activate licensee default restorable configuration + * 3) Reinstall licensee default restorable configuration + */ + EhspsRestoreActiveAppConf, + /** + * Updating plugin configuration + */ + + EhspsUpdatePluginConf, + + + /************************************** + * Client Request related requests: + *************************************/ + EhspsClientRequestBase, + + /** + * EhspsGetODT: + * Get currently active theme and resource list for specified application. + */ + EhspsGetODT = EhspsClientRequestBase, + + /** + * EhspsGetODTUpdate. + * Subscribes theme status change and theme update messages. + */ + EhspsGetODTUpdate, + + /** + * EhspsCancelGetODTUpdate. + * Cancels a subscription of theme updates. + */ + EhspsCancelGetODTUpdate, + + /** + * EhspsAccessResourceFile. + * Request access to resource file on hspsThemeServer private folder. + */ + EhspsAccessResourceFile, + + /** + * EhspsCopyResources + * Copies resource files to the destination folder. + * Given destination folder is only prefix for actual destination folder. + */ + EhspsCopyResources, + + /************************************** + * Out of range + *************************************/ + EhspsNotSupported + }; + +/** +* ThspsServiceCompletedMessage. Response codes used by client-server +* communication to indicate a result of the completion of requested service. +*/ +enum ThspsServiceCompletedMessage + { +/** Installation related responses: */ + + /** + * EhspsInstallThemeSuccess. Theme installation was successful. + */ + EhspsInstallThemeSuccess, + + /** + * EhspsInstallThemeFailed. Theme instalation was failed. + */ + EhspsInstallThemeFailed, + + /** + * EhspsInstallPhaseSuccess. Installation service was performed an + * installation phase successfully. + */ + EhspsInstallPhaseSuccess, + + /** + * EhspsReinstallConfSuccess. Configuration reinstallation was successful. + */ + EhspsReinstallConfSuccess, + + /** + * EhspsReinstallConfFailed. Configuration reinstalation was failed. + */ + EhspsReinstallConfFailed, + +/** Maintenance: */ + + /** + * EhspsGetListHeadersSuccess. Query of a header list was successful. + * Client must start listen the delivery events. + */ + EhspsGetListHeadersSuccess, + + /** + * EhspsGetListHeadersFailed. Headers cannot be listed. + */ + EhspsGetListHeadersFailed, + + /** + * EhspsGetListHeadersUpdate. A header is arrived. + */ + EhspsGetListHeadersUpdate, + + /** + * EhspsGetListHeadersUpdateData + * EhspsGetListHeadersUpdate for observing low-level API-calls. + */ + EhspsGetListHeadersUpdateData, + + /** + * EhspsGetListHeadersEmpty. Header list is empy - no matching headers on + * current query. Client must clear the list screen. + */ + EhspsGetListHeadersEmpty, + + /** + * EhspsGetListHeadersNoChange. No change in headers. Server side only. + */ + EhspsGetListHeadersNoChange, + + /** + * EhspsGetListHeadersRestart. Header list is canged radiacally. Listing + * must start from the begin. Client must clear the list screen. + */ + EhspsGetListHeadersRestart, + + /** + * EhspsGetListHeadersRestartData. + * EhspsGetListHeadersRestart for observing low-level API-calls. + */ + EhspsGetListHeadersRestartData, + + /** + * EhspsSetActiveThemeSuccess. Theme activation was successful. + */ + EhspsSetActiveThemeSuccess, + + /** + * EhspsSetActiveThemeFailed. Theme activation has failed. + */ + EhspsSetActiveThemeFailed, + + /** + * EhspsRestoreDefaultSuccess. Restoring the default theme was successful. + */ + EhspsRestoreDefaultSuccess, + + /** + * EhspsRestoreDefaultFailed. Restoring the default theme was failed. + */ + EhspsRestoreDefaultFailed, + + /** + * EhspsRemoveThemeSuccess. Theme removal was successful. + */ + EhspsRemoveThemeSuccess, + + /** + * EhspsRemoveThemeFailed. Theme removal was failed. + */ + EhspsRemoveThemeFailed, + + /** + * EhspsAddPluginSuccess. A plugin was added succesfully. + */ + EhspsAddPluginSuccess, + + /** + * EhspsAddPluginFailed. Failed to add a plugin. + */ + EhspsAddPluginFailed, + + /** + * EhspsRemovePluginSuccess. A plugin was removed succesfully. + */ + EhspsRemovePluginSuccess, + + /** + * EhspsRemovePluginFailed. Failed to remove a plugin. + */ + EhspsRemovePluginFailed, + + /** + * EhspsSetActivePluginSuccess. A plugin was activated succesfully. + */ + EhspsSetActivePluginSuccess, + + /** + * EhspsSetActivePluginFailed. Failed to activate a plugin. + */ + EhspsSetActivePluginFailed, + + /** + * EhspsSetSettingsSuccess. A plugin settings was updated succesfully. + */ + EhspsSetPluginSettingsSuccess, + + /** + * EEhspsSetSettingsFailed. Failed to set settings of plugin. + */ + EhspsSetPluginSettingsFailed, + + /** + * EhspsMovePluginsSuccess. A plugins list was updated succesfully. + */ + EhspsMovePluginsSuccess, + + /** + * EhspsMovePluginsFailed. Failed to update a plugins list. + */ + EhspsMovePluginsFailed, + + /** + * EhspsReplacePluginSuccess. A plugin was replace succesfully. + */ + EhspsReplacePluginSuccess, + + /** + * EhspsReplacePluginFailed. Failed to update a plugins list. + */ + EhspsReplacePluginFailed, + + /** + * EhspsGetPluginOdtSuccess. Getting plugin odt was successful. + */ + EhspsGetPluginOdtSuccess, + + /** + * EhspsGetPluginOdtFailed. Failed to get plugin odt. + */ + EhspsGetPluginOdtFailed, + +/* Client Requests: */ + + /** + * EhspsGetODTSuccess. + * ODT and associated resource list (if any) were received successfully. + */ + EhspsGetODTSuccess, + + /** + * EhspsGetODTFailed. ODT was not received. Request failed. + */ + EhspsGetODTFailed, + + /** + * EhspsGetODTLowMemoryStrategy. Memory chunk big enough could not be created + * by the server, switching to low memory strategy. + */ + EhspsGetODTLowMemoryStrategy, + + /** + * EhspsGetODTUpdateSuccess. Subscription of the theme updates and status + * changes was successful. Cient must start observe the server events. + */ + EhspsGetODTUpdateSuccess, + + /** + * EhspsSettingsLoaded. Loading settings for a theme was successful. + */ + EhspsSettingsLoaded, + + /** + * EhspsSettingsLoadFailed. Loading settings for a theme failed. + */ + EhspsSettingsLoadFailed, + + /** + * EhspsSettingsUpdated. Updating settings for a theme was successful. + */ + EhspsSettingsUpdated, + + /** + * EhspsSettingsUpdateFailed. Updating settings for a theme failed. + */ + EhspsSettingsUpdateFailed, + /** + * EhspsGetODTUpdateFailed. + * Subscription of the theme updates and status changes failed. + */ + EhspsGetODTUpdateFailed, + + /** + * EhspsGetODTUpdateStatus. Theme status is changed. + * Client must reset rendering and request theme again. + */ + EhspsGetODTUpdateStatus, + + /** EhspsGetODTUpdateHot. Theme is updated. Client should reload the theme. */ + EhspsGetODTUpdateHot, + + /** + * EhspsGetODTUpdateEmpty. + * No update available. Client may retain subscription. + */ + EhspsGetODTUpdateEmpty, + + /** EhspsGetODTUpdateNone. No update available. Used only on server-side. */ + EhspsGetODTUpdateNone, + + /** + * EhspsAccessResourceFileSuccess. + * Request to get access to a theme resource file was successful. + */ + EhspsAccessResourceFileSuccess, + + /** + * EhspsAccessResourceFileFailed. Request to get access to a theme resource + * file was successful. Possible in due to security fault. + */ + EhspsAccessResourceFileFailed, + +/** Generic: */ + /** + * @deprecated EhspsThemeServiceCanceled. + * Server has cancelled the service request possible in due to client + * cancellation request. Usually this is not handled by client because of + * the cancelled request on client-side. This protocol should not cause any + * problem. + */ + EhspsServiceRequestCanceled, + + /** + * EhspsServiceRequestSheduled. Server has sheduled the asynchronous service + * request. Client must start observe the server events. + */ + EhspsServiceRequestSheduled, + + /** + * EhspsServiceNotSupported. + * Server does not support servinng this request in current implementation. + */ + EhspsServiceNotSupported, + + /** + * EhspsServiceRequestError. Server rejects the service request maybe because + * the semaphore for this service in rised, or The request was violating + * the security. Addidional return Code tells the exact reason. + */ + EhspsServiceRequestError, + + /** + * EhspsResourceCopyFailed. + */ + EhspsResourceCopyFailed, + + /** + * EhspsResourceCopySuccess. + */ + EhspsResourceCopySuccess, + + /** + * Configuration state changed successfully + */ + EhspsSetConfStateSuccess, + + /** + * Configuration state change failed + */ + EhspsSetConfStateFailed, + + /** + * Active application configuration restored successfully + */ + EhspsRestoreActiveAppConfSuccess, + + /** + * Active application configuration restoring failed + */ + EhspsRestoreActiveAppConfFailed, + /** + * Updating plugin configuration failed + */ + EhspsUpdatePluginFailed, + /** + * Updating plugin configuration succeed + */ + EhspsUpdatePluginSuccess, + + /** + * Resolution changed, theme should be changed (emulator environment) + */ + EhspsResolutionChangedUpdate + + }; + + +/** +* ThspsThemeStatus. +* Theme status flag-definitions. Theme status flags are bit-masked. +*/ +enum ThspsThemeStatus + { + /** EhspsThemeStatusNone. Theme has no specific staus. This is a common case. */ + EhspsThemeStatusNone = 0x0000, //0b0000000000000000, + + /** + * EhspsThemeStatusActive. + * This theme is currently activated in scope of its application. + */ + EhspsThemeStatusActive = 0x0001, //0b0000000000000001, + + /** + * EhspsThemeStatusLicenceeDefault. + * This theme is licencee default. It is located on ROM (Z-drive) + */ + EhspsThemeStatusLicenceeDefault = 0x0002, //0b0000000000000010, + + /** EhspsThemeStatusOperatorDefault. This theme is set as operator default. */ + EhspsThemeStatusOperatorDefault = 0x0004, //0b0000000000000100, + + /** EhspsThemeStatusUserDefault. This theme has set as user default. */ + EhspsThemeStatusUserDefault = 0x0008, //0b0000000000001000 + + /** EhspsThemeStatusMakeActive. Activates the theme after installation. */ + EhspsThemeStatusMakeActive = 0x0010, //0b0000000000010000 + + /** EhspsThemeStatusClean. Removes the RAM-installed themes on default restoration. */ + EhspsThemeStatusClean = 0x0020, //0b0000000000100000 + + /** + * EhspsThemeStatusLicenceeRestorable. This theme is restored when licensee default + * theme is restored. When using this flag, the ThemeStatusLicenceeDefault + * -flag is also automatically activated. It is located on ROM (Z-drive) + */ + EhspsThemeStatusLicenceeRestorable = 0x0040, //0b00000000001000000, + + EhspsThemeStatusLocked = 0x0080, //0b00000000010000000, + /** EhspsThemeStatusHitchcock. Indicates that the theme is meant for a Hitchcock application. */ + EhspsThemeStatusHitchcock = 0x0100, //0b00000000100000000 + /** EhspsThemeStatusIncludeControlBlock. Includes control block to ODT when called with hspsGetODT. */ + EhspsThemeStatusIncludeControlBlock = 0x0200 //0b00000001000000000 + }; + + +/** + * ThspsInstallationPhase. + * The phases of the installation state-machine in Installation Service. + * In case of failed or canceled installation, the Roll-back process will take + * place from the phase where the instaaltion was before the failure. + */ +enum ThspsInstallationPhase + { + /** EhspsPhaseIdle. */ + EhspsPhaseIdle, + + /** EhspsPhaseInitialise. Header ok and query validity check */ + EhspsPhaseInitialise, + + /** EhspsPhaseCleanup. */ + EhspsPhaseCleanup, + + /** EhspsPhaseInstallODT. */ + EhspsPhaseInstallSkeleton, + + /** EhspsPhaseImportPlugins. */ + EhspsPhaseImportPlugins, + + /** EhspsPhaseRollBack. */ + EhspsPhaseRollBack + }; + + +/** + * ThspsFamily. + * Identifies resolution for which the widget for designed for. + * Should be in sync with the hspsmanifest.h file. + */ +enum ThspsFamily + { + EhspsFamilyUnknown = 0x00, + EhspsFamilyQvga = 0x01, + EhspsFamilyQvga2 = 0x02, + EhspsFamilyVga = 0x04, + EhspsFamilyVga3 = 0x08, + EhspsFamilyQhd = 0x10, + EhspsFamilyQhd_tch = 0x20, + EhspsFamilyVga_tch = 0x40 + }; + +/** + * ThspsConfigurationType. + * Indentifies the configuration type, which is diffrent for application and plugin themes. + */ +enum ThspsConfigurationType + { + EhspsAppConfiguration = 1, + EhspsViewConfiguration, + EhspsWidgetConfiguration, + EhspsTemplateConfiguration + }; + +/** + * ThspsConfigurationState. + * Indentifies the configuration state + */ +enum ThspsConfigurationState + { + EhspsConfStateNotConfirmed = 1, + EhspsConfStateWaitForConfirmation, + EhspsConfStateConfirmed, + EhspsConfStateError + }; + +/** + * ThspsConfStateChangeFilter + * Indentifies the configuration state change options + */ +enum ThspsConfStateChangeFilter + { + EhspsConfStateChangeNoFilter = 1, + EhspsConfStateChangePlugins + }; + +/** + * ThspsConfiguration. + * A definition for passing several uids from client to server session. + */ +struct ThspsConfiguration + { + // Application uid or Interface uid + TInt rootUid; + + // Theme uid + TInt themeUid; + + // Type of the configuration + ThspsConfigurationType type; + }; + + +/** + * Input parameters for the AddPlugin service + */ +struct ThpsParamAddPlugin + { + TInt appUid; // uid of the application configuration + TInt configurationId; // id of the configuration being modified + TInt pluginUid; // uid of the plugin configuration to be added + TInt positionIndex; // position of the added plugin in the configuration's plugins list + }; + +/** + * Input parameters for the RemovePlugin service + */ +struct ThpsParamRemovePlugin + { + TInt appUid; // uid of the application configuration + TInt pluginId; // id of the plugin configuration instance + }; + +/** + * Input parameters for the ActivatePlugin service + */ +struct ThpsParamSetActivePlugin + { + TInt appUid; // uid of the application configuration + TInt pluginId; // id of the plugin configuration instance + }; + +/** + * Input parameter for the GetSettings service + */ +struct ThspsParamGetPluginOdt + { + TInt appUid; // uid of the application configuration + TInt pluginUid; // uid of the plugin + }; + +/** + * Input parameters for the MovePlugins service + */ +const TInt KMaxPluginIdsLength = 2048; +struct ThpsParamMovePlugins + { + TInt appUid; // uid of the application configuration + TInt configurationId; // id of the configuration being modified + TBuf8 pluginIdsBuf; // descriptor for passing externalized plugin ids + }; + +/** + * Input parameter for the SetConfState service + */ +struct ThspsParamSetConfState + { + TInt appUid; // uid of the application + TInt confId; // id of the configuration + ThspsConfigurationState state; // new configuration state + ThspsConfStateChangeFilter filter; // filter parameter + }; + +/** + * Input parameter for the ReinstallConf service + */ +struct ThspsParamReinstallConf + { + TInt appUid; // uid of the application + TInt confUId; // uid of the reinstalled configuration + }; + +/** + * Input parameter for the RestoreActiveAppConf service + */ +struct ThspsParamRestoreActiveAppConf + { + TInt appUid; // uid of the application + TInt confUid; // uid of the restored configuration + }; + +/** + * Input parameter for the ReplacePlugin service + */ +struct ThspsParamReplacePlugin + { + TInt appUid; // uid of the application + TInt pluginId; // id of the existing plugin to be replaced + TInt confUid; // uid of the new plugin configuration + }; +/** + * Input parameter for the ReplacePlugin service + */ +struct ThspsParamSetPluginSettings + { + TInt pluginId; // id of the existing plugin to be replaced + TBool storingStatus; // storing status telling if modified plugin settings are needed to stored its reference. + }; + + +class ChspsODT; +class ChspsResource; +class ChspsDomDocument; +class ChspsRequestNotificationParams; +/** +* Part of HSPS Plugin Configuration Management Service APIs. +* MhspsThemeManagementServiceObserver. Interface definition for the HSPS +* Installation and Maintenance Service related events observation. +* The call-back function HandlehspsClientMessage() must be inplemented by client +* application if it want to handle messages coming from the +* hspsInstallationHandler and hspsMaintenanceHandler. +* For more information of different Installation and Maintenance Service +* related messages, see the documentaion of ThspsServiceCompletedMessage. +* +* @since S60 5.0 +* @ingroup group_hspsclients +*/ +class MhspsThemeManagementServiceObserver + { + public: + + /** + * HandlehspsClientMessage + * + * @since S60 5.0 + * @param aMessage contains a service completion message returned from + * the hspsInstallationHandler and hspsMaintenanceHandler to their + * observer. + */ + virtual void HandlehspsClientMessage(ThspsServiceCompletedMessage aMessage) = 0; + }; + +/** +* Part of HSPS Plugin Configuration Management Service APIs. +* MhspsClientRequestServiceObserver. Interface definition for the HSPS Client +* Request Service events observation. +* The call-back function HandlehspsRequestClientMessage() must be inplemented by +* the client applications if it want to handle messages coming from the +* hspsClientRequestHandler. +* For more information of different Client Request Service related messages, +* see the documentaion of ThspsServiceCompletedMessage. +* +* @since S60 5.0 +* @ingroup group_hspsclients +*/ +class MhspsClientRequestServiceObserver + { + public: + /** + * HandlehspsRequestClientMessage + * + * @since S60 5.0 + * @param aMessage contains a service completion message returned from + * the hspsClientRequestHandler to its observer. + * @param aParams contains data for changes what are observed + */ + virtual void HandlehspsRequestClientMessageL(ThspsServiceCompletedMessage aMessage, ChspsRequestNotificationParams& aParams ) = 0; + }; + +/** +* Part of HSPS Plugin Configuration Management Service APIs. +* MhspsInstallationService. API-definition for HSPS Plugin Installation Service. +* HSPS Plugin Installation Service is intended to serve Homescreen as well as S60 +* legacy applications - expecially the Personalisation Application - with the +* Homescreen Application Configuartion installation functionality. Implementation of this +* interface will offer high- and low-level API-functionality. +* High-level and low-level calls are diffrentiated by their parametrization. +* High-level parametrization is directed to the be used by applications which +* need human readable data and offer a user interface. Low-level +* parametrization is directed to the machine-originated requestors like +* OTA Push or DM (Device Management) sub-systems where data is not needed to +* understand semanticly. +* +* Processing a installation task works in asynchronous mode, howvere, synchronous mode is applied +* everytime the installation is initiated. After checking installation rights and files valididies, +* hsps Theme Server will allow actual installation. Client application must call actual +* installation by commencing next phase execution explicitly. First call of installation returns +* the ODT-header of the teme to be installed. This is to enable previewing information about +* a theme to be installed. In this point, user can accept or decline the installation. +* Installation preview feature is useful expecially in OTA-service cases when user acception on +* theme installation might be selected a a part of user policy settings. +* A theme can include resources that can be imported to the target system as such like some audio +* files etc., however, most of the images must be fitted on to the target device's color depth and +* pixel density. In these cases, the needed conversions will be executed asynchronously on +* server-side. Asynchronous installation is executed in phases - resource by resource. +* Installation phases are promoted automaticly, however, client application can control and +* monitor installation phases, and also cancel installation at any time. If installation is +* canceled, hspsThemeServer initiates roll-back functionality removing inconsistent installation. +* +* Client application must call hspsInstallNextPhase() after testing that the synchronous call +* hspsInstallTheme() has returned EhspsInstallPhaseSuccess return code signalling that actual +* installation is allowed. The rest of the installation phases will be executed automatically, +* however, installation can be interrupted by calling hspsCancelInstallTheme() at any time. +* If installation is canceled, hspsThemeServer initiates roll-back functionality removing +* inconsistent installation. +* Installation service uses specific manifest-file format to get informed about the xml, css, +* dtd, and resource files to be installed. Resource files might be locale-specific or generic +* as well. +* hspsThemeServer takes care of saving everything on their appropriate places in the target device's +* user disk. Theme storage is located in hspsThemeServer's private-folder. +* Locales are instructed in manifest file also. Manifest file's file-extension must be .dat, +* but actually, the file-name can be whatever, however, when low-level parametrization is used, +* the name must be "manifest.dat" and it must be the last file extracted from the installation +* package. +* For more information of manifest-file format, see "Xuikon Manifest File User Guide.doc". +* +* Installation functions can return one of the following +* ThspsServiceCompletedMessage-codes: +* - EhspsInstallThemeSuccess, +* - EhspsInstallPhaseSuccess, or +* - EhspsInstallThemeFailed. +* +* Client application must implement MhspsThemeManagementServiceObserver-interface +* and listen these messages +* mentionaed. Let it be emphasised that both synchronous and asynchronous calls +* can return the codes above. +* Installation functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see +* ThspsServiceCompletedMessage-documentation. +* +* @since S60 5.0 +* @ingroup group_hspsclients +*/ +class MhspsInstallationService + { + public: + /** + * hspsInstallTheme + * + * @since S60 5.0 + * @param aManifestFileName is the full path to the installation script file - a manifest + * file. + * @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the newly + * installed theme will be returned if the request is successful. The use of + * ChspsODT-type parameter follows the high-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsInstallTheme(const TDesC& aManifestFileName, + ChspsODT& aHeader) = 0; + + /** + * hspsInstallTheme + * + * @since S60 5.0 + * @param aManifestFileName is full path of the installation script file - a manifest file + * @param aHeaderData will return ODT-header of the newly installed theme in serialized + * (i.e. marshalled) data mode. This follows the low-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsInstallTheme(const TDesC& aManifestFileName, + TDes8& aHeaderData) = 0; + + /** hspsInstallNextPhase + * + * @since S60 5.0 + * @param aHeader is an empty ChspsODT-object in which a valid ODT-header of the latest + * installation phase completed if the request was successful. + * The use of ChspsODT-type parameter follow the high-level parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsInstallNextPhaseL(ChspsODT& aHeader) = 0; + + /** hspsInstallNextPhase + * + * @since S60 5.0 + * @param aHeaderData will return ODT-header of the latest installation phase in + * serialized (i.e. marshalled) data mode. This follows the low-level + * parametrization schema. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsInstallNextPhaseL(TDes8& aHeaderData) = 0; + + /** hspsCancelInstallTheme + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsCancelInstallTheme() = 0; + + }; + +/** +* Part of Xuikon Application Theme Management Service APIs. +* MhspsMaintenanceService. API-definition for Xuikon Theme Maintenance Service. +* Xuikon Theme Maintenance Service is intended to serve Xuikon applications as well as S60 legacy +* applications - especially Personalisation Application - with Theme Maintenance Services. +* Theme maintenance can take place after a set of themes are installed by Xuikon Theme Installation +* Service. Maintenance services includes theme listings, theme activation, theme removal, and +* default theme restoring functionality. +* Maintenance functions are presented in high-level and low-level parametrization mode. +* This is the same approach that was introduced with Xuikon Theme Installation Service - to support +* user-intefaces with human-readable high-level elements and on otherhand, machine-originated users +* with low-level data. Most of the maintenance functions are synchronous, only one is asynchronous; +* hspsGetNextHeader(). Others functions are stright forward to use but hspsGetListHeaders(). This will +* be explained next; synchronous call hspsGetListHeaders() initiates the theme header listing by +* passing search mask to Xuikon Theme Server's Maintenance Service. This search mask is called +* a query. It also passes a list object in where maintenance service should append theme-header +* objects (type of ChspsODT-class without DOM-document) when one is retrieved asychronously. +* Search mask should be filled with proper parameters matching the need in hand. +* If no parameters are given, all headers of Application Themes available in Definition Repository +* will be delivered, otherwise, only sub-set of theme-headers will be delivered. +* After the query-call hspsGetListHeaders(), the delivering of the theme-headers is asynchronous. +* Asynchronous service must be initiated by calling hspsGetNextHeader() after checking that any +* theme matching on current query is found. This action is called a subscription. To receive theme +* listing, the client application must implement MhspsThemeManagementServiceObserver-interface and +* start to listen call-back messages. The headers matching on query will be delivered immediately. +* Query remains until hspsCancelGetListHeaders() is called by client. If a new Application Theme +* exist in repository, it will be delivered. As mentioned, when hspsGetListHeaders() returns, +* the return value must be checked. Return value could be one of the following: +* - EhspsGetListHeadersSuccess - there is at least one Application Theme available matching on query. Call first +* hspsGetNextHeader() to get the headers. Same call will set the subscribtion of +* new ones possible coming available later. +* - EhspsGetListHeadersEmpty - there is no themes matching on the query available at the time, however, some might +* be exist later in due to installations. Client application should retain the +* subcription. +* - EhspsGetListHeadersFailed - service request failed in some reason. Possible reasons are for e.g. the missing +* rights to list headers queried. +* +* In the near future, there will be s.c. Additional Return Code Support feature available in Xuikon. This code +* will express for e.g. the number of headers to be delivered or possible system error code in failed cases. +* +* By MhspsServiceObserver::HandlehspsServiceMessage() call-back function implementation, client application +* must listen the following ThspsServiceCompletedMessage-messages: +* - EhspsGetListHeadersUpdate - header list on the client side has a new object appended at the end of the list, +* - EhspsGetListHeadersRestart - header list on server side has changed so much that the client must empty +* the list printed on screen. New list will be delivered immediately. +* The subscription stands. +* - EhspsGetListHeadersEmpty - header list on server side is now empty. The client must empty +* the list on screen if printed. The subscription stands. +* - EhspsGetListHeadersFailed - operation has failed. Client should cancel request and restart, perhaps. +* +* Maintenanace functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. +* +* @since S60 5.0 +* @ingroup group_hspsclients +*/ +class MhspsMaintenanceService + { + public: + + /** hspsGetListHeaders + * + * @since S60 5.0 + * @param aSearchMask is ChspsODT-object which attributes are filled to present search + * parameters for theme set queried by client. This parametrisation follows the + * high-level schema. + * @param aHeaderList is an list object able to carry ChspsODT-objects. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsGetListHeaders(const ChspsODT& aSearchMask, + CArrayPtrFlat& aHeaderList) = 0; + + /** hspsGetListHeaders + * + * @since S60 5.0 + * @param aSearchMaskData is serialized ChspsODT-object. Before serializing, attributes + * in ChspsODT-object were filled to present a search parameters for theme set queried. + * Serialized data parametrisation follows the low-level schema. + * @param aHeaderDataList is an list object able to carry serialized ChspsODT-objects. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsGetListHeaders(const TDesC8& aSearchMaskData, + CArrayPtrSeg& aHeaderDataList) = 0; + + /** hspsGetNextHeader + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsGetNextHeader() = 0; + + /** hspsCancelGetListHeaders + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsCancelGetListHeaders() = 0; + + /** hspsSetActiveTheme + * + * @since S60 5.0 + * @param aSetMask represents parameters by which the new theme activation will be done. + * There must be sufficient set of parameters presented, at least a theme UID. + * @param aHeader is an empty ODT-object which will contain the header of activated + * theme on the return of the call. This parametrisation follows the high-level + * schema. There must be sufficient set of parameters presented, at least a theme UID. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsSetActiveTheme(const ChspsODT& aSetMask, + ChspsODT& aHeader) = 0; + + /** hspsSetActiveTheme + * + * @since S60 5.0 + * @param aSetMaskData is externalized version of ChspsODT-object presenting parameters by + * which the new theme activation will be done. There must be sufficient set of + * parameters presented, at least a theme UID. This parametrisation follows the + * low-level schema. + * @param aHeaderData is an empty description for externalized ODT-object data. + * When internalized, this object will contain the header of newly activated theme + * as a result of the call. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsSetActiveTheme(const TDesC8& aSetMaskData, + TDes8& aHeaderData) = 0; + + /** + * hspsRestoreDefault + * + * @since S60 5.0 + * @param aSetMask is an ODT-header paramerized engough to express the theme querid to made + * active. + * @param aHeader is an empty ODT-header object that will contain the header of the theme + * actually made active if the request was successful. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsRestoreDefault(const ChspsODT& aSetMask, + ChspsODT& aHeader) = 0; + + /** hspsRemoveTheme + * + * @since S60 5.0 + * @param aSetMask is an ODT-header parametrized enough to express the theme to be removed. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsRemoveThemeL(const ChspsODT& aSetMask) = 0; + + /** + * Adds a new plugin configuration to the defined application configuration. + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration to be updated + * @param aConfId is an ID of the configuration being modified + * @param aPluginUid is an UID of the plugin configuration to be added + * @param aPosition is an UID of the added/new plugin configuration instance + * @param aAddedPluginId is an ID of the added plugin configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsAddPlugin( + const TInt aAppUid, + const TInt aConfId, + const TInt aPluginUid, + const TInt aPosition, + TInt& aAddedPluginId ) = 0; + + /** hspsRemovePlugin + * Removes an existing plugin configuration instance from the defined application configuration. + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration to be updated + * @param aPluginId is an ID of the plugin configuration instance to be removed + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsRemovePlugin( + const TInt aAppUid, + const TInt aPluginId ) = 0; + + /** + * Activates plugin. + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration to be updated + * @param aPluginId is an ID of the plugin configuration instance to be activated + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsSetActivePlugin( + const TInt aAppUid, + const TInt aPluginId ) = 0; + + /** + * hspsSetSettings + * @since S60 5.0 + */ + virtual ThspsServiceCompletedMessage hspsSetPluginSettings( + const ChspsODT& aHeader, + const TInt aPluginId, + ChspsDomDocument& aDom, + const TBool aPluginStoringStatus) = 0; + + /** + * Updates plugin positions in an existing plugins list. + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration to be updated + * @param aConfId is an ID of the configuration being updated (parent of the plugins node) + * @param aPluginIdList is an array of plugin IDs for setting the plugin positions + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsMovePluginsL( + const TInt aAppUid, + const TInt aConfId, + const CArrayFixFlat& aPluginIdList ) = 0; + + /** + * Updates configuration's state + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration + * @param aConfId is an ID of the configuration which state is updated + * @param aState is a new state of the configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsSetConfState( + const TInt aAppUid, + const TInt aConfId, + const ThspsConfigurationState aState, + const ThspsConfStateChangeFilter aFilter ) = 0; + + /** + * Restores active application configuration + * @since S60 5.0 + * @param aAppUid identifies the application which configuration is requested to be restored + * @param aConfUid identifies the configuration to be restored + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsRestoreActiveAppConf( + const TInt aAppUid, + const TInt aConfUid ) = 0; + + /** + * Updates plugin configuration in all application configurations + * + * @since S60 5.0 + * @param aOdt is odt header information of the plugin configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsPluginUpdateL( + const ChspsODT& aOdt ) = 0; + + /** + * Replaces existing plugin configuration instance in an active application configuration. + * + * @since S60 5.0 + * @param aAppUid identifies the application configuration + * @param aPluginId identifies the plugin to be replaced + * @param aConfUid is an uid of the new plugin configuration + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsReplacePlugin( + const TInt aAppUid, + const TInt aPluginId, + const TInt aConfUid ) = 0; + + }; + +/** +* Part of HSPS Plugin Configuration Management Service APIs. +* MhspsClientRequestService. HSPS Client Request Service API-definition. +* HSPS Client Request Service is intended to serve Rendering Engines with Application Themes +* and their associated resources. Implementation of this interface will provide access to +* HSPS Plugin Configuration database maintained by HSPS Definition Repository aka Plugin Registry. +* Definition Repository maintains plugin configurations in ChspsODT-objects. +* Themes can have resources like bitmaps etc. Resources can be accessed through this API also. +* Every individual resource has corresponding ChspsResource-object. Resource-objects are delivered +* to the client side in a resource list which is associated to its theme. Resource list exist only +* if there is any resources belonging to a theme. +* There can be only one theme activated for a specific application at one time. +* The information of activation of themes is stored in Symbian Central Repository -object. +* The Central Repository is requested on every theme request that Rendering Engine commences. +* +* To initaite theme usage, Rendering Engine must call hspsGetODT(). There is no high-level or +* low-level parametrization used, however, API supports two parametrization mode; retrieving a +* theme with or without resources. The cases of retrieving a theme without resources are currently +* rare, but with partial theme update cases to be implemented with OTA Push and DM-cases, it will +* be quite applicable. +* +* hspsGetODT() returns one of the following codes: +* - EhspsGetODTSuccess. Theme was received successfully. Client can start its rendering. +* - EhspsGetODTFailed. Theme was not received. Check Additional Return Code (not yet implemented) +* for the exact reason. Theme load can fail for e.g. for missing rights. +* - EhspsGetODTLowMemoryStrategy. Possible memory low to create memory chunk. Something must do to +* free memory and then try again. +* +* After receiving the theme, Rendering Engine may subscribe the theme related events. +* These events may concern the changes of the theme status (meaning that some other theme is +* activated), or that the theme is updated. In both cases, client should reload the theme and do +* the rendering again. To act as a subscriber of these events, client must implement the interface +* MhspsClientRequestServiceObserver. Subscription is applied by calling hspsGetODTUpdate(). +* This function returns immediately one of the following codes: +* - EhspsGetODTUpdateSuccess - The subscription of the theme updates and/or status changes was +* successful. +* The cient must start observe the server events. +* - EhspsGetODTUpdateFailed - The subscription of the theme updates and status changes was failed. +* +* Once success-response was received, the observation of the Client Request Service events can +* return one of the following codes: +* +* - EhspsGetODTUpdateStatus - Theme status was changed. Client must reset rendering and request theme +* again. +* - EhspsGetODTUpdateHot - Theme was updated. Client should reload the theme and then do the +* theme rendering again. +* +* Rendering Engine can get information of the theme resources through the ChspsResource-objects +* delivered on Resource List. When ChspsODT-object's DOM-document has a reference to some URL, +* the access method to the URL-related resource can be found in ChspsResource-object. +* When access-method is clear, client should call hspsAccessResourceFile() function with resource +* file path and empty RFile-handle. In successful cases, valid file handle to the associated +* resource file is returned. This functionality is arranged by the means of Symbian 9.0 EKA2 +* Kernel's support for Platform Security Concept. The return code can be one of the following: +* - EhspsAccessResourceFileSuccess - request to get access to a theme resource file was successful. +* - EhspsAccessResourceFileFailed - request to get access to a theme resource file was unsuccessful +* possible in due to a security fault. +* +* Client Request Service functions may also return one of the following codes: +* - EhspsServiceRequestSheduled, or +* - EhspsServiceRequestError. +* +* For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation. +* +* @since S60 5.0 +* @ingroup group_hspsclients +*/ +class MhspsClientRequestService + { + public: + + /** hspsGetODT + * + * @since S60 5.0 + * @param aAppUid is the UID of the application for which the theme is requested for. + * @param aODT is an empty ChspsODT-object in where the theme is expected to be placed when the + * call returns. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsGetODT(TInt aAppUid, ChspsODT& aODT) = 0; + + /** hspsGetODTUpdate + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsGetODTUpdate() = 0; + + /** hspsCancelGetODTUpdate + * + * @since S60 5.0 + * @return ThspsServiceCompletedMessage telling the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsCancelGetODTUpdate() = 0; + + /** hspsAccessResourceFile + * + * @since S60 5.0 + * @param aResourceFileName is the path for resource file to requested. Resource file name + * is given in every ChspsResource-object listed on the resource list. + * @param aConfiguration identifies the application or interface from which the theme is to be found + * @param aFile is an empty RFile object which a valid file handle to the resourec file will + * be placed on return. The file access is arranged by means of Symbian 9.0 EKA2 + * Platform Security file handle sharing concept. + * @return ThspsServiceCompletedMessage expressing the result of the call. + */ + virtual ThspsServiceCompletedMessage hspsAccessResourceFile( + const TDesC& aResourceFileName, + const ThspsConfiguration& aConfiguration, + RFile& aFile) = 0; + }; + +/** +* MhspsSecurityService. +* Part of HSPS Application Theme Management Service APIs. +* +* These functions are the following: +* - control user access on service request, and +* - adjust user access in queries. +* +* Function are explained below: +* +* CheckAccessRightsL() +* -------------------- +* CheckAccessRights function is used to limit client accesses to hsps Theme Server to +* the predefined ones. There will be a hardcoded access list with extension mechanism. +* CheckQueryValidityL() function is used to limit theme request to the set allowed for this +* particular user. For example, S60 Personalisation Application is allowed to operate with +* all themes in theme storage, however, AppShell is limited to operate with it own themes only. +* CheckAccessRightsL() function is called by CPolicyServer when hspsThemeServer receives user +* request. Access rights are hard-coded here for S60 3.1, however, in later versions, +* support for dynamic configuration of access rights must atken care. This would be appropriate +* to solve together TARM-policy implementation. +* +* CheckQueryValidityL() +* ------------------- +* CheckQueryValidityL() function is called by hsps Theme Server's service handlers +* (ChspsInstallionHandler, ChspsMaintenanceHandler, and ChspsClientRequestHandler) for adjusting +* user request to match the access rights level that user actually will have. +* This function is to be called immediately when actual ODT is known. +* In the istallation cases, ODT is known after manifest-file parsing. +* In the maintenanace cases, ODT is known immediately on query. +* In the theme usage cases, ODT is known when it application theme has retrieved from +* UI Definition Repository. +* For instance, if user is requesting the theme listing (message hspsGetListHeaders) with +* application UID set to 0 in query meaning that the query concerns all themes in storage. +* However, if user is not S60 Personalisation Application, the query must not be allowed. +* +* @lib hspsThemeServer.exe +* @since S60 5.0 +* @ingroup group_hspsserver +*/ +class MhspsSecurityService + { + public: + /** CheckL + * + * @since S60 5.0 + * @param aOdt is the ODT of the theme whose policy is checked + */ + virtual void CheckIfLicenseeDefaultExistsL( const ChspsODT& aOdt ) = 0; + + /** + * CheckAccessRightsL + * + * @since S60 5.0 + * @param aMessage is the RMessage2 containing the client request data. + * Client's access rights to the hsps Theme Server is to be checked. + * @return ETrue if request has passed the access rights check, otherwise return EFalse. + */ + virtual TBool CheckAccessRightsL( const RMessage2& aMessage ) = 0; + + }; + +#endif// __hspsTHEMEMANAGEMENT_H__ diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/hspstimemon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/hspstimemon.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2002-2004 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: ?Description +* +*/ + + + +#ifndef ChspsTIMEMON_H +#define ChspsTIMEMON_H + +// INCLUDES +#include +#include +#include +#include +#include + +/** +* ?one_line_short_description. +* ?other_description_lines +* +* @lib ?library +* @since Series ?XX ?SeriesXX_version +*/ +class ChspsTimeMon : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static ChspsTimeMon * NewL(); + + /** + * Destructor. + */ + virtual ~ChspsTimeMon (); + + public: // New functions + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static TTime StartTiming( const TDesC& aMsg ); + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static void StopTiming( TTime aStartTime, const TDesC& aMsg ); + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + inline static void PrintUserMem(const TDesC& aMsg); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // New functions + + /** + * ?member_description. + * @since Series ?XX ?SeriesXX_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + ChspsTimeMon (); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // ?one_line_short_description_of_data + //?data_declaration; + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + + }; + +inline TTime ChspsTimeMon::StartTiming(const TDesC& aMsg ) + { + TTime startTime; + startTime.HomeTime(); + RDebug::Print( aMsg ); + return startTime; + } + +inline void ChspsTimeMon::StopTiming( TTime aStartTime, const TDesC& aMsg ) + { + // calculating service time + TTime readyTime; + readyTime.HomeTime(); + TTimeIntervalMicroSeconds delay = readyTime.MicroSecondsFrom( aStartTime ); + TTime transferTime(delay.Int64()); + TBuf<64> timeString; + transferTime.FormatL(timeString,_L(" Time: %S%C microseconds")); + TBuf<256> tmp; + tmp.Append( aMsg ); + tmp.Append( timeString ); + RDebug::Print( tmp ); + } + +inline void ChspsTimeMon::PrintUserMem(const TDesC& aMsg) + { + TBuf<512> buffer; + TInt freeRAM; + HAL::Get( HALData::EMemoryRAMFree, freeRAM ); + RHeap heap = User::Heap(); + heap.Open(); + TInt _size = heap.Size(); + TInt largest = 0; + TInt available = heap.Available( largest ); + heap.Close(); + _LIT( KMemoryFormat, "FreeRAM: %d kB, User: - heap %d kB, available %d kB, largest block %d kB" ); + buffer.Format( KMemoryFormat, ( freeRAM / 1024), (_size / 1024), + (available / 1024), (largest / 1024 ) ); + + RDebug::Print( _L("ChspsTimeMon::PrintUserMem RAM:%S: %S"), &aMsg, &buffer ); + } + +#endif // ChspsTIMEMON_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/mhspsdomiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/mhspsdomiterator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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: Interface class for dom iterators +* +*/ + + + +#ifndef Mhsps_DOM_ITERATOR_H +#define Mhsps_DOM_ITERATOR_H + + +// FORWARD DECLARATIONS +class ChspsDomNode; + + +// CLASS DECLARATION + +/** +* Mixin class to let us define different iterators for +* different traversal policies. +* +* @lib hspsdomdocument.lib +* @since S60 5.0 +* @ingroup group_hspsdom +*/ +class MhspsDomIterator + { + public: // Destructor + + /** + * Destructor. + * + * @since S60 5.0 + */ + virtual ~MhspsDomIterator(){} + + public: // Adding and removing + + /** + * Get first i.e root node. + * + * @since S60 5.0 + */ + virtual ChspsDomNode* First()=0; + + /** + * Get next node. + * + * @since S60 5.0 + */ + virtual ChspsDomNode* NextL()=0; + + /** + * Get next sibling. + * + * @since S60 5.0 + */ + virtual ChspsDomNode* NextSibling( ChspsDomNode& aNode )=0; + + }; + +#endif // Mhsps_DOM_ITERATOR_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/inc/mhspsdomlistitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/inc/mhspsdomlistitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Interface class for dom list items. +* +*/ + + + +#ifndef Mhsps_DOM_LIST_ITEM_H +#define Mhsps_DOM_LIST_ITEM_H + +// INCLUDES + +// FORWARD DECLARATIONS + + +// CLASS DECLARATION + +/** +* Class represents a list item interface. Items are stored into +* a ChspsDomList as a instance of this class. +* +* @lib hspsdomdocument.lib +* @since S60 5.0 +* @ingroup group_hspsdom +*/ +class MhspsDomListItem + { + public: // Destructor + + /** + * Destructor. + */ + virtual ~MhspsDomListItem(){} + + public: // Serializing + + /** + * This list item's data size in bytes. + * + * @since S60 5.0 + * @return Data size in bytes. + */ + virtual TInt Size() const=0; + + /** + * Externalize list item. + * + * @since S60 5.0 + * @param aStream Output stream + */ + virtual void ExternalizeL( RWriteStream& aStream )const=0; + + /** + * Internalize list item. + * + * @since S60 5.0 + * @param aStream Input stream + */ + virtual void InternalizeL( RReadStream& aStream )=0; + + + + public: //Accessing + /** + * Get the name of this item as UTF8 encoded, if any. + * + * @since S60 5.0 + * @return Name buffer or KNullDesC8 + */ + virtual const TDesC8& Name()=0; + + }; + +#endif // Mhsps_DOM_LIST_ITEM_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/rom/hsps.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/rom/hsps.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: IBY file for ROM image creation +* +*/ + + +#ifndef HSPS_IBY +#define HSPS_IBY + +#include + +file=ABI_DIR\BUILD_DIR\hspsdomdocument.dll SHARED_LIB_DIR\hspsdomdocument.dll + +// Uncomment if ____HSPS_CFG_LOG_ON____ defined. +// file=ABI_DIR\BUILD_DIR\hspstools.dll SHARED_LIB_DIR\hspstools.dll + +file=ABI_DIR\BUILD_DIR\hspsresource.dll SHARED_LIB_DIR\hspsresource.dll +file=ABI_DIR\BUILD_DIR\hspsresult.dll SHARED_LIB_DIR\hspsresult.dll +file=ABI_DIR\BUILD_DIR\hspsodt.dll SHARED_LIB_DIR\hspsodt.dll +file=ABI_DIR\BUILD_DIR\hspsdefrep.dll SHARED_LIB_DIR\hspsdefrep.dll +file=ABI_DIR\BUILD_DIR\hspsdefinitionengineinterface.dll SHARED_LIB_DIR\hspsdefinitionengineinterface.dll + +// Stock plugins +ECOM_PLUGIN( hspsdefinitionengine.dll , hspsdefinitionengine.rsc ) + +// Homescreen plug-in service +// HSPS Client-side modules: +file=ABI_DIR\BUILD_DIR\hspsclient.dll SHARED_LIB_DIR\hspsclient.dll +file=ABI_DIR\BUILD_DIR\hspsclientsession.dll SHARED_LIB_DIR\hspsclientsession.dll +file=ABI_DIR\BUILD_DIR\hspsrequestclient.dll SHARED_LIB_DIR\hspsrequestclient.dll + +// Homescreen plug-in service Server-side modules: +file=ABI_DIR\BUILD_DIR\hspsthemeserver.exe PROGRAMS_DIR\hspsthemeserver.exe + +//Backup registration +data=DATAZ_\private\200159c0\backup_registration.xml private\200159c0\backup_registration.xml + +// Exporting of HSPS Test configurations: +// Uncomment if _HSPS_AUTOINSTALL_TEST_THEMES_ defined +// #include + +#endif // HSPS_IBY + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreenpluginsrv/rom/hspstestconfigurations.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/rom/hspstestconfigurations.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,152 @@ +/* +* 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: Test configurations for the internal HSPS Eunit tests +* +*/ + + +#ifndef HSPSTESTCONFIGURATIONS_IBY +#define HSPSTESTCONFIGURATIONS_IBY + + +// Configuration files + +// NOTE!!! This file should be in sync with the homescreenpluginservice\internal\testthemes\group\bld.inf file + +// ============================================================================== +// MinimalConfiguration +// ============================================================================== + +// MinimalConfiguration - Widget +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b102\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b102\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b102\1.0\widgetconfiguration.xml private\200159c0\install\0998\101fb657\2000b102\1.0\widgetconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b102\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b102\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b102_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b102_1.0.dat + +// minimalconfiguration - view +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b101\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\viewconfiguration.xml private\200159c0\install\0998\101fb657\2000b101\1.0\viewconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\main.xml private\200159c0\install\0998\101fb657\2000b101\1.0\main.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\picture.jpeg private\200159c0\install\0998\101fb657\2000b101\1.0\picture.jpeg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\resource.file private\200159c0\install\0998\101fb657\2000b101\1.0\resource.file +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\viewnavigationrules.xml private\200159c0\install\0998\101fb657\2000b101\1.0\viewnavigationrules.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b101\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b101\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b101_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b101_1.0.dat + +// minimalconfiguration - root +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b100\1.0\manifest.dat private\200159c0\install\102750f0\101fb657\2000b100\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b100\1.0\rootconfiguration.xml private\200159c0\install\102750f0\101fb657\2000b100\1.0\rootconfiguration.xml +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b100\1.0\0\locale.dtd private\200159c0\install\102750f0\101fb657\2000b100\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\app_102750f0_101fb657_2000b100_1.0.dat private\200159c0\install\app_102750f0_101fb657_2000b100_1.0.dat + + +// ============================================================================== +// typicalconfiguration +// ============================================================================== + +// typicalconfiguration - widget +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b120\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\widgetconfiguration.xml private\200159c0\install\0998\101fb657\2000b120\1.0\widgetconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\hs_logo.jpg private\200159c0\install\0998\101fb657\2000b120\1.0\hs_logo.jpg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\widget.bmp private\200159c0\install\0998\101fb657\2000b120\1.0\widget.bmp +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b120\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\1\locale.dtd private\200159c0\install\0998\101fb657\2000b120\1.0\1\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b120\1.0\9\locale.dtd private\200159c0\install\0998\101fb657\2000b120\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b120_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b120_1.0.dat + +// typicalconfiguration - view1 +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b111\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\viewconfiguration.xml private\200159c0\install\0998\101fb657\2000b111\1.0\viewconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\view1.bmp private\200159c0\install\0998\101fb657\2000b111\1.0\view1.bmp +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b111\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\1\locale.dtd private\200159c0\install\0998\101fb657\2000b111\1.0\1\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\9\locale.dtd private\200159c0\install\0998\101fb657\2000b111\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\0\hs_logoz.jpg private\200159c0\install\0998\101fb657\2000b111\1.0\0\hs_logoz.jpg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\1\hs_logoz.jpg private\200159c0\install\0998\101fb657\2000b111\1.0\1\hs_logoz.jpg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b111\1.0\9\hs_logoz.jpg private\200159c0\install\0998\101fb657\2000b111\1.0\9\hs_logoz.jpg +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b111_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b111_1.0.dat + +// typicalconfiguration - view2 +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b112\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\viewconfiguration.xml private\200159c0\install\0998\101fb657\2000b112\1.0\viewconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\view2.bmp private\200159c0\install\0998\101fb657\2000b112\1.0\view2.bmp +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b112\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\1\locale.dtd private\200159c0\install\0998\101fb657\2000b112\1.0\1\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b112\1.0\9\locale.dtd private\200159c0\install\0998\101fb657\2000b112\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b112_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b112_1.0.dat + +// typicalconfiguration - root +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\manifest.dat private\200159c0\install\102750f0\101fb657\2000b110\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\rootconfiguration.xml private\200159c0\install\102750f0\101fb657\2000b110\1.0\rootconfiguration.xml +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\root.bmp private\200159c0\install\102750f0\101fb657\2000b110\1.0\root.bmp +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\0\locale.dtd private\200159c0\install\102750f0\101fb657\2000b110\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\1\locale.dtd private\200159c0\install\102750f0\101fb657\2000b110\1.0\1\locale.dtd +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b110\1.0\9\locale.dtd private\200159c0\install\102750f0\101fb657\2000b110\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\install\app_102750f0_101fb657_2000b110_1.0.dat private\200159c0\install\app_102750f0_101fb657_2000b110_1.0.dat + + +// ============================================================================== +// operatorconfiguration +// ============================================================================== + +// operatorconfiguration - view +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b131\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b131\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b131\1.0\configuration.xml private\200159c0\install\0998\101fb657\2000b131\1.0\configuration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b131\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b131\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b131_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b131_1.0.dat + +// operatorconfiguration - root +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b130\1.0\manifest.dat private\200159c0\install\102750f0\101fb657\2000b130\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b130\1.0\configuration.xml private\200159c0\install\102750f0\101fb657\2000b130\1.0\configuration.xml +data=DATAZ_\private\200159c0\install\102750f0\101fb657\2000b130\1.0\0\locale.dtd private\200159c0\install\102750f0\101fb657\2000b130\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\app_102750f0_101fb657_2000b130_1.0.dat private\200159c0\install\app_102750f0_101fb657_2000b130_1.0.dat + + +// ============================================================================== +// finnishwidget +// ============================================================================== + +// finnishwidget - widget +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\manifest.dat private\200159c0\install\0998\101fb657\2000b132\1.0\manifest.dat +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\widgetconfiguration.xml private\200159c0\install\0998\101fb657\2000b132\1.0\widgetconfiguration.xml +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\common.jpg private\200159c0\install\0998\101fb657\2000b132\1.0\common.jpg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\0\locale.dtd private\200159c0\install\0998\101fb657\2000b132\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\9\locale.dtd private\200159c0\install\0998\101fb657\2000b132\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\0\localizedbg.jpg private\200159c0\install\0998\101fb657\2000b132\1.0\0\localizedbg.jpg +data=DATAZ_\private\200159c0\install\0998\101fb657\2000b132\1.0\9\localizedbg.jpg private\200159c0\install\0998\101fb657\2000b132\1.0\9\localizedbg.jpg +data=DATAZ_\private\200159c0\install\plugin_0998_101fb657_2000b132_1.0.dat private\200159c0\install\plugin_0998_101fb657_2000b132_1.0.dat + + + +// ============================================================================== +// installedwidget +// ============================================================================== + +// installedwidget +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\manifest.dat private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\manifest.dat +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\widgetconfiguration.xml private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\widgetconfiguration.xml +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\locale.dtd private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\locale.dtd +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\hs_logo.jpg private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\hs_logo.jpg +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\widget.bmp private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\0\widget.bmp +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\locale.dtd private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\locale.dtd +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\hs_logo.jpg private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\hs_logo.jpg +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\widget.bmp private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\1\widget.bmp +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\locale.dtd private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\locale.dtd +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\hs_logo.jpg private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\hs_logo.jpg +data=DATAZ_\private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\widget.bmp private\200159c0\sisxtest\0998\101fb657\2000b133\1.0\9\widget.bmp +data=DATAZ_\private\200159c0\sisxtest\plugin_0998_101fb657_2000b133_1.0.dat private\200159c0\sisxtest\plugin_0998_101fb657_2000b133_1.0.dat + +#endif // HSPSTESTCONFIGURATIONS_IBY + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/action_handler_plugin_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/action_handler_plugin_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,14 @@ + + +action_handler_plugin_api +Action Handler Plug-in API +c++ +contentpublishingsrv + + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: File that exports the files belonging to : sapi_actionhandler +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/ahpluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(ahpluginuids.hrh) +../inc/ahplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(ahplugin.h) + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/inc/ahplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/inc/ahplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: Plugin Interface + * +*/ + +#ifndef C_ACTION_HANDLER_PLUGIN_H +#define C_ACTION_HANDLER_PLUGIN_H + +#include + +class CLiwMap; + +/** + * Action handler interface for ECOM plugins + */ +class CAHPlugin : public CBase + { + +public: + + /** + * Method called by Action Handler in order to handle an action. + * Must be implemented by plugin provider. + * + * @param aMap an action object to be executed + * @return Error code + */ + virtual TInt ExecuteActionL( const CLiwMap* aMap ) = 0; + + }; + +#endif // C_ACTION_HANDLER_PLUGIN_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/inc/ahpluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/inc/ahpluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +/* +* 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: UID used in Action Handler rss plug-ins files + * +*/ + + +#ifndef AH_PLUGINUID__HRH_ +#define AH_PLUGINUID__HRH_ + +#define KAHPluginInterfaceUid 0x10282E5E + +#endif /*ASPAPLUGINUID__HRH_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/conf/ah_plugin_api.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/conf/ah_plugin_api.cfg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,14 @@ +[StifSettings] +CheckHeapBalance= off +[EndStifSettings] + +############################################################## +# Test +############################################################## + +[Test] +title Test_CAHPluginExecuteActionL +create ahpluginapitest ahs +ahs Test_CAHPluginExecuteActionL +delete ahs +[Endtest] \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/data/ahapi.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/data/ahapi.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +rem /* +rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem * All rights reserved. +rem * This component and the accompanying materials are made available +rem * under the terms of "Eclipse Public License v1.0" +rem * which accompanies this distribution, and is available +rem * at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem * +rem * Initial Contributors: +rem * Nokia Corporation - initial contribution. +rem * +rem * Contributors: +rem * +rem * Description: +rem * +rem */ + +md c:\data\stif\ah_results\ +ATSInterface.exe -testmodule TestScripter -config c:\testframework\ah_plugin_api.cfg \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/eabi/ahpluginapitestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/eabi/ahpluginapitestu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI24CActionHandlerTestPlugin @ 2 NONAME + _ZTV24CActionHandlerTestPlugin @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +TARGET ahpluginapitest.dll +TARGETTYPE dll +UID 0x1000af5a 0x016660F6 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE ahpluginapitest.cpp +SOURCE ahpluginapitestblocks.cpp +SOURCE ahtestplugin.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY stiftestinterface.lib +LIBRARY liwservicehandler.lib +LIBRARY eikcore.lib +LIBRARY cone.lib + +LANG SC + +EPOCALLOWDLLDATA + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/ah_plugin_api.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +; +; Copyright (c) 2009 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: +; +; obrtester.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"ahapitest"},(0x016660F6),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install + + "\epoc32\release\armv5\urel\ahpluginapitest.dll" - "!:\sys\bin\ahpluginapitest.dll" + "..\init\ah_plugin_api.ini" -"!:\testframework\ah_plugin_api.ini" + "..\conf\ah_plugin_api.cfg" -"!:\testframework\ah_plugin_api.cfg" + "..\data\ahapi.bat" -"!:\ahapi.bat" + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../init/ah_plugin_api.ini c:/testframework/ah_plugin_api.ini +../conf/ah_plugin_api.cfg c:/testframework/ah_plugin_api.cfg +../data/ahapi.bat c:/ahapi.bat + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +ah_plugin_api.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/createsis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/createsis.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis ah_plugin_api.pkg +signsis ah_plugin_api.sis ah_plugin_api.sisx rd.cer rd-key.pem +pause \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd-key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd-key.pem Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 +6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh +7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB +gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX +pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB +yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j +KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 +iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 +2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ +9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 +aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO +TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 +mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd.cer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/group/rd.cer Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z +NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl +cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT +rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa +gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI +f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL +BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud +IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd +IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE +IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G +CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 +Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT +7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR +-----END CERTIFICATE----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahpluginapitest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahpluginapitest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 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 TESTCLASS_H +#define TESTCLASS_H + +// INCLUDES + + +#include +#include +#include +#include +#include + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CtestClass test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CAHPluginApiTest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CAHPluginApiTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CAHPluginApiTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CAHPluginApiTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Test methods are listed below. + */ + TInt Test_CAHPluginExecuteActionL(CStifItemParser& /*aItem*/ ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + + }; + +#endif // TESTCLASS_H + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahtestplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/inc/ahtestplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* 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: Action Handler test Plugin + * +*/ + + +#ifndef C_AH_TEST_PLUGIN_H +#define C_AH_TEST_PLUGIN_H + +#include +#include + + +// FORWARD DECLARATION +class CLiwMap; +class TLiwVariant; +class CEikonEnv; + + +/** + * Exemplary Action Handler Plugin. + * Class extends the CAHPlugin in order to be able to be used + * as a plugin for action handler. + * + * @lib exemplaryactionhandler + * @since S60 S60 v5.0 + */ +class CActionHandlerTestPlugin : public CAHPlugin + { + +public: + + /** + * Standard Symbian 2 phase constructor + */ + static CActionHandlerTestPlugin* NewL(); + + /** + * Standard Symbian 2 phase constructor + */ + static CActionHandlerTestPlugin* NewLC(); + + /** + * Standard C++ destructor. + */ + ~CActionHandlerTestPlugin (); + + /** + * Executes provided action + * + * @return status code + */ + TInt ExecuteActionL( const CLiwMap* aMap ); +private: + /** + * Standard Symbian 2nd phase constructor. + */ + void ConstructL(); + +private: + + /** + * Extract Variant + */ + TInt ExtractVariantL( const CLiwMap* aMap, + TLiwVariant& aVariant, + const TDesC8& aMapName ); + + }; + +#endif /* C_AH_TEST_PLUGIN_H */ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/init/ah_plugin_api.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/init/ah_plugin_api.ini Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,178 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\data\stif\ah_results\ +TestReportFileName= Utils + +TestReportFormat= HTML # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= dom_test2 +#[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +[New_Module] +ModuleName= testscripter + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) + +TestCaseFile= c:\testframework\ah_plugin_api.cfg + + +[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitest.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES + +#include +#include +#include "ahpluginapitest.h" +#include "ahtestplugin.h" +#include +_LIT8( KTitle , "title" ); +_LIT8( KMessage, "message" ); +// ============================ MEMBER FUNCTIONS =============================== + + +TInt CAHPluginApiTest::Test_CAHPluginExecuteActionL(CStifItemParser& ) + { + TInt result (KErrGeneral); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + map->InsertL( KTitle, _L8("title") ); + map->InsertL( KMessage, _L8("message") ); + CActionHandlerTestPlugin* plugin = CActionHandlerTestPlugin::NewLC(); + result = plugin->ExecuteActionL( map ); + CleanupStack::PopAndDestroy( plugin ); + CleanupStack::PopAndDestroy( map ); + return result; + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahpluginapitestblocks.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES +#include +#include +#include +#include "ahpluginapitest.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CAHPluginApiTest::CAHPluginApiTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem ); + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CAHPluginApiTest::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CAHPluginApiTest* CAHPluginApiTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CAHPluginApiTest* self = new (ELeave) CAHPluginApiTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CAHPluginApiTest::~CAHPluginApiTest() + { + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CAHPluginApiTest::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 + +// ----------------------------------------------------------------------------- +// CMCSAPITest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CAHPluginApiTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + + ENTRY( "Test_CAHPluginExecuteActionL", CAHPluginApiTest::Test_CAHPluginExecuteActionL ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahtestplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/action_handler_plugin_api/tsrc/src/ahtestplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,108 @@ +/* +* 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: Exemplary Action Handler Plugin +* +*/ + + + +#include +#include +#include + +#include "ahtestplugin.h" + +_LIT8( KTitle , "title" ); +_LIT8( KMessage, "message" ); + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CActionHandlerTestPlugin::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CActionHandlerTestPlugin* CActionHandlerTestPlugin::NewL() + { + CActionHandlerTestPlugin* self = CActionHandlerTestPlugin::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CActionHandlerTestPlugin* CActionHandlerTestPlugin::NewLC() + { + CActionHandlerTestPlugin* self = new( ELeave ) CActionHandlerTestPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CActionHandlerTestPlugin::~CActionHandlerTestPlugin() + { + } + +// --------------------------------------------------------------------------- +// Executes provided action +// --------------------------------------------------------------------------- +// +TInt CActionHandlerTestPlugin::ExecuteActionL( const CLiwMap* aMap ) + { + TInt errCode( KErrNotFound ); + TLiwVariant variant; + variant.PushL(); + errCode = ExtractVariantL( aMap, variant, KTitle ); + if( errCode == KErrNone ) + { + errCode = ExtractVariantL( aMap, variant, KMessage ); + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } + + +// --------------------------------------------------------------------------- +// Extract variant +// --------------------------------------------------------------------------- +// +TInt CActionHandlerTestPlugin::ExtractVariantL( const CLiwMap* aMap, + TLiwVariant& aVariant, + const TDesC8& aMapName ) + + { + TInt errCode( KErrNone ); + + if ( !aMap->FindL( aMapName, aVariant ) ) + { + errCode = KErrNotFound; + } + + return errCode; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/ai_content_model_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/ai_content_model_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + AI Content Model API + AI Content Model API provides an abstraction to access the plug-in content, enables service request routing to the plug-in, and provides a callback interface used by the Active Idle plug-ins to give notification about modifications in the content and/or internal state.Each Active Idle plug-in must implement this interface together with the plug-in proprietary Content Model API, which specifies the content provided by the plug-in at run time, uniquely identifies content type and the logical means of every content entity, and specifies set of services supported by the plug-in. AI Content Model and the plug-in proprietary Content Model API are used at Active Idle UI and/or Theme development time. + c++ + activeidle + + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Content Model API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/aicontentobserver.inl MW_LAYER_PLATFORM_EXPORT_PATH(aicontentobserver.inl) +../inc/aicontentobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentobserver.h) +../inc/aipropertyextension.h MW_LAYER_PLATFORM_EXPORT_PATH(aipropertyextension.h) +../inc/aieventhandlerextension.h MW_LAYER_PLATFORM_EXPORT_PATH(aieventhandlerextension.h) +../inc/aipropertyextension.inl MW_LAYER_PLATFORM_EXPORT_PATH(aipropertyextension.inl) +../inc/aicontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentmodel.h) +../inc/aicontentrequest.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentrequest.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aicontentmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,230 @@ +/* +* 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: Generic Active Idle Content item and Content item iterator definitions. +* +*/ + + + +#ifndef M_AICONTENTMODEL_H +#define M_AICONTENTMODEL_H + +#include +#include // For wchar_t + +/** + * Maximum length for a content item textual id. + * + * @see TAiContentItem::id + */ +const TInt KAiContentIdMaxLength = 255; + +/** + * Maximum length for content type. + * + * @see TAiContentItem::type + */ +const TInt KAiContentTypeMaxLength = 255; + +/** + * Null value for content id. Plug-in content model should never use this id + * value in its content model. + */ +const TInt KAiNullContentId = KErrNotFound; + +/** + * Encapsulates metadata of single plug-ins content item. The class is used + * as building block for the plug-ins content model, abstracts content + * selector, content reference and event. + */ +struct TAiContentItem +{ + /** + * Plug-in specific id of this content item. + */ + TInt id; + + /** + * Textual id of this content item. Used for binding content items to + * UI elements. + * + * @see KAiContentIdMaxLength + */ + const wchar_t* cid; + + /** + * Content item data MIME type. For example "text/plain" for textual + * content. + * + * @see KAiContentTypeMaxLength + */ + const char* type; +}; + +/** + * Helper function for accessing Content item textual id TAiContentItem::cid. + * + * This function's performance is relative to O(N) where N is the length of + * the textual id in characters. If the id of the same content item is accessed + * repeatedly (for example in a loop) store the returned id in a local TPtrC + * variable instead of calling this function repeatedly. + * + * @param aContentItem content item whose textual id to return. + * @return textual id of aContentItem as a descriptor. + */ +inline TPtrC16 ContentCid( const TAiContentItem& aContentItem ) + { + return TPtrC16( (const TText16*) aContentItem.cid ); + } + +/** + * Helper function for accessing Content item data type TAiContentItem::type. + * + * This function's performance is relative to O(N) where N is the length of + * the type name in characters. If the type of the same content item is accessed + * repeatedly (for example in a loop) store the returned type in a local TPtrC8 + * variable instead of calling this function repeatedly. + * + * @param aContentItem content item whose type to return. + * @return data type of aContentItem as a descriptor. + */ +inline TPtrC8 ContentType( const TAiContentItem& aContentItem ) + { + return TPtrC8( (const TText8*) aContentItem.type ); + } + + +/** + * Mime type for passing bitmap content data. + * The content data should contain a packaged CGulIcon object pointer when this + * MIME tyoe is used. + * + * @see CGulIcon + * @see MAiContentObserver::PublishPtr + */ +const char KAiContentTypeBitmap[] = "image/x-s60-bitmap"; + +/** + * MIME type for passing textual data. + * + * @see MAiContentObserver::Publish + */ +const char KAiContentTypeText[] = "text/plain"; + + +/** + * Abstract interface which provides services to iterate content items + * supported by the plug-in. Only used by the Active Idle Framework. + * Each plug-in must provide implementation of interface to access: + * content selectors, content references, and events. Instances of interface + * are accessed through method GetProperty in interface CAiContentPublisher. + * + * @since S60 3.2 + */ +class MAiContentItemIterator +{ +public: + /** + * Tests if this enumeration contains more elements. + * + * @return ETrue if this iterator object contains at least one more + * element to provide; EFalse otherwise. + */ + virtual TBool HasNext() const = 0; + + /** + * Returns the next element of this iterator if this enumeration object + * has at least one more element to provide. + * + * @return The next element. + * @leave KErrOverflow if iterator is at the end of range. + */ + virtual const TAiContentItem& NextL() = 0; + + /** + * Returns the first element of this iterator which matches aId. + * + * @param aId - unique identification of the content item, corresponds + * to TAiContentItem::id. + * @return The first element matching aId. + * @leave KErrNotFound if element matching aId is not found from the + * complete iterator range. + */ + virtual const TAiContentItem& ItemL( TInt aId ) const = 0; + + /** + * Returns the first element of this iterator which matches aCid. + * + * @param aCid - textual identification of the content item, corresponds + * to TAiContentItem::cid. + * @return The first element matching aCid. + * @leave KErrNotFound if element matching aCid is not found from the + * complete iterator range. + */ + virtual const TAiContentItem& ItemL( const TDesC& aCid ) const = 0; + + /** + * Resets iterator to the first item in the list. + */ + virtual void Reset() = 0; + + /** + * Release the iterator. + */ + virtual void Release() = 0; + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiContentItemIterator() { } + +private: + /** + * Required to implement CleanupReleasePushL(MAiContentItemIterator*). + */ + static void Cleanup(TAny* aSelf); + friend void CleanupReleasePushL(MAiContentItemIterator*); +}; + +/** + * Helper function which calls MAiContentItemIterator::Release() with NULL + * checking. Especially useful in destructors. + */ +inline void Release(MAiContentItemIterator* aObj) + { + if (aObj) aObj->Release(); + } + +/** + * + */ +inline void CleanupReleasePushL(MAiContentItemIterator* aObj) + { + CleanupStack::PushL( + TCleanupItem(&MAiContentItemIterator::Cleanup, aObj) ); + } + +/** + * Required to implement CleanupReleasePushL(MAiContentItemIterator*). + * Inline to avoid problems with multiple definitions. + */ +inline void MAiContentItemIterator::Cleanup(TAny* aSelf) + { + ::Release(static_cast(aSelf)); + } + + + +#endif // M_AICONTENTMODEL_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,265 @@ +/* +* 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: Active Idle content observer interface. +* +*/ + + +#ifndef M_AICONTENTOBSERVER_H +#define M_AICONTENTOBSERVER_H + +#include + +class MAiPropertyExtension; +class RFile; +class TDesC8; +class TDesC16; +struct TAiPublisherInfo; + +/** + * Used by AI Plug-in to give notification about modifications in + * content and/or internal state. + * + * @since S60 3.2 + */ +class MAiContentObserver + { +public: // New functions + + /** + * Invoked by the plug-in to inform that it initiates content publishing + * transaction. + * + * @param aTxId - transaction Id + * @return - Possible return values: + * - KErrNone - transaction is started. + * - KErrNotSupported - UI Controller does not support transactions, + * meaning that content will be rendered every time when Publish + * is called. + */ + virtual TInt StartTransaction( TInt aTxId ) = 0; + + /** + * Invoked by the plug-in to request framework that content publishing + * transaction must be finalized and content should be rendered to the + * screen. + * + * @param aTxId - transaction Id + * @return - Possible return values: + * - KErrNone - transaction is over. + * - KErrNotSupported - UI Controller does not support transactions, + * meaning that content will be rendered every time when Publish + * is called. + * - KErrNotFound - transaction with matching id has not been + * started. + * - Any of the system-wide error codes in case of resource allocation failure. + */ + virtual TInt Commit( TInt aTxId ) = 0; + + /** + * Invoked by plug-in to indicate that content publishing transaction + * must be cancelled. + * + * @param aTxId - transaction Id + * @return - Possible return values: + * - KErrNone - transaction is cancelled. + * - KErrNotSupported - UI Controller does not support transactions, + * meaning that content will be rendered every time when Publish + * is called. + * - KErrNotFound - transaction with matching id has not been + * started. + */ + virtual TInt CancelTransaction( TInt aTxId ) = 0; + + /** + * Invoked by plug-in to test if the specified content can be published. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aIndex - index of the content item. + * @return ETrue - if content could be published; EFalse otherwise. + */ + virtual TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; + + /** + * Invoked by the plug-in to inform that content identified by reference + * aResource must be published to UI control\element identified by selector + * aContent. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aResource - identification of content reference, MUST correspond + * single content reference supported by plug-in. The framework + * utilizes the reference if to match for cid and MIME type of the + * content supplied with in UI definition. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aResource, TInt aIndex ) = 0; + + /** + * Invoked by the plug-in to inform that textual content provided within + * parameter aText must be published to UI control\element identified by + * selector aContent. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aText - Textual content in UNICODE. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + * - KErrArgument - if content cannot be published to UI element, + * e.g. MIME type mismatch. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC16& aText, TInt aIndex ) = 0; + + /** + * Invoked by the plug-in to inform that content provided within buffer + * aBuf must be published to UI control\element identified by selector + * aContent. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aBuf - instance of content. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + * - KErrArgument - if content cannot be published to UI element, + * e.g. MIME type mismatch. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, const TDesC8& aBuf, TInt aIndex ) = 0; + + /** + * Invoked by the plug-in to inform that an object provided by pointer aPtr + * must be published to UI control\element identified by selector aContent. + * The implementation packages the pointer to a buffer and delegates to + * buffer publishing method Publish(MAiPropertyExtension&, TInt, const TDesC8&, TInt). + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aPtr - pointer to the content object. The actual type of the + * pointer is deduced based on the MIME type of the content item + * identified by aContent. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + * - KErrArgument - if content cannot be published to UI element, + * e.g. MIME type mismatch. + * @see KAiContentTypeBitmap + */ + inline TInt PublishPtr( MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex ); + + /** + * Helper function for unpacking a pointer that has been published with + * MAiContentObserver::PublishPtr. + * + * @see MAiContentObserver::PublishPtr + */ + template inline static PtrT* UnpackPtr( const TDesC8& aBuf ); + + /** + * Invoked by the plug-in to inform that content from file handle aFile + * must be published to UI control\element identified by selector aContent. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aFile - file handle from where content can be obtained by UI + * framework. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + * - KErrArgument - if content cannot be published to UI element, + * e.g. MIME type mismatch. + */ + virtual TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, RFile& aFile, TInt aIndex ) = 0; + + /** + * Invoked by the plug-in to inform that content must be cleaned in UI + * control\element identified by selector aContent. + * + * @param aPlugin - Plug-in property extension interface implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aIndex - index of the content item. + * @return - Possible return values: + * - KErrNone - if content is published. + * - KErrNotSupported - if content selector is not supported by + * current UI definition. + * - KErrNotFound - if content reference is not found in current + * UI definition. + */ + virtual TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ) = 0; + + /** + * Returns interface extension. Not used in S60 3.2 release. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + virtual TAny* Extension( TUid aUid ) = 0; + + /** + * Invoked by the plugin factory + * + * @param aPublsiherInfo Publisher which requires subscription + * @return ETrue if subsription is needed, EFalse otherwise + */ + virtual TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const = 0; + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiContentObserver() { } + }; + + +#include + +#endif // M_AICONTENTOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Inline function implementations for aicontentobserver.h +* +*/ + + +inline TInt MAiContentObserver::PublishPtr + (MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex) + { + // Package the pointer to a buffer and delegate to buffer publish method + return this->Publish(aPlugin, aContent, TPckgC(aPtr), aIndex); + } + +template inline +PtrT* MAiContentObserver::UnpackPtr(const TDesC8& aBuf) + { + TAny* result = NULL; + if ( aBuf.Size() == sizeof( TAny* ) ) + { + TPckg(result).Copy(aBuf); // Effectively writes aBuf contents to result + } + return static_cast(result); + } + +// End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aicontentrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aicontentrequest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* 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: Content item refresh request interface +* +*/ + + +#ifndef M_AICONTENTREQUEST_H +#define M_AICONTENTREQUEST_H + +/** + * Interface for requesting a content publisher to refresh its published + * content to the UI. + * + * @since S60 3.2 + * @see MAiPropertyExtension + */ +class MAiContentRequest + { +public: + /** + * Requests AI content publisher to publish specific content item. + * + * @param aContentId content identifier in target plug-ins content model. + * @return ETrue if the plugin will refresh the content by calling its + * content observer, EFalse otherwise. + */ + virtual TBool RefreshContent( TInt aContentId ) = 0; + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiContentRequest() { } + }; + +#endif + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aieventhandlerextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aieventhandlerextension.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,75 @@ +/* +* 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: Event handling extension for the CAiContentPublisher interface. +* +*/ + + +#ifndef M_AIEVENTHANDLEREXTENSION_H +#define M_AIEVENTHANDLEREXTENSION_H + +#include + +/** + * Extension of the CAiContentPublisher interface, which allows Active Idle + * Framework to notify their plug-ins that they must to handle event. + * Plug-ins must provide implementation of interface only if they are + * supporting event model (e.g. provides possibility to manipulate engine + * properties via UI). + * + * @since S60 3.2 + */ +class MAiEventHandlerExtension + { +public: + /** + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + */ + virtual void HandleEvent(TInt aEvent, const TDesC& aParam) = 0; + + /** + * Invoked by the framework when plug-in must handle an event. + * + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provied to plug-in as-is in the descriptor. + */ + virtual void HandleEvent(const TDesC& /*aEventName*/, const TDesC& /*aParam*/) { }; + + /** + * Invoked by the framework for querying if plugin has menu item + * + * @param aMenuItem menu item name + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + virtual TBool HasMenuItem(const TDesC& /*aMenuItem*/) { return EFalse; } + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiEventHandlerExtension() { } + }; + +#endif // M_AIEVENTHANDLEREXTENSION_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,219 @@ +/* +* 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: +* +*/ + + +#ifndef M_AIPROPERTYEXTENSION_H +#define M_AIPROPERTYEXTENSION_H + +#include + +/** + * Maximum length for Content publisher name + */ +const TInt KAiPublisherNameMaxLength = 128; + +/** + * Maximum length for Content publisher namespace + */ +const TInt KAiPublisherNamespaceMaxLength = 32; + +/** + * Content publisher name buffer + */ +typedef TBuf TAiPublisherName; + +/** + * Content publisher namespace buffer + */ +typedef TBuf8 TAiPublisherNamespace; + +/** + * Contains information about Content publisher plug-in. + */ +struct TAiPublisherInfo + { + TAiPublisherInfo() + : iUid( TUid::Null() ), + iName( KNullDesC ), + iNamespace( KNullDesC8 ) + { + } + + inline TAiPublisherInfo& operator= (const TAiPublisherInfo& aInfo) + { + iUid = TUid::Uid( aInfo.iUid.iUid ); + iName.Copy( aInfo.iName ); + iNamespace.Copy( aInfo.iNamespace ); + return *this; + } + + inline TBool operator== (const TAiPublisherInfo& aInfo) const + { + if( iUid == aInfo.iUid && + iName == aInfo.iName && + iNamespace == aInfo.iNamespace ) + { + return ETrue; + } + + return EFalse; + } + + TUid iUid; + TAiPublisherName iName; + TAiPublisherNamespace iNamespace; + }; + +/** + * Defines set of properties supported by plug-in. + * + * Example how to provide and set the properties. + * @code + * void CMyAiPlugin::ConstructL() + * { + * iInfo = new (ELeave) TAiPublisherInfo; + * iContent = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginContent ); + * iResources = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginResources ); + * iEvents = AiUtility::CreateContentItemArrayIteratorL( KMyAiPluginEvents ); + * } + * + * void CMyAiPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) + * { + * if( !aValue ) return; + * + * switch( aProperty ) + * { + * case EAiPublisherInfo: + * { + * const TAiPublisherInfo* info = + * static_cast(aValue); + * iInfo->iUid.iUid = info->iUid.iUid; + * iInfo->iName.Copy( info->iName ); + * break; + * } + * } + * } + * + * TAny* CMyAiPlugin::GetPropertyL( TInt aProperty ) + * { + * switch( aProperty ) + * { + * case EAiPublisherInfo: + * return iInfo; + * + * case EAiPublisherContent: + * return iContent; + * + * case EAiPublisherResources: + * return iResources; + * + * case EAiPublisherEvents: + * return iEvents; + * } + * return NULL; + * } + * @endcode + */ +enum TAiPublisherProperty + { + /** + * Enables read-only access to Plug-in information. GetProperty MUST return + * instance of struct TAiPublisherInfo via TAny* . + */ + EAiPublisherInfo = 0x0001, + + /** + * Enables read-only access to iterator of content selectors. GetProperty + * MUST return instance of MAiContentItemIterator for content selectors. + */ + EAiPublisherContent, + + /** + * Enables read-only access to iterator of content references. GetProperty + * MUST return instance of MAiContentItemIterator for content references. + */ + EAiPublisherResources, + + /** + * Enables read-only access to iterator of events supported by plug-in. + * GetProperty MUST return instance of MAiContentItemIterator for events. + */ + EAiPublisherEvents, + + /** + * Provides access to MAiContentRequest interface for refreshing a content + * item. + * @see EAiPublisherContent + */ + EAiContentRequest, + + /** + * Provides access to MAiContentRequest interface for refreshing a resource + * item. + * @see EAiPublisherResources + */ + EAiResourceRequest, + + /** + * Provides access to localized plugin name if supported. HBufC* + * @see EAiPublisherResources + */ + EAiPluginName + }; + + +/** + * Property extension interface for CAiContentPublisher. + * + * @see CAiContentPublisher::Extension + * @since S60 3.2 + */ +class MAiPropertyExtension + { +public: // New functions + + /** + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return Pointer to property value. + */ + virtual TAny* GetPropertyL(TInt aProperty) = 0; + + /** + * Helper function for accessing the Publisher Info Property. + */ + inline const TAiPublisherInfo* PublisherInfoL(); + + /** + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + virtual void SetPropertyL(TInt aProperty, TAny* aValue) = 0; + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiPropertyExtension() { } + }; + +#include + +#endif // M_AIPROPERTYEXTENSION_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_content_model_api/inc/aipropertyextension.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2005-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: Inline function implementations for MAiPropertyExtension +* +*/ + + +inline const TAiPublisherInfo* MAiPropertyExtension::PublisherInfoL() + { + return static_cast(this->GetPropertyL(EAiPublisherInfo)); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_information_api/ai_plugin_information_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_information_api/ai_plugin_information_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + AI Plug-in Information API + Provides infomration about loaded active idle plug-ins + c++ + activeidle + + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_information_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_information_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Plug-in Information API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/activeidle2domainpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(activeidle2domainpskeys.h) +../inc/activeidle2internalpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(activeidle2internalpskeys.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_information_api/inc/activeidle2domainpskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_information_api/inc/activeidle2domainpskeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,187 @@ +/* +* 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: Active Idle 2 domain P&S key definitions +* +*/ + + +#ifndef ACTIVEIDLE2_DOMAIN_PS_KEYS_H +#define ACTIVEIDLE2_DOMAIN_PS_KEYS_H + +/** +* PubSub Category AI information API +*/ +const TUid KPSUidAiInformation = {0x101FD657}; + +/** +* PubSub keys +*/ +const TUint KActiveIdleUid = 0x00000001; // Contains UID of StandbyUI (Active Idle) application + +const TUint KActiveIdleState = 0x00000002; // Contains one value from following emuneration + +enum EPSActiveIdleState +{ + // Indicates that Active Idle goes to background + // Value is triggered by KAknFullOrPartialForegroundLost event + // + // Corresponds to value EPSTelephonyNotIdle writtern to former KTelephonyIdleStatus + EPSAiBackground = 0, + + // Indicates that Active Idle goes to foreground + // Value is triggered by KAknFullOrPartialForegroundGained event + // + // Corresponds to value EPSTelephonyIdle writtern to former KTelephonyIdleStatus + EPSAiForeground, + + // Indicates that Active Idle goes to background and keyboard focus goes to Phone app for Tel number entry + // The key is managed by windows server plug-in depends on the key pressed by end-user (See Chapter "Key event handling" from Active Idle SWAD) + // + // Corresponds to value EPSTelephonyIncomingKeyEvents written to former KTelephonyFocusInfo + EPSAiNumberEntry +}; + +const TUint KActiveIdlePopupState = 0x00000003; // Contains one value from following emuneration + +enum EPSActiveIdlePopupState +{ + // Indicates that Active Idle is displaying dialog or menu + // The key is managed by windows server plug-in to determine whether to enable keylock handling + EPSAiDisplayingMenuOrDialog, + + // Indicates that Active Idle is not displaying dialog or menu + // The key is managed by windows server plug-in to determine whether to enable keylock handling + EPSAiNotDisplayingMenuOrDialog +}; + + +const TUint KActiveIdleActOnSendKey = 0x00000004; // Contains 0 if we are to ignore the send or > 0 if we need to react to it + +const TUint KActiveIdleTouchToolbarWidth = 0x00000005; + +const TUint KActiveIdleTouchToolbarHeight = 0x00000006; + +const TUint KActiveIdleSimRegFailedReceived = 0x00000007; // Contains 1 if we have received sim reg failed message, 0 if not. + +enum EPSActiveIdleSimRegReceiveStatus +{ + // Indicates that Active Idle is displaying dialog or menu + // The key is managed by windows server plug-in to determine whether to enable keylock handling + EPSSimRegFailedMessageNotReceived = 0, + + // Indicates that Active Idle is not displaying dialog or menu + // The key is managed by windows server plug-in to determine whether to enable keylock handling + EPSSimRegFailedMessageReceived +}; + +const TUint KActiveIdleThemeSupportsXsp = 0x00000008; // Contains one value from following enumeration + +enum EPSActiveIdleThemeSupportsXsp +{ + // Value indicates that xSP feature is not supported in currently active theme + EPSAiXspNotSupported, + + // Value indicates that the current theme supports the xSP feature + EPSAiXspIsSupported +}; + +const TUint KActiveIdleLaunch = 0x00000009; // Contains information if shortcut launching is ongoing or not + +enum EPSActiveIdleIdleLaunch +{ + + // Value indicates that no shortcut is in launching state and new launch tapping can be handled + EPSAiLaunchNotActive = 0, + + // Value indicates that active idle shortcut is launching + EPSAiLaunchIsActive +}; + + +// Indicates that Active Idle 2 should be restarted. +const TUint KActiveIdleRestartAI2 = 0x0000000B; + +// Indicates that all the CPS Harvester plugins have been updated +const TUint KActiveIdleCpsPluginsUpdated = 0x0000000C; + +enum EPSActiveIdleCpsPluginsUpdated + { + EPSAiPluginsNotUpdated = 0, + EPSAiPluginsUpdated + }; + +// Key to indicate wether the WS plug-in forwards all the numeric keypad +// events to telephone or not. +const TUint KActiveIdleForwardNumericKeysToPhone = 0x0000000D; + +enum EActiveIdleForwardNumericKeysToPhone + { + // Forward events to phone + EPSAiForwardNumericKeysToPhone, + + // Don't forward events to phone + EPSAiDontForwardNumericKeysToPhone + }; + +// Indicates that in ExtHS mode the LSK should have a locked shortcut. +// Contains the full shortcut definition string. +const TUint KActiveIdleExtHS_LSKLocked = 0x00000501; + +// Indicates that in ExtHS mode the RSK should have a locked shortcut. +// Contains the full shortcut definition string. +const TUint KActiveIdleExtHS_RSKLocked = 0x00000502; + +// Indicates that in ExtHS mode the plugin configuration has changed. +const TUint KActiveIdleExtHS_PluginConfChange = 0x00000503; + +/** +* PubSub Category AI plug-in registry API +*/ +const TUid KPSUidActiveIdle2 = {0x102750F0}; // ActiveIdle2 SID + +/** +* +* First iterate Active plugin UID range to find all +* active plugin UID's. Use that UID as a key to find the plugins name +* from the name range. +* +*/ + +/** +* Active plugin count +* +* Possible integer values: +* 0x000000000 - 0xFFFFFFFF : Active plugin count +*/ +const TUint KAIActivePluginCount = 0x00000000; + +/** +* Active plugin UID range +* +* Possible integer values: +* 0x100000000 - 0xFFFFFFFF : Active plugins UID +*/ +const TUint KAIActivePluginRangeStart = 0x00000001; +const TUint KAIActivePluginRangeEnd = 0x0FFFFFFF; + +/** +* Active plugin name range +* +* Possible string values: +* Plugin name +*/ +const TUint KAIPluginNameRangeStart = 0x10000000; +const TUint KAIPluginNameRangeEnd = 0xFFFFFFFF; + +#endif // ACTIVEIDLE2_DOMAIN_PS_KEYS_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_information_api/inc/activeidle2internalpskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_information_api/inc/activeidle2internalpskeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2002 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: Internal Publish & Subscribe keys for Active Idle 2 +* +*/ + + +#ifndef __ACTIVEIDLE2INTERNALPSKEYS_H__ +#define __ACTIVEIDLE2INTERNALPSKEYS_H__ + +/** + * Gives possibility to execute shortcuts defined by localapp URL. + * This UID is used as a key id under KUidSystemCategory. + * Clients must supply string in localapp URL format defined by RFC 2396. + * + * @type RProperty::EText + */ +const TUint32 KPSUidShortcutCmd = 0x102750FF; + +/** + * Shortcut Plug-in command for enabling keylock. + */ +_LIT( KAiPSEnableKeyLock, "localapp:keylock?on"); + +/** + * Shortcut Plug-in command for canceling keylock. + */ +_LIT( KAiPSSkipKeyLock, "localapp:keylock?skip"); + +/** + * Shortcut Plug-in command for timeoutting keylock. + */ +_LIT( KAiPSKeyLockTimeout, "localapp:keylock?timeout"); + +/** + * Shortcut Plug-in command for launching Logs to dialed calls view. + */ +_LIT( KAiPSLaunchLogs, "localapp:logs?view=dialled"); + +/** + * Shortcut Plug-in command for launching Voice Dial UI. + */ +_LIT( KAiPSLaunchNameDialer, "localapp:voicedial"); + +/** + * Shortcut Plug-in command for canceling voice dial ui. + */ +_LIT( KAiPSSkipNameDialer, "localapp:voicedial?skip"); + + +// Restart code for category KPSUidAiInformation = 0x101FD657 key KActiveIdleRestartAI2 0xA +const TInt KActiveIdleRestartCode = 0xFA93BAD2; + + + +/** + * Publish and Subscribe key for data plugin states in KPSUidActiveIdle2 category (AI plug-in registry API) + */ +const TUint KPSAiDataPluginState = 0x0000000F; // Contains one value from following emuneration + +/** + * States for the KPSAiDataPluginState key + */ +enum EPSAiDataPluginState +{ + EPSAiDataPluginsNotLoaded, + EPSAiDataPluginsLoaded +}; + + +#endif // __ACTIVEIDLE2INTERNALPSKEYS_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/ai_plugin_management_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/ai_plugin_management_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + AI Plug-in Management API + AI Plug-in Management API is the ECom plug-in interface that Active Idle plug-ins must implement. It is used to control the plug-in life cycle: e.g. to load/destroy plug-ins and suspend/resume plug-in execution. + c++ + activeidle + + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Plug-in Management API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/aicontentpublisheruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aicontentpublisheruid.hrh) +../inc/aiprofilepluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiprofilepluginuids.hrh) +../inc/aiscutuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiscutuids.hrh) +../inc/aicontentpublisher.h MW_LAYER_PLATFORM_EXPORT_PATH(aicontentpublisher.h) +../inc/aidevicestatuscontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aidevicestatuscontentmodel.h) +../inc/aiscutcontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutcontentmodel.h) +../inc/aiscutdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutdefs.h) +../inc/aiprofileplugincontentmodel.h MW_LAYER_PLATFORM_EXPORT_PATH(aiprofileplugincontentmodel.h) +../inc/aiscutappuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiscutappuids.hrh) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,398 @@ +/* +* 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: Interface for Active Idle content publisher plug-ins. +* +*/ + + +#ifndef C_AICONTENTPUBLISHER_H +#define C_AICONTENTPUBLISHER_H + +#include +#include + +/** + * ECom plugin interface UID + */ +const TUid KInterfaceUidContentPlugin = { AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER }; + +/** + * API Extension UID for MAiPropertyExtension. + * + * @see CAiContentPublisher::Extension + * @see MAiPropertyExtension + */ +const TUid KExtensionUidProperty = { 0x1 }; + +/** + * API Extension UID for MAiEventExtension. + * + * @see CAiContentPublisher::Extension + * @see MAiEventExtension + */ +const TUid KExtensionUidEventHandler = { 0x2 }; + +/** + * Defines set of reasons for plug-in state change. + */ +enum TAiTransitionReason + { + + /** + * Unknown transition reason. + */ + EAiUnknownTransitionReason = 0, + + /** + * System has started up. + */ + EAiSystemStartup, + + /** + * System is shutting down. + */ + EAiSystemShutdown, + + /** + * Backlight on. + */ + EAiBacklightOn, + + /** + * Backlight off. + */ + EAiBacklightOff, + + /** + * Backup or restore has been initiated. + */ + EAiBackupRestoreStarted, + + /** + * Backup or restore has ended. + */ + EAiBackupRestoreEnded, + + /** + * Call started. + */ + EAiPhoneCallStarted, + + /** + * Call ended. + */ + EAiPhoneCallEnded, + + /** + * Active Idle UI Definition change has started. + */ + EAiUiDefinitionChangeStarted, + + /** + * Active Idle UI Definition change has ended. + */ + EAiUiDefinitionChangeEnded, + + /** + * Phone general theme has changed. + */ + EAiGeneralThemeChanged, + + /** + * Screen layout has changed. + */ + EAiScreenLayoutChanged, + + /** + * System clock crossed midnight. + */ + EAiMidnightPassed, + + /** + * Language has been changed. + */ + EAiLanguageChanged, + + /** + * System time has been changed by user. + */ + EAiTimeChanged, + + /** + * Idle changes to background. + */ + EAiIdleBackground, + + /** + * Idle changes to foreground. + */ + EAiIdleForeground, + + /** + * Suspending plugins. + */ + EAiSuspendPlugins, + + /** + * Keylock enabled. + */ + EAiKeylockEnabled, + + /** + * Keylock disabled. + */ + EAiKeylockDisabled, + + /** + * Plugins can go online + */ + EAiIdleOnLine, + + /** + * Plugins must go offline + */ + EAiIdleOffLine, + + /** + * Page changed + */ + EAiIdlePageSwitch + }; + +class MAiContentObserver; +class MAiPluginSettings; +typedef RPointerArray< MAiPluginSettings > RAiSettingsItemArray; + +/** + * ECom plug-in interface that Active Idle plug-ins must implement. + * It is used to control plug-in life cycle: load/destroy plug-ins; + * suspend/resume plug-in execution. + * + * @since S60 3.2 + */ +class CAiContentPublisher : public CBase + { +public: // Constructors and destructor + + /** + * Creates a new plug-in instance based on implementation UID. + * + * @param aImpUid implementation UID of plug-in to instantiate. + * @return pointer to the instantiated interface implementation. + * @pre Interface implementation exists by uid aImpUid. + */ + inline static CAiContentPublisher* NewL(TUid aImpUid); + + /** + * Creates a new plug-in instance based on mime type. + * + * @param aMime MIME type of plug-in to instantiate. + * @return pointer to the instantiated interface implementation. + */ + inline static CAiContentPublisher* NewL(const TDesC8& aMime); + + /** + * Destroys instance of the plug-in. Called by the framework during plug-in + * unloading phase. + */ + inline virtual ~CAiContentPublisher(); + +public: // New functions + /** + * This method transit the plugin to "Alive" state. + * The method is called by the framework to instruct plug-in that it is + * allowed to actively publish its data to its observers. This means the plugin + * is allowed to consume memory and CPU resources, e.g plug-in is able load + * engines, run timers, perform asynchronous operations, etc. The method + * transits the plug-in to "Alive" state. There can be many concurrent + * calls to resume, with different or the same reason code, this allows + * the plugin to properly respond to enviroment change that raise the + * need to re-publish content (changes like date/time change etc). + * + * @param aReason reason for state change, see TAiTransitionChange. + * @pre None + * @post Plugin is in resumed state and actively publishes its data. + * + * Short example what a typical resume implementation does. + * @code + * if( !MyEngineCreated() ) + * { + * CreateEngine(); + * } + * StartEngine(); + * @endcode + */ + virtual void Resume(TAiTransitionReason aReason) = 0; + + /** + * This method transits the plug-in to "Suspendend" state. + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timer, cancel outstanding asynchronous operations, etc. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @pre None + * @post Plugin suspends publishing data and free resources (timers etc). + * + * Short example what a typical suspend implementation does. + * @code + * DisableEngine(); + * @endcode + */ + virtual void Suspend(TAiTransitionReason aReason) = 0; + + /** + * This method transits the plug-in to "Idle" state. + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, the plug-in + * should unload its engines during backup operation. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @pre None + * @post Plugin stops publishing data and frees all possible resources. + * + * Short example what a typical stop implementation does. + * @code + * DestroyEngine(); + * @endcode + */ + virtual void Stop(TAiTransitionReason aReason) = 0; + + /** + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @pre None + * @post Plugin publishes its data to the subscribed observer. + * + * Short example what a typical subscribe implementation does and + * one alternative how observers are used. + * @code + * if( !ObserverAlreadyAdded( aObserver ) ) + * { + * iMyContentObservers.AppendL( aObserver ); + * } + * + * ... + * + * // Engine reports data changed + * + * const TDesC& data = iEngine->LatestData(); + * for( TInt i = 0; i < iMyContentObservers.Count(); ++i ) + * { + * iMyContentObservers[i].Publish( data ); + * } + * @endcode + */ + virtual void SubscribeL(MAiContentObserver& aObserver) = 0; + + /** + * Configures the plug-in. + * + * @param aSettings setting items defined in the UI definition. + * This plugin takes ownership of the + * MAiPluginSettings objects in the array. + * If this method leaves the caller will handle the cleanup. + * @pre None + * @post Plugin has set its state according to relevant settings. + * + * Short example how to read plugin settings. + * @code + * for( TInt i = 0; i < aSettings.Count(); ++i ) + * { + * MAiPluginSettingsItem& item = (aSettings[i])->AiPluginSettingsItem(); + * TInt32 value = 0; + * if( ParseInt( value, item.Value() ) != KErrNone ) + * { + * continue; + * } + * if( value < 0 ) + * { + * continue; // All our settings are counts, skip bad settings + * } + * if( item.Key() == EMySettingMaxUsers ) + * { + * iEngine->SetMaxUsers( value ); + * continue; + * } + * else if( item.Key() == EMySettingNumItems ) + * { + * iNumItems = value; + * continue; + * } + * } + * // We own the array so destroy it + * aSettings.ResetAndDestroy(); + * @endcode + */ + virtual void ConfigureL( RAiSettingsItemArray& aSettings) = 0; + + /** + * Returns interface extension. In S60 3.2 only event & property + * extensions are supported. See MAiEventHandlerExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @see MAiEventExtension + * @see MAiPropertyExtension + * @return the extension interface. Actual type depends on the passed aUid + * argument. + * + * Example on how to properly return an extension. + * @code + * if (aUid == KExtensionUidProperty) + * { + * return static_cast(this); + * } + * else if (aUid == KExtensionUidEventHandler) + * { + * return static_cast(this); + * } + * return NULL; // Requested extension not supported + * @endcode + */ + virtual TAny* Extension(TUid aUid) = 0; + +private: // data + /** An identifier used during destruction. */ + TUid iDestructKey; + }; + +inline CAiContentPublisher* CAiContentPublisher::NewL(TUid aImplUid) + { + TAny* ptr = REComSession::CreateImplementationL(aImplUid, + _FOFF(CAiContentPublisher, iDestructKey)); + + return reinterpret_cast (ptr); + } + +inline CAiContentPublisher* CAiContentPublisher::NewL(const TDesC8& aMime) + { + TEComResolverParams params; + params.SetDataType(aMime); + + TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidContentPlugin, + _FOFF(CAiContentPublisher, iDestructKey), params); + + return reinterpret_cast (ptr); + } + +inline CAiContentPublisher::~CAiContentPublisher() + { + REComSession::DestroyedImplementation(iDestructKey); + } + +#endif // C_AICONTENTPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisheruid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aicontentpublisheruid.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* 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: Resource headers for aicontentpublisher +* +*/ + + +#ifndef AICONTENTPUBLISHERUID_HRH +#define AICONTENTPUBLISHERUID_HRH + +/** + * Ecom interface uid for CAiContentPublisher. + * + * Example resource of a plugin that implements content publisher interface. + * @code + * #include + * #include + * + * #define MY_DLL_UID 0xFFEEDDCC + * #define MY_PLUGIN_IMPLEMENTATION_UID 0xBBAA9988 + * + * RESOURCE REGISTRY_INFO registry_info + * { + * resource_format_version = RESOURCE_FORMAT_VERSION_2; + * dll_uid = MY_DLL_UID; + * + * // Interface info array + * interfaces = + * { + * INTERFACE_INFO + * { + * // UID of the implemented interface + * interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + * + * implementations = + * { + * IMPLEMENTATION_INFO + * { + * implementation_uid = MY_PLUGIN_IMPLEMENTATION_UID; + * version_no = 1; + * display_name = "My plugin"; + * } + * }; + * } + * }; + * } + * @endcode + */ +#define AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER 0x102750ED + +#endif // AICONTENTPUBLISHERUID_HRH diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aidevicestatuscontentmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aidevicestatuscontentmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* 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: Device Status plug-in content model +* +*/ + + + +#ifndef AIDEVICESTATUSCONTENTMODEL_H +#define AIDEVICESTATUSCONTENTMODEL_H + +#include + +/** + * Content model for Device Status plug-in. + * This header defines which information Device Status publishes + */ + +// ================================= CONTENT =================================== + +//content item id's +enum TAiDeviceStatusContentIds + { + EAiDeviceStatusContentNetworkIdentity, + EAiDeviceStatusContentProfileName, + EAiDeviceStatusContentGeneralProfileName, + EAiDeviceStatusContentDate, + EAiDeviceStatusContentSilentIndicator, + EAiDeviceStatusContentTimedProfileIndicator, + EAiDeviceStatusContentSIMRegStatus, + EAiDeviceStatusContentNWStatus, + EAiDeviceStatusContentMCNIndicator, + EAiDeviceStatusContentVHZIndicator, + EAiDeviceStatusContentCUGIndicator, + EAiDeviceStatusContentGeneralIndicator, + EAiDeviceStatusContentVHZText, + EAiDeviceStatusContentCUGMCNIndicator + }; + + +//content item textual id's +const wchar_t KAiDeviceStatusContentNetworkIdentity_Cid[] = L"NetworkIdentity"; +const wchar_t KAiDeviceStatusContentProfileName_Cid[] = L"ProfileName"; +const wchar_t KAiDeviceStatusContentGeneralProfileName_Cid[] = L"GeneralProfileName"; +const wchar_t KAiDeviceStatusContentDate_Cid[] = L"Date"; +const wchar_t KAiDeviceStatusContentSilentIndicator_Cid[] = L"SilentIndicator"; +const wchar_t KAiDeviceStatusContentTimedProfileIndicator_Cid[] = L"TimedProfileIndicator"; +const wchar_t KAiDeviceStatusContentSIMRegStatus_Cid[] = L"SIMRegStatus"; +const wchar_t KAiDeviceStatusContentNWStatus_Cid[] = L"NWStatus"; +const wchar_t KAiDeviceStatusContentMCNIndicator_Cid[] = L"MCNIndicator"; +const wchar_t KAiDeviceStatusContentVHZIndicator_Cid[] = L"VHZIndicator"; +const wchar_t KAiDeviceStatusContentCUGIndicator_Cid[] = L"CUGIndicator"; +const wchar_t KAiDeviceStatusContentGeneralIndicator_Cid[] = L"GeneralIndicator"; +const wchar_t KAiDeviceStatusContentVHZText_Cid[] = L"VHZText"; +const wchar_t KAiDeviceStatusContentCUGMCNIndicator_Cid[] = L"CUGMCNIndicator"; + + +const char KAiDeviceStatusMimeTypeTextPlain[] = "text/plain"; + +/** +* Content what device status plugin publishes +*/ + +const TAiContentItem KAiDeviceStatusContent[] = + { + //Published data can be service provider name, offline profile, + //operator logo or anything related to network status + { EAiDeviceStatusContentNetworkIdentity, KAiDeviceStatusContentNetworkIdentity_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is name of the profile from profiles engine + { EAiDeviceStatusContentProfileName, KAiDeviceStatusContentProfileName_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is name of the general profile from profiles engine + { EAiDeviceStatusContentGeneralProfileName, KAiDeviceStatusContentGeneralProfileName_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is current date as a text. Formatted according to current locale + { EAiDeviceStatusContentDate, KAiDeviceStatusContentDate_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data silent indicator as a text + { EAiDeviceStatusContentSilentIndicator, KAiDeviceStatusContentSilentIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data timed profile indicator as a text + { EAiDeviceStatusContentTimedProfileIndicator, KAiDeviceStatusContentTimedProfileIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is resource id + { EAiDeviceStatusContentSIMRegStatus, KAiDeviceStatusContentSIMRegStatus_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is resource id + { EAiDeviceStatusContentNWStatus, KAiDeviceStatusContentNWStatus_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is MCN message + { EAiDeviceStatusContentMCNIndicator, KAiDeviceStatusContentMCNIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is VHZ name + { EAiDeviceStatusContentVHZIndicator, KAiDeviceStatusContentVHZIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is localized text, for example "Group 1" + { EAiDeviceStatusContentCUGIndicator, KAiDeviceStatusContentCUGIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data general indicator as a text + { EAiDeviceStatusContentGeneralIndicator, KAiDeviceStatusContentGeneralIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data VHZ text + { EAiDeviceStatusContentVHZText, KAiDeviceStatusContentVHZText_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is localized text, for example "Group 1" or MCN message + { EAiDeviceStatusContentCUGMCNIndicator, KAiDeviceStatusContentCUGMCNIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain } + }; + +const TInt KAiDeviceStatusContentCount = sizeof( KAiDeviceStatusContent ) / + sizeof( KAiDeviceStatusContent[0] ); + + + +//content item id's +enum TAiDeviceStatusResourceIds + { + EAiDeviceStatusResourceSIMRegFail, + EAiDeviceStatusResourceNWOk, + EAiDeviceStatusResourceNWLost + }; + +const wchar_t KAiDeviceStatusResourceSIMRegFail_Cid[] = L"SIMRegFail"; +const wchar_t KAiDeviceStatusResourceShowNWLost_Cid[] = L"NWLost"; + + +const TAiContentItem KAiDeviceStatusResources[] = +{ + //Published data is resource id + { EAiDeviceStatusResourceSIMRegFail, KAiDeviceStatusResourceSIMRegFail_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + { EAiDeviceStatusResourceNWLost, KAiDeviceStatusResourceShowNWLost_Cid, + KAiDeviceStatusMimeTypeTextPlain }, +}; + +const TInt KAiDeviceStatusResourceCount = sizeof( KAiDeviceStatusResources ) / + sizeof( KAiDeviceStatusResources[0] ); + + +#endif // AIDEVICESTATUSCONTENTMODEL_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiprofileplugincontentmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiprofileplugincontentmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Content model for profile plug-in. +* +*/ + + +#ifndef AIPROFILEPLUGINCONTENTMODEL_H +#define AIPROFILEPLUGINCONTENTMODEL_H + +#include +#include + +// AI Profile Plug-in ECOM implementation UID. +const TInt KImplUidProfilePlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; +const TUid KUidProfilePlugin = { KImplUidProfilePlugin }; + + +/** +* Default profile identifiers. Default profiles are those pre-installed in the phone: +* +* Id of General Profile: 0 +* Id of Silent Profile: 1 +* Id of Meeting Profile: 2 +* Id of Outdoor Profile: 3 +* Id of Pager Profile: 4 +* Id of OffLine Profile: 5 //Use this only if Off-Line Profile is supported +* Id of Drive Profile: 6 //Use this only if Drive Profile is supported +*/ + + +// ================================= CONTENT =================================== + +/** + * Content Ids. + */ +enum TAiProfileContentIds +{ + EAiProfileContentActiveProfileName = 1, + EAiProfileContentProfileName, + EAiProfileContentSwapProfileName, + EAiProfileActiveProfileSilentChar, + EAiProfileActiveProfileIcon, + EAiProfileActiveProfileNameAndIconChar +}; + +/** + * Content that the plug-in will publish. + */ +const TAiContentItem KAiProfileContent[] = +{ + // Active Profile name as plain text. + { EAiProfileContentActiveProfileName, L"ActiveProfileName", "text/plain" } + , + // Profile names as plain text. + { EAiProfileContentProfileName, L"ProfileName", "text/plain" } + , + // Swap profile name as plain text. + { EAiProfileContentSwapProfileName, L"SwapProfileName", "text/plain" } + , + // Active Profile Silent indicator as plain text. + { EAiProfileActiveProfileSilentChar, L"ActiveProfileSilentChar", "text/plain" } + , + // Active Profile Silent indicator as image. + { EAiProfileActiveProfileIcon, L"ActiveProfileIcon", KAiContentTypeBitmap } + , + // Active Profile name and PUA char + { EAiProfileActiveProfileNameAndIconChar, L"ActiveProfileNameAndIconChar", "text/plain" } +}; +const TInt KAiProfileContentCount = sizeof( KAiProfileContent ) / + sizeof( KAiProfileContent[0] ); +// ================================ RESOURCES ================================== + +/** + * Resource Ids. + */ +enum TAiProfileResourceIds +{ + EAiProfileActiveProfileSilentIconResource = 1, + EAiProfileActiveProfileGeneralIconResource, + EAiProfileActiveProfileTimedIconResource +}; + +/** + * Resources that the plug-in will publish. + */ +const TAiContentItem KAiProfileResources[] = +{ + // Active Profile Silent indicator as image. + { EAiProfileActiveProfileSilentIconResource, L"ActiveProfileSilentIconResource", "image/*" }, + { EAiProfileActiveProfileGeneralIconResource, L"ActiveProfileGeneralIconResource", "image/*" }, + { EAiProfileActiveProfileTimedIconResource, L"ActiveProfileTimedIconResource", "image/*" } + +}; + +// ============================ SERVICES (Events) ============================== + +/** + * Event Ids. + */ +enum TAiProfileEventIds +{ + EAiProfileEventSwitchByIndex, + EAiProfileEventSwitchByName, + EAiProfileEventSwap, + EAiProfileEditActive +}; + +/** + * Services that the plug-in can perform. + */ +const TAiContentItem KAiProfileEvents[] = +{ + // Switches a profile by its index that is delivered as an integer. + // Usage: Profile/SwitchProfileByIndex(1) + { EAiProfileEventSwitchByIndex, L"SwitchProfileByIndex", "int" } + , + // Switches a profile by its value that is delivered in a descriptor. + // Usage: Profile/SwitchProfileByName(Silent) + { EAiProfileEventSwitchByName, L"SwitchProfileByName", "str" } + , + // Swap a profile from active profile to profile X and from profile X + // to General profile. + // Usage: Profile/SwapProfile(1) + { EAiProfileEventSwap, L"SwapProfile", "str" }, + + // Open the active profile directly to edit mode + // in Profiles application + { EAiProfileEditActive, L"EditActiveProfile", "str" } + + +}; + +#endif // AIPROFILEPLUGINCONTENTMODEL_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiprofilepluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiprofilepluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2005-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: UIDs for the Active Idle subsystem components. +* +*/ + + +#ifndef AIPROFILEPLUGINUIDS_HRH +#define AIPROFILEPLUGINUIDS_HRH + +#include + +/** + * Ecom dll uid for AI Profile plug-in. + */ +#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_PROFILEPLUGIN 0x10275100 + +/** + * Ecom implementation uid for AI Profile plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN 0x10275101 + + +#endif //AIPROFILEPLUGINUIDS_HRH diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiscutappuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiscutappuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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: App uids for shortcut plug-in +* +*/ + + +#ifndef AISCUTAPPUIDS_HRH +#define AISCUTAPPUIDS_HRH + +#define KScutExchangeMailUidValue 0x10282480 // +#define KScutFlashPlayerUidValue 0x101fd693 // +#define KScutOperatorMenuUidValue 0x10008D5E // !! +#define KScutVideoServicesUidValue 0x10281893 // !! +#define KScutVoiceDialUidValue 0x101F8543 // aivoicedialui + +#define KScutAmsEditorUidValue 0x1020745A // +#define KScutEmailEditorUidValue 0x101F4CD6 // +#define KScutMmsEditorUidValue 0x100058DE // +#define KScutPostcardEditorUidValue 0x10207247 // +#define KScutUnifiedEditorUidValue 0x102072D8 // +#define KScutSyncMlEmailUidValue 0x101F7C5C // + +#define KScutAboutUidValue 0x10005A22 // +#define KScutApplicationManagerUidValue 0x101F8512 // +#define KScutApplicationShellUidValue 0x101F4CD2 // +#define KScutBluetoothUidValue 0x10005951 // +#define KScutBrowserUidValue 0x10008D39 // +#define KScutCalculatorUidValue 0x10005902 // +#define KScutCalendarUidValue 0x10005901 // +#define KScutCamcorderUidValue 0x101F857A // +#define KScutChineseDictionaryUidValue 0x101F9CFE // +#define KScutClockUidValue 0x10005903 // +#define KScutConnectionManagerUidValue 0x101F84D0 // +#define KScutConverterUidValue 0x101F4668 // +#define KScutDiallerUidValue 0x100058B3 // +#define KScutDRMRightsManagerUidValue 0x101F85C7 // +#define KScutDeviceManagerUidValue 0x101F6DE5 // +#define KScutFMRadioUidValue 0x10207A89 // +#define KScutFMTXRadioUidValue 0x10282BEF // +#define KScutFaxModemUidValue 0x1000594E // +#define KScutFileManagerUidValue 0x101F84EB // +#define KScutGeneralSettingsUidValue 0x100058EC // +#define KScutControlPanelUidValue 0 // not yet! +#define KScutHelpUidValue 0x10005234 // +#define KScutIRUidValue 0x1000594D // +#define KScutInstantMessagingUidValue 0x101F4673 // +#define KScutLandmarksUidValue 0x101F85A2 // +#define KScutLogsUidValue 0x101F4CD5 // +#define KScutMediaGallery2UidValue 0x101F8599 // +#define KScutMediaPlayerUidValue 0x200159B2 // +#define KScutMemoryCardUidValue 0x101F4666 // +#define KScutMessagingCenterUidValue 0x100058C5 // +#define KScutMusicPlayerUidValue 0x102072C3 // +#define KScutNavigatorUidValue 0x101F85A0 // +#define KScutNotepadUidValue 0x10005907 // +#define KScutPersonalisationUidValue 0x10005A32 // +#define KScutPhoneUidValue 0x100058B3 // +#define KScutPhonebookUidValue 0x101F4CCE // +#define KScutPocUidValue 0x101FD63D // +#define KScutProfilesUidValue 0x100058F8 // +#define KScutSatUiUidValue 0x101F4CE0 // +#define KScutSearchUidValue 0x10282411 // +#define KScutSmlSyncUidValue 0x101F6DE4 // +#define KScutSpeedDialUidValue 0x1000590A // +#define KScutUSBUidValue 0x102068E2 // +#define KScutUserDictionaryUidValue 0x101F8645 // +#define KScutVoIPUidValue 0x10202871 // +#define KScutVoiceCommandsUidValue 0x101F8555 // +#define KScutVoiceMailboxUidValue 0x100058F5 // +#define KScutVoiceRecorderUidValue 0x100058CA // + +#define KScutInstallationViewIdValue 0x10283321 +#define KScutChangeThemeViewIdValue 0x102750A7 +#define KScutDiallerViewIdValue 0x10282D81 +#define KScutRemoteMailboxViewIdValue 0x2 +#define KScutConnectivityStatusViewIdValue 0x10207250 + +#endif // AISCUTAPPUIDS_HRH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiscutcontentmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiscutcontentmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,242 @@ +/* +* 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: Content model for shortcut plug-in. +* +*/ + + +#ifndef AISCUTCONTENTMODEL_H +#define AISCUTCONTENTMODEL_H + +#include + +#include + +// AI Shortcut Plug-in ECOM implementation UID. +const TInt KImplUidScutPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; +const TUid KUidScutPlugin = { KImplUidScutPlugin }; + +// ================================= CONTENT =================================== + +/** + * Content Ids. + */ +enum TAiScutContentIds +{ + EAiScutContentShortcutIcon, + EAiScutContentShortcutCaption, + EAiScutContentShortcutShortCaption, + EAiScutContentShortcutMskCaption, + EAiScutContentShortcutSkCaption, + EAiScutContentShortcutSkIcon, + EAiScutContentShortcutToolbarCaption, + EAiScutContentShortcutToolbarIcon, + EAiScutContentPopupTextCaptionLine, + EAiScutContentPopupTextFirstLine, + EAiScutContentPopupTextSecondLine, + EAiScutContentPopupTextThirdLine +}; + +/** + * Content that the plug-in will publish. + */ +const TAiContentItem KAiScutContent[] = +{ + // Shortcut icon as CFbsBitmap. + { EAiScutContentShortcutIcon, L"ShortcutIcon", KAiContentTypeBitmap } + , + // Shortcut caption as plain text (used for long application titles). + { EAiScutContentShortcutCaption, L"ShortcutCaption", "text/plain" } + , + // Shortcut short caption as plain text (used for short application titles in softkeys). + { EAiScutContentShortcutShortCaption, L"ShortcutShortCaption", "text/plain" } + , + // Shortcut msk caption as plain text (used for short application titles in MSK). + { EAiScutContentShortcutMskCaption, L"ShortcutMskCaption", "text/plain" } + , + // Shortcut sk caption as plain text (used for short application titles in SK). + { EAiScutContentShortcutSkCaption, L"ShortcutSkCaption", "text/plain" } + , + // Shortcut sk icon as bitmap (used for application icons in SK). + { EAiScutContentShortcutSkIcon, L"ShortcutSkIcon", KAiContentTypeBitmap } + , + // Shortcut sk caption as plain text (used for short application titles in SK). + { EAiScutContentShortcutToolbarCaption, L"ShortcutToolbarCaption", "text/plain" } + , + // Shortcut toolbar icon as bitmap (used for application icons in toolbar). + { EAiScutContentShortcutToolbarIcon, L"ShortcutToolbarIcon", KAiContentTypeBitmap } + , + // Caption line of Popup as plain text. + { EAiScutContentPopupTextCaptionLine, L"ShortcutPopupCaptionLine", "text/plain" } + , + // 1st actual line of Popup as plain text. + { EAiScutContentPopupTextFirstLine, L"ShortcutPopup1stLine", "text/plain" } + , + // 2nd actual line of Popupn as plain text. + { EAiScutContentPopupTextSecondLine, L"ShortcutPopup2ndLine", "text/plain" } + , + // 3rd actual line of Popup as plain text. + { EAiScutContentPopupTextThirdLine, L"ShortcutPopup3rdLine", "text/plain" } +}; + +const TInt KAiScutContentCount = sizeof( KAiScutContent ) / + sizeof( KAiScutContent[0] ); + + +// ================================ RESOURCES ================================== + +/** + * Resource Ids. + */ +enum TAiScutPluginResourceIds +{ + EAiScutResourceDefaultIcon, + EAiScutResourceEmptyIcon, + EAiScutResourceBackCaption, + EAiScutResourceEmptyCaption, + EAiScutResourceNewMsgCaption, + EAiScutResourceNewEmailCaption, + EAiScutResourceNewSyncMLMailCaption, + EAiScutResourceNewPostcardCaption, + EAiScutResourceNewAudioMsgCaption, + EAiScutResourceSelectMsgTypeCaption, + EAiScutResourceChangeThemeCaption, + EAiScutResourceNewMsgShortCaption, + EAiScutResourceNewEmailShortCaption, + EAiScutResourceNewSyncMLMailShortCaption, + EAiScutResourceNewPostcardShortCaption, + EAiScutResourceNewAudioMsgShortCaption, + EAiScutResourceSelectMsgTypeShortCaption, + EAiScutResourceChangeThemeShortCaption +}; + +/** + * Resources that the plug-in will publish. + */ +const TAiContentItem KAiScutResources[] = +{ + // Default shortcut icon. + { EAiScutResourceDefaultIcon, L"DefaultIcon", "image/*" } + , + // Empty shortcut icon, used when shortcut target is unknown. + { EAiScutResourceEmptyIcon, L"EmptyIcon", "image/*" } + , + // Localizable caption for the back shortcut + { EAiScutResourceBackCaption, L"BackCaption", "text/plain" } + , + // Localizable caption for the empty shortcut. + { EAiScutResourceEmptyCaption, L"EmptyCaption", "text/plain" } + , + // Localizable caption for the "new message" shortcut. + { EAiScutResourceNewMsgCaption, L"NewMessageCaption", "text/plain" } + , + // Localizable caption for the "new email" shortcut. + { EAiScutResourceNewEmailCaption, L"NewEmailCaption", "text/plain" } + , + // Localizable caption for the "new syncml mail" shortcut. + { EAiScutResourceNewSyncMLMailCaption, L"NewSyncMLMailCaption", "text/plain" } + , + // Localizable caption for the "new postcard" shortcut. + { EAiScutResourceNewPostcardCaption, L"NewPostcardCaption", "text/plain" } + , + // Localizable caption for the "new audio message" shortcut. + { EAiScutResourceNewAudioMsgCaption, L"NewAudioMsgCaption", "text/plain" } + , + // Localizable caption for the "select message type" shortcut. + { EAiScutResourceSelectMsgTypeCaption, L"SelectMsgTypeCaption", "text/plain" } + , + // Localizable caption for the "change theme" shortcut. + { EAiScutResourceChangeThemeCaption, L"ChangeThemeCaption", "text/plain" } + , + // Localizable short caption for the "new message" shortcut. + { EAiScutResourceNewMsgShortCaption, L"NewMessageShortCaption", "text/plain" } + , + // Localizable short caption for the "new email" shortcut. + { EAiScutResourceNewEmailShortCaption, L"NewEmailShortCaption", "text/plain" } + , + // Localizable short caption for the "new syncml mail" shortcut. + { EAiScutResourceNewSyncMLMailShortCaption, L"NewSyncMLMailShortCaption", "text/plain" } + , + // Localizable short caption for the "new postcard" shortcut. + { EAiScutResourceNewPostcardShortCaption, L"NewPostcardShortCaption", "text/plain" } + , + // Localizable short caption for the "new audio message" shortcut. + { EAiScutResourceNewAudioMsgShortCaption, L"NewAudioMsgShortCaption", "text/plain" } + , + // Localizable short caption for the "new message" shortcut. + { EAiScutResourceSelectMsgTypeShortCaption, L"SelectMsgTypeShortCaption", "text/plain" } + , + // Localizable short caption for the "change theme" shortcut. + { EAiScutResourceChangeThemeShortCaption, L"ChangeThemeShortCaption", "text/plain" } + +}; + +const TInt KAiScutResourceCount = sizeof( KAiScutResources ) / + sizeof( KAiScutResources[0] ); + + +// ============================ SERVICES (Events) ============================== + +/** + * Event Ids. + */ +enum TAiScutEventIds +{ + EAiScutEventLaunchByIndex, + EAiScutEventLaunchByValue, + EAiScutEventShowSettings, + EAiScutEventShowSetting, + EAiScutEventLaunchFastswap, + EAiScutEventLaunchByIndexAlternate, + EAiScutEventLoseFocus, + EAiScutEventGainFocus +}; + +/** + * Services that the plug-in can perform. + */ +const TAiContentItem KAiScutEvents[] = +{ + // Launches a shortcut by its index that is delivered as an integer. + { EAiScutEventLaunchByIndex, L"LaunchByIndex", "int" } + , + // Launches a shortcut by its value that is delivered in a descriptor. + { EAiScutEventLaunchByValue, L"LaunchByValue", "str" } + , + // Shows the shortcut plug-in settings dialog. + { EAiScutEventShowSettings, L"ShowSettings", "" } + , + // Shows the shortcut plug-in setting. + { EAiScutEventShowSetting, L"ShowSetting", "" } + , + // Opens the fast swap window + { EAiScutEventLaunchFastswap, L"LaunchFastSwap", "" } + , + // Special launching. If the index points to appshell + // fastswap is opened. Other special cases can be added to the engine + { EAiScutEventLaunchByIndexAlternate, L"LaunchByIndexAlternate", "int" } + , + // Used when we move out of a SC button (Needed for Popup-functionality). + // index of shortcut is delivered as an integer + { EAiScutEventLoseFocus, L"LoseFocus", "int" } + , + // Used when we move into a SC button (Needed for Popup-functionality). + // index of shortcut is delivered as an integer. + { EAiScutEventGainFocus, L"GainFocus", "int" } + +}; + +#endif // AISCUTCONTENTMODEL_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiscutdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiscutdefs.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,158 @@ +/* +* 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: Shortcut plug-in definitions. +* +*/ + + +#ifndef AISCUTDEFS_H +#define AISCUTDEFS_H + +#include +#include +#include "aiscutappuids.hrh" + +// ============================================================================= +// =============== UIDs and view ids to external applications ================== +// ============================================================================= + +// Active Idle UID. +const TUid KScutActiveIdleUid = { 0x102750F0 }; + +// Shortcut Settings DLL UID. +const TUid KScutSettingsDllUid = { AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN }; + +// Keypad lock UID +const TUid KScutKeyLockUid = { 0x10000000 }; + +// Web Browser application UID. +const TUid KScutBrowserUid = { KScutBrowserUidValue }; + +// General Settings application UID. +const TUid KScutGeneralSettingsUid = { KScutGeneralSettingsUidValue }; + +// Message Centre application UID. +const TUid KScutMessagingUid = { KScutMessagingCenterUidValue }; + +// Remote mailbox view id. Message list view id (0x2) defined in MceIds.hrh. +const TUid KScutRemoteMailboxViewId = { KScutRemoteMailboxViewIdValue }; + +// Personalisation application UID. +const TUid KScutPersonalisationUid = { KScutPersonalisationUidValue }; + +// Change-Theme view id in the Personalisation application. +const TUid KScutChangeThemeViewId = { KScutChangeThemeViewIdValue }; + +// Installation view id in the Control Panel. +const TUid KScutInstallationViewId = { KScutInstallationViewIdValue }; + +// Connectivity view id in the Control Panel. +const TUid KScutConnectivityViewId = { KScutConnectivityStatusViewIdValue }; +// Voice dialer UID +const TUid KScutVoiceDialUid = { KScutVoiceDialUidValue }; + +// Logs UID +const TUid KScutLogsUid = { KScutLogsUidValue }; + +// AppShell UID +const TUid KScutAppShellUid = { KScutApplicationShellUidValue }; + +// Telephony UID +const TUid KScutDiallerUid = { KScutDiallerUidValue }; + +// Postcard editor UID +const TUid KScutPostcardEditorUid = { KScutPostcardEditorUidValue }; + +// On-Screen Dialler view id in the Telephony application. +const TUid KScutDiallerViewId = { KScutDiallerViewIdValue }; + +// On-Screen Dialler view command +const TUid KScutDiallerViewCommand = { 0x1 }; +// AppMngr +const TUid KScutAppMngrUid = { 0x101F8512 }; + +// EasyVoip Application UID +const TUid KScutEasyVoIPApplicationUid = { 0x1020E566 }; + +// VoIP launcher UID +const TUid KScutVoIPLauncherUid = { 0x10275424 }; + +// EasyVoip Central Repository UID +const TUid KUidEasyVoIPRepository = { 0x1020E593 }; + +// EasyVoIP shortcut startup flag +const TUint32 KEasyVoIPShortcutStartup = 0x00000004; + +// Logs views +_LIT8( KLogsMissedCallsView , "missed" ); +_LIT8( KLogsDialledCallsView , "dialled" ); +_LIT8( KLogsReceivedCallsView , "received" ); +_LIT8( KLogsMainView , "counters" ); + +// Softkeys +_LIT( KLeftSoftkey , "0x01000100" ); +_LIT( KRightSoftkey , "0x01000101" ); + +const TUint32 KLeftSoftkeyId = { 0x01000100 }; +const TUint32 KRightSoftkeyId = { 0x01000101 }; + +/** + * Bit fields for content items that the observers support. + */ +enum TSupportedContentItems +{ + ESupportIcon = 0x1, + ESupportCaption = 0x2, + ESupportShortCaption = 0x4 +}; + +class CAiScutShortcut; +class CAiScutShortcutInfo; +typedef RPointerArray RAiShortcutArray; +typedef RPointerArray RAiShortcutInfoArray; + +/** + * Definitions for application titles. + */ +enum TAiScutAppTitleType +{ + EAiScutLongTitle, + EAiScutShortTitle, + EAiScutSkeyTitle, + EAiScutMskTitle +}; + +class TAiScutAppTitleEntry +{ +public: + TUid iAppUid; + TUid iViewId; + HBufC* iLongTitle; + HBufC* iShortTitle; + HBufC* iSkeyTitle; + HBufC* iMskTitle; +}; + +/** + * Localized send ui resource for error note. + */ +_LIT( KSendNormResource, "sendnorm.rsc" ); + +/** + * Shortcut menu strings + */ +_LIT( KSettings, "widgetsettings" ); +#endif // AISCUTDEFS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_plugin_management_api/inc/aiscutuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_plugin_management_api/inc/aiscutuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Uids for shortcut plug-in +* +*/ + + +#ifndef AISCUTUIDS_HRH +#define AISCUTUIDS_HRH + +#include + +/** + * Ecom dll uid for AI Shortcut plug-in. + */ +#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN 0x102750F9 + +/** + * Ecom implementation uid for AI Shortcut plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN 0x102750FA + +/** + * Ecom dll uid for AI Shortcut Settings plug-in. + */ +#define AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN 0x102750FB + +/** + * Ecom implementation uid for AI Shortcut Settings plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN 0x102750FC + +#endif // AISCUTUIDS_HRH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_shortcut_command_api/ai_shortcut_command_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_shortcut_command_api/ai_shortcut_command_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + + AI Shortcut Command API + Gives possibility to execute shortcuts defined by localapp URL + c++ + activeidle + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_shortcut_command_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_shortcut_command_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Shortcut Command API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/aiscutplugindomaincrkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutplugindomaincrkeys.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_shortcut_command_api/inc/aiscutplugindomaincrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_shortcut_command_api/inc/aiscutplugindomaincrkeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,127 @@ +/* +* 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: Shortcut Plug-in CenRep keys. +* +*/ + + +#ifndef AISCUTPLUGINDOMAINCRKEYS_H +#define AISCUTPLUGINDOMAINCRKEYS_H + +/** + * Uid for central repository file that holds shortcut plug-in settings. + */ +const TUid KCRUidShortcutItems = { 0x10275104 }; + +/** + * Flag bit 31 + * Theme-default shortcuts. 1000 0000 0000 0000 0000 0000 0000 0000 + */ +const TUint32 KScutFlagBitThemeDefault = 0x80000000; + +/** + * Mask to unset the theme-default flag. 0111 1111 1111 1111 1111 1111 1111 1111 + */ +const TUint32 KScutBitMaskThemeDefault = 0x7FFFFFFF; + +/** + * Flag bit 30 + * Locked shortcuts. 0100 0000 0000 0000 0000 0000 0000 0000 + */ +const TUint32 KScutFlagBitLocked = 0x40000000; + +/** + * Mask to unset the locked flag. 1011 1111 1111 1111 1111 1111 1111 1111 + */ +const TUint32 KScutBitMaskLocked = 0xBFFFFFFF; + +/** + * Flag bit 24 + * Optionally visible shortcut (softkeys). 0000 0001 0000 0000 0000 0000 0000 0000 + */ +const TUint32 KScutFlagBitOptionallyVisible = 0x01000000; + +/** + * Flag bit 25 + * Non-visible shortcut (key press). 0000 0010 0000 0000 0000 0000 0000 0000 + */ +const TUint32 KScutFlagBitNonVisible = 0x02000000; + +/** +* Flag bits 26-31 //0000 0001 0000 0000 0000 0001 0000 0000 +* Icon ovverides 0010 0000 0000 0000 0000 0000 0000 0000 +*/ +const TUint32 KScutFlagBitIconOverride = 0x20000000; + +/** + * Flag bit for toolbar shortcuts + */ +const TUint32 KScutFlagBitToolbarShortcut = 0x10000000; + +/** + * Mask for additional settings. + */ +const TUint32 KScutMaskAdditionalSetting = 0xFFFFFFFF ^ (KScutFlagBitIconOverride + KScutFlagBitToolbarShortcut); + +/** + * Partial key for theme-default shortcut ids. + */ +const TUint32 KScutCenRepKeyThemeDefault = KScutFlagBitThemeDefault; + +/** + * Partial key for user defined shortcut ids. + */ +const TUint32 KScutCenRepKeyUserDefined = 0x0; + +/** + * Mask used to separate theme-default ids from user defined ids. + */ +const TUint32 KScutCenRepKeyMask = KScutFlagBitThemeDefault; + +/** + * Shortcut count for the active theme + */ +const TUint32 KScutCenRepShorcutCount = 0xFFFFFFF0; + +/** + * A key which contains a space-separated list of application UIDs + * identifying the applications that should not show the xSP tip message. + */ +const TUint32 KAIxSPNoTipAppsList = 0x0001FFFF; + +/** + * Shortcut plug-in keycodes for optionally visible shortcuts. + */ +enum TAiScutKeyCodes +{ + // Navigation keys. + EAiScutScrollKeyLeft = 0x0000, + EAiScutScrollKeyRight = 0x0001, + EAiScutScrollKeyUp = 0x0002, + EAiScutScrollKeyDown = 0x0003, + EAiScutSelectionKey = 0x0004, + + // Soft keys. + EAiScutSoftKeyLeft = 0x0100, + EAiScutSoftKeyRight = 0x0101, + + // Touch toolbar + EAiScutToolbarFirst = 0x1000, + EAiScutToolbarSecond = 0x1001, + EAiScutToolbarThird = 0x1002 +}; + +#endif // AISCUTPLUGINDOMAINCRKEYS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/ai_utilities_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/ai_utilities_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + AI Utilities API + Provides utility services common for all AI plug-ins such as string parsing, content model itterator, customizable setting management, publish and subscribe keys observer. + c++ + activeidle + + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Utilities API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/aipspropertyobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(aipspropertyobserver.h) +../inc/aistrparser.h MW_LAYER_PLATFORM_EXPORT_PATH(aistrparser.h) +../inc/aiplugintool.h MW_LAYER_PLATFORM_EXPORT_PATH(aiplugintool.h) +../inc/aiutility.h MW_LAYER_PLATFORM_EXPORT_PATH(aiutility.h) +../inc/aipluginsettings.h MW_LAYER_PLATFORM_EXPORT_PATH(aipluginsettings.h) +../inc/aistrcnv.h MW_LAYER_PLATFORM_EXPORT_PATH(aistrcnv.h) +../inc/contentprioritymap.h MW_LAYER_PLATFORM_EXPORT_PATH(contentprioritymap.h) + +#ifdef __COVER_DISPLAY +../inc/aisecondarydisplayapi.h MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/aisecondarydisplayapi.h) +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aipluginsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aipluginsettings.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,312 @@ +/* +* 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: +* +*/ + + +#ifndef M_AIPLUGINSETTINGS_H +#define M_AIPLUGINSETTINGS_H + +#include + +const TInt KMaxSettingsValueStringLength = 1024; + +class MAiPluginSettings; +class MAiPluginSettingsItem; +class MAiPluginContentItem; +class MAiPluginConfigurationItem; + +typedef RPointerArray RAiSettingsItemArray; + +enum TAiPluginItem + { + EAiPluginSettingsItem = 0, + EAiPluginContentItem, + EAiPluginConfigurationItem + }; + +/** + * Active Idle framework settings storing interface. + * + * @since S60 3.2 + */ +class MAiPluginSettingsStorer + { +public: + /** + * Saves setting item value identified by key to settings store. + * + * @param aKey setting item key. + * @param aValue setting item value. + */ + virtual void SaveL(TInt32 aKey, const TDesC& aValue) = 0; + + /** + * Reads setting item value identified by key from settings store. + * + * @param aKey setting item key. + * @param aValue received setting item value. + */ + virtual void ReadL(TInt32 aKey, TDes& aValue) = 0; + + }; + +/** + * Active Idle framework settings access interface. + * + * @since S60 3.2 + */ +class MAiPluginSettings + { +public: + /** + * Returns the settings item. + */ + virtual MAiPluginSettingsItem& AiPluginSettingsItem() = 0; + + virtual ~MAiPluginSettings() { } + + virtual TInt AiPluginItemType() = 0; + + virtual MAiPluginContentItem& AiPluginContentItem() = 0; + + virtual MAiPluginConfigurationItem& AiPluginConfigurationItem() = 0; + + }; + +/** + * Active Idle framework settings item interface. + * + * @since S60 3.2 + */ +class MAiPluginSettingsItem + { +public: + + /** + * Get a pointer to the descriptor value of the setting. + * + * @return returns the value of the setting item. + * + * @since S60 3.2 + */ + virtual TPtrC Value() = 0; + + /** + * Sets the setting value. + * + * @param aValue the descriptor value for the Setting. + * @param aSaveToStore (this parameter is ignored) + * + * @since S60 3.2 + */ + virtual void SetValueL(const TDesC& aValue, TBool aSaveToStore = ETrue) = 0; + + /** + * Get publisher uid this setting item belongs to. + * + * @return publisher uid. + * + * @since S60 3.2 + */ + virtual const TUid& PublisherId() const = 0; + + /** + * Set publisher uid this setting item belongs to. + * + * @param aUid publisher uid. + * + * @since S60 3.2 + */ + virtual void SetPublisherId(const TUid& aUid) = 0; + + /** + * Get setting item key. + * + * @return key value. + * + * @since S60 3.2 + */ + virtual TInt32 Key() const = 0; + + /** + * Set setting item key. + * + * @param aKey setting item key. + * + * @since S60 3.2 + */ + virtual void SetKey(TInt32 aKey) = 0; + + /** + * Set storer for this setting item. + * + * @param aStorer pointer to instance of storer interface. + * + * @since S60 3.2 + */ + virtual void SetStorer(MAiPluginSettingsStorer* aStorer) = 0; + + /** + * Reads this setting item value from settings store. + * + * @since S60 3.2 + */ + virtual void ReadFromStoreL() = 0; + + /** + * Saves this setting item value to settings store. + * + * @since S60 3.2 + */ + virtual void SaveToStoreL() = 0; + +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiPluginSettingsItem() { } + + }; + + +/** + * Active Idle framework dynamic content model item interface. + * + * @since S60 5.0 + */ +class MAiPluginContentItem + { +public: + + /** + * Get a pointer to the descriptor name of the content item. + * + * @return returns the value of the content item. + * + * @since S60 5.0 + */ + virtual TPtrC Name() = 0; + + /** + * Sets the content item name. + * + * @param aName the descriptor name for the content item. + * + * @since S60 5.0 + */ + virtual void SetNameL(const TDesC& aName) = 0; + + /** + * Get a pointer to the content item type. + * + * @return returns content item type + * + * @since S60 5.0 + */ + virtual TPtrC Type() = 0; + + /** + * Sets the type of the content item. + * + * @param aType + * + * @since S60 5.0 + */ + virtual void SetTypeL(const TDesC& aType) = 0; + +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiPluginContentItem() { } + }; + + +/** + * Active Idle framework dynamic content source configuration interface. + * + * @since S60 5.0 + */ +class MAiPluginConfigurationItem + { +public: + + /** + * Get a pointer to the configuration item owner. + * + * @return returns configuration item type + * + * @since S60 5.0 + */ + virtual TPtrC Owner() = 0; + + /** + * Sets the owner of the configuration item. + * + * @param aOwner + * + * @since S60 5.0 + */ + virtual void SetOwnerL( const TDesC& aOwner ) = 0; + + /** + * Get a pointer to the descriptor name of the configuration item. + * + * @return returns the name of the configuration item. + * + * @since S60 5.0 + */ + virtual TPtrC Name() = 0; + + /** + * Sets the configuration item name. + * + * @param aName the descriptor name for the configuration item. + * + * @since S60 5.0 + */ + virtual void SetNameL( const TDesC& aName ) = 0; + + /** + * Get a pointer to the configuration item value. + * + * @return returns configuration item value + * + * @since S60 5.0 + */ + virtual TPtrC Value() = 0; + + /** + * Sets the value of the configuration item. + * + * @param aValue + * + * @since S60 5.0 + */ + virtual void SetValueL( const TDesC& aValue ) = 0; + +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiPluginConfigurationItem() { } + }; + +#endif // M_AIPLUGINSETTINGS_H + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aiplugintool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aiplugintool.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,105 @@ +/* +* 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: +* +*/ + + +#ifndef M_AIPLUGINTOOL_H +#define M_AIPLUGINTOOL_H + +#include +#include + +class TAiPublisherInfo; +class CAiContentPublisher; +class MAiContentItemIterator; +class MAiPropertyExtension; +class MAiEventHandlerExtension; + +/** +* Plugin tool. +* +* @since S60 3.2 +*/ +class MAiPluginTool + { + +public: + + /** + * Get the publisher info of the passed publisher. + * + * @since S60 3.2 + * @param reference to content publisher + * @return pointer to publisher info + */ + virtual const TAiPublisherInfo* PublisherInfoL( + CAiContentPublisher& aContentPublisher ) = 0; + + /** + * Get the content item iterator for the passed publisher. + * + * @param reference to content publisher + * @param content type indication + * @return pointer to content iterator + */ + virtual MAiContentItemIterator* ContentItemIteratorL( + CAiContentPublisher& aContentPublisher, + TInt aContentType = EAiPublisherContent ) = 0; + + + /** + * Get the property extension for passed publisher. + * + * @param reference to content publisher + * @return property extension pointer + */ + virtual MAiPropertyExtension* PropertyExt( + CAiContentPublisher& aContentPublisher ) = 0; + + /** + * Get the event handler extension for passed publisher. + * + * @param reference to content publisher + * @return event handler extension pointer + */ + virtual MAiEventHandlerExtension* EventHandlerExt( + CAiContentPublisher& aContentPublisher ) = 0; + + /** + * Release the tool. + */ + virtual void Release() = 0; + +protected: + + MAiPluginTool() { } + + }; + +inline void Release( MAiPluginTool* aSelf ) + { + if ( aSelf ) + { + aSelf->Release(); + } + } + +#endif // M_AIPLUGINTOOL_H + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aipspropertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aipspropertyobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* 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: Publish and subscribe parameter observer implementation. +* +*/ + + +#ifndef MAIPSPROPERTYOBSERVER_H +#define MAIPSPROPERTYOBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* It is the interface for handling property change events. +* +* @since S60 3.2 +*/ +class MAiPSPropertyObserver + { + public: + + /** + * Get the current value of the key. + * + * @since S60 3.2 + * @param aValue refrerence to an integer value of key + * @return integer value of the error. + */ + virtual TInt Get( TInt& aValue) = 0; + + /** + * Get the current value of the key. + * + * @since S60 3.2 + * @param aString reference to an 8-bit descriptor of the key + * @return integer value of the error. + */ + virtual TInt Get( TDes8& aString ) = 0; + + /** + * Get the current value of the key. + * + * @since S60 3.2 + * @param aString reference to an 16-bit descriptor of the key + * @return integer value of the error. + */ + virtual TInt Get( TDes16& aString ) = 0; + + /** + * Release the observer + */ + virtual void Release() = 0; + + protected: + ~MAiPSPropertyObserver() { } + }; + +/** + * Helper for calling MAiPSPropertyObserver::Release() with NULL checking. + */ +inline void Release(MAiPSPropertyObserver* obj) + { + if (obj) + { + obj->Release(); + } + } + +#endif // MAIPSPROPERTYOBSERVER_H + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aisecondarydisplayapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aisecondarydisplayapi.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 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: This file contains note definitions for Cover UI sync +* +*/ + + +#ifndef AISECONDARYDISPLAYAPI_HRH +#define AISECONDARYDISPLAYAPI_HRH + +// CONSTANTS +const TUid KAICategory = { 0x102750F3 }; + +// DATA TYPES + +// Enumerates dialogs +enum TAiDialogIndex + { + EAiNoNote = 0, + EAiSimRegistrationFailed + }; + +#endif // AISECONDARYDISPLAYAPI_HRH + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aistrcnv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aistrcnv.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 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: String conversion utility functions +* +*/ + + +#ifndef AISTRCNV_H +#define AISTRCNV_H + +#include + +namespace AiUtility + { + /** + * Parses an integer value from string. The string may contain + * the integer value either in hexadecimal or decimal format. + * + * @param aResult the result integer value + * @param aSourceString the source string + * @return KErrNone if aStringValue is parsed to aValue. + */ + IMPORT_C TInt ParseInt( TInt32& aResult, const TDesC8& aSourceString ); + + /** + * Parses an integer value from string. The string may contain + * the integer value either in hexadecimal or decimal format. + * + * @param aResult the result integer value + * @param aSourceString the source string + * @return KErrNone if aStringValue is parsed to aValue. + */ + IMPORT_C TInt ParseInt( TInt32& aResult, const TDesC16& aSourceString ); + + /** + * Copies aText to aBuffer. + * + * @param aTargetBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aSourceText the text to copy. + * @return pointer to result buffer. + */ + IMPORT_C HBufC16* CopyToBufferL(HBufC16* aTargetBuffer, const TDesC16& aSourceText); + + /** + * Copies and converts aText to aBuffer. UTF-8 to UCS-2 conversion + * is applied to aText. + * + * @param aTargetBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aSourceText the text to copy. + * @return pointer to result buffer. + */ + IMPORT_C HBufC16* CopyToBufferL(HBufC16* aTargetBuffer, const TDesC8& aSourceText); + + /** + * Copies aText to aBuffer. + * + * @param aTargetBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aSourceText the text to copy. + * @return pointer to result buffer. + */ + IMPORT_C HBufC8* CopyToBufferL(HBufC8* aTargetBuffer, const TDesC8& aSourceText); + + /** + * Copies and converts aText to aBuffer. UCS-2 to UTF-8 conversion + * is applied to aText. + * + * @param aTargetBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aSourceText the text to copy. + * @return pointer to result buffer. + */ + IMPORT_C HBufC8* CopyToBufferL(HBufC8* aTargetBuffer, const TDesC16& aSourceText); + + /** + * Ensures the buffer maximum length to be at least given number of characters. + * This function checks the maximum length of given buffer and reallocates a + * new buffer if the maximum length is not at least given number of characters. + * + * @param aBuffer refence to pointer to buffer to be checked. + * @param aMaxLength new maximum length + * @return modifiable pointer descriptor to the buffer + * + */ + IMPORT_C TPtr16 EnsureBufMaxLengthL(HBufC16*& aBuffer, TInt aMaxLength ); + + } + +#endif // AISTRCNV_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aistrparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aistrparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,113 @@ +/* +* 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: Collection of string parsing methods. +* +*/ + + +#ifndef AISTRPARSER_H +#define AISTRPARSER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* It is the interface for handling string parsing. +* +* @since S60 3.2 +*/ +class MAiStrParser + { +public: + + /** + * Parses an integer value from string. The string may contain + * the integer value either in hexadecimal or decimal format. + * + * @param aValue the result integer value + * @param aStringValue the source string + * @return KErrNone if aStringValue is parsed to aValue. + */ + virtual TInt ParseInt( TInt32& aValue, const TDesC8& aStringValue ) = 0; + + /** + * Copies aText to aBuffer. + * + * @param aBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aText the text to copy. + * @return pointer to result buffer. + */ + virtual HBufC16* CopyToBufferL(HBufC16* aBuffer, const TDesC16& aText) = 0; + + /** + * Copies and converts aText to aBuffer. UTF-8 to UCS-2 conversion + * is applied to aText. + * + * @param aBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aText the text to copy. + * @return pointer to result buffer. + */ + virtual HBufC16* CopyToBufferL(HBufC16* aBuffer, const TDesC8& aText) = 0; + + /** + * Copies aText to aBuffer. + * + * @param aBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aText the text to copy. + * @return pointer to result buffer. + */ + virtual HBufC8* CopyToBufferL(HBufC8* aBuffer, const TDesC8& aText) = 0; + + /** + * Copies and converts aText to aBuffer. UCS-2 to UTF-8 conversion + * is applied to aText. + * + * @param aBuffer a buffer to hold text. If aBuffer is NULL or + * insufficient, the function allocates a buffer. + * @param aText the text to copy. + * @return pointer to result buffer. + */ + virtual HBufC8* CopyToBufferL(HBufC8* aBuffer, const TDesC16& aText) = 0; + + /** + * Release the parser + */ + virtual void Release() = 0; + +protected: + + ~MAiStrParser() { } + + }; + +/** + * Helper for calling MAiStrParser::Release() with NULL checking. + */ +inline void Release(MAiStrParser* obj) + { + if (obj) + { + obj->Release(); + } + } + + +#endif // AISTRPARSER_H + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/aiutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/aiutility.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* 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: +* +*/ + + +#ifndef AIUTILITY_H +#define AIUTILITY_H + +#include +#include + +class MAiPSPropertyObserver; +class MAiStrParser; +class MAiContentItemIterator; +class MAiPluginSettings; +class MAiPluginTool; + +/** +* Active Idle Utility Library. +* +* @since S60 3.2 +*/ +namespace AiUtility + { + + /** + * Creates a Publish & Subscribe keys observer. + * + * @param aCallBack callback method to call when the key value changes. + * @param aCategory key category. + * @param aKey key to observe in category. + * @return pointer to a new publish and subscribe keys observer. + */ + IMPORT_C MAiPSPropertyObserver* CreatePSPropertyObserverL( + TCallBack aCallBack, + TUid aCategory, + TInt aKey ); + + /** + * Creates a string parser. + * + * @return pointer to a new string parser. + */ + IMPORT_C MAiStrParser* CreateStrParserL(); + + /** + * Creates a new iterator instance from a TAiContentItem array. + * + * @since S60 3.2 + * @param aArray content item array. + * @param aCount number of content items in aArray. + * @return a new iterator object for aArray. + */ + IMPORT_C MAiContentItemIterator* CreateContentItemArrayIteratorL( + const TAiContentItem* aArray, + TInt aCount ); + + /** + * Helper factory function for creating a MAiContentItemIterator out + * of a const C array of TAiContentItem objects. This function infers the item + * count of the array automatically from the array argument passed to it. + * + * @param aArray const C array of TAiContentItem objects. + * @return MAiContentItemIterator instance for iterating aArray. Client + * takes ownership of the returned object. + */ + template + inline MAiContentItemIterator* CreateContentItemArrayIteratorL + ( const TAiContentItem (&aArray)[N] ) + { + return AiUtility::CreateContentItemArrayIteratorL(aArray, N); + } + + /** + * Creates the plugin settings. + * + * @since S60 3.2 + * @return pointer to plugin settings. + */ + IMPORT_C MAiPluginSettings* CreatePluginSettingsL(); + + /** + * Creates the plugin tool. + * + * @since S60 3.2 + * @return pointer to plugin tool. + */ + IMPORT_C MAiPluginTool* CreatePluginToolL(); + + } + +#endif // AIUTILITY_H + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_utilities_api/inc/contentprioritymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_utilities_api/inc/contentprioritymap.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: +* +*/ + + +#ifndef C_CONTENTPRIORITYMAP_H +#define C_CONTENTPRIORITYMAP_H + +#include +#include + +namespace AiUtility { + +/** + * Content priority map for UI controllers. + * + * @lib aiutils.lib + * @since S60 3.2 + */ +class CContentPriorityMap : public CBase + { + +public: + /** + * Creates and returns a new instance of this class. + * + * @post CurrentPriority(*) == KErrNotFound + */ + IMPORT_C static CContentPriorityMap* NewL(); + + virtual ~CContentPriorityMap(); + + /** + * Returns the current priority assigned to UI element. + * + * @param aUiElementId textual identifier of the UI element. + * @return Current priority set to ui element or KErrNotFound if not set. + */ + IMPORT_C TInt CurrentPriority( const TDesC8& aUiElementId ) const; + + /** + * Sets the current priority assigned to UI element. + * + * @param aUiElementId textual identifier of the UI element. + * @param aPriority priority value to set. + * @return KErrNone if priority was set succesfully, otherwise one of + * the system-wide error codes. + * @post CurrentPriority(aUiElementId) == aPriority + */ + IMPORT_C TInt SetCurrentPriority( const TDesC8& aUiElementId, TInt aPriority ); + + /** + * Clears the current priority assigned to UI element. + * + * @param aUiElementId textual identifier of the UI element. + * @post CurrentPriority(aUiElementId) == KErrNotFound + */ + IMPORT_C void ClearPriority( const TDesC8& aUiElementId ); + + /** + * Clears all priority assignments of this map. + */ + IMPORT_C void Reset(); + + /** + * Tests if content with given priority may override + * current content in given ui element. + * + * @param aUiElementId textual identifier of the UI element. + * @param aNewPriority priority of the new content. + */ + IMPORT_C TBool OverrideContent( const TDesC8& aUiElementId, TInt aNewPriority ) const; + +private: + + CContentPriorityMap(); + +private: // data + + RPtrHashMap iPriorityMap; + + }; + + +} // namespace AiUtility + +#endif // C_CONTENTPRIORITYMAP_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_variation_api/ai_variation_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_variation_api/ai_variation_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + + AI Variation API + Active Idle Local Variation API + c++ + activeidle + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_variation_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_variation_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Variation API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/AIContainerDomainCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(AIContainerDomainCRKeys.h) +../inc/activeidle2domaincrkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(activeidle2domaincrkeys.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_variation_api/inc/AIContainerDomainCRKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_variation_api/inc/AIContainerDomainCRKeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: +* Definitions of domain keys related to Active Idle in CenRep +* +*/ + +#ifndef AICONTAINERDOMAINCRKEYS_H +#define AICONTAINERDOMAINCRKEYS_H + +#include + +/** + * Active Idle Settings + * + */ +const TUid KCRUidActiveIdle = {0x10207467}; + +/** + * KAINewsTickerStatus + * Define the status of the News_ticker Plugin + * - Off = 0 + * - On = 1 + * + */ +const TUint32 KAINewsTickerStatus = 0x00000001; + +/** + * KAINumOfOperatorPlugins + * Defines number of operator plugins + * Keys that are defined after this key, are considered to be plugin uids + * e.g. if KAINumOfOperatorPlugins = 1, then next key (3) would be read and used as an UID to load the plugin + */ +const TUint32 KAINumOfOperatorPlugins = 0x00000002; + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/ai_variation_api/inc/activeidle2domaincrkeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* 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: Internal Central Repository keys for Active Idle 2 +* +*/ + + +#ifndef __AI2INTERNALCRKEYS_H__ +#define __AI2INTERNALCRKEYS_H__ + +// Active Idle 2 Central Repository UIDs +const TUint32 KCRUidActiveIdleLV = 0x10275102; + +// Active Idle 2 Central Repository keys + +const TUint32 KAiMainUIController = 0x00000100; + +// UI controller key range 0x00000101 to 0x000001ff +const TUint32 KAiFirstUIController = 0x00000101; +const TUint32 KAiLastUIController = 0x000001ff; + +// Key for status pane layout +const TUint32 KAiStatusPaneLayout = 0x00000200; + +enum KAiSPLayoutSelector + { + EAiStatusPaneLayoutIdleNormal, + EAiStatusPaneLayoutIdleFlat, + EAiStatusPaneLayoutIdleHidden + }; + +// Keypad lock keys +/** + * Key id for scan code for the 1st lock key in the key lock sequence. + */ +const TUint32 KAIFirstKeyLockKey = 0x00000300; + +/** + * Key id for scan code for the 2nd lock key in the key lock sequence. + */ +const TUint32 KAISecondKeyLockKey = 0x00000301; + +/** + * Key id for scan code for the optional extra 2nd lock key. + */ +const TUint32 KAISecondKeyLockKey2 = 0x00000302; + +/** + * Key id for key lock sequence timeout in milliseconds. + */ +const TUint32 KAIKeyLockTimeout = 0x00000303; + +/** + * Key id for scan code for voice dial launch key. + */ +const TUint32 KAIVoiceDialLaunchKey = 0x00000304; + +/** + * Key id for Voice dial key timeout in milliseconds. + * This should be the same as long key press timeout. + */ +const TUint32 KAIVoiceDialKeyTimeout = 0x00000305; + +/** + * Key id for Display PLMN and SPN indicators simultaneously. + */ +const TUint32 KAISPNAndEONS = 0x00000400; + +/** + * Key id for publish VHZ in navipane. + */ +const TUint32 KAIVHZInMainpane = 0x00000500; + +/** + * Key id to show/hide external StandbyScreen/default Idle Themes + */ +const TUint32 KAIExternalStatusScreen = 0x00000600; + +/** + * Key id for touch toolbar visibility configuration + */ +const TUint32 KAITouchToolbarVisible = 0x00000700; + +/** + * Range start for plugin settings. Three keys per setting + */ +const TUint32 KAIPluginSettingsKeyRangeStart = 0x00001000; + +/** + * Range start for extra shortcuts such as URLs. These are placed + * to shortcut settings. + */ +const TUint32 KAIExtraShortcutsKeyRangeStart = 0x00002000; + +/** + * Range start for backup application definitions. + */ +const TUint32 KAIBackupShortcutDefinitionStart = 0x00003000; + +/** + * Key id to store homescreen status online/offline + */ +const TUint32 KAIWebStatus = 0x0000300F; + + +#endif // __AI2INTERNALCRKEYS_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/content_harvester_plugin_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/content_harvester_plugin_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,14 @@ + + +content_harvester_plugin_api +Content harvester plugin API +c++ +contentpublishingsrv + + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: File that exports the files belonging to : ContentHarvester +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/contentharvesterpluginuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(contentharvesterpluginuids.hrh) +../inc/contentharvesterplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(contentharvesterplugin.h) + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: Plugin interface + * +*/ + + +#ifndef C_CONTENTHARVESTERPLUGIN_H +#define C_CONTENTHARVESTERPLUGIN_H + +#include + +// CLASS DECLARATION +/** + * The interface class for all Content Harvester plugins. + * Plugins are responsible for updating and synchronization with CPS. + * + */ +class CContentHarvesterPlugin : public CBase + { +public: + + /** + * Method called by Content Harvester in order to invoke Update operation. + * Must be implemented by plugin provider. + */ + virtual void UpdateL() = 0; + + }; + +#endif // C_CONTENTHARVESTERPLUGIN_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterpluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/inc/contentharvesterpluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: UID used in Content Harvester rss plug-ins files + * +*/ + + +#ifndef CONTENTHARVESTERPLUGINUID_HRH_ +#define CONTENTHARVESTERPLUGINUID_HRH_ + +#define KContentHarvesterPluginUid 0x10282E5B // interface uid +#define KCHSwiPluginUidDll 0x20022E84 // SwiPlugin DLL UID +#define KCHSwiPluginUidImpl 0x20022E85 // SwiPlugin Impl UID + +#endif /*CONTENTHARVESTERPLUGINUID_HRH_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/conf/cps_plugin_api.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/conf/cps_plugin_api.cfg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,14 @@ +[StifSettings] +CheckHeapBalance= off +[EndStifSettings] + +############################################################## +# Test +############################################################## + +[Test] +title Test_CContentHarvesterPluginUpdateL +create cpspluginapitest cps +cps Test_CContentHarvesterPluginUpdateL +delete cps +[Endtest] \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/data/chpapi.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/data/chpapi.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +rem /* +rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem * All rights reserved. +rem * This component and the accompanying materials are made available +rem * under the terms of "Eclipse Public License v1.0" +rem * which accompanies this distribution, and is available +rem * at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem * +rem * Initial Contributors: +rem * Nokia Corporation - initial contribution. +rem * +rem * Contributors: +rem * +rem * Description: +rem * +rem */ +md c:\data\stif\chp_results\ +ATSInterface.exe -testmodule TestScripter -config c:\testframework\cps_plugin_api.cfg \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/eabi/cpspluginapitestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/eabi/cpspluginapitestu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI14CCPSTestPlugin @ 2 NONAME + _ZTV14CCPSTestPlugin @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../init/cps_plugin_api.ini c:/testframework/cps_plugin_api.ini +../conf/cps_plugin_api.cfg c:/testframework/cps_plugin_api.cfg +../data/chpapi.bat c:/chpapi.bat + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +cps_plugin_api.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +TARGET cpspluginapitest.dll +TARGETTYPE dll +UID 0x1000af5a 0x016660A6 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE cpspluginapitest.cpp +SOURCE cpspluginapitestblocks.cpp +SOURCE cpstestplugin.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY stiftestinterface.lib + +LANG SC + +EPOCALLOWDLLDATA + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/cps_plugin_api.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +; +; Copyright (c) 2009 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: +; +; obrtester.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"cpsapitest"},(0x016660A6),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install + + "\epoc32\release\armv5\urel\cpspluginapitest.dll" - "!:\sys\bin\cpspluginapitest.dll" + "..\init\cps_plugin_api.ini" -"!:\testframework\cps_plugin_api.ini" + "..\conf\cps_plugin_api.cfg" -"!:\testframework\cps_plugin_api.cfg" + "..\data\chpapi.bat" -"!:\chpapi.bat" + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/createsis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/createsis.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis cps_plugin_api.pkg +signsis cps_plugin_api.sis cps_plugin_api.sisx rd.cer rd-key.pem +pause \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd-key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd-key.pem Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 +6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh +7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB +gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX +pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB +yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j +KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 +iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 +2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ +9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 +aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO +TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 +mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd.cer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/group/rd.cer Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z +NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl +cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT +rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa +gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI +f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL +BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud +IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd +IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE +IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G +CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 +Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT +7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR +-----END CERTIFICATE----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpspluginapitest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpspluginapitest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 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 TESTCLASS_H +#define TESTCLASS_H + +// INCLUDES + + +#include +#include +#include +#include +#include + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CtestClass test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CCPSPluginApiTest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCPSPluginApiTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CCPSPluginApiTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CCPSPluginApiTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Test methods are listed below. + */ + TInt Test_CContentHarvesterPluginUpdateL(CStifItemParser& /*aItem*/ ); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + + }; + +#endif // TESTCLASS_H + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpstestplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/inc/cpstestplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,73 @@ +/* +* 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: Action Handler test Plugin + * +*/ + + +#ifndef C_CPS_TEST_PLUGIN_H +#define C_CPS_TEST_PLUGIN_H + +#include +#include + + +// FORWARD DECLARATION + +/** + * Exemplary CPS Plugin. + * + * @lib exemplaryactionhandler + * @since S60 S60 v5.0 + */ +class CCPSTestPlugin : public CContentHarvesterPlugin + { + +public: + + /** + * Standard Symbian 2 phase constructor + */ + static CCPSTestPlugin* NewL(); + + /** + * Standard Symbian 2 phase constructor + */ + static CCPSTestPlugin* NewLC(); + + /** + * Standard C++ destructor. + */ + ~CCPSTestPlugin (); + + /** + * Executes provided action + * + * @return status code + */ + void UpdateL(); +private: + /** + * Standard Symbian 2nd phase constructor. + */ + void ConstructL(); + +public: + + TInt iInt; + + + }; + +#endif /* C_CPS_TEST_PLUGIN_H */ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/init/cps_plugin_api.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/init/cps_plugin_api.ini Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,178 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\data\stif\chp_results\ +TestReportFileName= Utils + +TestReportFormat= HTML # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= dom_test2 +#[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +[New_Module] +ModuleName= testscripter + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) + +TestCaseFile= c:\testframework\cps_plugin_api.cfg + + +[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitest.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES + +#include +#include +#include "cpspluginapitest.h" +#include "cpstestplugin.h" + +// ============================ MEMBER FUNCTIONS =============================== + + +TInt CCPSPluginApiTest::Test_CContentHarvesterPluginUpdateL(CStifItemParser& ) + { + TInt result (KErrGeneral); + CCPSTestPlugin* plugin = CCPSTestPlugin::NewLC(); + if( plugin->iInt == KErrNotFound ) + { + plugin->UpdateL(); + result = plugin->iInt; + } + CleanupStack::PopAndDestroy( plugin ); + return result; + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpspluginapitestblocks.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES +#include +#include +#include +#include "cpspluginapitest.h" + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCPSPluginApiTest::CCPSPluginApiTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem ); + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCPSPluginApiTest::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCPSPluginApiTest* CCPSPluginApiTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CCPSPluginApiTest* self = new (ELeave) CCPSPluginApiTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CCPSPluginApiTest::~CCPSPluginApiTest() + { + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CCPSPluginApiTest::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 +// ----------------------------------------------------------------------------- +// CMCSAPITest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CCPSPluginApiTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + + ENTRY( "Test_CContentHarvesterPluginUpdateL",CCPSPluginApiTest::Test_CContentHarvesterPluginUpdateL ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpstestplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/content_harvester_plugin_api/tsrc/src/cpstestplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,75 @@ +/* +* 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: Exemplary Action Handler Plugin +* +*/ + + + + +#include "cpstestplugin.h" + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CCPSTestPlugin::ConstructL() + { + iInt = KErrNotFound; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CCPSTestPlugin* CCPSTestPlugin::NewL() + { + CCPSTestPlugin* self = CCPSTestPlugin::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CCPSTestPlugin* CCPSTestPlugin::NewLC() + { + CCPSTestPlugin* self = new( ELeave ) CCPSTestPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CCPSTestPlugin::~CCPSTestPlugin() + { + } + +// --------------------------------------------------------------------------- +// Executes provided action +// --------------------------------------------------------------------------- +// +void CCPSTestPlugin::UpdateL() + { + iInt = KErrNone; + } + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: File that exports the files belonging to context utility api +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hgcontextutilitybase.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutilitybase.h) +../inc/hgcontextutility.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextutility.h) +../inc/hgcontextdef.h MW_LAYER_PLATFORM_EXPORT_PATH(hg/hgcontextdef.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/inc/hgcontextdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/inc/hgcontextdef.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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: Context types +* +*/ + + +#ifndef HGCONTEXTDEF_H +#define HGCONTEXTDEF_H + +#include + +// context source +_LIT( KHgCFSource, "Hg" ); + +// context types +_LIT( KHgCFTypeContact, "Contact" ); +_LIT( KHgCFTypePbkContact, "PbkContact" ); +_LIT( KHgCFTypePbkContactMulti, "PbkContactMulti" ); +_LIT( KHgCFTypeText, "Text" ); +_LIT( KHgCFTypePhoto, "Photo" ); +_LIT( KHgCFTypeActiveDate, "ActiveDate" ); +_LIT( KHgCFTypeUrl, "Url" ); +_LIT( KHgCFTypeDate, "Date" ); + +_LIT( KHgCFTypeMusicState, "MusicState" ); +_LIT( KHgCFTypeMusicArtist, "MusicArtist" ); +_LIT( KHgCFTypeMusicTitle, "MusicTitle" ); +_LIT( KHgCFTypeMusicAlbum, "MusicAlbum" ); +_LIT( KHgCFTypeMusicAlbumArt, "MusicAlbumArt" ); +_LIT( KHgCFTypeMusicUri, "MusicUri" ); +_LIT( KHgCFTypeMusicGenre, "MusicGenre" ); +_LIT( KHgCFTypeMusicType, "MusicType" ); + +_LIT( KHgCFTypeMusicRadioName, "MusicRadioName" ); +_LIT( KHgCFTypeMusicRadioUrl, "MusicRadioUrl" ); +_LIT( KHgCFTypeMusicRadioFrequency, "MusicRadioFrequency" ); +_LIT( KHgCFTypeMusicRadioRDSPI, "MusicRadioRDSPI" ); + +_LIT( KHgCFTypeVideoState, "VideoState" ); +_LIT( KHgCFTypeVideoTitle, "VideoTitle" ); +_LIT( KHgCFTypeVideoUri, "VideoUri" ); +_LIT( KHgCFTypeVideoType, "VideoType" ); + +_LIT( KHgCFTypeTvChannelName, "TvChannelName" ); +_LIT( KHgCFTypeTvProgramName, "TvProgramName" ); +_LIT( KHgCFTypeTvProgramDesc, "TvProgramDesc" ); +_LIT( KHgCFTypeTvProgramGenre, "TvProgramGenre" ); + +_LIT( KHgCFTypeGpsLatitude, "GpsLatitude" ); +_LIT( KHgCFTypeGpsLongitude, "GpsLongitude" ); + +_LIT( KHgCFTypeOviId, "OviId" ); + +// some pre-defined values +_LIT( KHgCFValueUnknownContact, "" ); // special value for PbkContact +_LIT( KHgCFValueUnknownInfo, "" ); // e.g. for TV contexts, when information is not available +_LIT( KHgCFValueMusicTypePlayer, "MusicPlayer" ); +_LIT( KHgCFValueMusicTypeRadio, "Radio" ); +_LIT( KHgCFValueVideoTypeLocal, "VideoLocal" ); +_LIT( KHgCFValueVideoTypeStream, "VideoStream" ); + +_LIT( KHgCFServiceIdPrefixOvi, "Ovi" ); // for CHgContextUtility::PublishServiceIdL + +#endif // HGCONTEXTDEF_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/inc/hgcontextutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/inc/hgcontextutility.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,327 @@ +/* +* 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: Context publishing helper dll + * +*/ + + +#ifndef HGCONTEXTUTILITY_H +#define HGCONTEXTUTILITY_H + +#include +#include +#include +#include +#include +#include + +class MVPbkStoreContact; +class MVPbkContactLink; +class CVPbkContactLinkArray; +class CMdESession; + +/** + * Utility class to publish and access context through the Context Framework. + * @lib hgcontextutility.lib + * + * Typical usage in applications that are publishing context: + * During construction: + * \code + * iContextUtility = CHgContextUtility::NewL(); + * iContextUtility->RePublishWhenFgL( ETrue ); + * \endcode + * Publishing is accomplished with one single call, for example: + * \code + * void ContactChanged( MVPbkStoreContact* aNewContact ) { + * ... + * iContextUtility->PublishContactContextL( *aNewContact ); + * ... + * \endcode + * + * By default publishing requests are ignored if the application is + * not in foreground (does not apply to apps that do not have the + * ui environment). If there is still a good reason to allow this + * then call AllowPublishFromBackground( ETrue ). + */ +NONSHARABLE_CLASS( CHgContextUtility ) : public CHgContextUtilityBase + { +public: + /** + * 2-phased constructor. + */ + IMPORT_C static CHgContextUtility* NewL(); + + /** + * 2-phased constructor. + */ + IMPORT_C static CHgContextUtility* NewLC(); + + /* + * Destructor. + */ + IMPORT_C ~CHgContextUtility(); + + /** + * Publishes contact context. + * @param aContact contact + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes contact context. + * @param aContactLink contact link + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes contact context. + * Attempts to publish an empty value will be ignored. + * + * Prefer using the overloads taking vpbk contact or link, whenever possible. + * Use this in case of unknown contacts only, that is, a name, phone number, + * or email address that does not belong to a phonebook contact. + * + * @param aContactName formatted name, phone number, or email address, + * or a combination of them, e.g. "firstname lastname", "+12345678", + * "lastname firstname ", "firstname, lastname <0501234567>". + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( const TDesC& aContactName, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Overload for publishing multiple contacts. + * Ownership of passed pointers is not taken. + * @param aContacts contact array + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( + const RPointerArray& aContacts, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Overload for publishing multiple contacts. + * @param aContactLinks contact link array + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( + const CVPbkContactLinkArray& aContactLinks, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Overload for publishing multiple contacts. + * @param aContactNames string array, for element format + * see PublishContactContextL(const TDesC&) + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes freetext context. + * Not to be used for bulk text (e.g. full content of some text viewer component). + * @param aText some text, typically the highlighted substring + * from a viewer or editor control + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishTextContextL( const TDesC& aText, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes URL context. + * @param aUrl URL + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishUrlContextL( const TDesC& aUrl, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes date/time context. + * @param aTime time + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishTimeContextL( const TTime& aTime, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes photo context. + * @param aFilename name of image file, with full path + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishPhotoContextL( const TDesC& aFilename, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes photo context. + * @param aMdeItemId item id for the Image object in MDS + * @param aMdeSession opened metadata engine session + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId, + CMdESession& aMdeSession, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes TV context. + * Pass KNullDesC if some of the needed data is not available. + * @param aChannelName channel name + * @param aProgramName program name + * @param aProgramDescription program description + * @param aGenre genre + */ + IMPORT_C void PublishTvContextL( + const TDesC& aChannelName, + const TDesC& aProgramName, + const TDesC& aProgramDescription, + const TDesC& aGenre ); + + /** + * Publishes an account id as contact context. + * + * @param aServiceId the service prefix, e.g. "Ovi" + * @param aAccountId the account id + * @param aDelay if non-zero then context is published only after + * a short delay. If a new publish call is made before the timer fires the + * pending value will not be published. + */ + IMPORT_C void PublishServiceIdL( const TDesC& aServiceId, + const TDesC& aAccountId, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Enables or disables automatic re-publishing of the latest + * context (published via this context utility instance) whenever + * the application comes to foreground. + * + * It is DISABLED by default. + * + * By enabling this the applications do not have to care about + * context publishing in HandleForegroundEventL etc. + * + * The feature needs CCoeEnv and calls will be ignored if the + * environment is not available. + * + * @param aEnable flag to turn the feature on/off + */ + IMPORT_C void RePublishWhenFgL( TBool aEnable ); + + /** + * Enables or disables context publishing when being in background. + * Applies to all PublishContextL variants. + * If disabled then no context will be published if it seems that the + * caller application is not in foreground. + * Has no effect if there is no CCoeEnv available, publishing is always + * allowed in that case. + * + * It is DISABLED by default, that is, publishing is not allowed + * from applications that are not in foreground. + * + * @param aAllow flag to turn the feature on/off + */ + IMPORT_C void AllowPublishFromBackground( TBool aAllow ); + + /** + * Adds new music context info to music context publishing parameters. + * This method is to be used in context with PublishMusicContextL. Fill in the + * parameters and then call PublishMusicContextL. + * This parameter list is cleared after publishing music context. + * + * @param aKey Name of the key to be published. + * @param aData Data for the key. + * @leave KErrNotFound, when key is empty. + * @leave KErrAlreadyExists, when key is already in the list. + * @see hgcontextdef.h for keys + * @see PublishMusicContextL + */ + IMPORT_C void AddMusicContextInfoL( const TDesC& aKey, const TDesC& aData ); + + /** + * Publishes music context from provided parameters as music context. + * Publishes all known (in hgcontextdef.h) music context fields as music + * context. All keys, which do not contain any data, are automatically + * filled with '' -string. + * Clears the parameter list after publishing the context. + * + * @leave KErrNotReady, when music context data parameter list is empty. + * * @see hgcontextdef.h for keys + * @see AddMusicContextInfoL + */ + IMPORT_C void PublishMusicContextL( + const TTimeIntervalMicroSeconds32& aDelay = 0 ); + + /** + * Publishes Radio context. + * Pass KNullDesC if some of the needed data is not available. + * @param aRadioName radio name + * @param aRadioUrl radio url + * @param aRadioFrequency radio frequency + * @param aRadioRDSPI radio identification code + */ + IMPORT_C void PublishRadioContextL( + const TDesC& aRadioName, + const TDesC& aRadioUrl, + const TDesC& aRadioFrequency, + const TDesC& aRadioRDSPI ); + + /** + * Creates a combined string from the elements of the given array. + * Returns NULL if the array has less than 2 elements. + * @param aArray string array + * @return combined string or NULL, ownership transferred to caller + */ + IMPORT_C static HBufC* BuildCombinedStringL( const MDesCArray& aArray ); + + /** + * Splits the given combined string and appends the components to + * the given array. The initial content of the array is not modified. + * If aString does not seem to be a string combined from multiple entries + * then aString is appended to aArray without any changes. + * @param aString combined string, input + * @param aArray array, output + */ + IMPORT_C static void SplitCombinedStringL( const TDesC& aString, + CDesCArray& aArray ); + +protected: + CHgContextUtility(); + void ConstructL(); + }; + +#endif /* HGCONTEXTUTILITY_H */ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/inc/hgcontextutilitybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/inc/hgcontextutilitybase.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +/* +* 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: Context publishing helper dll + * +*/ + + +#ifndef HGCONTEXTUTILITYBASE_H +#define HGCONTEXTUTILITYBASE_H + +#include +#include + +class CHgContextUtilityImpl; + +/** + * Utility base class to publish and access context through the Context Framework. + * @lib hgcontextutility.lib + */ +class CHgContextUtilityBase : public CBase + { +public: + /** + * Publishes context. + * Also defines the context if it has not been defined. + * Publishing empty value is not allowed, however such errors are ignored + * here so the function will not leave when CFW responds with KErrArgument. + * The security policy for the context will be set to require + * LocalServices capability. + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context + */ + IMPORT_C void PublishContextL( const TDesC& aContextType, + const TDesC& aContextData ); + + /** + * Publishes context, the value will contain all the strings + * from the given array, typically by using some separator character. + * @see PublishContextL + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context will be a combined + * version of all the strings from this array + */ + IMPORT_C void PublishContextL( const TDesC& aContextType, + const MDesCArray& aContextData ); + + /** + * Publishes context but only after a short interval, using a timer. + * If it is called again before the timer expires then the timer + * is restarted (and so the previous pending value is never published). + * @param aContextType context type, source is always KHgCFSource + * @param aContextData value for the context + * @param aDelay delay for the timer, in microseconds + */ + IMPORT_C void PublishContextDelayedL( const TDesC& aContextType, + const TDesC& aContextData, const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Overload for delayed publishing of a value combined from multiple strings. + * @param aContextType context type + * @param aContextData string array + * @param aDelay delay for the timer, in microseconds + */ + IMPORT_C void PublishContextDelayedL( const TDesC& aContextType, + const MDesCArray& aContextData, const TTimeIntervalMicroSeconds32& aDelay ); + + /** + * Requests the given context and returns the value for the + * first result. Returns NULL if not found. + * @param aContextType context type, the source is always KHgCFSource + */ + IMPORT_C HBufC* GetContextL( const TDesC& aContextType ); + + /** + * Requests the given context and returns the value for the + * first result. Returns NULL if not found. + * @param aContextSource context source + * @param aContextType context type + */ + IMPORT_C HBufC* GetContextL( const TDesC& aContextSource, + const TDesC& aContextType ); + +protected: + CHgContextUtilityBase(); + ~CHgContextUtilityBase(); + void BaseConstructL(); + CHgContextUtilityImpl* iImpl; + }; + +#endif /* HGCONTEXTUTILITYBASE_H */ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/bwins/t_ui_context_utility_apiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/bwins/t_ui_context_utility_apiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +EXPORTS + ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void) + ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &) + ?PublishContactContextL@CHgContextUtility@@QAEXABV?$RPointerArray@VMVPbkStoreContact@@@@ABVTTimeIntervalMicroSeconds32@@@Z @ 3 NONAME ; void CHgContextUtility::PublishContactContextL(class RPointerArray const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 4 NONAME ; void CHgContextUtility::PublishContactContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ??1CHgContextUtility@@UAE@XZ @ 5 NONAME ; CHgContextUtility::~CHgContextUtility(void) + ?NewLC@CHgContextUtility@@SAPAV1@XZ @ 6 NONAME ; class CHgContextUtility * CHgContextUtility::NewLC(void) + ?RePublishWhenFgL@CHgContextUtility@@QAEXH@Z @ 7 NONAME ; void CHgContextUtility::RePublishWhenFgL(int) + ?PublishPhotoContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 8 NONAME ; void CHgContextUtility::PublishPhotoContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 9 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkContactLink@@ABVTTimeIntervalMicroSeconds32@@@Z @ 10 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkContactLink const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishUrlContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 11 NONAME ; void CHgContextUtility::PublishUrlContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishTvContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 12 NONAME ; void CHgContextUtility::PublishTvContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) + ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@ABVMDesC16Array@@@Z @ 13 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class MDesC16Array const &) + ?AllowPublishFromBackground@CHgContextUtility@@QAEXH@Z @ 14 NONAME ; void CHgContextUtility::AllowPublishFromBackground(int) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMVPbkStoreContact@@ABVTTimeIntervalMicroSeconds32@@@Z @ 15 NONAME ; void CHgContextUtility::PublishContactContextL(class MVPbkStoreContact const &, class TTimeIntervalMicroSeconds32 const &) + ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@@Z @ 16 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &) + ?NewL@CHgContextUtility@@SAPAV1@XZ @ 17 NONAME ; class CHgContextUtility * CHgContextUtility::NewL(void) + ?PublishContextDelayedL@CHgContextUtilityBase@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 18 NONAME ; void CHgContextUtilityBase::PublishContextDelayedL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?SplitCombinedStringL@CHgContextUtilityImpl@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 19 NONAME ABSENT ; void CHgContextUtilityImpl::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) + ?PublishTextContextL@CHgContextUtility@@QAEXABVTDesC16@@ABVTTimeIntervalMicroSeconds32@@@Z @ 20 NONAME ; void CHgContextUtility::PublishTextContextL(class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContextL@CHgContextUtilityBase@@QAEXABVTDesC16@@0@Z @ 21 NONAME ; void CHgContextUtilityBase::PublishContextL(class TDesC16 const &, class TDesC16 const &) + ?GetContextL@CHgContextUtilityBase@@QAEPAVHBufC16@@ABVTDesC16@@0@Z @ 22 NONAME ; class HBufC16 * CHgContextUtilityBase::GetContextL(class TDesC16 const &, class TDesC16 const &) + ?BuildCombinedStringL@CHgContextUtilityImpl@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 23 NONAME ABSENT ; class HBufC16 * CHgContextUtilityImpl::BuildCombinedStringL(class MDesC16Array const &) + ?PublishPhotoContextL@CHgContextUtility@@QAEXKAAVCMdESession@@ABVTTimeIntervalMicroSeconds32@@@Z @ 24 NONAME ; void CHgContextUtility::PublishPhotoContextL(unsigned long, class CMdESession &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVCVPbkContactLinkArray@@ABVTTimeIntervalMicroSeconds32@@@Z @ 25 NONAME ; void CHgContextUtility::PublishContactContextL(class CVPbkContactLinkArray const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishTimeContextL@CHgContextUtility@@QAEXABVTTime@@ABVTTimeIntervalMicroSeconds32@@@Z @ 26 NONAME ; void CHgContextUtility::PublishTimeContextL(class TTime const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishContactContextL@CHgContextUtility@@QAEXABVMDesC16Array@@ABVTTimeIntervalMicroSeconds32@@@Z @ 27 NONAME ; void CHgContextUtility::PublishContactContextL(class MDesC16Array const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishServiceIdL@CHgContextUtility@@QAEXABVTDesC16@@0ABVTTimeIntervalMicroSeconds32@@@Z @ 28 NONAME ; void CHgContextUtility::PublishServiceIdL(class TDesC16 const &, class TDesC16 const &, class TTimeIntervalMicroSeconds32 const &) + ?PublishMusicContextL@CHgContextUtility@@QAEXABVTTimeIntervalMicroSeconds32@@@Z @ 29 NONAME ; void CHgContextUtility::PublishMusicContextL(class TTimeIntervalMicroSeconds32 const &) + ?AddMusicContextInfoL@CHgContextUtility@@QAEXABVTDesC16@@0@Z @ 30 NONAME ; void CHgContextUtility::AddMusicContextInfoL(class TDesC16 const &, class TDesC16 const &) + ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 31 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &, class TRequestStatus &) + ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@AAVTRequestStatus@@@Z @ 32 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &, class TRequestStatus &) + ?SplitAndMatchL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 33 NONAME ; void CHgCtxContactMatcher::SplitAndMatchL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &) + ?GetFieldDataBinaryL@CHgCtxContactMatcher@@QBE?AVTPtrC8@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 34 NONAME ; class TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const + ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXXZ @ 35 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(void) + ?GetNameL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 36 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNameL(class MVPbkStoreContactFieldCollection &) + ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 37 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(class TRequestStatus &) + ?OpenAllStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 38 NONAME ; void CHgCtxContactMatcher::OpenAllStoresL(class TRequestStatus &) + ?GetFieldDataDateTimeL@CHgCtxContactMatcher@@QBE?AVTTime@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 39 NONAME ; class TTime CHgCtxContactMatcher::GetFieldDataDateTimeL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const + ?SplitFindStringL@CHgCtxContactMatcher@@SAPAVCDesC16Array@@ABVTDesC16@@@Z @ 40 NONAME ; class CDesC16Array * CHgCtxContactMatcher::SplitFindStringL(class TDesC16 const &) + ?GetAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 41 NONAME ; void CHgCtxContactMatcher::GetAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) + ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXAAVTRequestStatus@@@Z @ 42 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(class TRequestStatus &) + ?GetCustomFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 43 NONAME ; void CHgCtxContactMatcher::GetCustomFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter) + ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@@Z @ 44 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &) + ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 45 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, class TRequestStatus &) + ?IsOwnNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAH@Z @ 46 NONAME ; void CHgCtxContactMatcher::IsOwnNumberL(class TDesC16 const &, int &) + ?OpenOwnNumberStoresL@CHgCtxContactMatcher@@QAEXXZ @ 47 NONAME ; void CHgCtxContactMatcher::OpenOwnNumberStoresL(void) + ?GetWebAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@W4TWebAddressesType@1@@Z @ 48 NONAME ; void CHgCtxContactMatcher::GetWebAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &, enum CHgCtxContactMatcher::TWebAddressesType) + ?FieldTypes@CHgCtxContactMatcher@@QBEABVMVPbkFieldTypeList@@XZ @ 49 NONAME ; class MVPbkFieldTypeList const & CHgCtxContactMatcher::FieldTypes(void) const + ?GetContactManager@CHgCtxContactMatcher@@QAEAAVCVPbkContactManager@@XZ @ 50 NONAME ; class CVPbkContactManager & CHgCtxContactMatcher::GetContactManager(void) + ?GetNamesForFindL@CHgCtxContactMatcher@@QAEPAVHBufC16@@AAVMVPbkStoreContactFieldCollection@@@Z @ 51 NONAME ; class HBufC16 * CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &) + ?GetNumbersL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 52 NONAME ; void CHgCtxContactMatcher::GetNumbersL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) + ?ContactNameFormatterL@CHgCtxContactMatcher@@QAEAAVMPbk2ContactNameFormatter@@XZ @ 53 NONAME ; class MPbk2ContactNameFormatter & CHgCtxContactMatcher::ContactNameFormatterL(void) + ?IsEmailAddressL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 54 NONAME ; int CHgCtxContactMatcher::IsEmailAddressL(class TDesC16 const &) + ?IsPhoneNumberL@CHgCtxContactMatcher@@SAHABVTDesC16@@@Z @ 55 NONAME ; int CHgCtxContactMatcher::IsPhoneNumberL(class TDesC16 const &) + ?GetFieldDataTextL@CHgCtxContactMatcher@@QBE?AVTPtrC16@@ABVMVPbkStoreContact@@ABVMVPbkFieldType@@@Z @ 56 NONAME ; class TPtrC16 CHgCtxContactMatcher::GetFieldDataTextL(class MVPbkStoreContact const &, class MVPbkFieldType const &) const + ?RegisterContactObserverL@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 57 NONAME ; void CHgCtxContactMatcher::RegisterContactObserverL(class MHgCtxContactObserver &) + ?GetContactStoresL@CHgCtxContactMatcher@@QAEAAVMVPbkContactStoreList@@XZ @ 58 NONAME ; class MVPbkContactStoreList & CHgCtxContactMatcher::GetContactStoresL(void) + ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@AAVTRequestStatus@@@Z @ 59 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *, class TRequestStatus &) + ?CancelOperation@CHgCtxContactMatcher@@QAEXXZ @ 60 NONAME ; void CHgCtxContactMatcher::CancelOperation(void) + ?NewLC@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 61 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewLC(class RFs *) + ?GetCustomFieldTypeLC@CHgCtxContactMatcher@@QAEPAVCVPbkFieldTypeRefsList@@W4TVPbkFieldTypeName@@W4TVPbkFieldTypeParameter@@@Z @ 62 NONAME ; class CVPbkFieldTypeRefsList * CHgCtxContactMatcher::GetCustomFieldTypeLC(enum TVPbkFieldTypeName, enum TVPbkFieldTypeParameter) + ?CloseStoresL@CHgCtxContactMatcher@@QAEXXZ @ 63 NONAME ; void CHgCtxContactMatcher::CloseStoresL(void) + ?SplitMsgContactL@CHgCtxContactMatcher@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 64 NONAME ; void CHgCtxContactMatcher::SplitMsgContactL(class TDesC16 const &, class CDesC16Array &) + ?GetImppFieldL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@PAVCDesC16Array@@11@Z @ 65 NONAME ; void CHgCtxContactMatcher::GetImppFieldL(class MVPbkStoreContactFieldCollection &, class CDesC16Array *, class CDesC16Array *, class CDesC16Array *) + ?GetNamesForFindL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 66 NONAME ; void CHgCtxContactMatcher::GetNamesForFindL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) + ?NewL@CHgCtxContactMatcher@@SAPAV1@PAVRFs@@@Z @ 67 NONAME ; class CHgCtxContactMatcher * CHgCtxContactMatcher::NewL(class RFs *) + ?MatchDataL@CHgCtxContactMatcher@@QAEXABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@ABVTCallBack@@@Z @ 68 NONAME ; void CHgCtxContactMatcher::MatchDataL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TCallBack const &) + ?OpenStoreL@CHgCtxContactMatcher@@QAEXABVCVPbkContactStoreUriArray@@@Z @ 69 NONAME ; void CHgCtxContactMatcher::OpenStoreL(class CVPbkContactStoreUriArray const &) + ?FindContactWithBirthdayL@CHgCtxContactMatcher@@QAEXABVTTime@@AAVCVPbkContactLinkArray@@@Z @ 70 NONAME ; void CHgCtxContactMatcher::FindContactWithBirthdayL(class TTime const &, class CVPbkContactLinkArray &) + ?LookupL@CHgCtxContactMatcher@@QAEXABVTDesC16@@AAVCVPbkContactLinkArray@@@Z @ 71 NONAME ; void CHgCtxContactMatcher::LookupL(class TDesC16 const &, class CVPbkContactLinkArray &) + ?UnregisterContactObserver@CHgCtxContactMatcher@@QAEXAAVMHgCtxContactObserver@@@Z @ 72 NONAME ; void CHgCtxContactMatcher::UnregisterContactObserver(class MHgCtxContactObserver &) + ?MatchPhoneNumberL@CHgCtxContactMatcher@@QAEXABVTDesC16@@HW4TVPbkPhoneNumberMatchFlags@CVPbkPhoneNumberMatchStrategy@@AAVCVPbkContactLinkArray@@@Z @ 73 NONAME ; void CHgCtxContactMatcher::MatchPhoneNumberL(class TDesC16 const &, int, enum CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags, class CVPbkContactLinkArray &) + ?OpenDefaultMatchStoresL@CHgCtxContactMatcher@@QAEXXZ @ 74 NONAME ; void CHgCtxContactMatcher::OpenDefaultMatchStoresL(void) + ??1CHgCtxContactMatcher@@UAE@XZ @ 75 NONAME ; CHgCtxContactMatcher::~CHgCtxContactMatcher(void) + ?GetStoreContactL@CHgCtxContactMatcher@@QAEXABVMVPbkContactLink@@PAPAVMVPbkStoreContact@@@Z @ 76 NONAME ; void CHgCtxContactMatcher::GetStoreContactL(class MVPbkContactLink const &, class MVPbkStoreContact * *) + ?GetEmailAddressesL@CHgCtxContactMatcher@@QAEXAAVMVPbkStoreContactFieldCollection@@AAVCDesC16Array@@@Z @ 77 NONAME ; void CHgCtxContactMatcher::GetEmailAddressesL(class MVPbkStoreContactFieldCollection &, class CDesC16Array &) + ?MatchDataL@CHgCtxContactMatcher@@QAEXABVTDesC16@@ABVMVPbkFieldTypeList@@AAVCVPbkContactLinkArray@@AAVTRequestStatus@@@Z @ 78 NONAME ; void CHgCtxContactMatcher::MatchDataL(class TDesC16 const &, class MVPbkFieldTypeList const &, class CVPbkContactLinkArray &, class TRequestStatus &) + ?GetThumbnailL@CHgCtxContactMatcher@@QAEPAVCFbsBitmap@@AAVMVPbkStoreContactFieldCollection@@@Z @ 79 NONAME ; class CFbsBitmap * CHgCtxContactMatcher::GetThumbnailL(class MVPbkStoreContactFieldCollection &) + ?SplitCombinedStringL@CHgContextUtility@@SAXABVTDesC16@@AAVCDesC16Array@@@Z @ 80 NONAME ; void CHgContextUtility::SplitCombinedStringL(class TDesC16 const &, class CDesC16Array &) + ?BuildCombinedStringL@CHgContextUtility@@SAPAVHBufC16@@ABVMDesC16Array@@@Z @ 81 NONAME ; class HBufC16 * CHgContextUtility::BuildCombinedStringL(class MDesC16Array const &) + ?PublishRadioContextL@CHgContextUtility@@QAEXABVTDesC16@@000@Z @ 82 NONAME ; void CHgContextUtility::PublishRadioContextL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/eabi/t_ui_context_utility_apiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/eabi/t_ui_context_utility_apiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +EXPORTS + _Z9LibEntryLv @ 1 NONAME + _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME + _ZN17CHgContextUtility16RePublishWhenFgLEi @ 3 NONAME + _ZN17CHgContextUtility17PublishTvContextLERK7TDesC16S2_S2_S2_ @ 4 NONAME + _ZN17CHgContextUtility18PublishUrlContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 5 NONAME + _ZN17CHgContextUtility19PublishTextContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 6 NONAME + _ZN17CHgContextUtility19PublishTimeContextLERK5TTimeRK27TTimeIntervalMicroSeconds32 @ 7 NONAME + _ZN17CHgContextUtility20PublishPhotoContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 8 NONAME + _ZN17CHgContextUtility20PublishPhotoContextLEmR11CMdESessionRK27TTimeIntervalMicroSeconds32 @ 9 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 10 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK13RPointerArrayI17MVPbkStoreContactERK27TTimeIntervalMicroSeconds32 @ 11 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK16MVPbkContactLinkRK27TTimeIntervalMicroSeconds32 @ 12 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK17MVPbkStoreContactRK27TTimeIntervalMicroSeconds32 @ 13 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK21CVPbkContactLinkArrayRK27TTimeIntervalMicroSeconds32 @ 14 NONAME + _ZN17CHgContextUtility22PublishContactContextLERK7TDesC16RK27TTimeIntervalMicroSeconds32 @ 15 NONAME + _ZN17CHgContextUtility26AllowPublishFromBackgroundEi @ 16 NONAME + _ZN17CHgContextUtility4NewLEv @ 17 NONAME + _ZN17CHgContextUtility5NewLCEv @ 18 NONAME + _ZN17CHgContextUtilityD0Ev @ 19 NONAME + _ZN17CHgContextUtilityD1Ev @ 20 NONAME + _ZN17CHgContextUtilityD2Ev @ 21 NONAME + _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16 @ 22 NONAME + _ZN21CHgContextUtilityBase11GetContextLERK7TDesC16S2_ @ 23 NONAME + _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16RK12MDesC16Array @ 24 NONAME + _ZN21CHgContextUtilityBase15PublishContextLERK7TDesC16S2_ @ 25 NONAME + _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16RK12MDesC16ArrayRK27TTimeIntervalMicroSeconds32 @ 26 NONAME + _ZN21CHgContextUtilityBase22PublishContextDelayedLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 27 NONAME + _ZN21CHgContextUtilityImpl20BuildCombinedStringLERK12MDesC16Array @ 28 NONAME ABSENT + _ZN21CHgContextUtilityImpl20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 29 NONAME ABSENT + _ZTI11CHgTestBase @ 30 NONAME ; ## + _ZTI21CHgContextUtilityBase @ 31 NONAME ; ## + _ZTV11CHgTestBase @ 32 NONAME ; ## + _ZTV21CHgContextUtilityBase @ 33 NONAME ; ## + _ZN17CHgContextUtility17PublishServiceIdLERK7TDesC16S2_RK27TTimeIntervalMicroSeconds32 @ 34 NONAME + _ZN17CHgContextUtility20AddMusicContextInfoLERK7TDesC16S2_ @ 35 NONAME + _ZN17CHgContextUtility20PublishMusicContextLERK27TTimeIntervalMicroSeconds32 @ 36 NONAME + _ZN17CHgContextUtility20BuildCombinedStringLERK12MDesC16Array @ 37 NONAME + _ZN17CHgContextUtility20PublishRadioContextLERK7TDesC16S2_S2_S2_ @ 38 NONAME + _ZN17CHgContextUtility20SplitCombinedStringLERK7TDesC16R12CDesC16Array @ 39 NONAME + _ZN20CHgCtxContactMatcher10MatchDataLERK12MDesC16ArrayRK18MVPbkFieldTypeListR21CVPbkContactLinkArrayRK9TCallBack @ 40 NONAME + _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 41 NONAME + _ZN20CHgCtxContactMatcher10MatchDataLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArrayR14TRequestStatus @ 42 NONAME + _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArray @ 43 NONAME + _ZN20CHgCtxContactMatcher10OpenStoreLERK25CVPbkContactStoreUriArrayR14TRequestStatus @ 44 NONAME + _ZN20CHgCtxContactMatcher11GetNumbersLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 45 NONAME + _ZN20CHgCtxContactMatcher12CloseStoresLEv @ 46 NONAME + _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16R14TRequestStatus @ 47 NONAME + _ZN20CHgCtxContactMatcher12IsOwnNumberLERK7TDesC16Ri @ 48 NONAME + _ZN20CHgCtxContactMatcher13GetAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 49 NONAME + _ZN20CHgCtxContactMatcher13GetImppFieldLER32MVPbkStoreContactFieldCollectionP12CDesC16ArrayS3_S3_ @ 50 NONAME + _ZN20CHgCtxContactMatcher13GetThumbnailLER32MVPbkStoreContactFieldCollection @ 51 NONAME + _ZN20CHgCtxContactMatcher14IsPhoneNumberLERK7TDesC16 @ 52 NONAME + _ZN20CHgCtxContactMatcher14OpenAllStoresLER14TRequestStatus @ 53 NONAME + _ZN20CHgCtxContactMatcher14OpenAllStoresLEv @ 54 NONAME + _ZN20CHgCtxContactMatcher14SplitAndMatchLERK7TDesC16RK18MVPbkFieldTypeListR21CVPbkContactLinkArray @ 55 NONAME + _ZN20CHgCtxContactMatcher15CancelOperationEv @ 56 NONAME + _ZN20CHgCtxContactMatcher15GetCustomFieldLER32MVPbkStoreContactFieldCollectionR12CDesC16Array18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 57 NONAME + _ZN20CHgCtxContactMatcher15IsEmailAddressLERK7TDesC16 @ 58 NONAME + _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollection @ 59 NONAME + _ZN20CHgCtxContactMatcher16GetNamesForFindLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 60 NONAME + _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContact @ 61 NONAME + _ZN20CHgCtxContactMatcher16GetStoreContactLERK16MVPbkContactLinkPP17MVPbkStoreContactR14TRequestStatus @ 62 NONAME + _ZN20CHgCtxContactMatcher16GetWebAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16ArrayNS_17TWebAddressesTypeE @ 63 NONAME + _ZN20CHgCtxContactMatcher16SplitFindStringLERK7TDesC16 @ 64 NONAME + _ZN20CHgCtxContactMatcher16SplitMsgContactLERK7TDesC16R12CDesC16Array @ 65 NONAME + _ZN20CHgCtxContactMatcher17GetContactManagerEv @ 66 NONAME + _ZN20CHgCtxContactMatcher17GetContactStoresLEv @ 67 NONAME + _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArray @ 68 NONAME + _ZN20CHgCtxContactMatcher17MatchPhoneNumberLERK7TDesC16iN29CVPbkPhoneNumberMatchStrategy26TVPbkPhoneNumberMatchFlagsER21CVPbkContactLinkArrayR14TRequestStatus @ 69 NONAME + _ZN20CHgCtxContactMatcher18GetEmailAddressesLER32MVPbkStoreContactFieldCollectionR12CDesC16Array @ 70 NONAME + _ZN20CHgCtxContactMatcher20GetCustomFieldTypeLCE18TVPbkFieldTypeName23TVPbkFieldTypeParameter @ 71 NONAME + _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLER14TRequestStatus @ 72 NONAME + _ZN20CHgCtxContactMatcher20OpenOwnNumberStoresLEv @ 73 NONAME + _ZN20CHgCtxContactMatcher21ContactNameFormatterLEv @ 74 NONAME + _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLER14TRequestStatus @ 75 NONAME + _ZN20CHgCtxContactMatcher23OpenDefaultMatchStoresLEv @ 76 NONAME + _ZN20CHgCtxContactMatcher24FindContactWithBirthdayLERK5TTimeR21CVPbkContactLinkArray @ 77 NONAME + _ZN20CHgCtxContactMatcher24RegisterContactObserverLER21MHgCtxContactObserver @ 78 NONAME + _ZN20CHgCtxContactMatcher25UnregisterContactObserverER21MHgCtxContactObserver @ 79 NONAME + _ZN20CHgCtxContactMatcher4NewLEP3RFs @ 80 NONAME + _ZN20CHgCtxContactMatcher5NewLCEP3RFs @ 81 NONAME + _ZN20CHgCtxContactMatcher7LookupLERK7TDesC16R21CVPbkContactLinkArray @ 82 NONAME + _ZN20CHgCtxContactMatcher8GetNameLER32MVPbkStoreContactFieldCollection @ 83 NONAME + _ZN20CHgCtxContactMatcherD0Ev @ 84 NONAME + _ZN20CHgCtxContactMatcherD1Ev @ 85 NONAME + _ZN20CHgCtxContactMatcherD2Ev @ 86 NONAME + _ZNK20CHgCtxContactMatcher10FieldTypesEv @ 87 NONAME + _ZNK20CHgCtxContactMatcher17GetFieldDataTextLERK17MVPbkStoreContactRK14MVPbkFieldType @ 88 NONAME + _ZNK20CHgCtxContactMatcher19GetFieldDataBinaryLERK17MVPbkStoreContactRK14MVPbkFieldType @ 89 NONAME + _ZNK20CHgCtxContactMatcher21GetFieldDataDateTimeLERK17MVPbkStoreContactRK14MVPbkFieldType @ 90 NONAME + _ZThn12_N20CHgCtxContactMatcherD0Ev @ 91 NONAME + _ZThn12_N20CHgCtxContactMatcherD1Ev @ 92 NONAME + _ZThn16_N20CHgCtxContactMatcherD0Ev @ 93 NONAME + _ZThn16_N20CHgCtxContactMatcherD1Ev @ 94 NONAME + _ZThn20_N20CHgCtxContactMatcherD0Ev @ 95 NONAME + _ZThn20_N20CHgCtxContactMatcherD1Ev @ 96 NONAME + _ZThn4_N20CHgCtxContactMatcherD0Ev @ 97 NONAME + _ZThn4_N20CHgCtxContactMatcherD1Ev @ 98 NONAME + _ZThn8_N20CHgCtxContactMatcherD0Ev @ 99 NONAME + _ZThn8_N20CHgCtxContactMatcherD1Ev @ 100 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002 - 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: T_ui_context_utility_api test module. +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +t_ui_context_utility_api.mmp + +PRJ_MMPFILES + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/group/context_utility_api.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/group/context_utility_api.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +ATSInterface.exe -testmodule T_ui_context_utility_api \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/*TYPE STIFUNIT*//* +* Copyright (c) 2002 - 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: T_ui_context_utility_api test module. +* +*/ + + +#include + +TARGET T_ui_context_utility_api.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E7 + +CAPABILITY ALL -TCB + +DEFFILE T_ui_context_utility_api.def + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../../contextutility/inc + +// USERINCLUDE for base test class +USERINCLUDE ../testbase + +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/internal + +SOURCEPATH ../src +SOURCE T_ui_context_utility_api.cpp +SOURCE T_ui_context_utility_api_cases.cpp +SOURCE wait.cpp +SOURCE hgctxcontactmatcher.cpp + +SOURCEPATH ../../../../contextutility/src +SOURCE hgcontextutilityimpl.cpp +SOURCE hgcontextutility.cpp +SOURCE hgcontextutilitybase.cpp + +// SOURCEPATH for base test class +SOURCEPATH ../testbase +SOURCE hgtestbase.cpp + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY stiftestinterface.lib +LIBRARY avkon.lib +LIBRARY aknnotify.lib +LIBRARY eikcore.lib +LIBRARY cfclient.lib +LIBRARY cfservices.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY mdeclient.lib +LIBRARY vpbkeng.lib +LIBRARY efsrv.lib +LIBRARY Pbk2Presentation.lib +LIBRARY fbscli.lib +LIBRARY imageconversion.lib +LIBRARY commonengine.lib + +DEBUGLIBRARY flogger.lib + +LANG SC + +EXPORTUNFROZEN + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/group/t_ui_context_utility_api.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +; +; Copyright (c) 2009 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: +; +; +; Installation file for STIF +; + +; Languages +&EN + +; Provide value for uid +#{"STIF"},(0x00000000),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +"\epoc32\release\armv5\udeb\T_ui_context_utility_api.dll" - "!:\Sys\Bin\T_ui_context_utility_api.dll" +"context_utility_api.bat" - "c:\context_utility_api.bat" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/inc/hgctxcontactmatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/inc/hgctxcontactmatcher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,904 @@ +/* +* 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: Contact metching class +* +*/ + + +#ifndef HGCONTACTMATCHER_H +#define HGCONTACTMATCHER_H + +// System includes +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +// Classes referenced +class RFs; +class CActiveSchedulerWait; +class CVPbkContactManager; +class MVPbkContactLink; +class CVPbkContactLinkArray; +class CVPbkContactStoreUriArray; +class MVPbkContactOperationBase; +class MVPbkFieldType; +class MVPbkFieldTypeList; +class MVPbkStoreContact; +class MVPbkStoreContactField; +class CVPbkFieldTypeRefsList; +class MVPbkStoreContactFieldCollection; +class MVPbkContactFieldSelector; + +class CPbk2SortOrderManager; +class MPbk2ContactNameFormatter; +class CFbsBitmap; + +/** + * Observer interface for contact added/changed/deleted notifications. + */ +class MHgCtxContactObserver + { +public: + /** + * Called when a contact is added, changed, or deleted. + */ + virtual void HandleContactEventL() = 0; + }; + +/** +* CHgCtxContactMatcher class is an API for contact matching. +* +* Before a method starts executing a Virtual Phonebook operation, +* it checks if there's an older asynchronous operation already in execution. +* If there is, synchronous methods leave with error code KErrInUse. +* Asynchronous methods complete the request with same error code. +* +* If phone backup/restore has been detected, using methods which +* require Virtual Phonebook is not possible normally. +* Instead those methods leave with error code KErrAccessDenied. +* Once EStoreBackupRestoreCompleted event has been received, +* methods can be called normally. +* +* @lib hgcontextservicesutils.lib +*/ + +NONSHARABLE_CLASS( CHgCtxContactMatcher ) : public CBase, + public MVPbkSingleContactOperationObserver, + public MVPbkContactStoreListObserver, + public MVPbkContactFindObserver, + public MVPbkContactFindFromStoresObserver, + public MVPbkContactViewObserver + { +public: // Construct & destruct + + /** + * Two-phase constructor for CHgCtxContactMatcher class. + * + * @param aFsSession File server session. + * + * @return CHgCtxContactMatcher* Pointer to newly created instance. + */ + IMPORT_C static CHgCtxContactMatcher* NewL( RFs* aFsSession = 0 ); + + /** + * Two-phase constructor for CHgCtxContactMatcher class. + * Like NewL(), but also places instance on cleanup stack. + * + * @return CHgCtxContactMatcher* Pointer to newly created instance. + */ + IMPORT_C static CHgCtxContactMatcher* NewLC( RFs* aFsSession = 0 ); + + /** + * C++ destructor. + */ + IMPORT_C ~CHgCtxContactMatcher(); + +private: // Internal construct + + /** + * C++ Constructor. + */ + CHgCtxContactMatcher( RFs* aFsSession ); + + /** + * Second phase constructor + */ + void ConstructL(); + +public: // API methods + + /** + * Opens one or more contact stores for future match operations. + * + * @param aUriArray Array of contact store URIs to be opened. + * + * @exception KErrNotSupported when none of the stores opens + * @exception KErrGeneral if some stores are already open + */ + IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray ); + + /** + * Opens one or more contact stores for future match operations. + * Asynchronous version. + * + * @param aUriArray Array of contact store URIs to be opened. + * @param aStatus Completion status of the request. + * KErrNone - at least one store opened successfully + * KErrNotSupported - all stores failed to open + * KErrGeneral - if some stores are already open + */ + IMPORT_C void OpenStoreL( const CVPbkContactStoreUriArray& aUriArray, + TRequestStatus& aStatus ); + + /** + * Opens all contact stores for future match operations. + * NOTE: does not open OwnNumber store. + * + * @exception KErrNotSupported when none of the stores opens + * @exception KErrGeneral if some stores are already open + */ + IMPORT_C void OpenAllStoresL(); + + /** + * Opens all contact stores for future match operations. + * Asynchronous version. + * NOTE: does not open OwnNumber store. + * + * @param aStatus Completion status of the request. + * KErrNone - at least one store opened successfully + * KErrNotSupported - all stores failed to open + * KErrGeneral - if some stores are already open + */ + IMPORT_C void OpenAllStoresL( TRequestStatus& aStatus ); + + /** + * Opens default contact stores for future match operations. + * Used to find local aliases to phone numbers and email addresses + * NOTE: does not open OwnNumber store or fixed dialing store + * Opens the stores in the default preference order + * + * @exception KErrNotSupported when none of the stores opens + * @exception KErrGeneral if some stores are already open + */ + IMPORT_C void OpenDefaultMatchStoresL(); + + /** + * Opens default contact stores for future match operations. + * Used to find local aliases to phone numbers and email addresses + * Asynchronous version. + * NOTE: does not open OwnNumber store or fixed dialing store + * Opens the stores in the default preference order + * + * @param aStatus Completion status of the request. + * KErrNone - at least one store opened successfully + * KErrNotSupported - all stores failed to open + * KErrGeneral - if some stores are already open + */ + IMPORT_C void OpenDefaultMatchStoresL( TRequestStatus& aStatus ); + + /** + * Opens all OwnNumber stores for future match operations. + * + * @exception KErrNotSupported when none of the stores opens + * @exception KErrGeneral if some stores are already open + */ + IMPORT_C void OpenOwnNumberStoresL(); + + /** + * Opens all OwnNumber stores for future match operations. + * + * @param aStatus Completion status of the request. + * KErrNone - at least one store opened successfully + * KErrNotSupported - all stores failed to open + * KErrGeneral - if some stores are already open + */ + IMPORT_C void OpenOwnNumberStoresL( TRequestStatus& aStatus ); + + /** + * Closes all currently open contact stores + * including OwnNumber stores. + * + * @return Leaves on error. + */ + IMPORT_C void CloseStoresL(); + + /** + * Determines whether a phone number is OwnNumber. Synchronous version. + * The method searches for the number from currently open stores. + * In order to use SIM's ISDN store, it should be the only open store. + * Can be opened with OpenOwnNumberStoresL(). + * + * @param aSearch Phone number to search for + * @param aResult Boolean result. + */ + IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TBool& aResult ); + + /** + * Determines whether a phone number is OwnNumber. Asynchronous version. + * The method searches for the number from currently open stores. + * In order to use SIM's ISDN store, it should be the only open store. + * Can be opened with OpenOwnNumberStoresL(). + * + * @param aSearch Phone number to search for + * @param aStatus Request status containing the result and + * possible error code. + * KErrNone = TRUE, + * KErrNotFound = FALSE, + * other value = system wide error code. + */ + IMPORT_C void IsOwnNumberL( const TDesC& aSearch, TRequestStatus& aStatus ); + + /** + * Finds contacts with phone numbers that match the search string. + * Synchronous version. + * Contacts are searched from all currently open contact stores. + * Matching is done from the end of the phone number. + * Note: If the search string is shorter than 7 digits, matching from + * Phone memory contact store works ONLY if the phone number is + * exactly the same as the search string. + * Example: + * Search string "567" would find phone number "567", but not "1234567". + * From SIM stores both numbers would be found. + * + * @param aSearch Search string + * @param aDigits Number of digits to match from the end of phone number. + * @param aFlags Search all or stop at first match. + * See enum values from CVPbkPhoneNumberMatchStrategy.h + * @param aLinkArray Links to matching contacts are returned in this + * array that method caller provides. + * + * @return KErrNone = success, otherwise an error code. ,,list of codes + */ + IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, + CVPbkContactLinkArray& aLinkArray ); + + /** + * Finds contacts with phone numbers that match the search string. + * Asynchronous version. + * Searching is done according to parameters like in the synchronous version, + * but status code is returned in aStatus. + * + * @param aStatus Completion status of the request. + * Values: KErrNone = success, otherwise an error code. + */ + IMPORT_C void MatchPhoneNumberL( const TDesC& aSearch, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, + CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ); + + /** + * Returns the global list of possible field types. + * + * @return List of field types + */ + IMPORT_C const MVPbkFieldTypeList& FieldTypes() const; + + /** + * Gets a store contact from a contact link. + * @param aContactLink The link from which store contact should be returned. + * @param aStoreContact Pointer to store contact. + * Client must take the ownership immediately. + */ + IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink, + MVPbkStoreContact** aStoreContact ); + + /** + * Gets a store contact from a contact link. + * Asynchronous version. + * Parameters like in the synchronous version, + * but status code is returned in aStatus. + * + * @param aStatus Completion status of the request. + * Values: KErrNone = success, otherwise an error code. + */ + IMPORT_C void GetStoreContactL( const MVPbkContactLink& aContactLink, + MVPbkStoreContact** aStoreContact, TRequestStatus& aStatus ); + + /** + * Returns a pointer to contact's field data of given field type. + * If the field type isn't found from contact, return value is KNullDesC. + * NOTE: this works only for field types of storage type + * EVPbkFieldStorageTypeText. + * For other types, leaves with error code KErrArgument. + * + * @param aStoreContact The contact from which field data should be returned. + * @param aFieldType Field's type. + * @return TPtrC pointer to field's data. + */ + IMPORT_C TPtrC GetFieldDataTextL( const MVPbkStoreContact& aStoreContact, + const MVPbkFieldType& aFieldType ) const; + + /** + * Returns a pointer to contact's field data of given field type. + * If the field type isn't found from contact, return value is + * "1.1.1111". (d.m.yyyy). + * NOTE: this works only for field types of storage type + * EVPbkFieldStorageTypeDateTime. + * For other types, leaves with error code KErrArgument. + * + * @param aStoreContact The contact from which field data should be returned. + * @param aFieldType Field's type. + * @return TTime pointer to field's data. + */ + IMPORT_C TTime GetFieldDataDateTimeL( const MVPbkStoreContact& aStoreContact, + const MVPbkFieldType& aFieldType ) const; + + /** + * Returns a pointer to contact's field data of given field type. + * If the field type isn't found from contact, return value is KNullDesC8. + * NOTE: this works only for field types of storage type + * EVPbkFieldStorageTypeBinary. + * For other types, leaves with error code KErrArgument. + * + * @param aStoreContact The contact from which field data should be returned. + * @param aFieldType Field's type. + * @return TPtrC8 pointer to field's data. + */ + IMPORT_C TPtrC8 GetFieldDataBinaryL( const MVPbkStoreContact& aStoreContact, + const MVPbkFieldType& aFieldType ) const; + + /** + * Cancels asynchronous operation. + */ + IMPORT_C void CancelOperation(); + + /** + * Returns the used contact store list, needed for e.g. aiw fetch + * @return The used contact store list + */ + IMPORT_C MVPbkContactStoreList& GetContactStoresL(); + + /** + * Returns the name of the contact in the same format as MPbk2ContactNameFormatter + * @param aFieldCollection The fieldcollection of the contact + * @return HBufC* the name of the contact or null + */ + IMPORT_C HBufC* GetNameL( + MVPbkStoreContactFieldCollection& aFieldCollection ); + + /** + * Returns reference to the contactmanager + * @return reference to the contact manager + */ + IMPORT_C CVPbkContactManager& GetContactManager(); + + /** + * Finds contacts with field data that match the search string. + * Contacts are searched from all currently open contact stores. + * Matching is done from field types given by the method caller. + * The list of all possible field types can be fetched from the wrapper + * using FieldTypes(). + * + * @param aSearch Search string + * @param aFieldTypes List of field types included in matching. + * @param aLinkArray Links to matching contacts are returned + * in this array that method caller provides. + * + * @return KErrNone = success, otherwise an error code. ,,list of codes + */ + IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray); + + /** + * Finds contacts with field data that match the search string. + * Contacts are searched from all currently open contact stores. + * Matching is done from field types given by the method caller. + * The list of all possible field types can be fetched from the wrapper + * using FieldTypes(). + * + * @param aSearchStrings Search strings + * @param aFieldTypes List of field types included in matching. + * @param aLinkArray Links to matching contacts are returned + * in this array that method caller provides. + * @param aWordParserCallBack is the callback function to the parser + * + * @return KErrNone = success, otherwise an error code. + */ + IMPORT_C void MatchDataL( const MDesC16Array& aSearchStrings, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray, + const TCallBack& aWordParserCallBack ); + + /** + * Finds contacts with field data that match the search string. + * Asynchronous version. + * Searching is done according to parameters like in the synchronous version, + * but status code is returned in aStatus. + * + * @param aStatus Completion status of the request. + * Values: KErrNone = success, otherwise an error code. + */ + IMPORT_C void MatchDataL( const TDesC& aSearch, const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ); + + /** + * Returns reference to the contact name formatter. Object is created if not used earlier. + * @return reference to the contact name formatter + */ + IMPORT_C MPbk2ContactNameFormatter& ContactNameFormatterL(); + + /** + * Splits the input to words and then performs a MatchDataL using the same + * splitter callback function. + * + * LookupL and this are the preferred functions to do text-based lookups from Hg code. + * + * @see MatchDataL + * @see LookupL + */ + IMPORT_C void SplitAndMatchL( const TDesC& aData, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray ); + + /** + * Registers for getting notifications when a contact is added, changed, or deleted. + * Does nothing if already added. + * @param aObserver ref to observer + */ + IMPORT_C void RegisterContactObserverL( MHgCtxContactObserver& aObserver ); + + /** + * Unregisters the given observer. + * Does nothing if the given observer has not been registered before. + * @param aObserver ref to observer + */ + IMPORT_C void UnregisterContactObserver( MHgCtxContactObserver& aObserver ); + + /** + * Looks up a contact based on + * - name, or + * - phone number, or + * - email address, or + * - service id + * + * Also handles the "name " or "name " format. + * + * For service IDs the full uri must be given, e.g. if a contact + * has an Ovi ID in phonebook set to "somebody" then the search will + * only succeed if aData contains "Ovi:somebody" (unless of course + * the string "somebody" matches some name fields). + * + * @param aData name or phone number of email address + * @param aLinkArray array to which the result links are added, + * no items are appended if not found + */ + IMPORT_C void LookupL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray ); + + /** + * Returns the phone numbers of the contact. + * @param aFieldCollection The fieldcollection of the contact + * @param aArray Phone numbers are appended to this. (not resetted) + */ + IMPORT_C void GetNumbersL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ); + + /** + * Returns the email addresses of the contact. + * @param aFieldCollection The fieldcollection of the contact + * @param aArray Email addresses are appended to this. (not resetted) + */ + IMPORT_C void GetEmailAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ); + + /** + * Constructs the address (e.g. street, city, country) for the contact. + * The elements are combined into one string, using space as separator. + * aArray will have 0-3 items appended: nothing, or general and/or work and/or home address. + * @param aFieldCollection The fieldcollection of the contact + * @param aArray Addresses are appended to this. (not resetted) + */ + IMPORT_C void GetAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ); + + enum TWebAddressesType + { + EWebAddresses, //for general web adress + EWebAddressesHome, //for home web adress + EWebAddressesWork //for work web adress + }; + + /** + * Gets the prefered web address for the contact. + * + * aArray can have 0 or more items appended. + * + * @param aFieldCollection The fieldcollection of the contact + * @param aArray Web addresses are appended to this. (not resetted) + * @param aType Determinates which web adress return, @see TWebAddressesType + */ + IMPORT_C void GetWebAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray, + TWebAddressesType aType ); + + + /** + * Gets the thumbnail for a contact. + * @param aFieldCollection The fieldcollection of the contact + * @return bitmap or null (null if not found) + */ + IMPORT_C CFbsBitmap* GetThumbnailL( + MVPbkStoreContactFieldCollection& aFieldCollection ); + + /** + * Checks if the given string is a phone number. + */ + IMPORT_C static TBool IsPhoneNumberL( const TDesC& aData ); + + /** + * Checks if the given string is an email address. + */ + IMPORT_C static TBool IsEmailAddressL( const TDesC& aData ); + + /** + * Appends content of name fields to the given array. + * Uses less fields than LookupL, here only family and given name + * are taken and returned. + * + * @param aFieldCollection fields to check + * @param aArray array to which strings are appended + */ + IMPORT_C void GetNamesForFindL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ); + + /** + * Gets content of name fields. + * Overload for getting results in one string instead of an array. + * @param aFieldCollection fields to check + * @return content of name fields in no particular order separated by a space + */ + IMPORT_C HBufC* GetNamesForFindL( + MVPbkStoreContactFieldCollection& aFieldCollection ); + + /** + * Splits a string into parts. + * Space, comma, and semicolon are treated as separators. + */ + IMPORT_C static CDesCArray* SplitFindStringL(const TDesC& aFindString); + + /** + * Splits a "name1 name2 ... " into two parts: + * "name1 name2 ..." and "something". + * < and > characters are removed. + * The resulting strings are appended to the given arrray. + * Such format is used by messaging components and this function + * is useful if a search has to be made based on both the name and + * the phone number / email address. + * @param aString input string + * @param aArray array to append to + */ + IMPORT_C static void SplitMsgContactL( const TDesC& aString, CDesCArray& aArray ); + + /** + * Appends the values from all matching text fields to a given array. + * @param aFieldCollection fields to scan through + * @param aArray destination array + * @param aVersitName versit property name + * @param aVersitParam versit property parameter + */ + IMPORT_C void GetCustomFieldL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray, + TVPbkFieldTypeName aVersitName, + TVPbkFieldTypeParameter aVersitParam ); + + /** + * Returns a matching field type for the given versit name/parameter. + * The returned list is empty if no matching field types were found. + * @param aVersitName versit property name + * @param aVersitParam versit property parameter + * @return field type list, also on the cleanup stack + */ + IMPORT_C CVPbkFieldTypeRefsList* GetCustomFieldTypeLC( + TVPbkFieldTypeName aVersitName, + TVPbkFieldTypeParameter aVersitParam ); + + /** + * Finds impp field data. + * @param aFieldCollection fields to scan + * @param aSchemeOnlyAray if non-null then scheme parts are appended to here + * @param aUriOnlyArray if non-null then uri parts are appended to here + * @param aFullArray if non-null then full field contents are appended to here + */ + IMPORT_C void GetImppFieldL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray* aSchemeOnlyArray, + CDesCArray* aUriOnlyArray, + CDesCArray* aFullArray ); + + /** + * Finds all contacts that have a birthday on the given month/day. + * Other components from aDate - like year, hours, etc. - are ignored. + * @param aDate date to look for + * @param aLinkArray links are appended to this array + * If no matching contacts are found then aLinkArray is left untouched. + */ + IMPORT_C void FindContactWithBirthdayL( const TTime& aDate, + CVPbkContactLinkArray& aLinkArray ); + +private: // from MVPbkContactStoreListObserver, MVPbkContactStoreObserver + + /** + * Called when the opening process is complete, ie. all stores have + * been reported either failed or successfully opened. + */ + void OpenComplete(); + + /** + * Called when a contact store is ready for use. + */ + void StoreReady( MVPbkContactStore& aContactStore ); + + /** + * Called when a contact store becomes unavailable. + * Client may inspect the reason of the unavailability and decide whether or not + * it will keep the store opened (ie. listen to the store events). + * @param aContactStore The store that became unavailable. + * @param aReason The reason why the store is unavailable. + * This is one of the system wide error codes. + */ + void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason ); + + /** + * Called when changes occur in the contact store. + * @see TVPbkContactStoreEvent, MVPbkContactStoreObserver.h + * + * @param aContactStore + * @param aStoreEvent Event that has occured. + */ + void HandleStoreEventL( MVPbkContactStore& aContactStore, + TVPbkContactStoreEvent aStoreEvent ); + +private: // from MVPbkContactFindFromStoresObserver + /** + * Called when find is complete on a single store. Callee takes + * ownership of the results. In case of an error during find, + * the aResultsFromStore may contain only partial results of the find. + * + * @param aStore is the store from which the contacts were searched from + * + * @param aResultsFromStore Array of contact links that matched the find. + * Callee must take ownership of this object in + * the end of the function, ie. in case the function + * does not leave. + */ + void FindFromStoreSucceededL( MVPbkContactStore& aStore, + MVPbkContactLinkArray* aResultsFromStore ); + + /** + * This function is called if/when there were errors while searching + * from a store. + * @param aStore is the store from which the search was done. + * @param aError is the error code. + */ + void FindFromStoreFailed( MVPbkContactStore& aStore, TInt aError ); + + /** + * Called when find is complete. + */ + void FindFromStoresOperationComplete(); + +private: // from MVPbkContactFindObserver + + /** + * Called when find is complete. Callee takes ownership of the results. + * In case of an error during find, the aResults may contain only + * partial results of the find. + * + * @param aResults Array of contact links that matched the find. + * Callee must take ownership of this object in + * the end of the function, ie. in case the function + * does not leave. + */ + void FindCompleteL( MVPbkContactLinkArray* aResults ); + + /** + * Called in case the find fails for some reason. + * + * @param aError One of the system wide error codes. + */ + void FindFailed( TInt aError ); + +private: // from MVPbkSingleContactOperationObserver + + /** + * Called when operation is completed. + * + * @param aOperation the completed operation. + * @param aContact the contact returned by the operation. + * Client must take the ownership immediately. + */ + void VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& aOperation, MVPbkStoreContact* aContact ); + + /** + * Called if the operation fails. + * + * @param aOperation the failed operation. + * @param aError error code of the failure. + */ + void VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& aOperation, TInt aError ); + +private: // from MVPbkContactViewObserver + void ContactViewReady( + MVPbkContactViewBase& aView ); + void ContactViewUnavailable( + MVPbkContactViewBase& aView ); + void ContactAddedToView( + MVPbkContactViewBase& aView, + TInt aIndex, + const MVPbkContactLink& aContactLink ); + void ContactRemovedFromView( + MVPbkContactViewBase& aView, + TInt aIndex, + const MVPbkContactLink& aContactLink ); + void ContactViewError( + MVPbkContactViewBase& aView, + TInt aError, + TBool aErrorNotified ); + +private: // Constants + + // Wrapper method IDs for calls that have an asynchronous version + enum TMethodId + { + ENoMethod = 0, + EMatchPhoneNumber, + EMatchData, + EGetStoreContact, + EOpenStore, + ECloseStores + }; + + // Wrapper method processing status. + enum TMethodStatus + { + EIdle = 0, + EExecuting, + EFinished + }; + +private: // Methods + const MVPbkStoreContactField* FindField( const MVPbkStoreContact& aContact, + const MVPbkFieldType& aFType ) const; + static CVPbkContactStoreUriArray* GetStoreArrayLC( + const TDesC& (* const aFuncPtrs[])() ); + void OpenStoreL( const TDesC& (* const aFuncPtrs[])() ); + void OpenStoreL( const TDesC& (* const aFuncPtrs[])(), + TRequestStatus& aStatus ); + void FreeOldOperation(); + + // Copies the entries to the existing recipient array + void CopyFindResultsL( MVPbkContactLinkArray* aResults ); + + // Open store, code common to sync/async versions. + void OpenStoreCommonL( const CVPbkContactStoreUriArray& aUriArray ); + + // Match phonenumber, code common to sync/async versions. + void MatchPhoneNumberCommonL( const TDesC& aData, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags ); + + void InitOperationL( TMethodId aApiMethod ); + void InitOperationL( TMethodId aApiMethod, TRequestStatus* aStatus ); + void InitOperation( TRequestStatus* aStatus ); + void OperationComplete( TInt ErrorCode = KErrNone ); + void OperationFailed( TInt aError ); + void CleanupNumberMatch(); + void RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes ); + + void TryTextLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray ); + void TryNumberLookupL( const TDesC& aName, CVPbkContactLinkArray& aLinkArray ); + + void PreCreateNameFieldTypesL(); + void PreCreateEmailFieldTypesL(); + void PreCreateXspIdFieldTypesL(); + void PreCreateNumberFieldTypesL(); + void PreCreateAddressFieldTypesL(); + void PreCreateWebAddressFieldTypesL(); + void PreCreateWebAddressHomeFieldTypesL(); + void PreCreateWebAddressWorkFieldTypesL(); + void PreCreateWorkAddressFieldTypesL(); + void PreCreateHomeAddressFieldTypesL(); + + void GetTextFieldsL( const CVPbkFieldTypeRefsList& aList, + const MVPbkStoreContactFieldCollection& aFieldCollection, CDesCArray& aArray ); + +private: // Data + + // Used members + + RFs* iFsSession; + TBool iFsSessionOwned; + MVPbkStoreContact** iResultStoreContact; // result of GetStoreContact + CVPbkContactLinkArray* iResultContactLinkArray; // result of matching operations + TInt iResultContactLinkCnt; // number of links found in matching operations + TRequestStatus* iClientStatus; // request status used in asynch calls + + // Own members + CVPbkContactManager* iContactManager; + MVPbkContactOperationBase* iOperation; // CM operation being processed + CActiveSchedulerWait iASchedulerWait; // used in asynch calls + CVPbkContactStoreUriArray* iStoreUris; // used in matching + CVPbkPhoneNumberMatchStrategy* iMatchStrategy; // used in matching + CVPbkPhoneNumberMatchStrategy::TConfig* iStratConfig; // used in matching + TBool iSync; // is this wrapper call Synchronous (1) or Asynchronous (0) + TInt iError; // error code used while processing VPbk-operations + TBool iBackup;// contact store backup/restore in progress + // API method ID. Needed for cleanup after method finishes. + TMethodId iApiMethod; + // API method status. Needed to know processing has finished. + TMethodStatus iApiMethodStatus; + + CPbk2SortOrderManager* iSortOrderManager; + MPbk2ContactNameFormatter* iNameFormatter; + + RPointerArray iContactObservers; // ptrs not owned + CVPbkFieldTypeRefsList* iNameFieldTypes; + CVPbkFieldTypeRefsList* iEmailFieldTypes; + CVPbkFieldTypeRefsList* iXspIdFieldTypes; + CVPbkFieldTypeRefsList* iNumberFieldTypes; + CVPbkFieldTypeRefsList* iAddressFieldTypes; + CVPbkFieldTypeRefsList* iWebAddressFieldTypes; + CVPbkFieldTypeRefsList* iWebAddressHomeFieldTypes; + CVPbkFieldTypeRefsList* iWebAddressWorkFieldTypes; + CVPbkFieldTypeRefsList* iWorkAddressFieldTypes; + CVPbkFieldTypeRefsList* iHomeAddressFieldTypes; + }; + +/** +* Panic codes used in CHgCtxContactMatcher. +* +* @since 3.1u +*/ +class HgContactMatcherPanics + { +public: // API + + /** + * Panic codes + */ + enum TPanic + { + EPanNullPointer = 0, + EPanInvalidParam, + EPanInvalidOp + }; + +public: + + /** + * Panic + */ + static void Panic( TPanic aPanic ); + }; + +#endif + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/inc/t_ui_context_utility_api.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/inc/t_ui_context_utility_api.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2002 - 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: T_ui_context_utility_api test module. +* +*/ + + + +#ifndef T_ui_context_utility_api_H +#define T_ui_context_utility_api_H + +// INCLUDES +#include "hgtestbase.h" +#include "hgctxcontactmatcher.h" + +// Logging path +_LIT( KT_ui_context_utility_apiLogPath, "\\logs\\testframework\\T_ui_context_utility_api\\" ); +// Log file +_LIT( KT_ui_context_utility_apiLogFile, "T_ui_context_utility_api.txt" ); + +// CLASS DECLARATION + +/** +* This a T_ui_context_utility_api class. +*/ +NONSHARABLE_CLASS(CT_ui_context_utility_api) : public CHgTestBase + { + public: + + CT_ui_context_utility_api(); + + void ConstructL(); + + static CT_ui_context_utility_api* NewL(); + + void CreateEnvL(); + void DestroyEnv(); + TInt LoadTestCasesL( + TInt& _test_case_no, + CT_ui_context_utility_api::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult); + + ~CT_ui_context_utility_api(); + + TInt RunTestL( + CT_ui_context_utility_api::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult); + + RPtrHashMap* GetImplHashTablePtr() + { + class CTestUtility : public CBase + { + public: + CHgContextUtilityImpl* iImpl; + }; + + class CTestImplementation : CTimer + { + public: + // number of pointers before iMusicContextInfo, calculate M-classes as pointers too + TInt unneeded[12]; + RPtrHashMap iMusicContextInfo; + }; + + // Fetch the pointer to hash table for testing purposes + return &((CTestImplementation*)((CTestUtility*)iContextUtility)->iImpl)->iMusicContextInfo; + } + #define TEST_VAR_DECLARATIONS + /** + * all testmodule-global variables declarations are inserted here + */ + #include "../src/T_ui_context_utility_api_cases.cpp" + #undef TEST_VAR_DECLARATIONS + + // for creating test env + CTrapCleanup* ENV_cleanup; + TInt ENV_err; + CEikonEnv* ENV_env; + CAknAppUi* ENV_aknAppUI; + }; + +#endif // T_ui_context_utility_api_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/src/hgctxcontactmatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/src/hgctxcontactmatcher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2539 @@ +/* +* 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: Contact matching class +* +*/ + + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hgctxcontactmatcher.h" + + +#include "hgctxutilslogging.h" + + +// ================= Static Constant Data =================== + +typedef const TDesC& (*UriFuncPtr)(); + +// Number match store URIs in priority order. +// When doing number matching, order of the stores in the uri array will +// determine which stores are searched first (sequential match). We stop +// the search when first match is found. +static const UriFuncPtr NumberMatchStoreUris[] = + { + VPbkContactStoreUris::DefaultCntDbUri, + // If we don't manage to open some store, we remove it from our array + VPbkContactStoreUris::SimGlobalAdnUri, + VPbkContactStoreUris::SimGlobalSdnUri, + NULL, // end marker + }; + +// All store URIs except own number store +static const UriFuncPtr AllStoreUris[] = + { + VPbkContactStoreUris::DefaultCntDbUri, + // If we don't manage to open some store, we remove it from our array + VPbkContactStoreUris::SimGlobalAdnUri, + VPbkContactStoreUris::SimGlobalSdnUri, + VPbkContactStoreUris::SimGlobalFdnUri, + NULL, // end marker + }; + +// Own number store URIs +static const UriFuncPtr OwnNumberStoreUris[] = + { + VPbkContactStoreUris::SimGlobalOwnNumberUri, + NULL, // end marker + }; + +// number of digits that must match from the right side of a phone number +const TInt KNumberMatchLenFromRight = 7; + +// granularity for CDesCArray +const TInt KArrayGranularity = 4; + +// YYYYMMDD:HHMMSS.MMMMMM +_LIT(KNullTime, "11110000:010101.00000"); + +// ================= STATIC FUNCTIONS ======================= + +// --------------------------------------------------------- +// FindWordSplitterL +// --------------------------------------------------------- +// +static TInt FindWordSplitterL( TAny* aParams ) + { + TVPbkWordParserCallbackParam* parser = + static_cast( aParams ); + + const TText* ptr = parser->iStringToParse->Ptr(); + const TText* end = ptr + parser->iStringToParse->Length(); + + const TText* startOfWord=NULL; + for ( ; ; ) + { + if ( ptr==end || TChar(*ptr).IsSpace() || *ptr == ',' || *ptr == ';' ) + { + if ( startOfWord ) + { + TPtrC addWord( startOfWord,ptr - startOfWord ); + parser->iWordArray->AppendL( addWord ); + startOfWord = NULL; + } + if ( ptr == end ) + { + break; + } + } + else if ( !startOfWord ) + { + startOfWord = ptr; + } + ptr++; + } + return( KErrNone ); + } + +static HBufC* CombineStringsLC( CDesCArray& aArray ) + { + TInt len = 0; + for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i ) + { + len += aArray[i].Length() + 1; + } + HBufC* result = HBufC::NewLC( len ); + TPtr p( result->Des() ); + for ( TInt i = 0, ie = aArray.Count(); i != ie; ++i ) + { + if ( i ) + { + p.Append( ' ' ); + } + p.Append( aArray[i] ); + } + return result; + } + +// ================= MEMBER FUNCTIONS ======================= + +// ---------------------------------------------------------------------------- +// Two-phase constructor for CHgCtxContactMatcher class. +// ---------------------------------------------------------------------------- +EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewL( + RFs* aFsSession ) + { + CHgCtxContactMatcher* self = CHgCtxContactMatcher::NewLC( aFsSession ); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phase constructor for CHgCtxContactMatcher class. +// ---------------------------------------------------------------------------- +EXPORT_C CHgCtxContactMatcher* CHgCtxContactMatcher::NewLC( + RFs* aFsSession ) + { + CHgCtxContactMatcher* self = new ( ELeave ) CHgCtxContactMatcher( aFsSession ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// C++ destructor. +// ---------------------------------------------------------------------------- +EXPORT_C CHgCtxContactMatcher::~CHgCtxContactMatcher() + { + delete iNameFieldTypes; + delete iNumberFieldTypes; + delete iEmailFieldTypes; + delete iXspIdFieldTypes; + delete iAddressFieldTypes; + delete iWebAddressFieldTypes; + delete iHomeAddressFieldTypes; + delete iWorkAddressFieldTypes; + + FreeOldOperation(); + CleanupNumberMatch(); + delete iStoreUris; + delete iContactManager; + delete iSortOrderManager; + delete iNameFormatter; + + if ( iClientStatus ) + { + User::RequestComplete( iClientStatus, KErrCancel ); + } + if ( iASchedulerWait.IsStarted() ) + { + iASchedulerWait.AsyncStop(); + } + + iContactObservers.Close(); + + if ( iFsSessionOwned && iFsSession ) + { + iFsSession->Close(); + delete iFsSession; + } + } + +// ---------------------------------------------------------------------------- +// C++ Constructor. +// ---------------------------------------------------------------------------- +CHgCtxContactMatcher::CHgCtxContactMatcher( RFs* aFsSession) : iFsSession( aFsSession ) + { + } + +// ---------------------------------------------------------------------------- +// Second phase constructor +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::ConstructL() + { + if ( !iFsSession ) + { + // The contact manager would be okay with NULL but some of our own functions + // need an RFs. + iFsSessionOwned = ETrue; + iFsSession = new ( ELeave ) RFs; + User::LeaveIfError( iFsSession->Connect() ); + } + + iContactManager = CVPbkContactManager::NewL( + *CVPbkContactStoreUriArray::NewLC(), iFsSession ); + CleanupStack::PopAndDestroy(); // CVPbkContactStoreUriArray + + // No stores open yet + iStoreUris = CVPbkContactStoreUriArray::NewL(); + } + +//******************* API-methods ********************************************* + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenStoreL( + const CVPbkContactStoreUriArray& aUriArray ) + { + InitOperationL( EOpenStore ); + OpenStoreCommonL( aUriArray ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + // Wait until stores are open + iASchedulerWait.Start(); + } + User::LeaveIfError( iError ); + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenStoreL( + const CVPbkContactStoreUriArray& aUriArray, TRequestStatus& aStatus ) + { + InitOperationL( EOpenStore ); + OpenStoreCommonL( aUriArray ); + InitOperation( &aStatus ); + + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + } + } + + +// ---------------------------------------------------------------------------- +// Common code to sync/async versions. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::OpenStoreCommonL( + const CVPbkContactStoreUriArray& aUriArray ) + { + if (iStoreUris->Count()) + { + // Opening more stores when some stores are already open is not + // supported. Support would require managing iStoreUris properly + // so that it contains all open stores. + User::Leave(KErrGeneral); + } + + const TInt count = aUriArray.Count(); + + for (TInt i = 0; i < count; ++i) + { + // Appended Uri:s to the array. If store fails to open it is removed + // from the array. This keeps Uri's in priority order in the array. + TVPbkContactStoreUriPtr uriPtr = aUriArray[i]; + iStoreUris->AppendL( uriPtr ); + + iContactManager->LoadContactStoreL( uriPtr ); + } + MVPbkContactStoreList& storeList = iContactManager->ContactStoresL(); + storeList.OpenAllL( *this ); + } + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL() + { + OpenStoreL(AllStoreUris); + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenAllStoresL( TRequestStatus& aStatus ) + { + OpenStoreL(AllStoreUris, aStatus); + } + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL() + { + OpenStoreL(NumberMatchStoreUris); + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenDefaultMatchStoresL( TRequestStatus& aStatus ) + { + OpenStoreL(NumberMatchStoreUris, aStatus); + } + +// ---------------------------------------------------------------------------- +// Open OwnNumber stores. +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL() + { + OpenStoreL(OwnNumberStoreUris); + } + +// ---------------------------------------------------------------------------- +// Open OwnNumber stores. +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::OpenOwnNumberStoresL( TRequestStatus& aStatus ) + { + OpenStoreL(OwnNumberStoreUris, aStatus); + } + +// ---------------------------------------------------------------------------- +// Close all open stores. +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::CloseStoresL() + { + // Closing stores does not work. MatchDataL() finds contacts from + // closed stores. + + InitOperationL( ECloseStores ); + + iApiMethodStatus = EExecuting; + TRAPD( err, iContactManager->ContactStoresL().CloseAll( *this ) ); + iApiMethodStatus = EFinished; + if ( err == KErrNone) + { + delete iStoreUris; iStoreUris = NULL; + iStoreUris = CVPbkContactStoreUriArray::NewL(); + } + else + { + User::Leave(err); + } + } + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL( + const TDesC& aData, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, + CVPbkContactLinkArray& aLinkArray ) + { + InitOperationL( EMatchPhoneNumber ); + iResultContactLinkArray = &aLinkArray; + + // Start asynchronous matching and wait until results are ready + MatchPhoneNumberCommonL( aData, aDigits, aFlags ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + iASchedulerWait.Start(); + } + User::LeaveIfError( iError ); + } + + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::MatchPhoneNumberL( + const TDesC& aData, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags, + CVPbkContactLinkArray& aLinkArray, TRequestStatus& aStatus ) + { + InitOperationL( EMatchPhoneNumber ); + iResultContactLinkArray = &aLinkArray; + // Start asynchronous matching + MatchPhoneNumberCommonL( aData, aDigits, aFlags ); + InitOperation( &aStatus ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + } + } + +// ---------------------------------------------------------------------------- +// Common code for sync and async versions +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::MatchPhoneNumberCommonL( + const TDesC& aData, TInt aDigits, + CVPbkPhoneNumberMatchStrategy::TVPbkPhoneNumberMatchFlags aFlags ) + { + // Delete resources allocated for previous match + CleanupNumberMatch(); + + // iStoreUris is filled when stores are opened + + iStratConfig = new (ELeave) CVPbkPhoneNumberMatchStrategy::TConfig( + aDigits, + *iStoreUris, + CVPbkPhoneNumberMatchStrategy::EVPbkSequentialMatch, + aFlags); + iMatchStrategy = CVPbkPhoneNumberMatchStrategy::NewL( + *iStratConfig, + *iContactManager, + *this); + // Start asynchronous matching + iMatchStrategy->MatchL( aData ); + } + + +// ---------------------------------------------------------------------------- +// Find from a store succeeded +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FindFromStoreSucceededL( MVPbkContactStore& /*aStore*/, + MVPbkContactLinkArray* aResultsFromStore ) + { + __ASSERT_DEBUG( aResultsFromStore, HgContactMatcherPanics::Panic( + HgContactMatcherPanics::EPanNullPointer )); + + // Take the ownership of the result immediately + CleanupDeletePushL( aResultsFromStore ); + + CopyFindResultsL( aResultsFromStore ); + + CleanupStack::PopAndDestroy(); // aResultsFromStore + } + +// ---------------------------------------------------------------------------- +// Copy the found results for a store into array +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::CopyFindResultsL( MVPbkContactLinkArray* + aResults ) + { + const TInt count = aResults->Count(); + if ( iResultContactLinkArray ) + { + // Copy links to the member array + for ( TInt i = 0; i < count; ++i ) + { + iResultContactLinkArray->AppendL( aResults->At( i ).CloneLC() ); + CleanupStack::Pop(); // cloned link + } + } + else + { + iResultContactLinkCnt += count; + } + } + + +// ---------------------------------------------------------------------------- +// Find failed +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FindFromStoreFailed( MVPbkContactStore& /*aStore*/, TInt /*aError*/ ) + { + //no operation, search to continue from the other stores + } + + +// ---------------------------------------------------------------------------- +// Find complete +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FindFromStoresOperationComplete() + { + if (!iResultContactLinkArray) + { + // Links were not copied. Result is whether any links found or not. + OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound ); + } + else + { + OperationComplete(); + iResultContactLinkArray = NULL; + } + } + +// ---------------------------------------------------------------------------- +// Return global list of field types. +// ---------------------------------------------------------------------------- +EXPORT_C const MVPbkFieldTypeList& CHgCtxContactMatcher::FieldTypes() const + { + return iContactManager->FieldTypes(); + } + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetStoreContactL( + const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact ) + { + InitOperationL( EGetStoreContact ); + iResultStoreContact = aStoreContact; + + // Start asynchronous operation and wait until results are ready + FreeOldOperation(); + iOperation = iContactManager->RetrieveContactL( aLink, *this ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + iASchedulerWait.Start(); + } + User::LeaveIfError( iError ); + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetStoreContactL( + const MVPbkContactLink& aLink, MVPbkStoreContact** aStoreContact, + TRequestStatus& aStatus ) + { + InitOperationL( EGetStoreContact ); + iResultStoreContact = aStoreContact; + // Start asynchronous operation + FreeOldOperation(); + iOperation = iContactManager->RetrieveContactL( aLink, *this ); + InitOperation( &aStatus ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + } + } + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber, TBool& aResult ) + { + InitOperationL( EMatchPhoneNumber ); + + // Not interested in links, only whether found or not + iResultContactLinkArray = NULL; + iResultContactLinkCnt = 0; + + // Start asynchronous matching and wait until results are ready + MatchPhoneNumberCommonL( aNumber, aNumber.Length(), + CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + iASchedulerWait.Start(); + } + User::LeaveIfError( iError ); + + aResult = iResultContactLinkCnt > 0; + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::IsOwnNumberL( const TDesC& aNumber, + TRequestStatus& aStatus ) + { + InitOperationL( EMatchPhoneNumber ); + + // Not interested in links, only whether found or not + iResultContactLinkArray = NULL; + iResultContactLinkCnt = 0; + + // Start asynchronous matching + MatchPhoneNumberCommonL( aNumber, aNumber.Length(), + CVPbkPhoneNumberMatchStrategy::EVPbkStopOnFirstMatchFlag ); + InitOperation( &aStatus ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + } + } + +// ---------------------------------------------------------------------------- +// Cancel asynchronous operation +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::CancelOperation() + { + if (iApiMethodStatus != EExecuting) + { + return; + } + + __ASSERT_DEBUG(!iSync, HgContactMatcherPanics::Panic( + HgContactMatcherPanics::EPanInvalidOp)); + + switch(iApiMethod) + { + case EMatchData: + case EGetStoreContact: + FreeOldOperation(); // deleting the operation cancels it + break; + case EMatchPhoneNumber: + CleanupNumberMatch(); + break; + default: + ; + } + + User::RequestComplete( iClientStatus, KErrCancel ); + + iApiMethod = ENoMethod; + iApiMethodStatus = EFinished; + } + +// ---------------------------------------------------------------------------- +// GetFieldData, for EVPbkFieldStorageTypeText +// ---------------------------------------------------------------------------- +EXPORT_C TPtrC CHgCtxContactMatcher::GetFieldDataTextL( + const MVPbkStoreContact& aContact, + const MVPbkFieldType& aFType ) const + { + TPtrC ret(KNullDesC); + const MVPbkStoreContactField* field = FindField( aContact, aFType); + if (field) + { + const MVPbkContactFieldData& fdata = field->FieldData(); + if (fdata.DataType() == EVPbkFieldStorageTypeText) + { + const MVPbkContactFieldTextData& fdata2 = + MVPbkContactFieldTextData::Cast(fdata); + ret.Set( fdata2.Text() ); + } + else + { + User::Leave( KErrArgument ); + } + } + return ret; + } + +// ---------------------------------------------------------------------------- +// GetFieldData, for EVPbkFieldStorageTypeDateTime +// ---------------------------------------------------------------------------- +EXPORT_C TTime CHgCtxContactMatcher::GetFieldDataDateTimeL( + const MVPbkStoreContact& aContact, + const MVPbkFieldType& aFType ) const + { + TTime ret(KNullTime); + const MVPbkStoreContactField* field = FindField( aContact, aFType); + if (field) + { + const MVPbkContactFieldData& fdata = field->FieldData(); + if (fdata.DataType() == EVPbkFieldStorageTypeDateTime) + { + const MVPbkContactFieldDateTimeData& fdata2 = + MVPbkContactFieldDateTimeData::Cast( fdata ); + ret = fdata2.DateTime(); + } + else + { + User::Leave( KErrArgument ); + } + } + return ret; + } + +// ---------------------------------------------------------------------------- +// GetFieldData, for EVPbkFieldStorageTypeBinary +// ---------------------------------------------------------------------------- +EXPORT_C TPtrC8 CHgCtxContactMatcher::GetFieldDataBinaryL( + const MVPbkStoreContact& aContact, + const MVPbkFieldType& aFType ) const + { + TPtrC8 ret(KNullDesC8); + const MVPbkStoreContactField* field = FindField( aContact, aFType); + if (field) + { + const MVPbkContactFieldData& fdata = field->FieldData(); + if (fdata.DataType() == EVPbkFieldStorageTypeBinary) + { + const MVPbkContactFieldBinaryData& fdata2 = + MVPbkContactFieldBinaryData::Cast( fdata ); + ret.Set( fdata2.BinaryData() ); + } + else + { + User::Leave( KErrArgument ); + } + } + return ret; + } + + +//******************************** Private Methods *************************** + +// ---------------------------------------------------------------------------- +// Finds a field of given type from contact. +// Returns pointer to field or NULL if not found. +// ---------------------------------------------------------------------------- + const MVPbkStoreContactField* CHgCtxContactMatcher::FindField( + const MVPbkStoreContact& aContact, + const MVPbkFieldType& aFType ) const + { + const MVPbkStoreContactFieldCollection& coll = aContact.Fields(); + TInt n = coll.FieldCount(); + + const MVPbkStoreContactField* field = NULL; + TBool bFound = EFalse; + for(TInt i=0; i < n && !bFound; ++i) + { + field = &coll.FieldAt( i ); + const MVPbkFieldType* ftype = field->MatchFieldType( 0 ); + if ( ftype ) + { + if ( ftype->IsSame( aFType )) + { + bFound = ETrue; + } + } + } + if ( !bFound ) + { + field = NULL; + } + return field; + } + +// ---------------------------------------------------------------------------- +// Get URI array with stores +// ---------------------------------------------------------------------------- +CVPbkContactStoreUriArray* CHgCtxContactMatcher::GetStoreArrayLC( + const TDesC& (* const aFuncPtrs[])() ) + { + CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC(); + + // Add stores + for(TInt i = 0; aFuncPtrs[i]; i++) + { + TVPbkContactStoreUriPtr uriPtr(aFuncPtrs[i]()); + uriArray->AppendL(uriPtr); + } + return uriArray; + } + +// ---------------------------------------------------------------------------- +// Open stores. Synchronous version +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])()) + { + CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs); + + CHgCtxContactMatcher::OpenStoreL(*uriArray); + CleanupStack::PopAndDestroy(uriArray); + } + +// ---------------------------------------------------------------------------- +// Open stores. Asynchronous version +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::OpenStoreL(const TDesC& (* const aFuncPtrs[])(), + TRequestStatus& aStatus) + { + CVPbkContactStoreUriArray* uriArray = GetStoreArrayLC(aFuncPtrs); + + CHgCtxContactMatcher::OpenStoreL(*uriArray, aStatus); + CleanupStack::PopAndDestroy(uriArray); + } + +// ---------------------------------------------------------------------------- +// Called when the opening process is complete, +// ie. all stores have been reported either failed or successfully opened. +// ---------------------------------------------------------------------------- +// +void CHgCtxContactMatcher::OpenComplete() + { + TInt error = KErrNone; + if ( iStoreUris->Count() == 0 ) + { + // unable to open any of the specified stores + error = KErrNotSupported; + } + OperationComplete( error ); + } + +// ---------------------------------------------------------------------------- +// Called when a contact store is ready to use. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::StoreReady( MVPbkContactStore& /*aContactStore*/ ) + { + } + +// ---------------------------------------------------------------------------- +// Called when a contact store becomes unavailable. +// Client may inspect the reason of the unavailability and decide whether or not +// it will keep the store opened (ie. listen to the store events). +// @param aContactStore The store that became unavailable. +// @param aReason The reason why the store is unavailable. +// This is one of the system wide error codes. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::StoreUnavailable( MVPbkContactStore& aContactStore, + TInt /*aReason*/ ) + { + // Remove contact store from uri list + iStoreUris->Remove( aContactStore.StoreProperties().Uri() ); + } + +// ---------------------------------------------------------------------------- +// Called when changes occur in the contact store. +// @see TVPbkContactStoreEvent +// +// @param aStoreEvent Event that has occured. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::HandleStoreEventL( + MVPbkContactStore& /*aContactStore*/, + TVPbkContactStoreEvent aStoreEvent) + { + // Contact and group events can be ignored, but we pass backup events for the observer. + switch ( aStoreEvent.iEventType ) + { + case TVPbkContactStoreEvent::EStoreBackupBeginning: + case TVPbkContactStoreEvent::EStoreRestoreBeginning: + { + iBackup = ETrue; + break; + } + case TVPbkContactStoreEvent::EStoreBackupRestoreCompleted: + { + iBackup = EFalse; + break; + } + case TVPbkContactStoreEvent::EContactAdded: + case TVPbkContactStoreEvent::EContactDeleted: + case TVPbkContactStoreEvent::EContactChanged: + { + for ( TInt i = 0, ie = iContactObservers.Count(); i != ie; ++i ) + { + iContactObservers[i]->HandleContactEventL(); + } + break; + } + default: + break; + } + } + + +// ---------------------------------------------------------------------------- +// Called when find is complete. Callee takes ownership of the results. +// In case of an error during find, the aResults may contain only +// partial results of the find. +// +// @param aResults Array of contact links that matched the find. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FindCompleteL( MVPbkContactLinkArray* aResults ) + { + __ASSERT_DEBUG( aResults, HgContactMatcherPanics::Panic( + HgContactMatcherPanics::EPanNullPointer )); + + // Take the ownership of the result immediately + CleanupDeletePushL( aResults ); + + CopyFindResultsL( aResults ); + + CleanupStack::PopAndDestroy(); // aResults + + if (!iResultContactLinkArray) + { + // No need to copy links. Only interested whether found or not + OperationComplete( iResultContactLinkCnt ? KErrNone:KErrNotFound ); + } + else + { + OperationComplete(); + iResultContactLinkArray = NULL; + } + } + +// ---------------------------------------------------------------------------- +// Called in case the find fails for some reason. +// +// @param aError One of the system wide error codes. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FindFailed( TInt aError ) + { + OperationFailed( aError ); + iResultContactLinkArray = NULL; + } + +// ---------------------------------------------------------------------------- +// Free old VPbk-operation. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::FreeOldOperation() + { + delete iOperation; + iOperation = NULL; + } + +// ---------------------------------------------------------------------------- +// Called when operation is completed. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& /*aOperation*/, MVPbkStoreContact* aContact) + { + *iResultStoreContact = aContact; + iResultStoreContact = NULL; + OperationComplete(); + } + +// ---------------------------------------------------------------------------- +// Called if the operation fails. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& /*aOperation*/, TInt aError) + { + OperationFailed( aError ); + } + +// ---------------------------------------------------------------------------- +// Set member variables for sync operation +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod ) + { + if ( iBackup ) + { + User::Leave( KErrAccessDenied ); + } + + // Check whether operation is in progress + if ( iApiMethodStatus == EExecuting ) + { + User::Leave( KErrInUse ); + } + + iSync = ETrue; + iError = KErrNone; + iApiMethod = aMethod; + iApiMethodStatus = EIdle; + } + +// ---------------------------------------------------------------------------- +// Set member variables for async operation +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::InitOperationL( TMethodId aMethod, TRequestStatus* aStatus ) + { + InitOperationL( aMethod ); + + iSync = EFalse; + iClientStatus = aStatus; + *iClientStatus = KRequestPending; + } + +// ---------------------------------------------------------------------------- +// Set member variables for async operation +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::InitOperation( TRequestStatus* aStatus ) + { + iSync = EFalse; + iClientStatus = aStatus; + *iClientStatus = KRequestPending; + } + +// ---------------------------------------------------------------------------- +// Sync/async operation finished succesfully, return results to method caller. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::OperationComplete( TInt aErrorCode ) + { + if (iSync) + { + if ( iASchedulerWait.IsStarted() ) + { + iASchedulerWait.AsyncStop(); + } + } + else + { + if ( iClientStatus ) + { + User::RequestComplete( iClientStatus, aErrorCode ); + iClientStatus = NULL; + } + } + iApiMethodStatus = EFinished; + } + +// ---------------------------------------------------------------------------- +// Sync/async operation failed, return results to method caller. +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::OperationFailed( TInt aError ) + { + iError = aError; + OperationComplete( aError ); + } + +// ---------------------------------------------------------------------------- +// Free resources allocated for number matching +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::CleanupNumberMatch() +{ + delete iMatchStrategy; + iMatchStrategy = NULL; + + delete iStratConfig; + iStratConfig = NULL; + + // store uris are not deleted here - opened array remains valid + // until new set of stores is opened. +} + +// --------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetContactStoresL +// --------------------------------------------------------------------------- +EXPORT_C MVPbkContactStoreList& CHgCtxContactMatcher::GetContactStoresL() + { + return iContactManager->ContactStoresL(); + } + + +// ----------------------------------------------------------------------------- +// TInt CHgCtxContactMatcher::GetName +// +// Returns the formatted name fo the contact +// ----------------------------------------------------------------------------- +EXPORT_C HBufC* CHgCtxContactMatcher::GetNameL( MVPbkStoreContactFieldCollection& + aFieldCollection ) + { + MPbk2ContactNameFormatter& nameFormatter = ContactNameFormatterL(); + + HBufC* formattedName = nameFormatter.GetContactTitleOrNullL( aFieldCollection, + MPbk2ContactNameFormatter::EUseSeparator ); + return formattedName; + } + +// ----------------------------------------------------------------------------- +// CVPbkContactManager& CHgCtxContactMatcher::GetContactManager( ) +// ----------------------------------------------------------------------------- +EXPORT_C CVPbkContactManager& CHgCtxContactMatcher::GetContactManager() + { + return *iContactManager; + } + + +// ---------------------------------------------------------------------------- +// Synchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray) + { + InitOperationL( EMatchData ); + iResultContactLinkArray = &aLinkArray; + + // Start asynchronous matching and wait until results are ready + FreeOldOperation(); + iOperation = iContactManager->FindL(aData, aFieldTypes, *this); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + iASchedulerWait.Start(); + } + + User::LeaveIfError( iError ); + RemoveSimilarEmailAddressesL( aData, aLinkArray, aFieldTypes ); + } + +// ---------------------------------------------------------------------------- +// Remove contacts that do not have exactly the correct email address +// e.g. if cbd@test.com address is requested, the for example a contact with address abcd@test.com will be removed +// from the result. +// This filtering is done only in the syncronous version of MatchDataL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::RemoveSimilarEmailAddressesL( const TDesC& aData, CVPbkContactLinkArray& aLinkArray, const MVPbkFieldTypeList& aFieldTypes ) + { + TVPbkFieldVersitProperty prop; + prop.SetName( EVPbkVersitNameEMAIL ); + // do extra checks for email addresses + + const MVPbkFieldType* foundType = NULL; + // Continue only if at least one type is EVPbkVersitNameEMAIL + TInt i; + for ( i = 0 ; i < aFieldTypes.FieldTypeCount() ; i++ ) + { + foundType = &(aFieldTypes.FieldTypeAt( i )); + if ( foundType->VersitProperties().Count() > 0 + && foundType->VersitProperties()[0].Name() == prop.Name() ) + { + break; + } + } + if ( i == aFieldTypes.FieldTypeCount() ) + { + // no email types + return; + } + + const MVPbkFieldTypeList& fieldTypeList = FieldTypes(); + + TInt index = 0; + TBool isExactMatch; + while( index < aLinkArray.Count() ) + { + MVPbkStoreContact* storeContact; + GetStoreContactL( aLinkArray.At( index ), &storeContact ); + storeContact->PushL(); + + isExactMatch = EFalse; + for ( TInt i = 0; i < fieldTypeList.FieldTypeCount(); i++ ) + { + // find the email property + foundType = &(fieldTypeList.FieldTypeAt( i )); + if ( foundType->VersitProperties().Count() > 0 + && foundType->VersitProperties()[0].Name() == prop.Name() ) + { + TPtrC src = GetFieldDataTextL(*storeContact, *foundType ); + if ( aData.CompareF( src ) == 0 ) + { + isExactMatch = ETrue; + } + } + } + if ( isExactMatch ) + { + // go for the next contact + index++; + } + else + { + // remove the contact, because the email address does not match the one queried. + // the next one will take plce of this contact in the list (=do not increase index) + aLinkArray.Delete( index ); + } + CleanupStack::PopAndDestroy( storeContact ); + } + } + +// ---------------------------------------------------------------------------- +// Asynchronous version +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::MatchDataL( const TDesC& aData, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray, + TRequestStatus& aStatus) + { + InitOperationL( EMatchData ); + iResultContactLinkArray = &aLinkArray; + + // Start asynchronous matching + FreeOldOperation(); + iOperation = iContactManager->FindL(aData, aFieldTypes, *this); + InitOperation( &aStatus ); + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + } + } +// ---------------------------------------------------------------------------- +// MatchData for searchstrings +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::MatchDataL( const MDesC16Array& aSearchStrings, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray, + const TCallBack& aWordParserCallBack ) + { + InitOperationL( EMatchData ); + iResultContactLinkArray = &aLinkArray; + + // Start asynchronous matching and wait here until results are ready + FreeOldOperation(); + iOperation = iContactManager->FindL( aSearchStrings, aFieldTypes, + *this, aWordParserCallBack ); + + if ( iApiMethodStatus != EFinished ) + { + iApiMethodStatus = EExecuting; + iASchedulerWait.Start(); + } + User::LeaveIfError( iError ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactNameFormatterL +// ---------------------------------------------------------------------------- +EXPORT_C MPbk2ContactNameFormatter& CHgCtxContactMatcher::ContactNameFormatterL() + { + //first initialise, if not already initialised + if ( !iSortOrderManager ) + { + iSortOrderManager = CPbk2SortOrderManager::NewL( FieldTypes() ); + } + + if ( !iNameFormatter ) + { + iNameFormatter = Pbk2ContactNameFormatterFactory::CreateL( FieldTypes(), + *iSortOrderManager ); + } + return *iNameFormatter; + } + + +// --------------------------------------------------------------------------- +// HgContactMatcherPanics::Panic +// +// Panic function +// --------------------------------------------------------------------------- +void HgContactMatcherPanics::Panic( TPanic aPanic ) + { + _LIT(KPanicCategory, "ContactMatcher"); + User::Panic( KPanicCategory, aPanic ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::SplitAndMatchL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::SplitAndMatchL( const TDesC& aData, + const MVPbkFieldTypeList& aFieldTypes, + CVPbkContactLinkArray& aLinkArray) + { + CDesCArray* wordArray = SplitFindStringL( aData ); + CleanupStack::PushL( wordArray ); + TCallBack findParser( FindWordSplitterL ); + MatchDataL( *wordArray, aFieldTypes, aLinkArray, findParser ); + CleanupStack::PopAndDestroy( wordArray ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::RegisterContactObserverL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::RegisterContactObserverL( + MHgCtxContactObserver& aObserver ) + { + if ( iContactObservers.Find( &aObserver ) == KErrNotFound ) + { + iContactObservers.AppendL( &aObserver ); + } + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::UnregisterContactObserver +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::UnregisterContactObserver( + MHgCtxContactObserver& aObserver ) + { + TInt pos = iContactObservers.Find( &aObserver ); + if ( pos >= 0 ) + { + iContactObservers.Remove( pos ); + } + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::LookupL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::LookupL( const TDesC& aData, + CVPbkContactLinkArray& aLinkArray ) + { + HGLOG_CONTEXT( LookupL, HGLOG_LOCAL ); + HGLOG1_IN( "'%S'", &aData ); + + // Take part_A from "part_A " + // or part_A from "part_A". + TPtrC input( aData ); + TInt ltPos = input.Locate( '<' ); + TInt gtPos = input.Locate( '>' ); + if ( ltPos != KErrNotFound && gtPos> ltPos ) + { + input.Set( aData.Mid( 0, ltPos ) ); + } + HBufC* trimmedInput = input.AllocLC(); + trimmedInput->Des().Trim(); + + TInt oldCount = aLinkArray.Count(); + if ( IsPhoneNumberL( *trimmedInput ) ) + { + TryNumberLookupL( *trimmedInput, aLinkArray ); + } + else + { + TryTextLookupL( *trimmedInput, aLinkArray ); + } + + CleanupStack::PopAndDestroy( trimmedInput ); + + if ( aLinkArray.Count() == oldCount && ltPos != KErrNotFound && gtPos > ltPos ) + { + // lookup for part_A was not successful so try part_B + trimmedInput = aData.Mid( ltPos + 1, gtPos - ltPos - 1 ).AllocLC(); + trimmedInput->Des().Trim(); + if ( IsPhoneNumberL( *trimmedInput ) ) + { + TryNumberLookupL( *trimmedInput, aLinkArray ); + } + else + { + TryTextLookupL( *trimmedInput, aLinkArray ); + } + CleanupStack::PopAndDestroy( trimmedInput ); + } + + HGLOG1_OUT( "got %d results", aLinkArray.Count() - oldCount ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateNameFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateNameFieldTypesL() + { + HGLOG_CONTEXT( PreCreateNameFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iNameFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameFN ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNameFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try FN" ); + } + + prop.SetName( EVPbkVersitNameN ); + prop.SetSubField( EVPbkVersitSubFieldGivenName ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNameFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try given name" ); + } + + prop.SetName( EVPbkVersitNameN ); + prop.SetSubField( EVPbkVersitSubFieldFamilyName ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNameFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try family name" ); + } + + prop.SetName( EVPbkVersitNameORG ); + prop.SetSubField( EVPbkVersitSubFieldOrgName ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNameFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try org name" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateEmailFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateEmailFieldTypesL() + { + HGLOG_CONTEXT( PreCreateEmailFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iEmailFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameEMAIL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamINTERNET ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iEmailFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general email" ); + } + + prop.SetName( EVPbkVersitNameEMAIL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamINTERNET ); + prop.Parameters().Add( EVPbkVersitParamWORK ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iEmailFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work email" ); + } + + prop.SetName( EVPbkVersitNameEMAIL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamINTERNET ); + prop.Parameters().Add( EVPbkVersitParamHOME ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iEmailFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home email" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateXspIdFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateXspIdFieldTypesL() + { + HGLOG_CONTEXT( PreCreateXspIdFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iXspIdFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameIMPP ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iXspIdFieldTypes->AppendL( *t ); + } + + HGLOG1_OUT( "found %d xsp id field types", + iXspIdFieldTypes->FieldTypeCount() ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateNumberFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateNumberFieldTypesL() + { + HGLOG_CONTEXT( PreCreateNumberFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iNumberFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamCELL ); + prop.Parameters().Add( EVPbkVersitParamHOME ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home mobile" ); + } + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamCELL ); + prop.Parameters().Add( EVPbkVersitParamWORK ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work mobile" ); + } + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamCELL ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general mobile" ); + } + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamHOME ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home landline" ); + } + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + prop.Parameters().Add( EVPbkVersitParamWORK ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work landline" ); + } + + prop.SetName( EVPbkVersitNameTEL ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + prop.Parameters().Reset(); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iNumberFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general landline" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateAddressFieldTypesL() + { + HGLOG_CONTEXT( PreCreateAddressFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldCountry ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general country" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldRegion ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general region" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldLocality ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general locality" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldStreet ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try general street" ); + } + + HGLOG_OUT(); + } + + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL() + { + HGLOG_CONTEXT( PreCreateWebAddressFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iWebAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.Parameters().Add( EVPbkVersitParamPREF ); + prop.SetName( EVPbkVersitNameURL ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWebAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try prefered url" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateWebAddressHomeFieldTypesL() + { + HGLOG_CONTEXT( PreCreateWebAddressHomeFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iWebAddressHomeFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.Parameters().Add( EVPbkVersitParamHOME ); + prop.SetName( EVPbkVersitNameURL ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWebAddressHomeFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home url" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateWebAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateWebAddressWorkFieldTypesL() + { + HGLOG_CONTEXT( PreCreateWebAddressWorkFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iWebAddressWorkFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.Parameters().Add( EVPbkVersitParamWORK ); + prop.SetName( EVPbkVersitNameURL ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWebAddressWorkFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work url" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateHomeAddressFieldTypesL() + { + HGLOG_CONTEXT( PreCreateHomeAddressFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iHomeAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + prop.Parameters().Add( EVPbkVersitParamHOME ); + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldCountry ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iHomeAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home country" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldRegion ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iHomeAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home region" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldLocality ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iHomeAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home locality" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldStreet ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iHomeAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try home street" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::PreCreateWorkAddressFieldTypesL() + { + HGLOG_CONTEXT( PreCreateWorkAddressFieldTypesL, HGLOG_LOCAL ); + HGLOG_IN(); + + iWorkAddressFieldTypes = CVPbkFieldTypeRefsList::NewL(); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + prop.Parameters().Add( EVPbkVersitParamWORK ); + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldCountry ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWorkAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work country" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldRegion ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWorkAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work region" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldLocality ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWorkAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work locality" ); + } + + prop.SetName( EVPbkVersitNameADR ); + prop.SetSubField( EVPbkVersitSubFieldStreet ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + iWorkAddressFieldTypes->AppendL( *t ); + HGLOG0( HGLOG_INFO, "will try work street" ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::TryTextLookupL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::TryTextLookupL( const TDesC& aName, + CVPbkContactLinkArray& aLinkArray ) + { + HGLOG_CONTEXT( TryTextLookupL, HGLOG_LOCAL ); + HGLOG_IN(); + + CVPbkFieldTypeRefsList* fieldTypes = CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( fieldTypes ); + + // try name and email and ovi id fields + if ( !iNameFieldTypes ) + { + PreCreateNameFieldTypesL(); + } + for ( TInt i = 0, ie = iNameFieldTypes->FieldTypeCount(); i != ie; ++i ) + { + fieldTypes->AppendL( iNameFieldTypes->FieldTypeAt( i ) ); + } + if ( !iEmailFieldTypes ) + { + PreCreateEmailFieldTypesL(); + } + for ( TInt i = 0, ie = iEmailFieldTypes->FieldTypeCount(); i != ie; ++i ) + { + fieldTypes->AppendL( iEmailFieldTypes->FieldTypeAt( i ) ); + } + if ( !iXspIdFieldTypes ) + { + PreCreateXspIdFieldTypesL(); + } + for ( TInt i = 0, ie = iXspIdFieldTypes->FieldTypeCount(); i != ie; ++i ) + { + fieldTypes->AppendL( iXspIdFieldTypes->FieldTypeAt( i ) ); + } + + SplitAndMatchL( aName, *fieldTypes, aLinkArray ); + + CleanupStack::PopAndDestroy( fieldTypes ); + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::TryNumberLookupL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::TryNumberLookupL( const TDesC& aNumber, + CVPbkContactLinkArray& aLinkArray ) + { + HGLOG_CONTEXT( TryNumberLookupL, HGLOG_LOCAL ); + HGLOG_IN(); + + MatchPhoneNumberL( aNumber, + KNumberMatchLenFromRight, + CVPbkPhoneNumberMatchStrategy::EVPbkMatchFlagsNone, + aLinkArray ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetTextFieldsL +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::GetTextFieldsL( + const CVPbkFieldTypeRefsList& aList, + const MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ) + { + HGLOG_CONTEXT( GetTextFieldsL, HGLOG_LOCAL ); + HGLOG_IN(); + + for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) + { + const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); + const MVPbkFieldType* type = field.BestMatchingFieldType(); + if ( type && aList.ContainsSame( *type ) ) + { + const MVPbkContactFieldData& fdata( field.FieldData() ); + if ( fdata.DataType() == EVPbkFieldStorageTypeText ) + { + const MVPbkContactFieldTextData& fdata2 = + MVPbkContactFieldTextData::Cast( fdata ); + const TDesC& text( fdata2.Text() ); + aArray.AppendL( text ); + HGLOG1( HGLOG_INFO, "found: '%S'", &text ); + } + } + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetNumbersL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetNumbersL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ) + { + HGLOG_CONTEXT( GetNumbersL, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( !iNumberFieldTypes ) + { + PreCreateNumberFieldTypesL(); + } + GetTextFieldsL( *iNumberFieldTypes, aFieldCollection, aArray ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetEmailAddressesL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetEmailAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ) + { + HGLOG_CONTEXT( GetEmailAddressesL, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( !iEmailFieldTypes ) + { + PreCreateEmailFieldTypesL(); + } + GetTextFieldsL( *iEmailFieldTypes, aFieldCollection, aArray ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetAddressesL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ) + { + HGLOG_CONTEXT( GetAddressesL, HGLOG_LOCAL ); + HGLOG_IN(); + + CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); + CleanupStack::PushL( arr ); + + if ( !iAddressFieldTypes ) + { + PreCreateAddressFieldTypesL(); + } + GetTextFieldsL( *iAddressFieldTypes, aFieldCollection, *arr ); + if ( arr->Count() ) + { + HBufC* combined = CombineStringsLC( *arr ); + aArray.AppendL( *combined ); + HGLOG1( HGLOG_INFO, "added '%S'", combined ); + CleanupStack::PopAndDestroy( combined ); + } + + arr->Reset(); + if ( !iHomeAddressFieldTypes ) + { + PreCreateHomeAddressFieldTypesL(); + } + GetTextFieldsL( *iHomeAddressFieldTypes, aFieldCollection, *arr ); + if ( arr->Count() ) + { + HBufC* combined = CombineStringsLC( *arr ); + aArray.AppendL( *combined ); + HGLOG1( HGLOG_INFO, "added '%S'", combined ); + CleanupStack::PopAndDestroy( combined ); + } + + arr->Reset(); + if ( !iWorkAddressFieldTypes ) + { + PreCreateWorkAddressFieldTypesL(); + } + GetTextFieldsL( *iWorkAddressFieldTypes, aFieldCollection, *arr ); + if ( arr->Count() ) + { + HBufC* combined = CombineStringsLC( *arr ); + aArray.AppendL( *combined ); + HGLOG1( HGLOG_INFO, "added '%S'", combined ); + CleanupStack::PopAndDestroy( combined ); + } + + CleanupStack::PopAndDestroy( arr ); + HGLOG_OUT(); + } + + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetWebAddressesL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetWebAddressesL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray, + TWebAddressesType aType ) + { + HGLOG_CONTEXT( GetWebAddressesL, HGLOG_LOCAL ); + HGLOG_IN(); + CVPbkFieldTypeRefsList* addressFieldTypes( NULL ); + + switch ( aType ) + { + case EWebAddresses: + { + if ( !iWebAddressFieldTypes ) + { + PreCreateWebAddressFieldTypesL(); + } + addressFieldTypes = iWebAddressFieldTypes; + } + break; + + case EWebAddressesHome: + { + if ( !iWebAddressHomeFieldTypes ) + { + PreCreateWebAddressHomeFieldTypesL(); + } + addressFieldTypes = iWebAddressHomeFieldTypes; + } + break; + + case EWebAddressesWork: + { + if ( !iWebAddressWorkFieldTypes ) + { + PreCreateWebAddressWorkFieldTypesL(); + } + addressFieldTypes = iWebAddressWorkFieldTypes; + } + break; + + default: + break; + } + + if( addressFieldTypes ) + { + GetTextFieldsL( *addressFieldTypes, aFieldCollection, aArray ); + } + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetThumbnailL +// ---------------------------------------------------------------------------- +EXPORT_C CFbsBitmap* CHgCtxContactMatcher::GetThumbnailL( + MVPbkStoreContactFieldCollection& aFieldCollection ) + { + HGLOG_CONTEXT( GetThumbnailL, HGLOG_LOCAL ); + HGLOG_IN(); + + CFbsBitmap* result = 0; + TVPbkFieldVersitProperty prop; + prop.SetName( EVPbkVersitNamePHOTO ); + const MVPbkFieldType* t = FieldTypes().FindMatch( prop, 0 ); + if ( t ) + { + HGLOG0( HGLOG_INFO, "photo field type found" ); + for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) + { + const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); + const MVPbkFieldType* type = field.BestMatchingFieldType(); + if ( type && type->IsSame( *t ) ) + { + const MVPbkContactFieldData& fdata( field.FieldData() ); + if ( fdata.DataType() == EVPbkFieldStorageTypeBinary ) + { + HGLOG0( HGLOG_INFO, "found thumbnail" ); + const MVPbkContactFieldBinaryData& fdata2 = + MVPbkContactFieldBinaryData::Cast( fdata ); + TPtrC8 data( fdata2.BinaryData() ); + CImageDecoder* decoder = 0; + // DataNewL does not seem to work properly with + // EOptionAlwaysThread, it will hang in WaitForRequest + // for ever, at least in the panel app. + // So write the image to a temporary file (duhhh...) + // and use FileNewL. + RFile f; + TFileName tempFileName; + iFsSession->CreatePrivatePath( EDriveC ); + iFsSession->PrivatePath( tempFileName ); + _LIT( KDriveC, "C:" ); + _LIT( KTempName, "hgctxthumb" ); + tempFileName.Insert( 0, KDriveC ); + tempFileName.Append( KTempName ); + HGLOG1( HGLOG_INFO, "tempfn='%S'", &tempFileName ); + User::LeaveIfError( f.Replace( *iFsSession, tempFileName, + EFileWrite ) ); + f.Write( data, data.Length() ); + f.Close(); + TRAPD( err, decoder = CImageDecoder::FileNewL( *iFsSession, + tempFileName, + CImageDecoder::EOptionAlwaysThread ) ); + HGLOG1( HGLOG_INFO, "decoder NewL result: %d", err ); + if ( err == KErrNone ) + { + CleanupStack::PushL( decoder ); + result = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( result ); + TSize sz( decoder->FrameInfo().iOverallSizeInPixels ); + TDisplayMode mode( decoder->FrameInfo().iFrameDisplayMode ); + HGLOG3( HGLOG_INFO, "size=%dx%d, mode=%d", sz.iWidth, + sz.iHeight, mode ); + User::LeaveIfError( result->Create( sz, mode ) ); + + TRequestStatus status; + HGLOG0( HGLOG_INFO, "starting to convert" ); + decoder->Convert( &status, *result ); + User::WaitForRequest( status ); + HGLOG1( HGLOG_INFO, "decoder Convert result: %d", + status.Int() ); + CleanupStack::Pop( result ); + CleanupStack::PopAndDestroy( decoder ); + + if ( status.Int() != KErrNone ) + { + delete result; + result = 0; + } + else + { + // stop and return the bitmap + break; + } + } + } + } + } + } + + HGLOG_OUT(); + return result; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::IsPhoneNumberL +// ---------------------------------------------------------------------------- +EXPORT_C TBool CHgCtxContactMatcher::IsPhoneNumberL( const TDesC& aData ) + { + TBool result = EFalse; + CFindItemEngine::SFoundItem item; + CFindItemEngine* search = CFindItemEngine::NewL( aData, + CFindItemEngine::EFindItemSearchPhoneNumberBin ); + if ( search->ItemCount() ) + { + search->Item( item ); + result = item.iStartPos == 0; + } + delete search; + return result; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::IsEmailAddressL +// ---------------------------------------------------------------------------- +EXPORT_C TBool CHgCtxContactMatcher::IsEmailAddressL( const TDesC& aData ) + { + TBool result = EFalse; + CFindItemEngine::SFoundItem item; + CFindItemEngine* search = CFindItemEngine::NewL( aData, + CFindItemEngine::EFindItemSearchMailAddressBin ); + if ( search->ItemCount() ) + { + search->Item( item ); + result = item.iStartPos == 0; + } + delete search; + return result; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetNamesForFindL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetNamesForFindL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray ) + { + CVPbkFieldTypeRefsList* nameTypes = CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( nameTypes ); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( EVPbkVersitNameN ); + prop.SetSubField( EVPbkVersitSubFieldGivenName ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + nameTypes->AppendL( *t ); + } + + prop.SetName( EVPbkVersitNameN ); + prop.SetSubField( EVPbkVersitSubFieldFamilyName ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + nameTypes->AppendL( *t ); + } + + for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) + { + const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); + t = field.MatchFieldType( 0 ); + if ( t && nameTypes->ContainsSame( *t ) ) + { + const MVPbkContactFieldData& fdata( field.FieldData() ); + if ( fdata.DataType() == EVPbkFieldStorageTypeText ) + { + const MVPbkContactFieldTextData& fdata2 = + MVPbkContactFieldTextData::Cast( fdata ); + aArray.AppendL( fdata2.Text() ); + } + } + } + + CleanupStack::PopAndDestroy( nameTypes ); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetNamesForFindL +// ---------------------------------------------------------------------------- +EXPORT_C HBufC* CHgCtxContactMatcher::GetNamesForFindL( + MVPbkStoreContactFieldCollection& aFieldCollection ) + { + CDesC16ArrayFlat* arr = new ( ELeave ) CDesC16ArrayFlat( KArrayGranularity ); + CleanupStack::PushL( arr ); + GetNamesForFindL( aFieldCollection, *arr ); + HBufC* result = CombineStringsLC( *arr ); + CleanupStack::Pop( result ); + CleanupStack::PopAndDestroy( arr ); + return result; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::SplitFindStringL +// ---------------------------------------------------------------------------- +EXPORT_C CDesCArray* CHgCtxContactMatcher::SplitFindStringL(const TDesC& aFindString) + { + CDesCArray* wordArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); + CleanupStack::PushL( wordArray ); + + TVPbkWordParserCallbackParam parser( &aFindString, wordArray ); + FindWordSplitterL( &parser ); + + CleanupStack::Pop(); // wordArray + return parser.iWordArray; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::SplitMsgContactL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::SplitMsgContactL( const TDesC& aString, + CDesCArray& aArray ) + { + TInt pos = aString.Locate( '<' ); + if ( pos >= 0 ) + { + // skip spaces before '<' + TInt endPos = pos - 1; + while ( endPos > 0 && TChar( aString[endPos] ).IsSpace() ) + { + --endPos; + } + // take the text before '<' + aArray.AppendL( aString.Left( endPos + 1 ) ); + // take the text between '<' and '>' + TInt closePos = aString.Locate( '>' ); + if ( closePos > pos ) + { + aArray.AppendL( aString.Mid( pos + 1, closePos - pos - 1 ) ); + } + } + else + { + aArray.AppendL( aString ); + } + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetCustomFieldL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetCustomFieldL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray& aArray, + TVPbkFieldTypeName aVersitName, + TVPbkFieldTypeParameter aVersitParam ) + { + HGLOG_CONTEXT( GetCustomFieldL, HGLOG_LOCAL ); + HGLOG_IN(); + + CVPbkFieldTypeRefsList* typeList = GetCustomFieldTypeLC( + aVersitName, aVersitParam ); + + GetTextFieldsL( *typeList, aFieldCollection, aArray ); + + CleanupStack::PopAndDestroy( typeList ); + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetCustomFieldTypeLC +// ---------------------------------------------------------------------------- +EXPORT_C CVPbkFieldTypeRefsList* CHgCtxContactMatcher::GetCustomFieldTypeLC( + TVPbkFieldTypeName aVersitName, + TVPbkFieldTypeParameter aVersitParam ) + { + HGLOG_CONTEXT( GetCustomFieldTypeLC, HGLOG_LOCAL ); + HGLOG_IN(); + + CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( typeList ); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + + prop.SetName( aVersitName ); + prop.Parameters().Add( aVersitParam ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + typeList->AppendL( *t ); + HGLOG0( HGLOG_INFO, "field found" ); + } + + HGLOG_OUT(); + return typeList; + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::GetImppFieldL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::GetImppFieldL( + MVPbkStoreContactFieldCollection& aFieldCollection, + CDesCArray* aSchemeOnlyArray, + CDesCArray* aUriOnlyArray, + CDesCArray* aFullArray ) + { + HGLOG_CONTEXT( GetImppFieldL, HGLOG_LOCAL ); + HGLOG_IN(); + + // this function will not build on TUBE + CVPbkFieldTypeRefsList* typeList = CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( typeList ); + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* t; + prop.SetName( EVPbkVersitNameIMPP ); + t = types.FindMatch( prop, 0 ); + if ( t ) + { + typeList->AppendL( *t ); + HGLOG0( HGLOG_INFO, "type found" ); + } + for ( TInt i = 0, ie = aFieldCollection.FieldCount(); i != ie; ++i ) + { + const MVPbkStoreContactField& field( aFieldCollection.FieldAt( i ) ); + const MVPbkFieldType* type = field.BestMatchingFieldType(); + if ( type && typeList->ContainsSame( *type ) ) + { + const MVPbkContactFieldData& fdata( field.FieldData() ); + HGLOG1( HGLOG_INFO, "field found %d", fdata.DataType() ); + if ( fdata.DataType() == EVPbkFieldStorageTypeUri ) + { + const MVPbkContactFieldUriData& fdata2 = + MVPbkContactFieldUriData::Cast( fdata ); + const TDesC& schemeOnly( fdata2.Scheme() ); + const TDesC& uriOnly( fdata2.Text() ); + const TDesC& fullText( fdata2.Uri() ); + HGLOG3( HGLOG_INFO, "'%S' + '%S' = '%S'", + &schemeOnly, &uriOnly, &fullText ); + if ( aSchemeOnlyArray ) + { + aSchemeOnlyArray->AppendL( schemeOnly ); + } + if ( aUriOnlyArray ) + { + aUriOnlyArray->AppendL( uriOnly ); + } + if ( aFullArray ) + { + aFullArray->AppendL( fullText ); + } + } + } + } + CleanupStack::PopAndDestroy( typeList ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::FindContactWithBirthdayL +// ---------------------------------------------------------------------------- +EXPORT_C void CHgCtxContactMatcher::FindContactWithBirthdayL( + const TTime& aDate, + CVPbkContactLinkArray& aLinkArray ) + { + HGLOG_CONTEXT( FindContactWithBirthdayL, HGLOG_LOCAL ); + HGLOG1_IN( "%Ld", aDate.Int64() ); + + // extract month and day + TDateTime dt = aDate.DateTime(); + TInt month = dt.Month(); + TInt day = dt.Day(); + HGLOG2( HGLOG_INFO, "wanted month = %d day = %d", month, day ); + + CVPbkFieldTypeRefsList* emptyList = CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( emptyList ); + + // create view with all contacts + CVPbkContactViewDefinition* def = CVPbkContactViewDefinition::NewLC(); + def->SetType( EVPbkContactsView ); + def->SetUriL( VPbkContactStoreUris::DefaultCntDbUri() ); + MVPbkContactViewBase* view = iContactManager->CreateContactViewLC( + *this, *def, *emptyList ); + + HGLOG0( HGLOG_INFO, "starting wait" ); + iASchedulerWait.Start(); + HGLOG0( HGLOG_INFO, "after wait" ); + + // view is ready + TInt ctCount = view->ContactCountL(); + HGLOG1( HGLOG_INFO, "contact count: %d", ctCount ); + + // find the birthday field type + const MVPbkFieldTypeList& types( FieldTypes() ); + TVPbkFieldVersitProperty prop; + const MVPbkFieldType* bdayFt; + prop.SetName( EVPbkVersitNameBDAY ); + prop.SetSubField( EVPbkVersitSubFieldNone ); + bdayFt = types.FindMatch( prop, 0 ); + + if ( bdayFt && ctCount ) + { + HGLOG0( HGLOG_INFO, "found bday field type" ); + TTime nullTime( KNullTime ); + // go through all contacts and check birthday field values + for ( TInt i = 0; i < ctCount; ++i ) + { + MVPbkContactLink* link( view->CreateLinkLC( i ) ); + MVPbkStoreContact* contact = 0; + GetStoreContactL( *link, &contact ); + if ( contact ) + { + HGLOG1( HGLOG_INFO, "got contact, idx %d", i ); + contact->PushL(); + TTime bday; + bday = GetFieldDataDateTimeL( *contact, *bdayFt ); + if ( bday != nullTime ) + { + HGLOG1( HGLOG_INFO, "found bday %Ld", bday.Int64() ); + dt = bday.DateTime(); + TInt thisMonth = dt.Month(); + TInt thisDay = dt.Day(); + HGLOG2( HGLOG_INFO, "for this contact month = %d day = %d", + thisMonth, thisDay ); + if ( thisMonth == month && thisDay == day ) + { + HGLOG0( HGLOG_INFO, "match" ); + aLinkArray.AppendL( link ); + link = 0; + } + } + CleanupStack::PopAndDestroy(); // contact + } + CleanupStack::Pop(); // if matched then no ownership and link is NULL by now + delete link; + } + } + + CleanupStack::PopAndDestroy(); // view + CleanupStack::PopAndDestroy( def ); + CleanupStack::PopAndDestroy( emptyList ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactViewReady +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::ContactViewReady( + MVPbkContactViewBase& aView ) + { + HGLOG_CONTEXT( ContactViewReady, HGLOG_LOCAL ); + HGLOG_IN(); + + if ( iASchedulerWait.IsStarted() ) + { + iASchedulerWait.AsyncStop(); + } + + aView.RemoveObserver( *this ); + + HGLOG_OUT(); + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactViewUnavailable +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::ContactViewUnavailable( + MVPbkContactViewBase& /*aView*/ ) + { + // means that view is unavailable for now + // but ContactViewReady will be called at some point + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactAddedToView +// ---------------------------------------------------------------------------- +void CHgCtxContactMatcher::ContactAddedToView( + MVPbkContactViewBase& /*aView*/, + TInt /*aIndex*/, + const MVPbkContactLink& /*aContactLink*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactRemovedFromView +// ---------------------------------------------------------------------------- + void CHgCtxContactMatcher::ContactRemovedFromView( + MVPbkContactViewBase& /*aView*/, + TInt /*aIndex*/, + const MVPbkContactLink& /*aContactLink*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CHgCtxContactMatcher::ContactViewError +// ---------------------------------------------------------------------------- + void CHgCtxContactMatcher::ContactViewError( + MVPbkContactViewBase& aView, + TInt aError, + TBool /*aErrorNotified*/ ) + { + HGLOG_CONTEXT( ContactViewError, HGLOG_LOCAL ); + HGLOG1_IN( "aError = %d", aError ); + + if ( iASchedulerWait.IsStarted() ) + { + iASchedulerWait.AsyncStop(); + } + + aView.RemoveObserver( *this ); + + HGLOG_OUT(); + } + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2002 - 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: T_ui_context_utility_api class member functions +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include "hgcontextutilityimpl.h" +#include "hgcontextutility.h" +#include "hgcontexttypes.h" +#include "hgtestbasemacros.h" +#include "T_ui_context_utility_api.h" +#include "wait.h" +#include "hgtestbasemacros.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CT_ui_context_utility_api::CT_ui_context_utility_api +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CT_ui_context_utility_api::CT_ui_context_utility_api() + { + iTestDllName = _L("CT_ui_context_utility_api").AllocL(); + } + +// ----------------------------------------------------------------------------- +// CT_ui_context_utility_api::ConstructL +// Symbian 2nd phase constructor can leave. +// +// Note: If OOM test case uses STIF Logger, then STIF Logger must be created +// with static buffer size parameter (aStaticBufferSize). Otherwise Logger +// allocates memory from heap and therefore causes error situations with OOM +// testing. For more information about STIF Logger construction, see STIF Users +// Guide. +// ----------------------------------------------------------------------------- +// +void CT_ui_context_utility_api::ConstructL() + { + CHgTestBase::BaseConstructL( KT_ui_context_utility_apiLogPath, + KT_ui_context_utility_apiLogFile ); + } + +// ----------------------------------------------------------------------------- +// CT_ui_context_utility_api::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CT_ui_context_utility_api* CT_ui_context_utility_api::NewL() + { + CT_ui_context_utility_api* self = new (ELeave) CT_ui_context_utility_api; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CT_ui_context_utility_api::~CT_ui_context_utility_api() + { + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point +// Returns: CTestModuleBase*: Pointer to Test Module object +// ----------------------------------------------------------------------------- +// +EXPORT_C CTestModuleBase* LibEntryL() + { + return CT_ui_context_utility_api::NewL(); + } + +// ----------------------------------------------------------------------------- +// SetRequirements handles test module parameters(implements evolution +// version 1 for test module's heap and stack sizes configuring). +// Returns: TInt: Symbian error code. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, + TUint32& /*aParameterValid*/ ) + { + return KErrNone; + } + +//// ----------------------------------------------------------------------------- +//// CT_ui_context_utility_api::RunTestL +//// Method responsible for enumerating and running test cases (and also setup and teardown activities before +//// and after each test case). +//// ----------------------------------------------------------------------------- +TInt CT_ui_context_utility_api::RunTestL( + CT_ui_context_utility_api::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult ) + { + TInt _test_case_no = -1; + //test cases, setup and teardown include + + + if( aRunReason == CHgTestBase::ERunTestCase ) + { + LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult); + LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); + LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult); + CreateEnvL(); + _test_case_no = -1; + TRAPD( + errCode, + LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_SETUP, aTestCases, aResult); + LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); + LoadTestCasesL(_test_case_no, aRunReason, STIF_RUN_TEARDOWN, aTestCases, aResult); + ) + DestroyEnv(); + User::LeaveIfError( errCode ); + } + else + { + LoadTestCasesL(_test_case_no, aRunReason, aTestToRun, aTestCases, aResult); + } + + return _test_case_no; + } + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +void CT_ui_context_utility_api::CreateEnvL() + { + CActiveScheduler::Install ( NULL ); + ENV_cleanup = CTrapCleanup::New(); + TInt ENV_err = KErrNone; + ENV_env = new CEikonEnv; + if ( ENV_env ) + { + TRAP( ENV_err, ENV_env->ConstructL() ); + if ( ENV_err ) + { + return; + } + ENV_aknAppUI = new CAknAppUi; + if (ENV_aknAppUI) + { + TRAP( ENV_err, ENV_aknAppUI->BaseConstructL( CEikAppUi::ENoAppResourceFile ) ); \ + if ( ENV_err ) + { + return; + } + } + } + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +void CT_ui_context_utility_api::DestroyEnv() + { + TInt KWait( 500000 ); + CActiveSchedulerWait* wait = new (ELeave) CActiveSchedulerWait(); + CPeriodic* periodic = CPeriodic::NewL( CActive::EPriorityIdle ); + periodic->Start(KWait, KWait, TCallBack( CHgTestBase::CallStop, wait ) ); + wait->Start(); + delete periodic; + delete wait; + + if ( ENV_aknAppUI ) + { + ENV_aknAppUI->PrepareToExit(); + } + if ( ENV_env ) + { + ENV_env->DestroyEnvironment(); + } + if( ENV_cleanup ) + { + delete ENV_cleanup; + } + CActiveScheduler::Install ( iActiveScheduler ); + } +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +TInt CT_ui_context_utility_api::LoadTestCasesL( + TInt& _test_case_no, + CT_ui_context_utility_api::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult) + { +#define TEST_CASES + #include "..\src\T_ui_context_utility_api_cases.cpp" +#undef TEST_CASES + return KErrNone; + } +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api_cases.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/src/t_ui_context_utility_api_cases.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1025 @@ +/* +* Copyright (c) 2002 - 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: T_ui_context_utility_api test module. +* +*/ + + +// DEFINITION OF GLOBAL VARIABLES +#ifdef TEST_VAR_DECLARATIONS +// here You can define global objects used all over code +CHgContextUtility* iContextUtility; +#endif + +// testing code starts here +#ifdef TEST_CASES + +#ifndef KNAME +#define KNAME +_LIT(KName,"James Bond"); +#endif + +// STIF_SETUP defines activities needed before every test case. +STIF_SETUP + { + iContextUtility = CHgContextUtility::NewL(); + return KErrNone; + } + +// STIF_TEARDOWN defines activities needed after every test case +STIF_TEARDOWN + { + delete iContextUtility; + return KErrNone; + } + +// a Canary test to verify test environment. +STIF_TESTDEFINE( CanaryTest ) +{ + +} + +STIF_TESTDEFINE( T_MemoryOnlyTest ) +{ + /*private implementation IsForeground + cant be covered by tests because covered by previous condition*/ + iContextUtility->AllowPublishFromBackground( ETrue ); + iContextUtility->AllowPublishFromBackground( EFalse ); + return KErrNone; +} +//Test code for testing PublishContextL function call +STIF_TESTDEFINE( T_PublishContextL ) + { + // publish the Hg.Contact context to CF + iContextUtility->PublishContextL( KHgCFTypeContact, KName ); + //private implementation with dalay cant be covered by test because its never called + return KErrNone; + } + +//Test code for testing T_PublishContextDelayedL function call +STIF_TESTDEFINE( T_PublishContextDelayedL ) + { + // publish the Hg.Contact context to CF + iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,50000); + iContextUtility->PublishContextDelayedL( KHgCFTypeContact, KName ,0); + return KErrNone; + } + +//Test code for testing GetContextL function call +STIF_TESTDEFINE( T_GetContextL ) + { + HBufC* icontext = iContextUtility->GetContextL( _L( "NonExistContextType" )); + + STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) ); + delete icontext; + + // publish the Hg.Contact context to CF + iContextUtility->PublishContextL( KHgCFTypeContact, KName ); + + icontext = iContextUtility->GetContextL( KHgCFTypeContact); + + STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) ); + delete icontext; + + return KErrNone; + } + +//Test code for testing GetContextL function call +STIF_TESTDEFINE( T_GetContextLWithContextSource ) + { + HBufC* icontext = iContextUtility->GetContextL(KHgCFSource,_L( "NonExistContextType" )); + + STIF_ASSERT_TRUE_DESC( icontext == NULL, _L( "Item found" ) ); + delete icontext; + + // publish the Hg.Contact context to CF + iContextUtility->PublishContextL( KHgCFTypeContact, KName ); + + icontext = iContextUtility->GetContextL(KHgCFSource,KHgCFTypeContact); + + STIF_ASSERT_TRUE_DESC( icontext != NULL, _L( "Context is not found" ) ); + delete icontext; + + return KErrNone; + } + +//Test code for testing spliting combined context +STIF_TESTDEFINE( T_SplitCombinedStringL ) + { + HBufC* val( NULL ); + _LIT( KDummyContext, "CtxUtilApiTest" ); + const TInt KArrayGranularity( 3 ); + CDesCArray* sourceArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); + CDesCArray* resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); + CleanupStack::PushL( sourceArray ); + CleanupStack::PushL( resultArray ); + + iContextUtility->PublishContextL( KDummyContext, *sourceArray ); + //Can't be verified if current context is NULL, because could be already published + + sourceArray->AppendL( _L( "https://somedomain.com?param=parmaValue" ) ); + iContextUtility->PublishContextL( KDummyContext, *sourceArray );//there only one value. nothing to combine but returned value should be equal + val = iContextUtility->GetContextL( KDummyContext ); + CleanupStack::PushL( val ); + STIF_ASSERT_TRUE( val && val->Length() ); + CHgContextUtility::SplitCombinedStringL( *val, *resultArray ); + CleanupStack::PopAndDestroy(val); + STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() ); + for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter ) + { + STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) ); + } + CleanupStack::PopAndDestroy(resultArray); + + resultArray = new( ELeave ) CDesC16ArrayFlat(KArrayGranularity); + CleanupStack::PushL( resultArray ); + sourceArray->AppendL( _L( "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" )); + sourceArray->AppendL( _L( "!@#$%^&&*()/\<>[]|~,." ) ); + + iContextUtility->PublishContextL( KDummyContext, *sourceArray ); + + val = iContextUtility->GetContextL( KDummyContext ); + STIF_ASSERT_TRUE( val && val->Length() ); + CleanupStack::PushL(val); + CHgContextUtility::SplitCombinedStringL( *val, *resultArray ); + CleanupStack::PopAndDestroy( val ); + STIF_ASSERT_TRUE( resultArray->Count() == sourceArray->Count() ); + for( TInt iter( 0 ); iter < sourceArray->Count(); ++iter ) + { + STIF_ASSERT_TRUE( 0 == (*sourceArray)[iter].Compare((*resultArray)[iter]) ); + } + CleanupStack::PopAndDestroy(resultArray); + CleanupStack::PopAndDestroy(sourceArray); + return KErrNone; + } + +//Test code for testing PublishContextL with array argument +STIF_TESTDEFINE( T_PublishContextLWithArray ) + { + _LIT( KDummyContext, "CtxUtilApiTest" ); + CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); + CleanupStack::PushL( arr ); + + iContextUtility->PublishContextL( KDummyContext, *arr ); + + arr->AppendL( _L( "first item" ) ); + arr->AppendL( _L( "second item" ) ); + arr->AppendL( _L( "third item" ) ); + iContextUtility->PublishContextL( KDummyContext, *arr ); + HBufC* val = iContextUtility->GetContextL( KDummyContext ); + STIF_ASSERT_TRUE( val && val->Length() ); + delete val; + CleanupStack::PopAndDestroy( arr ); + return KErrNone; + } + +//Test code for testing PublishContextDelayedL with array argument +STIF_TESTDEFINE( T_PublishContextDelayedLWithArray ) + { + _LIT( KDummyContext, "CtxUtilApiTest2" ); + CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); + CleanupStack::PushL( arr ); + arr->AppendL( _L( "first item" ) ); + arr->AppendL( _L( "second item" ) ); + arr->AppendL( _L( "third item" ) ); + iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 ); + iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 0 ); + iContextUtility->PublishContextDelayedL( KDummyContext, *arr, 500000 ); + CWait* wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + HBufC* val = iContextUtility->GetContextL( KDummyContext ); + STIF_ASSERT_TRUE( val && val->Length() ); + delete val; + CleanupStack::PopAndDestroy( arr ); + return KErrNone; + } + +//Test code for testing RePublishWhenFgL with different arguments +//Most probably nothing will happen because there is no CCoeEnv but +//it should never crash. +STIF_TESTDEFINE( T_RePublishWhenFgL ) + { + iContextUtility->RePublishWhenFgL( ETrue ); + iContextUtility->RePublishWhenFgL( EFalse ); + iContextUtility->RePublishWhenFgL( ETrue ); + return KErrNone; + } + +/* IMPORT_C void PublishContactContextL( const MVPbkStoreContact& aContact, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL1 ) + { + CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); + m->OpenDefaultMatchStoresL(); + CVPbkContactManager& cm( m->GetContactManager() ); + MVPbkContactStoreList& sl( m->GetContactStoresL() ); + MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); + const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); + MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); + MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); + _LIT(KName, "ctxutiltester"); + textData->SetTextL( KName ); + newContact->AddFieldL(newField); + CleanupStack::Pop(newField); + CWait* wait = CWait::NewLC(); + struct TDummyObs : public MVPbkContactObserver + { + CWait* iWait; + TDummyObs( CWait* aWait ) : iWait( aWait ) { } + void ContactOperationCompleted(TContactOpResult /*aResult*/) + { + iWait->Stop(); + } + void ContactOperationFailed(TContactOp /*aOpCode*/, + TInt /*aErrorCode*/, + TBool /*aErrorNotified*/) { } + } dummyObs( wait ); + newContact->CommitL( dummyObs ); + wait->Start( 2000000 ); + CleanupStack::PopAndDestroy( wait ); + + iContextUtility->PublishContactContextL( *newContact, 0 ); + iContextUtility->PublishContactContextL( *newContact, 500000 ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); + ca->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + wait = CWait::NewL(); + struct TDummyObs2 : public MVPbkBatchOperationObserver + { + CWait* iWait; + TDummyObs2( CWait* aWait ) : iWait( aWait ) { } + void StepComplete( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/ ) { } + TBool StepFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/, TInt /*aError*/ ) + { + return EFalse; + } + void OperationComplete( + MVPbkContactOperationBase& /*aOperation*/ ) + { + iWait->Stop(); + } + } dummyObs2( wait ); + MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); + CleanupDeletePushL( op ); + wait->Start( 2000000 ); + delete wait; + CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m + + return KErrNone; + } + +/* IMPORT_C void PublishContactContextL( const MVPbkContactLink& aContactLink, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL2 ) + { + CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); + m->OpenDefaultMatchStoresL(); + CVPbkContactManager& cm( m->GetContactManager() ); + MVPbkContactStoreList& sl( m->GetContactStoresL() ); + MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); + const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); + MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); + MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); + _LIT(KName, "ctxutiltester"); + textData->SetTextL( KName ); + newContact->AddFieldL(newField); + CleanupStack::Pop(newField); + CWait* wait = CWait::NewL(); + struct TDummyObs : public MVPbkContactObserver + { + CWait* iWait; + TDummyObs( CWait* aWait ) : iWait( aWait ) { } + void ContactOperationCompleted(TContactOpResult /*aResult*/) + { + iWait->Stop(); + } + void ContactOperationFailed(TContactOp /*aOpCode*/, + TInt /*aErrorCode*/, + TBool /*aErrorNotified*/){ } + } dummyObs( wait ); + newContact->CommitL( dummyObs ); + wait->Start( 2000000 ); + delete wait; + + CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); + ca->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + + iContextUtility->PublishContactContextL( ca->At( 0 ), 0 ); + iContextUtility->PublishContactContextL( ca->At( 0 ), 500000 ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + wait = CWait::NewL(); + struct TDummyObs2 : public MVPbkBatchOperationObserver + { + CWait* iWait; + TDummyObs2( CWait* aWait ) : iWait( aWait ) { } + void StepComplete( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/ ) { } + TBool StepFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/, TInt /*aError*/ ) + { + return EFalse; + } + void OperationComplete( + MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } + } dummyObs2( wait ); + MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); + CleanupDeletePushL( op ); + wait->Start( 2000000 ); + delete wait; + + // test with (surely) non-existing link + iContextUtility->PublishContactContextL( ca->At( 0 ) ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + + CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m + + return KErrNone; + } + +/* IMPORT_C void PublishContactContextL( const TDesC& aContactName, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL3 ) + { + iContextUtility->PublishContactContextL( KName ); + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + iContextUtility->PublishContactContextL( KName, 500000 ); + iContextUtility->PublishContactContextL( KName, 500000 ); + iContextUtility->PublishContactContextL( KName, 500000 ); + ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + return KErrNone; + } + +/* IMPORT_C void PublishContactContextL( + const RPointerArray& aContacts, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL4 ) + { + CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); + m->OpenDefaultMatchStoresL(); + CVPbkContactManager& cm( m->GetContactManager() ); + MVPbkContactStoreList& sl( m->GetContactStoresL() ); + MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); + const MVPbkFieldType* fieldType = m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); + MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); + MVPbkContactFieldTextData* textData = &(MVPbkContactFieldTextData::Cast(newField->FieldData())); + _LIT(KName, "ctxutiltester"); + textData->SetTextL( KName ); + newContact->AddFieldL(newField); + CleanupStack::Pop(newField); + CWait* wait = CWait::NewL(); + struct TDummyObs : public MVPbkContactObserver + { + CWait* iWait; + TDummyObs( CWait* aWait ) : iWait( aWait ) { } + void ContactOperationCompleted(TContactOpResult /*aResult*/) { iWait->Stop(); } + void ContactOperationFailed(TContactOp /*aOpCode*/, TInt /*aErrorCode*/, TBool /*aErrorNotified*/) { } + } dummyObs( wait ); + newContact->CommitL( dummyObs ); + wait->Start( 2000000 ); + delete wait; + + RPointerArray pa; + CleanupClosePushL( pa ); + pa.AppendL( newContact ); + iContextUtility->PublishContactContextL( pa, 0 ); + iContextUtility->PublishContactContextL( pa, 500000 ); + CleanupStack::PopAndDestroy( &pa ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + RPointerArray pa2; + CleanupClosePushL( pa2 ); + pa2.AppendL( newContact ); + pa2.AppendL( newContact ); + pa2.AppendL( newContact ); + pa2.AppendL( newContact ); + iContextUtility->PublishContactContextL( pa2, 500000 ); + iContextUtility->PublishContactContextL( pa2, 0 ); + CleanupStack::PopAndDestroy( &pa2 ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); + ca->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + wait = CWait::NewL(); + struct TDummyObs2 : public MVPbkBatchOperationObserver + { + CWait* iWait; + TDummyObs2( CWait* aWait ) : iWait( aWait ) { } + void StepComplete( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/ ) { } + TBool StepFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/, TInt /*aError*/ ) + { + return EFalse; + } + void OperationComplete( + MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } + } dummyObs2( wait ); + MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); + CleanupDeletePushL( op ); + wait->Start( 2000000 ); + delete wait; + CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m + + return KErrNone; + } + +/* IMPORT_C void PublishContactContextL( + const RPointerArray& aContactLinks, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL5 ) + { + CHgCtxContactMatcher* m = CHgCtxContactMatcher::NewLC(); + m->OpenDefaultMatchStoresL(); + CVPbkContactManager& cm( m->GetContactManager() ); + MVPbkContactStoreList& sl( m->GetContactStoresL() ); + MVPbkStoreContact* newContact = sl.At( 0 ).CreateNewContactLC(); + const MVPbkFieldType* fieldType = + m->FieldTypes().Find(R_VPBK_FIELD_TYPE_FIRSTNAME); + MVPbkStoreContactField* newField = newContact->CreateFieldLC(*fieldType); + MVPbkContactFieldTextData* textData = + &(MVPbkContactFieldTextData::Cast(newField->FieldData())); + _LIT(KName, "ctxutiltester"); + textData->SetTextL( KName ); + newContact->AddFieldL(newField); + CleanupStack::Pop(newField); + CWait* wait = CWait::NewL(); + struct TDummyObs : public MVPbkContactObserver + { + CWait* iWait; + TDummyObs( CWait* aWait ) : iWait( aWait ) { } + void ContactOperationCompleted(TContactOpResult /*aResult*/) + { + iWait->Stop(); + } + void ContactOperationFailed(TContactOp /*aOpCode*/, + TInt /*aErrorCode*/, + TBool /*aErrorNotified*/) { } + } dummyObs( wait ); + newContact->CommitL( dummyObs ); + wait->Start( 2000000 ); + delete wait; + + CVPbkContactLinkArray* pa = CVPbkContactLinkArray::NewLC(); + pa->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + iContextUtility->PublishContactContextL( *pa, 0 ); + iContextUtility->PublishContactContextL( *pa, 500000 ); + CleanupStack::PopAndDestroy( pa ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + CVPbkContactLinkArray* pa2 = CVPbkContactLinkArray::NewLC(); + pa2->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + pa2->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + pa2->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + iContextUtility->PublishContactContextL( *pa2, 500000 ); + iContextUtility->PublishContactContextL( *pa2, 0 ); + CleanupStack::PopAndDestroy( pa2 ); + wait = CWait::NewL(); + wait->Start( 2000000 ); + delete wait; + ctx = iContextUtility->GetContextL( KHgCFTypeContact); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + + CVPbkContactLinkArray* ca = CVPbkContactLinkArray::NewLC(); + ca->AppendL( newContact->CreateLinkLC() ); + CleanupStack::Pop(); + wait = CWait::NewL(); + struct TDummyObs2 : public MVPbkBatchOperationObserver + { + CWait* iWait; + TDummyObs2( CWait* aWait ) : iWait( aWait ) { } + void StepComplete( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/ ) { } + TBool StepFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aStepSize*/, TInt /*aError*/ ) + { + return EFalse; + } + void OperationComplete( + MVPbkContactOperationBase& /*aOperation*/ ) { iWait->Stop(); } + } dummyObs2( wait ); + MVPbkContactOperationBase* op = cm.DeleteContactsL( *ca, dummyObs2 ); + CleanupDeletePushL( op ); + wait->Start( 2000000 ); + delete wait; + CleanupStack::PopAndDestroy( 4 ); // op, ca, newContact, m + + return KErrNone; + } + +/*IMPORT_C void PublishContactContextL( const MDesCArray& aContactNames, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishContactContextL6 ) + { + CDesCArray* arr = new ( ELeave ) CDesC16ArrayFlat( 4 ); + CleanupStack::PushL( arr ); + arr->AppendL( _L( "first item" ) ); + arr->AppendL( _L( "second item" ) ); + arr->AppendL( _L( "third item" ) ); + iContextUtility->PublishContactContextL( *arr ); + iContextUtility->PublishContactContextL( *arr, 500000 ); + iContextUtility->PublishContactContextL( *arr ); + CleanupStack::PopAndDestroy( arr ); + return KErrNone; + } + +/* IMPORT_C void PublishTextContextL( const TDesC& aText, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishTextContextL ) + { + iContextUtility->PublishTextContextL( KNullDesC, 100 ); + iContextUtility->PublishTextContextL( _L("fbngiuwetghorb rteogvhetui gherigth" ) ); + iContextUtility->PublishTextContextL( KNullDesC ); + iContextUtility->PublishTextContextL( _L("+35442754") ); + iContextUtility->PublishTextContextL( _L("35442754") ); + iContextUtility->PublishTextContextL( _L("abcdef@ghijk.com") ); + iContextUtility->PublishTextContextL( _L(" " ) ); + return KErrNone; + } + +/* IMPORT_C void PublishUrlContextL( const TDesC& aUrl, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishUrlContextL ) + { + _LIT( KNokiaDomain, "http://www.nokia.com" ); + _LIT( KSomeDomain, "http://www.somedomain.com" ); + iContextUtility->PublishUrlContextL( KNokiaDomain, 1000 ); + iContextUtility->PublishUrlContextL( KSomeDomain ); + iContextUtility->PublishUrlContextL( KNokiaDomain ); + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeUrl ); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + STIF_ASSERT_TRUE( 0 == ctx->Compare( KNokiaDomain ) ); + delete ctx; + return KErrNone; + } + +/* IMPORT_C void PublishTimeContextL( const TTime& aTime, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishTimeContextL ) + { + TTime t( 0 ); + iContextUtility->PublishTimeContextL( t, 100 ); + iContextUtility->PublishTimeContextL( t ); + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeActiveDate ); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + delete ctx; + return KErrNone; + } + +/* IMPORT_C void PublishPhotoContextL( const TDesC& aFilename, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishPhotoContextL ) + { + _LIT( KJpegPath, "c:\\image.jpg" ); + _LIT( KPngPath, "c:\\image.png" ); + iContextUtility->PublishPhotoContextL( KJpegPath, 100 ); + iContextUtility->PublishPhotoContextL( KPngPath, 0 ); + iContextUtility->PublishPhotoContextL( KJpegPath ); + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypePhoto ); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) ); + delete ctx; + + iContextUtility->PublishPhotoContextL( KPngPath, 100000 ); + ctx = iContextUtility->GetContextL( KHgCFTypePhoto ); + STIF_ASSERT_TRUE_DESC( ctx != NULL, _L( "Context not found" ) ); + STIF_ASSERT_TRUE( 0 == ctx->Compare(KJpegPath) ); + delete ctx; + return KErrNone; + } + +/* IMPORT_C void PublishPhotoContextL( TItemId aMdeItemId, + CMdESession& aMdeSession, + const TTimeIntervalMicroSeconds32& aDelay = 0 );*/ +STIF_TESTDEFINE( T_PublishPhotoContextL2 ) + { + CWait* wait = CWait::NewLC(); + struct TObs : public MMdESessionObserver { + CWait* iWait; + TObs( CWait* aWait ) : iWait( aWait ) { } + void HandleSessionOpened( CMdESession& /*aSession*/, TInt /*aError*/ ) { iWait->Stop(); } + void HandleSessionError( CMdESession& /*aSession*/, TInt /*aError*/ ) { } + } mdeobs( wait ); + CMdESession* s = CMdESession::NewLC( mdeobs ); + wait->Start( 5000000 ); + // invalid item id + TRAPD( err, iContextUtility->PublishPhotoContextL( 0, *s ) ); + STIF_ASSERT_TRUE( err != KErrNone ); // leave should have occured + for ( TInt i = 0; i < 100; ++i ) + { + TRAP_IGNORE( iContextUtility->PublishPhotoContextL( TItemId( i ), *s ) ); + } + CleanupStack::PopAndDestroy( 2 ); + return KErrNone; + } + +/* IMPORT_C void PublishTvContextL( const TDesC& aChannelName, + const TDesC& aProgramName, const TDesC& aProgramDescription, + const TDesC& aGenre ); */ +STIF_TESTDEFINE( T_PublishTvContextL ) + { + _LIT( K1, "channel A" ); + _LIT( K2, "program X" ); + _LIT( K3, "very interesting program" ); + iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC ); + iContextUtility->PublishTvContextL( K1, K2, K3, KNullDesC ); + iContextUtility->PublishTvContextL( K1, K2, KNullDesC, KNullDesC ); + HBufC* ctx = iContextUtility->GetContextL( KHgCFTypeTvProgramName ); + STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( K2 ), + _L( "Context not found" ) ); + delete ctx; + + iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC ); + iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, KNullDesC ); + iContextUtility->PublishTvContextL( KNullDesC, K2, KNullDesC, KNullDesC ); + iContextUtility->PublishTvContextL( KNullDesC, KNullDesC, KNullDesC, _L("movie") ); + ctx = iContextUtility->GetContextL( KHgCFTypeTvChannelName ); + STIF_ASSERT_TRUE_DESC( ctx != NULL && !ctx->Compare( KHgCFValueUnknownInfo ), + _L( "Context not found" ) ); + delete ctx; + return KErrNone; + } + +/* IMPORT_C void PublishServiceIdL( const TDesC& aServiceId, + const TDesC& aAccountId, + const TTimeIntervalMicroSeconds32& aDelay = 0 ); */ +STIF_TESTDEFINE( T_PublishServiceIdL ) + { + iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") ); + iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid"), 1000000 ); + iContextUtility->PublishServiceIdL( _L("Ovi"), _L("someid") ); + } + +/* IMPORT_C void AddMusicContextInfoL( + const TDesC& aKey, + const TDesC& aData ); */ +STIF_TESTDEFINE( T_AddMusicContextInfoL ) + { + // Fetch the pointer to hash table for testing purposes + RPtrHashMap* hash = GetImplHashTablePtr(); + _LIT( KPlaying, "Playing" ); + _LIT( KArtist, "Hans Zimmer"); + _LIT( KTitle, "Why so serious" ); + _LIT( KAlbum, "Dark Knight" ); + _LIT( KGenre, "Soundtrack" ); + + STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L("There is stuff in the list!") ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicState ) == NULL, _L( "State in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicArtist ) == NULL, _L( "Artist in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicTitle ) == NULL, _L( "Title in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbum ) == NULL, _L( "Album in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicAlbumArt ) == NULL, _L( "Art in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicUri ) == NULL, _L( "Uri in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicGenre ) == NULL, _L( "Genre in the list!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Find( KHgCFTypeMusicType ) == NULL, _L( "Type in the list!" ) ); + + // No room for empty keys + TRAPD( err, iContextUtility->AddMusicContextInfoL( KNullDesC, KPlaying ) ); + STIF_ASSERT_TRUE_DESC( err == KErrNotFound, _L( "Empty key didn't cause leave!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); + + // Fill all values and test they will be there. + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicUri, KNullDesC ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicGenre, KGenre ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicType, KHgCFValueMusicTypePlayer ); + + STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items." ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicState )->CompareC( KPlaying ), + _L( "Wrong state in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicArtist )->CompareC( KArtist ), + _L( "Wrong artist in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicTitle )->CompareC( KTitle ), + _L( "Wrong title in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbum )->CompareC( KAlbum ), + _L( "Wrong album in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicAlbumArt )->CompareC( KHgCFValueUnknownInfo ), + _L( "Wrong art in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicUri )->CompareC( KHgCFValueUnknownInfo ), + _L( "Wrong uri in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicGenre )->CompareC( KGenre ), + _L( "Wrong genre in the table!" ) ); + STIF_ASSERT_TRUE_DESC( !hash->Find( KHgCFTypeMusicType )->CompareC( KHgCFValueMusicTypePlayer ), + _L( "Wrong type in the table!" ) ); + + // An attempt to add same key twice, causes problems. + TRAP( err, iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ) ); + STIF_ASSERT_TRUE_DESC( err == KErrAlreadyExists, _L( "Adding same key should cause a leave!" ) ); + STIF_ASSERT_TRUE_DESC( hash->Count() == 8, _L( "List should contain 8 items!" ) ); + + return KErrNone; + } + +/** IMPORT_C void PublishMusicContextL( + const TTimeIntervalMicroSeconds32& aDelay = 0 ); */ +STIF_TESTDEFINE( T_PublishMusicContextL ) + { + RPtrHashMap* hash = GetImplHashTablePtr(); + _LIT( KPlaying, "Playing" ); + _LIT( KArtist, "John Williams"); + _LIT( KTitle, "Raiders March" ); + _LIT( KAlbum, "Raiders of the Lost Ark" ); + + STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); + TRAPD( err, iContextUtility->PublishMusicContextL() ); + STIF_ASSERT_TRUE_DESC( err == KErrNotReady, _L( "No point to publish anything, when list is empty!" ) ); + + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicState, KPlaying ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicArtist, KArtist ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicTitle, KTitle ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbum, KAlbum ); + iContextUtility->AddMusicContextInfoL( KHgCFTypeMusicAlbumArt, KHgCFValueUnknownInfo ); + + iContextUtility->PublishMusicContextL(); + STIF_ASSERT_TRUE_DESC( hash->Count() == 0, _L( "There is stuff in the list!" ) ); + + HBufC* musicState = iContextUtility->GetContextL( KHgCFTypeMusicState ); + HBufC* musicArtist = iContextUtility->GetContextL( KHgCFTypeMusicArtist ); + HBufC* musicTitle = iContextUtility->GetContextL( KHgCFTypeMusicTitle ); + HBufC* musicAlbum = iContextUtility->GetContextL( KHgCFTypeMusicAlbum ); + HBufC* musicAlbumArt = iContextUtility->GetContextL( KHgCFTypeMusicAlbumArt ); + HBufC* musicGeneralUri = iContextUtility->GetContextL( KHgCFTypeMusicUri ); + HBufC* musicGenre = iContextUtility->GetContextL( KHgCFTypeMusicGenre ); + HBufC* musicType = iContextUtility->GetContextL( KHgCFTypeMusicType ); + + STIF_ASSERT_TRUE_DESC( musicState != NULL + && !musicState->Compare( KPlaying ), _L( "Music context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicArtist != NULL + && !musicArtist->Compare( KArtist ), _L( "Artist context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicTitle != NULL + && !musicTitle->Compare( KTitle ), _L( "Title context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicAlbum != NULL + && !musicAlbum->Compare( KAlbum ), _L( "Album context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicAlbumArt != NULL + && !musicAlbumArt->Compare( KHgCFValueUnknownInfo ), _L( "Art context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicGeneralUri != NULL + && !musicGeneralUri->Compare( KHgCFValueUnknownInfo ), _L( "Uri context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicGenre != NULL + && !musicGenre->Compare( KHgCFValueUnknownInfo ), _L( "Genre context not found" ) ); + STIF_ASSERT_TRUE_DESC( musicType != NULL + && !musicType->Compare( KHgCFValueUnknownInfo ), _L( "Type context not found" ) ); + + delete musicState; + delete musicArtist; + delete musicTitle; + delete musicAlbum; + delete musicAlbumArt; + delete musicGeneralUri; + delete musicGenre; + delete musicType; + + return KErrNone; + } + +STIF_TESTDEFINE( T_PublishRadioContextL ) + { + _LIT( KTestRadioName, "radio test name" ); + _LIT( KTestRadioUrl, "radio test url" ); + _LIT( KTestRadioFrequency, "radio test frequency" ); + _LIT( KTestRadioRDSPI, "radio test rdspi" ); + + HBufC* ctxRadioName = NULL; + HBufC* ctxRadioUrl = NULL; + HBufC* ctxRadioFrequency = NULL; + HBufC* ctxRadioRDSPI = NULL; + + RArray testData; + CleanupClosePushL(testData); + + // Empty Values + iContextUtility->PublishRadioContextL(KNullDesC, KNullDesC, KNullDesC, KNullDesC); + ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); + ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); + ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); + ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); + STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KHgCFValueUnknownInfo ), + _L( "Empty value: ctxRadioName error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KHgCFValueUnknownInfo ), + _L( "Empty value: ctxRadioUrl error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KHgCFValueUnknownInfo ), + _L( "Empty value: ctxRadioFrequency error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KHgCFValueUnknownInfo ), + _L( "Empty value: ctxRadioRDSPI error." ) ); + delete ctxRadioName; + delete ctxRadioUrl; + delete ctxRadioFrequency; + delete ctxRadioRDSPI; + + // One value + testData.Reset(); + testData.ReserveL(16); + for(TInt i = 0; i < 12; i++) + { + testData.AppendL(KNullDesC()); + } + testData.Insert(KTestRadioName(), 0); + testData.Insert(KTestRadioUrl(), 5); + testData.Insert(KTestRadioFrequency(), 10); + testData.Insert(KTestRadioRDSPI(), 15); + for(TInt i = 0; i < 16; i += 4) + { + iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); + ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); + ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); + ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); + ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); + STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && + !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), + _L( "One value: ctxRadioName error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && + !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), + _L( "One value: ctxRadioUrl error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && + !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), + _L( "One value: ctxRadioFrequency error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && + !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), + _L( "One value: ctxRadioRDSPI error." ) ); + delete ctxRadioName; + delete ctxRadioUrl; + delete ctxRadioFrequency; + delete ctxRadioRDSPI; + } + + // Two values + testData.Reset(); + testData.ReserveL(24); + for(TInt i = 0; i < 12; i++) + { + testData.AppendL(KNullDesC()); + } + testData.Insert(KTestRadioName(), 0); + testData.Insert(KTestRadioUrl(), 1); + testData.Insert(KTestRadioName(), 4); + testData.Insert(KTestRadioFrequency(), 6); + testData.Insert(KTestRadioName(), 8); + testData.Insert(KTestRadioRDSPI(), 11); + testData.Insert(KTestRadioUrl(), 13); + testData.Insert(KTestRadioFrequency(), 14); + testData.Insert(KTestRadioUrl(), 17); + testData.Insert(KTestRadioRDSPI(), 19); + testData.Insert(KTestRadioFrequency(), 22); + testData.Insert(KTestRadioRDSPI(), 23); + for(TInt i = 0; i < 24; i += 4) + { + iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); + ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); + ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); + ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); + ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); + STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && + !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), + _L( "Two values: ctxRadioName error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && + !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), + _L( "Two values: ctxRadioUrl error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && + !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), + _L( "Two values: ctxRadioFrequency error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && + !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), + _L( "Two values: ctxRadioRDSPI error." ) ); + delete ctxRadioName; + delete ctxRadioUrl; + delete ctxRadioFrequency; + delete ctxRadioRDSPI; + } + + // Three values + testData.Reset(); + testData.ReserveL(16); + for(TInt i = 0; i < 4; i++) + { + testData.AppendL(KTestRadioName()); + testData.AppendL(KTestRadioUrl()); + testData.AppendL(KTestRadioFrequency()); + testData.AppendL(KTestRadioRDSPI()); + } + testData.Remove(3); + testData.Insert(KNullDesC(), 3); + testData.Remove(6); + testData.Insert(KNullDesC(), 6); + testData.Remove(9); + testData.Insert(KNullDesC(), 9); + testData.Remove(12); + testData.Insert(KNullDesC(), 12); + for(TInt i = 0; i < 16; i += 4) + { + iContextUtility->PublishRadioContextL(testData[i], testData[i+1], testData[i+2], testData[i+3]); + ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); + ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); + ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); + ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); + STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && + !ctxRadioName->Compare( testData[i].Length() ? testData[i] : KHgCFValueUnknownInfo() ), + _L( "Three values: ctxRadioName error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && + !ctxRadioUrl->Compare( testData[i+1].Length() ? testData[i+1] : KHgCFValueUnknownInfo() ), + _L( "Three values: ctxRadioUrl error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && + !ctxRadioFrequency->Compare( testData[i+2].Length() ? testData[i+2] : KHgCFValueUnknownInfo() ), + _L( "Three values: ctxRadioFrequency error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && + !ctxRadioRDSPI->Compare( testData[i+3].Length() ? testData[i+3] : KHgCFValueUnknownInfo() ), + _L( "Three values: ctxRadioRDSPI error." ) ); + delete ctxRadioName; + delete ctxRadioUrl; + delete ctxRadioFrequency; + delete ctxRadioRDSPI; + } + + // Four values + iContextUtility->PublishRadioContextL(KTestRadioName, KTestRadioUrl, KTestRadioFrequency, KTestRadioRDSPI); + ctxRadioName = iContextUtility->GetContextL(KHgCFTypeMusicRadioName); + ctxRadioUrl = iContextUtility->GetContextL(KHgCFTypeMusicRadioUrl); + ctxRadioFrequency = iContextUtility->GetContextL(KHgCFTypeMusicRadioFrequency); + ctxRadioRDSPI = iContextUtility->GetContextL(KHgCFTypeMusicRadioRDSPI); + STIF_ASSERT_TRUE_DESC( ctxRadioName != NULL && !ctxRadioName->Compare( KTestRadioName ), + _L( "Four values: ctxRadioName error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioUrl != NULL && !ctxRadioUrl->Compare( KTestRadioUrl ), + _L( "Four values: ctxRadioUrl error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioFrequency != NULL && !ctxRadioFrequency->Compare( KTestRadioFrequency ), + _L( "Four values: ctxRadioFrequency error." ) ); + STIF_ASSERT_TRUE_DESC( ctxRadioRDSPI != NULL && !ctxRadioRDSPI->Compare( KTestRadioRDSPI ), + _L( "Four values: ctxRadioRDSPI error." ) ); + delete ctxRadioName; + delete ctxRadioUrl; + delete ctxRadioFrequency; + delete ctxRadioRDSPI; + + CleanupStack::PopAndDestroy(&testData); + + return KErrNone; + } + +#endif + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/src/wait.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/src/wait.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,143 @@ +/* +* 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: CWait class implementation +* +*/ + + +#include "wait.h" + +// CONSTANTS + +_LIT( KPanicCat, "ActTimSche" ); + +enum TPanicReason + { + EAlreadyStarted + }; + +LOCAL_C void Panic( TInt aCode ) + { + User::Panic( KPanicCat, aCode ); + } + +// MEMBER FUNCTIONS + +CWait* CWait::NewL() + { + + CWait* self = + CWait::NewLC(); + CleanupStack::Pop( self ); + + return self; + } + +CWait* CWait::NewLC() + { + + CWait* self = + new( ELeave ) CWait; + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +CWait::CWait(): + CTimer( EPriorityStandard ) + { + + // Double check if base class adds active object into scheduler + if( !IsAdded() ) + { + CActiveScheduler::Add( this ); + } + } + +void CWait::ConstructL() + { + + // Do base constructions + CTimer::ConstructL(); + + // Initialize active scheduler wait + iWait = new( ELeave ) CActiveSchedulerWait; + } + +// Destructor +CWait::~CWait() + { + + Cancel(); + delete iWait; + } + +// METHODS + +//----------------------------------------------------------------------------- +// CWait::Start +//----------------------------------------------------------------------------- +// +void CWait::Start( + const TTimeIntervalMicroSeconds32& aInterval ) + { + + __ASSERT_ALWAYS( !IsActive(), Panic( EAlreadyStarted ) ); + + After( aInterval ); + iWait->Start(); + } + +//----------------------------------------------------------------------------- +// CWait::Stop +//----------------------------------------------------------------------------- +// +void CWait::Stop() + { + + Cancel(); + } + +//----------------------------------------------------------------------------- +// CWait::RunL +//----------------------------------------------------------------------------- +// +void CWait::RunL() + { + + // Double check that wait really started + if( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + } + +//----------------------------------------------------------------------------- +// CWait::DoCancel +//----------------------------------------------------------------------------- +// +void CWait::DoCancel() + { + + // Double check that wait really started + CTimer::DoCancel(); + if( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + } + + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/src/wait.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/src/wait.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: CWait class declaration. +* +*/ + + + +#ifndef C_WAIT_H +#define C_WAIT_H + +#include + +/** +* Timed active scheduler wait. +* This class wraps inside a timer and scheduler wait. +* Wait will be automatically stopped after specified time. +*/ +NONSHARABLE_CLASS( CWait ): public CTimer + { + public: // Constructors and destructor + + // Two-phased constructor. + static CWait* NewL(); + static CWait* NewLC(); + + // Destructor. + virtual ~CWait(); + + public: // New methods + + /** + * Starts waiting in the scheduler. + * Wait will be automatically stopped after aInterval amount + * of time has passed. + * + * @param aInterval Interval after wait will be stopped. + * @return None + */ + void Start( const TTimeIntervalMicroSeconds32& aInterval ); + + /** + * Stops scheduler wait. + * + * @param None + * @return None + */ + void Stop(); + + private: // From base classes + + // @see CActive + void RunL(); + + // @see CActive + void DoCancel(); + + private: + + CWait(); + void ConstructL(); + + private: // Data + + // Own: Active scheduler wait + CActiveSchedulerWait* iWait; + }; + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2002 - 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: hgtestbase class member functions +* +*/ + + + +// INCLUDE FILES +#include +#include "hgtestbase.h" +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CHgTestBase::CHgTestBase +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CHgTestBase::CHgTestBase() + { + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::ConstructL +// Symbian 2nd phase constructor can leave. +// +// Note: If OOM test case uses STIF Logger, then STIF Logger must be created +// with static buffer size parameter (aStaticBufferSize). Otherwise Logger +// allocates memory from heap and therefore causes error situations with OOM +// testing. For more information about STIF Logger construction, see STIF Users +// Guide. +// ----------------------------------------------------------------------------- +// +void CHgTestBase::BaseConstructL( const TDesC& aTestPath, + const TDesC& aTestFile ) + { + iLog = CStifLogger::NewL( aTestPath, + aTestFile); + + // Sample how to use logging + _LIT( KLogStart, "Logging starts!" ); + iLog->Log( KLogStart ); + + iVersionLogged = EFalse; + iNumberOfTestCases = 0; + + // Construct active scheduler + iActiveScheduler = new ( ELeave ) CActiveScheduler; + + // Install active scheduler + // We don't need to check whether an active scheduler is already installed + // as this is a new thread, so there won't be one + CActiveScheduler::Install ( iActiveScheduler ); + } + +// Destructor +CHgTestBase::~CHgTestBase() + { + + delete iTestDllName; + delete iLog; + //delete ENV_cleanup; + delete iActiveScheduler; + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::InitL +// InitL is used to initialize the Test Module. +// ----------------------------------------------------------------------------- +// +TInt CHgTestBase::InitL( + TFileName& /*aIniFile*/, + TBool /*aFirstTime*/ ) + { + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::GetTestCasesL +// GetTestCases is used to inquire test cases from the Test Module. Test +// cases are stored to array of test cases. The Test Framework will be +// the owner of the data in the RPointerArray after GetTestCases return +// and it does the memory deallocation. +// ----------------------------------------------------------------------------- +// +TInt CHgTestBase::GetTestCasesL( + const TFileName& /*aConfig*/, + RPointerArray& aTestCases ) + { + TTestResult dummyResult; + return MainTestL(CHgTestBase::EEnumerateTestCases, -1, aTestCases, dummyResult); + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::OOMTestQueryL +// Used to check if a particular test case should be run in OOM conditions and +// which memory allocations should fail. +// ----------------------------------------------------------------------------- +// +TBool CHgTestBase::OOMTestQueryL( + const TFileName& /* aTestCaseFile */, + const TInt /*aCaseNumber*/, + TOOMFailureType& /* aFailureType */, + TInt& /*aFirstMemFailure*/, + TInt& /*aLastMemFailure*/ ) + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::OOMTestInitializeL +// Used to perform the test environment setup for a particular OOM test case. +// Test Modules may use the initialization file to read parameters for Test +// Module initialization but they can also have their own configure file or +// some other routine to initialize themselves. +// +// NOTE: User may add implementation for OOM test environment initialization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CHgTestBase::OOMTestInitializeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::OOMHandleWarningL +// In some cases the heap memory allocation should be skipped, either due to +// problems in the OS code or components used by the code being tested, or even +// inside the tested components which are implemented this way on purpose (by +// design), so it is important to give the tester a way to bypass allocation +// failures. +// +// NOTE: User may add implementation for OOM test warning handling. Usually no +// implementation is required. +// ----------------------------------------------------------------------------- +// +void CHgTestBase::OOMHandleWarningL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */ ) + { + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::OOMTestFinalizeL +// Used to perform the test environment cleanup for a particular OOM test case. +// +// NOTE: User may add implementation for OOM test environment finalization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CHgTestBase::OOMTestFinalizeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +void CHgTestBase::SendTestModuleVersion( const TDesC& aModuleName ) + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR; + moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR; + moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD; + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, aModuleName, newVersionOfMethod); + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::RunTestCaseL +// RunTestCaseL is used to run an individual test case specified +// by aTestCase. Test cases that can be run may be requested from +// Test Module by GetTestCases method before calling RunTestCase. +// ----------------------------------------------------------------------------- +// +TInt CHgTestBase::RunTestCaseL( + const TInt aCaseNumber, + const TFileName& /*aConfig*/, + TTestResult& aResult ) + { + if(!iVersionLogged) + { + CHgTestBase::SendTestModuleVersion( *iTestDllName ); + iVersionLogged = ETrue; + } + + RPointerArray aTestCases; //temporary + + /** + * SetupL is responsible for inicialization of all fields (etc.) common for all testcases + * MainTestL starts required testcase + * TeardownL destroys all data that was created by SetupL + */ + TInt errSetup = KErrNone; + TInt errTestcase = KErrNone; + + if(aCaseNumber > iNumberOfTestCases) + return KErrNotFound; + + __UHEAP_MARK; + + //TRAP(errSetup, MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_SETUP, aTestCases, aResult); + TRAP(errTestcase, MainTestL(CHgTestBase::ERunTestCase, aCaseNumber, aTestCases, aResult)); + // MainTestL(CHgTestBase::ERunTestCase, STIF_RUN_TEARDOWN, aTestCases, aResult)); + + __UHEAP_MARKEND; + + if(errTestcase != KErrNone) + { + aResult.SetResult(errTestcase, _L("Testcase failed")); + } + if(errSetup != KErrNone) + { + aResult.SetResult(errSetup, _L("Setup or teardown failed")); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHgTestBase::MainTestL +// Method responsible for enumerating and running test cases (and also setup and teardown activities before +// and after each test case). +// ----------------------------------------------------------------------------- +// +TInt CHgTestBase::MainTestL(CHgTestBase::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult ) + { + if(aRunReason == CHgTestBase::ERunTestCase) + { + if(aTestToRun < 0) + { + iLog->Log(_L("Running setup or teardown")); + } + else + { + iLog->Log(_L("Running test case #%d"), aTestToRun); + } + } + else + { + iLog->Log(_L("Enumerating test cases.")); + } + + TInt result = -1; + + // this method must be implemented in the test case + result = RunTestL( aRunReason, aTestToRun, aTestCases, aResult ); + + if(aRunReason != CHgTestBase::ERunTestCase) + { + iNumberOfTestCases = result; + iLog->Log(_L("Enumeration completed.")); + } + + // Test case was executed + return KErrNone; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbase.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,233 @@ +/* +* Copyright (c) 2002 - 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: hgtestbase module. +* +*/ + + +#include +#include "StifTestModule.h" +#include + +#include "hgtestbasemacros.h" + +// MACROS +#define TEST_MODULE_VERSION_MAJOR 0 +#define TEST_MODULE_VERSION_MINOR 0 +#define TEST_MODULE_VERSION_BUILD 0 + +// CLASS DECLARATION + +// FORWARD DECLARATIONS +class CHgTestClass; +class CEikonEnv; +class CAknAppUi; + +// DATA TYPES +typedef TInt (CHgTestClass::* TestFunction)(TTestResult&); + +/** +* An internal structure containing a test case name and +* the pointer to function doing the test +*/ +class TCaseInfoInternal +{ +public: + const TText* iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; +}; + +// CLASS DECLARATION + +/** +* A structure containing a test case name and +* the pointer to function doing the test +*/ +class TCaseInfo +{ +public: + TPtrC iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; + +TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) + { + }; + +}; + +class CHgTestBase : public CTestModuleBase +{ + +public: //Enums + // Reason for running test method + enum TCallReason + { + EEnumerateTestCases, + ERunTestCase, + }; + +public: // Constructors and destructor + /** + * Destructor. + */ + virtual ~CHgTestBase(); + +public: // New functions + static TInt CallStop( TAny* aWait ) + { + (static_cast(aWait))->AsyncStop(); + } +public: // Functions from base classes + + /** + * From CTestModuleBase InitL is used to initialize the + * test class object. It is called once for every instance of + * TestModule test class object after its creation. + * @param aIniFile Initialization file for the test module (optional) + * @param aFirstTime Flag is true when InitL is executed for first + * created instance of test class object + * @return Symbian OS error code + */ + TInt InitL( TFileName& aIniFile, TBool aFirstTime ); + + /** + * From CTestModuleBase GetTestCasesL is used to inquiry test cases + * from test class object. + * @param aTestCaseFile Test case file (optional) + * @param aTestCases Array of TestCases returned to test framework + * @return Symbian OS error code + */ + TInt GetTestCasesL( const TFileName& aTestCaseFile, + RPointerArray& aTestCases ); + + + /** + * From CTestModuleBase; OOMTestQueryL is used to specify is particular + * test case going to be executed using OOM conditions + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailureType OOM failure type (optional) + * @param aFirstMemFailure The first heap memory allocation failure value (optional) + * @param aLastMemFailure The last heap memory allocation failure value (optional) + * @return TBool + */ + virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TOOMFailureType& aFailureType, + TInt& /* aFirstMemFailure */, + TInt& /* aLastMemFailure */ ); + + /** + * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + */ + virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + + /** + * From CTestModuleBase; OOMHandleWarningL + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailNextValue FailNextValue for OOM test execution (optional) + * @return None + * + * User may add implementation for OOM test warning handling. Usually no + * implementation is required. + */ + virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */); + + /** + * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + * + */ + virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + + /** + * Method used to log version of test module + */ + void SendTestModuleVersion( const TDesC& aTestPath ); + +private: + /** + * From CTestModuleBase RunTestCaseL is used to run an individual + * test case. + * @param aCaseNumber Test case number + * @param aTestCaseFile Test case file (optional) + * @param aResult Test case result returned to test framework (PASS/FAIL) + * @return Symbian OS error code (test case execution error, which is + * not reported in aResult parameter as test case failure). + */ + TInt RunTestCaseL( const TInt aCaseNumber, + const TFileName& aTestCaseFile, + TTestResult& aResult ); + + /** + * Method containing all test cases, setup and teardown sections. + */ + TInt MainTestL(CHgTestBase::TCallReason aRunReason, TInt aTestToRun, RPointerArray& aTestCases, + TTestResult& aResult); + +protected: + + /** + * C++ default constructor. + */ + CHgTestBase(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void BaseConstructL( const TDesC& aTestPath, + const TDesC& aTestFile ); + + /** + * Put here the #include of the test cases cpp file + */ + virtual TInt RunTestL( + CHgTestBase::TCallReason aRunReason, + TInt aTestToRun, + RPointerArray& aTestCases, + TTestResult& aResult) = 0; + +protected: // Data + // Pointer to test (function) to be executed + TestFunction iMethod; + + // Pointer to logger + CStifLogger * iLog; + + // Flag saying if version of test module was already sent + TBool iVersionLogged; + // Total number of test cases + TInt iNumberOfTestCases; + HBufC16* iTestDllName; + // activescheduler for connecting + CActiveScheduler* iActiveScheduler; +}; diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbasemacros.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/testbase/hgtestbasemacros.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2002 - 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: hgtestbasemacros test module. +* +*/ + + + +#ifndef hgtestbasemacros_H +#define hgtestbasemacros_H + +_LIT( KAssertFailedEquals, "AssertEquals Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedNotEquals, "AssertNotEquals Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedNull, "AssertNull Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedNotNull, "AssertNotNull Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedSame, "AssertSame Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedNotSame, "AssertNotSame Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedTrue, "AssertTrue Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedFalse, "AssertFalse Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedNotLeaves, "AssertNotLeaves Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedLeaves, "AssertLeaves Failed [F:%s][L:%d]" ); +_LIT( KAssertFailedLeavesWith, "AssertLeavesWith Failed [F:%s][L:%d]" ); + + +#ifdef _UNICODE + #define __STIF_WIDEN2(x) L ## x + #define __STIF_WIDEN(x) __STIF_WIDEN2(x) + #define __STIF_DBG_FILE__ __STIF_WIDEN(__FILE__) +#else + #define __STIF_DBG_FILE__ __FILE__ +#endif + + +// Logs to the STIF log file AND to the RDebug +#define STIF_LOG( aMessage ) \ + iLog->Log( _L( aMessage ) ); RDebug::Print( _L( aMessage ) ); + + +// Defines a separate test case which consists of two blocks - one for enumeration of test cases +// second for running the testcase. +#define STIF_TESTDEFINE( aTestName ) \ +_test_case_no++; \ +if( aRunReason == CHgTestBase::EEnumerateTestCases ) \ + { \ + TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); \ + CleanupStack::PushL( newCase ); \ + newCase->iCaseNumber = _test_case_no; \ + newCase->iTitle.Copy( _L( #aTestName ) ); \ + User::LeaveIfError(aTestCases.Append ( newCase ) ); \ + CleanupStack::Pop( newCase ); \ + } \ +else if(aRunReason == CHgTestBase::ERunTestCase && _test_case_no == aTestToRun) + +#define STIF_RUN_SETUP -1 +#define STIF_RUN_TEARDOWN -2 + +// Defines a setup section of MainTestL method +#define STIF_SETUP \ + if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_SETUP ) + +// Defines a teardown section of MainTestL method +#define STIF_TEARDOWN \ + if( aRunReason == CHgTestBase::ERunTestCase && aTestToRun == STIF_RUN_TEARDOWN ) + +/********************************************************************************* + * Assert Macros + *********************************************************************************/ +#define __STIF_ASSERT_SHARED( aFunction, aMessage ) \ + if(!aFunction) \ + { \ + iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ + aResult.SetResult( KErrGeneral, _L("Testcase failed"));\ + User::Leave( KErrGeneral );\ + } + +#define __STIF_ASSERT_SHARED_DESC( aFunction, aMessage, aDesc ) \ + if(!aFunction) \ + { \ + iLog->Log( aMessage, __STIF_DBG_FILE__, __LINE__ );\ + aResult.SetResult( KErrGeneral, aDesc );\ + User::Leave( KErrGeneral );\ + } \ + else \ + { \ + aResult.SetResult( KErrNone, aDesc ); \ + } + + + +#define STIF_ASSERT_EQUALS( aExpected, aActual ) \ + __STIF_ASSERT_SHARED( AssertEquals( aExpected, aActual ) , KAssertFailedEquals ); + +#define STIF_ASSERT_EQUALS_DESC( aExpected, aActual, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( AssertEquals( aExpected, aActual ) , KAssertFailedEquals, aDescription ); + +#define STIF_ASSERT_NOT_EQUALS( aExpected, aActual ) \ + __STIF_ASSERT_SHARED( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals ); + +#define STIF_ASSERT_NOT_EQUALS_DESC( aExpected, aActual, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( !AssertEquals( aExpected, aActual ) , KAssertFailedNotEquals, aDescription ); + +#define STIF_ASSERT_NULL( aPtr ) \ + __STIF_ASSERT_SHARED( AssertNull( aPtr ), KAssertFailedNull ); + +#define STIF_ASSERT_NULL_DESC( aPtr, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( AssertNull( aPtr ), KAssertFailedNull, aDescription ); + +#define STIF_ASSERT_NOT_NULL( aPtr ) \ + __STIF_ASSERT_SHARED( !AssertNull( aPtr ), KAssertFailedNotNull ); + +#define STIF_ASSERT_NOT_NULL_DESC( aPtr, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( !AssertNull( aPtr ), KAssertFailedNotNull, aDescription ); + +#define STIF_ASSERT_SAME( aExpectedPtr, aActualPtr ) \ + __STIF_ASSERT_SHARED( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame ); + +#define STIF_ASSERT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedSame, aDescription ); + +#define STIF_ASSERT_NOT_SAME( aExpectedPtr, aActualPtr) \ + __STIF_ASSERT_SHARED( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame ); + +#define STIF_ASSERT_NOT_SAME_DESC( aExpectedPtr, aActualPtr, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( !AssertSame( aExpectedPtr, aActualPtr ), KAssertFailedNotSame, aDescription ); + +#define STIF_ASSERT_TRUE( aCondition ) \ + __STIF_ASSERT_SHARED( AssertTrue( aCondition ), KAssertFailedTrue ); + +#define STIF_ASSERT_TRUE_DESC( aCondition, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( AssertTrue( aCondition ), KAssertFailedTrue, aDescription ); + +#define STIF_ASSERT_FALSE( aCondition ) \ + __STIF_ASSERT_SHARED( !AssertTrue( aCondition ), KAssertFailedFalse ); + +#define STIF_ASSERT_FALSE_DESC( aCondition, aDescription ) \ + __STIF_ASSERT_SHARED_DESC( !AssertTrue( aCondition), KAssertFailedFalse, aDescription ); + +// Eclosing block is used to create the scope for the __leaveValue +#define STIF_ASSERT_NOT_LEAVES( aStatement ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves ); \ + } + +#define STIF_ASSERT_NOT_LEAVES_DESC( aStatement, aDescription ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, KErrNone ), KAssertFailedNotLeaves, aDescription ); \ + } + +// Eclosing block is used to create the scope for the __leaveValue +#define STIF_ASSERT_LEAVES( aStatement ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves ); \ + } + +#define STIF_ASSERT_LEAVES_DESC( aStatement, aDescription ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED_DESC( !AssertEquals( __leaveValue, KErrNone ), KAssertFailedLeaves, aDescription ); \ + } + +// Eclosing block is used to create the scope for the __leaveValue +#define STIF_ASSERT_LEAVES_WITH( aLeaveCode, aStatement ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves ); \ + } + +#define STIF_ASSERT_LEAVES_WITH_DESC( aLeaveCode, aStatement, aDescription ) \ + { \ + TRAPD( __leaveValue, aStatement ); \ + __STIF_ASSERT_SHARED_DESC( AssertEquals( __leaveValue, aLeaveCode ), KAssertFailedLeaves, aDescription ); \ + } + +#define STIF_ASSERT_PANIC( aPanicCode, aStatement ) \ + { \ + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \ + aStatement; \ + } + +#define STIF_ASSERT_PANIC_DESC( aPanicCode, aStatement, aDescription ) \ + { \ + TestModuleIf().SetExitReason( CTestModuleIf::EPanic, aPanicCode ); \ + aResult.SetResult(KErrNone, aDescription); \ + aStatement; \ + } +#include "sitfunitutils.inl" + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/tsrc/testbase/sitfunitutils.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 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: inline functions for the STIFUnit utils +* +*/ + + +template +inline TBool AssertEquals(const T& aExpected, const T& aActual) +/** + * AssertEquals + * + * @prototype + * @test + * + * @param aExpected - Expected result + * @param aActual - Actual result + * @return - True if equal + */ + { + if( aExpected==aActual ) + { + return ETrue; + } + return EFalse; + } + +template +inline TBool AssertNull(const T* aPtr) +/** + * AssertNull + * + * @prototype + * @test + * + * @param aPtr - Pointer + * @return - True if NULL + */ + { + if( aPtr==NULL ) + { + return ETrue; + } + return EFalse; + } + +template +inline TBool AssertSame(const T* aExpectedPtr, const T* aActualPtr) +/** + * AssertSame + * + * @prototype + * @test + * + * @param aExpectedPtr - Expected pointer + * @param aActualPtr - Actual pointer + * @return - True if equal + */ + { + if( aExpectedPtr==aActualPtr ) + { + return ETrue; + } + return EFalse; + } + +inline TBool AssertTrue(const TBool& aCondition) +/** + * AssertTrue + * + * @prototype + * @test + * + * @param aCondition - Condition + * @return - True if aCondition is true + */ + { + if( !aCondition ) + { + return EFalse; + } + return ETrue; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/context_utility_api/ui_context_utility_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/context_utility_api/ui_context_utility_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + UI Context Utility API + Utility API for publishing context to the Context Framework + c++ + contextengine + + + + + + + + + no + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/external_home_screen_api/external_home_screen_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/external_home_screen_api/external_home_screen_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + + External Home Screen API + Enables external home screen integration + c++ + activeidle + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/external_home_screen_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/external_home_screen_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: External Home Screen API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/ExtrStandbyScrConst.h MW_LAYER_PLATFORM_EXPORT_PATH(ExtrStandbyScrConst.h) +../inc/ExtrStandbyScr.h MW_LAYER_PLATFORM_EXPORT_PATH(ExtrStandbyScr.h) +../inc/ExtrStandbyScr.inl MW_LAYER_PLATFORM_EXPORT_PATH(ExtrStandbyScr.inl) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScr.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2005-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: Define the API for a external standby screen +* +*/ + + + +#ifndef EXTRSTANDBYSCR_H +#define EXTRSTANDBYSCR_H + +// INCLUDES +#include +#include +#include + +#include "ExtrStandbyScrConst.h" + +const TUid KCExtrStandbyScrInterfaceUid = {KExtrStandbyScrInterfaceUid} ; + +class CExtrStandbyScr : public CCoeControl + { +public: + + /** + * Creates new instance of CExtrStandbyScr based class. + * @param aImplementationUid implementation UID . + * @param aDataStore + * @return CExtrStandbyScr* Newly created instance. + */ + inline static CExtrStandbyScr* NewL(TUid aImplementationUid,CCoeControl *aContainer); + + /** + * Destructor. + */ + inline virtual ~CExtrStandbyScr(); + +public: + + /** + * LoadEngineL + * Instructs the plugin that is has been selected to run and to now load its corresponding engine + */ + virtual void LoadEngineL()=0; + +public: /* Layout */ + + /** + * GetPreferedSize + * Returns the preferred size of the plugin + */ + inline virtual TSize GetPreferedSize(); + + /** + * GetNextSizeDecrement + * The difference in size from the current size to the next smaller size this plugin can support + */ + inline virtual TSize GetNextSizeDecrement() ; + + /** + * ResetToDefaultState + * Set the plugin to the default state. This is called when the plugin start and with the red key + */ + inline virtual void ResetToDefaultState(); + +public: /* Functions to read static settings from plugin */ + + /** + * GetMinSize + * Returns the minimum size this plugin can render its content in + */ + virtual TSize GetMinSize() = 0 ; + + /** + * GetMaxSize + * Returns the maximum size this plugin can render its content in + */ + virtual TSize GetMaxSize() = 0 ; + +protected: + + virtual void Draw(const TRect& aRect) const; + +private: + // ECOM framework requires this ID in object destructor + TUid iDtor_ID_Key; + }; + +#include "ExtrStandbyScr.inl" + +#ifdef __ACTIVE_IDLE +#include "extrstandbyscrutil.inl" +#endif + +#endif // EXTRSTANDBYSCR_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScr.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScr.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005-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: Define the API for a external standby screen +* +*/ + + +// INCLUDES + +// --------------------------------------------------------- +// CExtrStandbyScr::NewL +// --------------------------------------------------------- +// +inline CExtrStandbyScr* CExtrStandbyScr::NewL(TUid aImplementationUid,CCoeControl *aContainer) + { + return REINTERPRET_CAST(CExtrStandbyScr*, + REComSession::CreateImplementationL (aImplementationUid, + _FOFF (CExtrStandbyScr, iDtor_ID_Key), + aContainer)) ; + } + +// --------------------------------------------------------- +// CExtrStandbyScr::~CExtrStandbyScr +// --------------------------------------------------------- +// +inline CExtrStandbyScr::~CExtrStandbyScr() + { + // Destroy any instance variables and then + // inform the framework that this specific + // instance of the interface has been destroyed. + REComSession::DestroyedImplementation (iDtor_ID_Key); + } + +// --------------------------------------------------------- +// CExtrStandbyScr::GetNextSizeDecrement +// --------------------------------------------------------- +// +inline TSize CExtrStandbyScr::GetNextSizeDecrement() + { + return TSize(0,0); + } + +// --------------------------------------------------------- +// CExtrStandbyScr::ResetToDefaultState +// --------------------------------------------------------- +// +inline void CExtrStandbyScr::ResetToDefaultState() + { + } + +// --------------------------------------------------------- +// CExtrStandbyScr::SetLayoutL +// --------------------------------------------------------- +// +inline TSize CExtrStandbyScr::GetPreferedSize() + { + return GetMaxSize(); + } + +#ifndef __ACTIVE_IDLE +// ----------------------------------------------------------------------------- +// CExtrStandbyScr::Draw +// ----------------------------------------------------------------------------- +// +inline void CExtrStandbyScr::Draw(const TRect& /*aRect*/) const + { + } +#endif \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScrConst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/external_home_screen_api/inc/ExtrStandbyScrConst.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005-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: Define the API for a external standby screen +* +*/ + + +#ifndef EXTRSTANDBYSCRCONST_H +#define EXTRSTANDBYSCRCONST_H + +#define KExtrStandbyScrInterfaceUid 0x101F8700 + +// This constant should be used in source code to check +// if opaque_data field of ecom plugin registration +// file has value which identifies fullscreen mode +#define KExtrStandbyScrFullScreenMode _L8("fullscreen") + +// This constant can be used in Ecom registration file +// to set opaque_data field correctly. +// e.g. opaque_data = KExtrStandbyScrFullScreenModeRss; +#define KExtrStandbyScrFullScreenModeRss "fullscreen" + +#endif // EXTRSTANDBYSCRCONST_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 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: Includes all the Domain API specific bld.inf files, which +* export files. +* +*/ + + + +#include "../ai_content_model_api/group/bld.inf" +#include "../ai_utilities_api/group/bld.inf" +#include "../ai_plugin_management_api/group/bld.inf" +#include "../ai_plugin_information_api/group/bld.inf" +#include "../ai_shortcut_command_api/group/bld.inf" +#include "../ai_variation_api/group/bld.inf" +#include "../action_handler_plugin_api/group/bld.inf" +#include "../content_harvester_plugin_api/group/bld.inf" +#include "../menu_model_api/group/bld.inf" +#include "../menu_sat_interface_api/group/bld.inf" +#include "../external_home_screen_api/group/bld.inf" +#include "../menu_content_service_api/group/bld.inf" +#include "../sapi_contentpublishing/group/bld.inf" +#include "../sapi_backstepping/group/bld.inf" +#include "../sapi_actionhandler/group/bld.inf" +#include "../sapi_homescreenplugin/group/bld.inf" +#include "../sapi_menucontent/group/bld.inf" +#include "../shortcutplugin_extension_api/group/bld.inf" +#include "../xcfw_api/group/bld.inf" +#include "../idlefw_api/group/bld.inf" +#include "../hs_widget_publisher_api/group/bld.inf" +#include "../context_utility_api/group/bld.inf" +#include "../hs_settings_api/group/bld.inf" +#include "../hs_content_control_api/group/bld.inf" diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_content_control_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_content_control_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2007-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: Build information file for project hs_content_control_api +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hscontentcontroller.h MW_LAYER_PLATFORM_EXPORT_PATH(hscontentcontroller.h) +../inc/hscontentcontrol.h MW_LAYER_PLATFORM_EXPORT_PATH(hscontentcontrol.h) +../inc/hscontentinfo.h MW_LAYER_PLATFORM_EXPORT_PATH(hscontentinfo.h) +../inc/hscontentinfoarray.h MW_LAYER_PLATFORM_EXPORT_PATH(hscontentinfoarray.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_content_control_api/inc/hscontentcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentcontrol.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef HSCONTENTCONTROL_H +#define HSCONTENTCONTROL_H + +// System includes +#include +#include + +// Forward declarations + +/** + * Content control interface + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +class MHsContentControl + { +public: + /** + * + */ + virtual void NotifyWidgetListChanged() = 0; + + /** + * + */ + virtual void NotifyViewListChanged() = 0; + + /** + * + */ + virtual void NotifyAppListChanged() = 0; + + }; + +#endif // HSCONTENTCONTROL_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_content_control_api/inc/hscontentcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentcontroller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTCOTROLLER_H +#define HSCONTENTCOTROLLER_H + +// System includes +#include + +// Forward declarations +class CHsContentInfo; +class CHsContentInfoArray; + +// Constants + +/** + * unable to add widget because active page is full. + * No widgets can be added to this page before removing some first. + */ +const TInt KHsErrorViewFull = -87001; + +/** + * Unable to add this widget because the maximum instance count + * per page will exceed + */ +const TInt KHsErrorMaxInstanceCountExceeded = -87002; + +/** + * unable to add widget because widget is too large to fit. + * A smaller widget might fit though. + */ +const TInt KHsErrorDoesNotFit = -87003; + + + +/** + * Content controller interface + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +class MHsContentController + { +public: + /** + * Fills an array of CHsContentInfo. Both widget and template types are appended. + * @param aArray Array of CHsContentInfo + */ + virtual TInt WidgetListL( CHsContentInfoArray& aArray ) = 0; + + /** + * Fills an array of CHsContentInfo. View types are appended. + * @param aArray Array of CHsContentInfo + */ + virtual TInt ViewListL( CHsContentInfoArray& aArray ) = 0; + + /** + * + */ + virtual TInt AppListL( CHsContentInfoArray& aArray ) = 0; + + /** + * Adds a widget to the active view. + * @param aInfo Content info object + * @return KErrNone on success, any of system wide error codes, + * KHsErrorViewFull, KHsErrorMaxInstanceCountExceeded or + * KHsErrorDoesNotFit + */ + virtual TInt AddWidgetL( CHsContentInfo& aInfo ) = 0; + + /** + * Removes a widget from the configuration. + * @param aInfo Content info object + */ + virtual TInt RemoveWidgetL( CHsContentInfo& aInfo ) = 0; + + /** + * + */ + virtual TInt AddViewL( CHsContentInfo& aInfo ) = 0; + + /** + * + */ + virtual TInt RemoveViewL( CHsContentInfo& aInfo ) = 0; + + /** + * + */ + virtual TInt ActivateViewL( CHsContentInfo& aInfo ) = 0; + + /** + * + */ + virtual TInt ActivateAppL( CHsContentInfo& aInfo ) = 0; + + }; + + +#endif // HSCONTENTCOTROLLER_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,406 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTINFO_H +#define HSCONTENTINFO_H + +// System includes +#include +#include +#include + +// Forward declarations + +/** + * Content data + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CHsContentInfo ) : public CBase + { + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentInfo* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentInfo* NewL( RReadStream& aStream ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentInfo* NewLC(); + + /** + * Clone. + */ + IMPORT_C CHsContentInfo* CloneL(); + + /** + * Destructor. + */ + ~CHsContentInfo(); + +private: + /** + * Constructor + */ + CHsContentInfo(); + + /** Second phase constructor */ + void ConstructL(); + +public: + /** + * Set Widget name. + * + * @since S60 5.0 + * @param aName. Name of the widget. + * @return Reference to this + */ + IMPORT_C void SetNameL( const TDesC8& aName ); + + /** + * Set Widget name. + * + * @since S60 5.0 + * @param aName. Name of the widget. + * @return Reference to this + */ + IMPORT_C void SetNameL( const TDesC& aName ); + + /** + * Set Widget's publisher Id . + * + * @since S60 5.0 + * @param aPublisherId. Name of the publisher. + * @return Reference to this + */ + IMPORT_C void SetPublisherIdL( const TDesC& aPublisherId ); + + /** + * Set Widget id. + * + * @since S60 5.0 + * @param aUid Static uid of the widget. + * @return Reference to this + */ + IMPORT_C void SetUidL( const TDesC8& aUid ); + + /** + * Set Widget plugin id. + * + * @since S60 5.0 + * @param aId Dynamic id generated by hsps. + * @return Reference to this + */ + IMPORT_C void SetPluginIdL( const TDesC8& aId ); + + /** + * Set widget type. Possible values widget and template + * + * @since S60 5.0 + * @param aType Widget type. + */ + IMPORT_C void SetTypeL( const TDesC8& aType ); + + /** + * Access to widget name. + * + * @since S60 5.0 + * @return Reference to name + */ + IMPORT_C const TDesC& Name() const; + + /** + * Access to widget's publisher id. + * + * @since S60 5.0 + * @return Reference to publisher id + */ + IMPORT_C const TDesC& PublisherId() const; + + /** + * Access to widget uid. + * + * @since S60 5.0 + * @return Uid or KNullDesC8 + */ + IMPORT_C const TDesC8& Uid() const; + + /** + * Access to widget name. + * + * @since S60 5.0 + * @return Reference to name + */ + IMPORT_C HBufC8* NameAs8BitLC() const; + + /** + * Access to widget plugin id. + * + * @since S60 5.0 + * @return Plugin id or null if not set + */ + IMPORT_C const TDesC8& PluginId() const; + + /** + * Set widget type. Possible values widget and template + * + * @since S60 5.0 + * @return Type or KNullDesC8. + */ + IMPORT_C const TDesC8& Type() const; + + /** + * Set Maximum number of widgets + * + * @param aMaxWidget maximum number of widgets + */ + IMPORT_C void SetMaxWidgets( TInt aMaxWidget ); + + /** + * Get Maximum number of widgets + * + * @return number of widgets or defaule value 1 + */ + IMPORT_C TInt MaxWidgets() const; + + /** + * Externalize. + * + * @param aStream A stream to externalize to + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream ); + + /** + * Sets whether this widget can be added to the active HS page + * + * @since S60 5.0 + * @param aValue ETrue if can be added, EFalse otherwise + */ + IMPORT_C void SetCanBeAdded( TBool aValue ); + + /** + * Queries whether this widget can be added to the active HS page + * + * @since S60 5.0 + * @return ETrue if can be added, EFalse otherwise + */ + IMPORT_C TBool CanBeAdded() const; + + /** + * Sets whether this widget can be removed from the active HS page + * + * @since S60 5.0 + * @param aValue ETrue if can be added, EFalse otherwise + */ + IMPORT_C void SetCanBeRemoved( TBool aValue ); + + /** + * Queries whether this widget can be removed from the active HS page + * + * @since S60 5.0 + * @return ETrue if can be removed, EFalse otherwise + */ + IMPORT_C TBool CanBeRemoved() const; + + /** + * Sets this widget's installation time + * + * @since S60 5.0 + * @param aTime Installation time + */ + IMPORT_C void SetInstallationTime( TTime& aTime ); + + /** + * Gets this widget's installation time + * + * @since S60 5.0 + * @return Installation time + */ + IMPORT_C TTime InstallationTime() const; + + /** + * Sets this widget's description + * + * @since S60 5.0 + * @param aDescription Description + */ + IMPORT_C void SetDescriptionL( const TDesC& aDescription ); + + /** + * Gets this widget's description + * + * @since S60 5.0 + * @return Description + */ + IMPORT_C const TDesC& Description() const; + + /** + * Sets this widget's icon path + * + * @since S60 5.0 + * @param aPath Path + */ + IMPORT_C void SetIconPathL( const TDesC& aIconPath ); + + /** + * Gets this widget's icon path + * + * @since S60 5.0 + * @return Path + */ + IMPORT_C const TDesC& IconPath() const; + + /** + * Internalize + * @param aStream A stream where the class is internalized + * + * @since S60 5.0 + */ + IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Returns size of a descriptor needed to externalize the class + * + * @since S60 5.0 + */ + IMPORT_C TInt Size(); + + /** + * Set WRT widget publisher uid. + * + * @since S60 5.0 + * @param aUid Publisher uid of the wrt widget. + * @return Reference to this + */ + IMPORT_C void SetPublisherUidL( const TDesC8& aUid ); + + /** + * Access to WRT widget publisher uid. + * + * @since S60 5.0 + * @return PublisherUid or KNullDesC8 + */ + IMPORT_C const TDesC8& PublisherUid() const; + + /** + * Sets whether this is a WRT widget + * + * @since S60 5.0 + * @param aIsWrt, ETrue if is WRT + */ + IMPORT_C void SetIsWrt( TBool aIsWrt ); + + /** + * Returns whether this is a WRT widget + * + * @since S60 5.0 + * @return ETrue if WRT, EFalse otherwise + */ + IMPORT_C TBool IsWrt() const; + + /** + * Marshals Content Info data to a descriptor + * + * @since S60 5.0 + * @return Descriptor containing the externalized Content Info data + */ + IMPORT_C HBufC8* MarshalL(); + +private: // Data + /** + * Widget name, Owned + */ + HBufC* iName; + + /** + * Widget uid, Owned + */ + HBufC8* iUid; + + /** + * Widget plugin id, Owned + */ + HBufC8* iPluginId; + + /** + * Widget type, Owned + */ + HBufC8* iType; + + /** + * Publisher Id, Owned + */ + HBufC* iPublisherId; + + /** + * Description, Owned + */ + HBufC* iDescription; + + /** + * Icon path, Owned + */ + HBufC* iIconPath; + + /** + * Max number of instances allowed + */ + TInt iMaxInstance; + + /** + * Flag to determine whether this widget + * can be added to the active HS page. + */ + TBool iCanBeAdded; + + /** + * Flag to determine whether this widget + * can be removed from the active HS page. + */ + TBool iCanBeRemoved; + + /** + * Installation time + */ + TTime iInstallationTime; + + /** + * WRT Widget publisher uid, Owned + */ + HBufC8* iPublisherUid; + + /** + * Flag to indicate whether this is a WRT widget + */ + TBool iIsWrt; + }; + +#endif // HSCONTENTINFO_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_content_control_api/inc/hscontentinfoarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_content_control_api/inc/hscontentinfoarray.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef HSCONTENTINFOARRAY_H +#define HSCONTENTINFOARRAY_H + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CHsContentInfo; + +/** + * Content data + * + * + * @code + * + * @endcode + * + * @lib hscontentcontrol.lib + * @since S60 v5.0 + */ +class CHsContentInfoArray : public CBase + { + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentInfoArray* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CHsContentInfoArray* NewL( RReadStream& aStream ); + + /** + * Destructor. + */ + virtual ~CHsContentInfoArray(); + + /** + * Externalizes the array into the stream. + */ + IMPORT_C void ExternalizeL( RWriteStream& aStream ); + + IMPORT_C RPointerArray< CHsContentInfo >& Array(); + + /** + * Internalizes the array from the stream. + */ + IMPORT_C void InternalizeL( RReadStream& aStream ); + + /** + * Returns size of a descriptor needed to externalize the class + */ + IMPORT_C TInt Size(); + + /** + * Marshals Content Info array to a descriptor + * + * @since S60 5.0 + * @return Descriptor containing the externalized Content Info array data + */ + IMPORT_C HBufC8* MarshalL(); + +private: + /** + * Constructor. + */ + CHsContentInfoArray(); + + /** + * Second phase constructor. + */ + void ConstructL(); + +private: // Data + RPointerArray< CHsContentInfo > iArray; + }; + +#endif // HSCONTENTINFOARRAY_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 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: Item id, name and properties +* +*/ +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hspluginsettings.h MW_LAYER_PLATFORM_EXPORT_PATH(hspluginsettings.h) +../inc/mhomescreensettingsif.h MW_LAYER_PLATFORM_EXPORT_PATH(mhomescreensettingsif.h) +../inc/mhomescreensettingsobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(mhomescreensettingsobserver.h) +../inc/itemmap.h MW_LAYER_PLATFORM_EXPORT_PATH(itemmap.h) +../inc/propertymap.h MW_LAYER_PLATFORM_EXPORT_PATH(propertymap.h) + +PRJ_MMPFILES \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,229 @@ +/* +* 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: Encapsulates hsps liw service +* +*/ +#ifndef C_CHomeScreenSettingsIf_H +#define C_CHomeScreenSettingsIf_H + +#include +#include // for MLiwNotifyCallback +#include +#include + +class CLiwServiceHandler; +class MLiwInterface; +class CLiwCriteriaItem; +class CLiwMap; +class CLiwList; +class MDesC8Array; +class CLiwDefaultMap; +class CLiwDefaultList; +class MLiwNotifyCallback; +class CLiwGenericParamList; + + +namespace HSPluginSettingsIf{ + +class CHspsConfiguration; +class CItemMap; +class CPropertyMap; +class MHomescreenSettingsObserver; + +/** + * Wrapper for hsps liw service + * + * + * @code + * + * @endcode + * + * @lib HomeScreenSettingsIf.lib + * @since S60 v5.0 + */ +class CHomescreenSettings: + public CBase, + public MLiwNotifyCallback, + public MHomescreenSettingsIf + { +public: + /** + * Two-phased constructor. + * + * @param aAppUid Application uid in integer format + * @param aObserver Observer + */ + IMPORT_C static CHomescreenSettings* NewL( + const TDesC8& aAppUid, + const TDesC8& aPluginId, + MHomeScreenSettingsObserver* aObserver ); + + /** + * Two-phased constructor. + * + * @param aAppUid Application uid in integer format + * @param aObserver Observer + */ + IMPORT_C static CHomescreenSettings* NewLC( + const TDesC8& aAppUid, + const TDesC8& aPluginId, + MHomeScreenSettingsObserver* aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CHomescreenSettings(); + +public: + /** + * From MHomescreenSettingsIf + * Stores defined plugin’s settings. + * Plugin is identified with unique plugin ID used in application’s + * configuration + * + * @param aPluginId Pluging’s ID which settings are stored + * @param aSettings List of item maps + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt GetSettingsL( + const TDesC8& aPluginId, + RPointerArray& aSettings ); + + /** + * From MHomescreenSettingsIf + * Stores defined plugin’s settings. + * Plugin is identified with unique plugin ID used in application’s + * configuration + * + * @param aPluginId Pluging’s ID which settings are stored + * @param aSettings List of item maps + * @param aStoringParam parameter to tell whether plugin configuration need to be saved also if parameter is ETrue. + * @return Operation status. KErrNone (success), KErrNotFound + */ + IMPORT_C TInt SetSettingsL( + const TDesC8& aPluginId, + const RPointerArray& aSettings, + const TBool aStoringParam ); + + +protected: + /** + * Constructor. + * + * @param aAppUid Application uid in integer format + * @param aObserver Observer + */ + CHomescreenSettings( + MHomeScreenSettingsObserver* aObserver, + const TDesC8& aPluginId ); + + /** + * Second phase constructor + * + * @param aAppUid Application uid in integer format + */ + void ConstructL( const TDesC8& aAppUid ); + + /** + * Processes all items configuration setting + * @param aItemList item list + * @param aTarget output hsps configuration + */ + void ProcessConfigurationSettingsL( + const CLiwList& aItemList, + CHspsConfiguration& aTarget ); + + /** + * Processes all items' properties configuration + * + * @param aPropertyMapList input properties + * @param aItemMap output item + */ + void ProcessConfItemPropertiesL( + const CLiwList& aPropertyMapList, + CItemMap& aItemMap ); + + /** + * Fills liw map from given item + * @param aMap liw item map to fill in + * @param aItemMap item map + */ + void FillMapFromItemL( CLiwDefaultMap& aMap, const CItemMap& aItemMap ); + + /** + * Fills liw map from given item properties + * @param aMap liw map to fill in + * @param aItemMap item properiteis map + */ + void FillMapFromPropertiesL( + CLiwDefaultList& aInPropertyMapList, + const RPointerArray& aProperties ); + + /** + * Sets plugin settings + * @param aPluginId plugin id + * @param aSettings array of items to set + * @param aStoringParam parameter to tell whether plugin configuration need to be saved. + * @return + */ + TInt SetPluginSettingsL( + const TDesC8& aPluginId, + const RPointerArray& aSettings, + const TDesC8& aStoringParam ); + + +protected: + /** + * From MLiwNotifyCallback + * Handle HSPS notifications + * + * @param aCmdId Command id + * @param aEventId Event id + * @param aEventParamList Event parameters + * @param aInParamList In parameters + */ + TInt HandleNotifyL(TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + +private: // data + /** + * Owned. SAPI service handler. + */ + CLiwServiceHandler* iServiceHandler; + /** + * Owned. HSPS SAPI service. + */ + CLiwCriteriaItem* iHspsService; + /** + * Owned. Provides hsps services. + */ + MLiwInterface* iHspsInterface; + /** + * Not owned. Wrapper observer + */ + MHomeScreenSettingsObserver* iObserver; + /* + * Asynchronous service request tarnsaction id + */ + TInt iTransactionId; + /** + * Plugin id + */ + const TDesC8& iPluginId; + }; + +} //namespace HSPluginSettingsIf + +#endif // C_CHomeScreenSettingsIf_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/inc/itemmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/inc/itemmap.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,125 @@ +/* +* 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: Item id, name and properties +* +*/ +#ifndef C_CITEMMAP_H +#define C_CITEMMAP_H + +#include + +namespace HSPluginSettingsIf{ + +class CPropertyMap; + +/** + * Item id, name and properties + * + * + * @code + * + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CItemMap : public CBase + { +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CItemMap* NewL(); + /** + * Two-phased constructor. + */ + IMPORT_C static CItemMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CItemMap(); + + /** + * Set item id + * + * @param aItemId Item id + * @return Reference to this object + */ + IMPORT_C CItemMap& SetItemIdL(const TDesC8& aItemId ); + + /** + * Get item id + * + * @return Reference to item id or KNullDesC8 + */ + IMPORT_C const TDesC8& ItemId()const; + + /** + * Set item name + * + * @param aItemName Item name + * @return Reference to this object + */ + IMPORT_C CItemMap& SetItemNameL(const TDesC8& aItemName ); + + /** + * Get item name + * + * @return Reference to item name or KNullDesC8 + */ + IMPORT_C const TDesC8& ItemName()const; + + /** + * Add item property map into properties array + * + * @param aPropertyMap Property map. Takes ownership + * @return Reference to this object + */ + IMPORT_C CItemMap& AddPropertyMapL(CPropertyMap* aPropertyMap ); + + /** + * Get property map array. + * + * @return Reference to proprty map array + */ + IMPORT_C RPointerArray& Properties()const; + +private: + + CItemMap(); + + void ConstructL(); + + +private: // data + /** + * Own. Item id + */ + HBufC8* iItemId; + /** + * Own. Item name + */ + HBufC8* iItemName; + /** + * Own. Array of property maps + */ + mutable RPointerArray iProperties; + }; + +} // namespace HSPluginSettingsIf + + +#endif // C_CITEMMAP_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsif.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2008-2009 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: Encapsulates name and value +* +*/ + +#ifndef MHOMESCREENSETTINGSIF_H_ +#define MHOMESCREENSETTINGSIF_H_ + +#include + +namespace HSPluginSettingsIf{ + +class CItemMap; + +class MHomescreenSettingsIf + { +public: + /** + * Stores defined plugin’s settings. + * Plugin is identified with unique plugin ID used in application’s + * configuration + * + * @param aPluginId Pluging’s ID which settings are stored + * @param aSettings List of item maps + * @return Operation status. KErrNone (success), KErrNotFound + */ + virtual TInt GetSettingsL(const TDesC8& aPluginId, RPointerArray< CItemMap >& aSettings) = 0; + + /** + * From MHomescreenSettingsIf + * Stores defined plugin’s settings. + * Plugin is identified with unique plugin ID used in application’s + * configuration + * + * @param aPluginId Pluging’s ID which settings are stored + * @param aSettings List of item maps + * @param aStoringParam parameter to tell whether plugin configuration need to be saved,if parameter is ETrue. + * @return Operation status. KErrNone (success), KErrNotFound + */ + virtual TInt SetSettingsL(const TDesC8& aPluginId, const RPointerArray< CItemMap >& aSettings, const TBool aStoringParam) = 0; + }; +} +#endif /*MHOMESCREENSETTINGSIF_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/inc/mhomescreensettingsobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2008-2009 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: Encapsulates name and value +* +*/ +#ifndef MHOMESCREENSETTINGSOBSERVER_H_ +#define MHOMESCREENSETTINGSOBSERVER_H_ + +#include + +namespace HSPluginSettingsIf{ + +/** + * Observer class for HomeScreenSettingsIf + * + * @code + * + * @endcode + * + * @lib HomeScreenSettingsIf.lib + * @since S60 v5.0 + */ +class MHomeScreenSettingsObserver + { +public: + /** + * Handle HSPS wrappper notifications + * + * @param aEvent Event + * @param aPluginName Plugin name + * @param aPluginUid Plugin uid + * @param aPluginId Plugin id + */ + virtual TInt SettingsChangedL( + const TDesC8& aEvent, + const TDesC8& aPluginName, + const TDesC8& aPluginUid, + const TDesC8& aPluginId ) = 0; + + }; +} +#endif /*MHOMESCREENSETTINGSOBSERVER_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_settings_api/inc/propertymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_settings_api/inc/propertymap.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Encapsulates name and value +* +*/ +#ifndef C_CPROPERTYMAP_H +#define C_CPROPERTYMAP_H + +#include + +namespace HSPluginSettingsIf{ + +/** + * Presents property as name and value pair + * + * @code + * @endcode + * + * @lib xnlayoutengine.lib + * @since S60 v5.0 + */ +class CPropertyMap : public CBase + { +public: + /** + * Two-phased constructor. + */ + IMPORT_C static CPropertyMap* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CPropertyMap* NewLC(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CPropertyMap(); + + /** + * Set property name + * + * @param aName Property nane + * @return Reference to this object + */ + IMPORT_C CPropertyMap& SetNameL( const TDesC8& aName ); + + /** + * Get property name + * + * @return Reference to name or KNullDesC8 + */ + IMPORT_C const TDesC8& Name()const; + + /** + * Set property value + * + * @param aValue Property value + * @return Reference to this object + */ + IMPORT_C CPropertyMap& SetValueL( const TDesC8& aValue ); + + /** + * Get property value + * + * @return Reference to value or KNullDesC8 + */ + IMPORT_C const TDesC8& Value()const; + +private: + /** + * Constructor. + */ + CPropertyMap(); + + /** + * Second phase constructor. + */ + void ConstructL(); + +private: // data + /** + * Own. Property name + */ + HBufC8* iName; + /** + * Own. Property value + */ + HBufC8* iValue; + }; +} + +#endif // C_CPROPERTYMAP_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/bwins/hswidgetpublisheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/bwins/hswidgetpublisheru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +EXPORTS + ??0?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z @ 1 NONAME ABSENT; std::basic_string, class std::allocator >::basic_string, class std::allocator >(class std::basic_string, class std::allocator > const &) + ??0?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z @ 2 NONAME ABSENT; std::basic_string, class std::allocator >::basic_string, class std::allocator >(char const *, class std::allocator const &) + ??0?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ @ 3 NONAME ABSENT; std::basic_string, class std::allocator >::basic_string, class std::allocator >(void) + ??0HsException@Hs@@QAE@H@Z @ 4 NONAME ; Hs::HsException::HsException(int) + ??0HsWidgetPublisher@Hs@@QAE@PAVIHsDataObserver@1@@Z @ 5 NONAME ; Hs::HsWidgetPublisher::HsWidgetPublisher(class Hs::IHsDataObserver *) + ??1HsException@Hs@@UAE@XZ @ 6 NONAME ; Hs::HsException::~HsException(void) + ??1HsWidgetPublisher@Hs@@QAE@XZ @ 7 NONAME ; Hs::HsWidgetPublisher::~HsWidgetPublisher(void) + ?createHsWidget@HsWidgetPublisher@Hs@@QAEAAVHsWidget@2@V?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z @ 8 NONAME ; class Hs::HsWidget & Hs::HsWidgetPublisher::createHsWidget(class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >) + ?getHsWidget@HsWidgetPublisher@Hs@@QAEAAVHsWidget@2@V?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z @ 9 NONAME ; class Hs::HsWidget & Hs::HsWidgetPublisher::getHsWidget(class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >) + ?getReason@HsException@Hs@@QAEHXZ @ 10 NONAME ; int Hs::HsException::getReason(void) + ?publishHsWidget@HsWidgetPublisher@Hs@@QAEXAAVHsWidget@2@@Z @ 11 NONAME ; void Hs::HsWidgetPublisher::publishHsWidget(class Hs::HsWidget &) + ?removeHsWidget@HsWidgetPublisher@Hs@@QAEXV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z @ 12 NONAME ; void Hs::HsWidgetPublisher::removeHsWidget(class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >) + ?removeItem@HsWidget@Hs@@QAEXV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z @ 13 NONAME ; void Hs::HsWidget::removeItem(class std::basic_string, class std::allocator >) + ?setItem@HsWidget@Hs@@QAEXV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z @ 14 NONAME ; void Hs::HsWidget::setItem(class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >) + ?setItem@HsWidget@Hs@@QAEXV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z @ 15 NONAME ; void Hs::HsWidget::setItem(class std::basic_string, class std::allocator >, int) + ?createHsWidgetWithDesc@HsWidgetPublisher@Hs@@QAEAAVHsWidget@2@V?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@0000@Z @ 16 NONAME ; class Hs::HsWidget & Hs::HsWidgetPublisher::createHsWidgetWithDesc(class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >, class std::basic_string, class std::allocator >) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/eabi/hswidgetpublisheru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/eabi/hswidgetpublisheru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +EXPORTS + _ZN2Hs11HsException9getReasonEv @ 1 NONAME + _ZN2Hs11HsExceptionC1Ei @ 2 NONAME + _ZN2Hs11HsExceptionC2Ei @ 3 NONAME + _ZN2Hs11HsExceptionD0Ev @ 4 NONAME + _ZN2Hs11HsExceptionD1Ev @ 5 NONAME + _ZN2Hs11HsExceptionD2Ev @ 6 NONAME + _ZN2Hs17HsWidgetPublisher11getHsWidgetESsSsSs @ 7 NONAME + _ZN2Hs17HsWidgetPublisher14createHsWidgetESsSsSs @ 8 NONAME + _ZN2Hs17HsWidgetPublisher14removeHsWidgetESsSsSs @ 9 NONAME + _ZN2Hs17HsWidgetPublisher15publishHsWidgetERNS_8HsWidgetE @ 10 NONAME + _ZN2Hs17HsWidgetPublisherC1EPNS_15IHsDataObserverE @ 11 NONAME + _ZN2Hs17HsWidgetPublisherC2EPNS_15IHsDataObserverE @ 12 NONAME + _ZN2Hs17HsWidgetPublisherD1Ev @ 13 NONAME + _ZN2Hs17HsWidgetPublisherD2Ev @ 14 NONAME + _ZN2Hs8HsWidget10removeItemESs @ 15 NONAME + _ZN2Hs8HsWidget7setItemESsSs @ 16 NONAME + _ZN2Hs8HsWidget7setItemESsi @ 17 NONAME + _ZNSsC1EPKcRKSaIcE @ 18 NONAME ABSENT + _ZNSsC1ERKSs @ 19 NONAME ABSENT + _ZNSsC1Ev @ 20 NONAME ABSENT + _ZNSsC2EPKcRKSaIcE @ 21 NONAME ABSENT + _ZNSsC2ERKSs @ 22 NONAME ABSENT + _ZNSsC2Ev @ 23 NONAME ABSENT + _ZTIN2Hs11HsExceptionE @ 24 NONAME ; ## + _ZTIN2Hs12HsWidgetItemE @ 25 NONAME ; ## + _ZTIN2Hs21HsWidgetPublisherImplE @ 26 NONAME ; ## + _ZTIN2Hs8HsWidgetE @ 27 NONAME ; ## + _ZTVN2Hs11HsExceptionE @ 28 NONAME ; ## + _ZTVN2Hs12HsWidgetItemE @ 29 NONAME ; ## + _ZTVN2Hs21HsWidgetPublisherImplE @ 30 NONAME ; ## + _ZTVN2Hs8HsWidgetE @ 31 NONAME ; ## + _ZN2Hs17HsWidgetPublisher22createHsWidgetWithDescESsSsSsSsSs @ 32 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 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: This file provides the information required for building the +* whole of a Homescreen Publishing Api. +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/hswidgetpublisher.h MW_LAYER_PLATFORM_EXPORT_PATH(hswidgetpublisher.h) +../inc/hswidget.h MW_LAYER_PLATFORM_EXPORT_PATH(hswidget.h) +../inc/hsdataobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(hsdataobserver.h) +../inc/hsexception.h MW_LAYER_PLATFORM_EXPORT_PATH(hsexception.h) +../rom/hswidgetpublisher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hswidgetpublisher.iby) + +PRJ_MMPFILES +hswidgetpublisher.mmp diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/group/hswidgetpublisher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/group/hswidgetpublisher.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 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: This is the project specification file for HSPApi. +* +*/ + + +#include + +TARGET hswidgetpublisher.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +UID 0x1000008d 0x069DD3DD + +CAPABILITY CAP_GENERAL_DLL + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_STDCPP_SYSTEMINCLUDE + +SOURCEPATH ../src + +SOURCE hsexception.cpp +SOURCE hswidgetitem.cpp +SOURCE hswidget.cpp +SOURCE hswidgetpublisherimpl.cpp +SOURCE hswidgetpublisher.cpp + + +LIBRARY euser.lib +LIBRARY liwservicehandler.lib +LIBRARY charconv.lib // for CnvUtfConverter +LIBRARY libstdcpp.lib +LIBRARY libc.lib + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/hs_widget_publisher_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/hs_widget_publisher_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ + + + Home Screen Publishing API + It enables the development of homescreen widgets for 3rd parties. It is dedicated for the homescreen content providers who want to publish content that may be displayed in homescreen widgets. It also allows providers to react to changes and actions performed on the widgets for which the data is published via a call-back interface. + c++ + contentpublishingsrv + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hsdataobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsdataobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef __HSDATAOBSERVER_H__ +#define __HSDATAOBSERVER_H__ + +#include + +namespace Hs { +/** + * An observer interface. + * Client must implement it to be able to get information + * about occuring Execute actions from the Homescreen Publishing API. + * + * @code + * class ObserverClass : public IHsDataObserver + * { + * void handleEvent( std::string aWidgetName, + * IHsDataObserver::EEvent aEvent) + * { + * } + * + * void handleItemEvent( std::string aWidgetName, + * std::string aWidgetItemName, + * IHsDataObserver::EItemEvent aEvent) + * { + * } + * } + * ObserverClass* dataObserver = new ObserverClass(); + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * @endcode + */ +class IHsDataObserver + { +public: + + /** + * Defines the events that may take place for a homescreen widget. + */ + enum EEvent + { + EUnknown = 0, ///< Unknown event: Means that event has not been defined. + EActivate = 1, ///< Activation event: Means that widget has been added to HS as content. + EDeactivate = 2, ///< Deactivation event: Means that widget has been removed frm. + ESuspend = 3, ///< Suspension event: Means that HS reading widget data is suspended. + EResume = 4 ///< Resume event. Means that HS reading widget data is resumed. + }; + + /** + * Defines the events that may take place for a homescreen widget item. + */ + enum EItemEvent + { + EUnknownItemEvent = 0, ///< Unknown event: Means that event has note been defined. + ESelect = 1 ///< Selection event: Means that the widget item has been selected. + }; + +public: + + /** + * Intended to handle an event that occured on a widget. + * This would include EActivate, EDeactivate, ESuspend, EReusume. + * + * @param aWidgetName Name of the widget that event is envoked for. + * @param aEvent Event type that has taken place. + */ + virtual void handleEvent( std::string aWidgetName, + IHsDataObserver::EEvent aEvent) = 0; + + /** + * Intended to handle an event that occured on a widget's item. + * This would include ESelection. + * + * @param aWidgetName Name of the widget that event is envoked for. + * @param awidgetItemName Name of the item that event is envoked for. + * @param aAEvent Event type that has taken place + */ + virtual void handleItemEvent( std::string aWidgetName, + std::string aWidgetItemName, + IHsDataObserver::EItemEvent aEvent) = 0; + }; +} + +#endif /*__HSDATAOBSERVER_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hsexception.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsexception.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef __HSEXCEPTION_H__ +#define __HSEXCEPTION_H__ + +#include + +namespace Hs { + +/** + * Class used to encapsulate error information thrown in exceptions by the + * Homescreen Publishing Api. + * @code + * + * ObserverClass* dataObserver = new ObserverClass(); + * try + * { + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * if ( hsPublisher ) + * { + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * //attempt to create the widget again (with the same information) + * //will cause an exception + * hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * } + * } + * catch (HsException& exception) + * { + * int errReason = exception.getReason(); + * //if the exception is thrown, becasue the widget attempted to + * //be created already exists the errReason will be KErrAlreadyExists + * } + * @endcode + */ +class HsException : public std::exception + { +public: + + /** + * Constructor of the HsException. + */ + IMPORT_C HsException( int aLeaveCode ); + + /** + * Destructor of the HsException. + */ + IMPORT_C virtual ~HsException(); + + /** + * Method retrieves the error information contained in the + * excpetion object. + * + * @code + * ObserverClass* dataObserver = new ObserverClass(); + * try + * { + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher(dataObserver); + * hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * } + * catch (HsException& exception) + * { + * int errReason = exception.getReason(); + * } + * @endcode + * @return Error code. + */ + IMPORT_C int getReason(); + +private: + + int mLeaveCode; + + }; +} + +#endif /*__HSEXCEPTION_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hsglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsglobals.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,98 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef GLOBALS_H_ +#define GLOBALS_H_ + +_LIT8( KCPInterface, "IDataSource" ); +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT( KStartUpFailed, "Homescreen Publishing Api startup failed."); + +_LIT( KCpData, "cp_data" ); +_LIT( KPublisher, "publisher" ); +_LIT( KHsWidgetPublisher, "hswidgetpublisher" ); +_LIT( KHSTemplate, "hstemplate" ); +_LIT( KContentAndPublisher_Registry, "cp_data:publisher" ); + +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KTemplateType, "template_type" ); +_LIT8( KWidgetName, "widget_name" ); +_LIT8( KWidgetUid, "widget_uid" ); +_LIT8( KWidgetInfo, "widget_info" ); +_LIT8( KWidgetMaxInstance, "widget_maxinstance" ); +_LIT8( KWidgetDesc, "widget_desc" ); +_LIT8( KWidgetIcon, "widget_icon" ); + +_LIT8( KDataMap, "data_map" ); +_LIT8( KActionMap, "action_map" ); + +_LIT8( KUIDs, "UID" ); +_LIT( KContentHarvesterUid, "0x10282E5A" ); +_LIT8( KAccessList, "ACL" ); +_LIT8( KACLRead, "read" ); +_LIT8( KACLWrite, "write" ); +_LIT8( KACLDelete, "delete" ); +_LIT( KHexPrefix, "0x" ); + +_LIT( KTriggerMap, "data"); +_LIT8( KExecuteAction, "ExecuteAction" ); + +_LIT8( KFilter, "filter" ); +_LIT8( KOperation, "operation" ); +_LIT8( KActionTrigger, "action_trigger" ); + +_LIT8( KCommand, "cmd" ); +_LIT8( KType, "type" ); + +_LIT8( KPluginId,"plugin_id"); +_LIT8( KApplicationUid, "application_uid" ); +_LIT8( KData, "data" ); +_LIT8( KLaunchMethod, "launch_method" ); +_LIT8( KApaCommand, "apa_command" ); +_LIT( KApaCommandBackground, "apa_command_background" ); +_LIT( KLaunchMethodValueCmdLine, "cmd_line" ); +_LIT( KActionValueLaunchApplication, "launch_application" ); + +_LIT8( KPublisherTwoRow, "PublisherTwoRow" ); +_LIT8( KItem, "item" ); + +_LIT8( KAdd, "Add" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KDelete, "Delete" ); +_LIT8( KErrorCode, "ErrorCode" ); + +_LIT8( KActive, "active" ); +_LIT8( KDeActive, "deactive" ); +_LIT8( KSuspend, "suspend" ); +_LIT8( KResume, "resume" ); +_LIT8( KSelected, "selected" ); +_LIT8( KSelectedColon, "selected:" ); +_LIT8( KSelectedFormat, "selected:%s" ); +_LIT8( KContentIdFormat, "%s:%s" ); +_LIT( KColon, ":" ); + +_LIT8( KChangeInfo, "change_info" ); +_LIT8( KOperationExecute, "execute" ); + +const TInt32 KCASpaAppLauncherPlugin = {0x10282E5F}; + +_LIT( KAll, "all" ); + +#endif /*GLOBALS_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hsserviceerrno.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsserviceerrno.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + +#ifndef __HSSERVICEERRNO_H__ +#define __HSSERVICEERRNO_H__ + +#define SERRBASE 1000 + +enum SapiErrors + { + + SErrNone , + + SErrInvalidServiceArgument = SERRBASE, + SErrUnknownArgumentName , + SErrBadArgumentType , + SErrMissingArgument , + SErrServiceNotSupported , + SErrServiceInUse , + SErrServiceNotReady , + SErrNoMemory , + SErrHardwareNotAvailable , + SErrServerBusy , + SErrEntryExists , + SErrAccessDenied , + SErrNotFound , + SErrUnknownFormat , + SErrGeneralError , + SErrCancelSuccess, + SErrServiceTimedOut + + }; + +#endif /*__HSSERVICEERRNO_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hswidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidget.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,190 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef __HSWIDGET_H__ +#define __HSWIDGET_H__ + +// Include Files +#include +#include +#include +#include + +namespace Hs { + +class HsWidgetItem; + +/** + * Class defining a Homescreen Widget. A widget is identified by + * its templateName, widgetName, uniqueIdentifier. + * + * @code + * @code + * class ObserverClass : public IHsDataObserver + * { + * void handleEvent( std::string aWidgetName, + * IHsDataObserver::EEvent aEvent) + * { + * } + * + * void handleItemEvent( std::string aWidgetName, + * std::string aWidgetItemName, + * IHsDataObserver::EItemEvent aEvent) + * { + * } + * } + * + * ObserverClass* dataObserver = new ObserverClass(); + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * hsPublisher->publishHsWidget( widget ); + * @endcode + */ +class HsWidget + { +public: + /** + * Adds a new widget item to the widget if it wasn't created + * previously or set a new value to the existing one. + * Widget item is identified by the name with the value provided. + * The value is a string. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * // assuming count and values[] are defined + * while ( count ) + * { + * widget->setItem("image", values[count] ); + * count--; + * } + * @endcode + * @param aItemName, Name of the widget item. + * @param aValue Integer value of the widget item. + * @exception HsException + */ + IMPORT_C void setItem( std::string aItemName, std::string aValue); + + /** + * Adds a new widget item to the widget if it wasn't created previously + * or set a new value to the existing one. Widget item is identified by + * the name with the value provided. The value is a int. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * // assuming count and values[] are defined + * while ( count ) + * { + * widget->setItem("image", values[count] ); + * count--; + * } + * @endcode + * @param aItemName, Name of the widget item. + * @param aValue Integer value of the widget item. + * @exception HsException + */ + IMPORT_C void setItem( std::string aItemName, int aValue ); + + /** + * Method removes widget's item. + * An attempt to remove not existing item causes exception with + * KErrNotFound reason; + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * widget.setItem( "myItem", "value" ); + * widget.removeItem( "myItem" ); + * hsPublisher->removeHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * @endcode + * @param aItemName Name of the Item. + * @param aWidgetName Name of the Widget + * @param aIdentifier Unique identification of the content. + * @exception HsException + */ + IMPORT_C void removeItem( std::string aItemName ); + +public: + + /** + */ + HsWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier, + std::string& aDescription, + std::string& aIconLocation ); + + /** + */ + virtual ~HsWidget(); + + /** + */ + HsWidgetItem* getWidgetItem( std::string& aItemName ); + + /** + */ + const std::string& getWidgetName(); + + /** + */ + const std::string& getTemplateName(); + + /** + */ + const std::string& getIdentifier(); + + /** + */ + int itemsCount(); + + /** + */ + HsWidgetItem* getWidgetItem( int aIndex ); + + /** + */ + bool checkIfWidgetItemExist( std::string& aItemName ); + + /** + */ + const std::string& getDescription() const; + + /** + */ + const std::string& getIconLocation() const; + +private: + std::string mWidgetName; + std::string mTemplateName; + std::string mIdentifier; + std::vector mItems; + std::string mDescription; + std::string mIconLocation; + }; + +} + + +#endif /*__HSWIDGET_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,75 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef __HSWIDGETITEM_H__ +#define __HSWIDGETITEM_H__ + +#include + +namespace Hs { + +class HsWidgetItem +{ +public: + + /** + */ + HsWidgetItem( std::string& aItemName, std::string& aValue ); + + /** + */ + HsWidgetItem( std::string& aItemName, int aValue ); + + /** + */ + virtual ~HsWidgetItem(); + + /** + */ + void setValue( int aValue ); + + /** + */ + void setValue( std::string& aValue ); + + /** + */ + const std::string& getItemName(); + + /** + */ + const std::string& getItemValue(); + + /** + */ + int getItemValueInt(); + + /** + */ + bool isStringValue(); + + +private: + std::string mItemName; + std::string mItemString; + int mItemInt; + bool mIsString; + }; +} + +#endif /*__HSWIDGETITEM_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,270 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +// This file defines the API for hswidgetpublisher.dll + +#ifndef __HSWIDGETPUBLISHER_H__ +#define __HSWIDGETPUBLISHER_H__ + +// Include Files +#include +#include +#include + +namespace Hs { + +// Class Definitions +class HsWidget; +class IHsDataObserver; +class HsWidgetPublisherImpl; + +/** + * Class allowing access to the Homescreen Publishing Api. + * Allows creation, update and deletion of widgets, as well as reception of + * information for the occuring events. + * + * @code + * class ObserverClass : public IHsDataObserver + * { + * void handleEvent( std::string aWidgetName, + * IHsDataObserver::EEvent aEvent) + * { + * } + * + * void handleItemEvent( std::string aWidgetName, + * std::string aWidgetItemName, + * IHsDataObserver::EItemEvent aEvent) + * { + * } + * } + * + * ObserverClass* dataObserver = new ObserverClass(); + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = publisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * // assuming count and values[] exists + * while (count) + * { + * widget->setItem( "image", values[count] ); + * count--; + * } + * hsPublisher->publishHsWidget( widget ); + * @endcode + */ +class HsWidgetPublisher + { +public: + /** + * Constructor of the HsWidgetPublisher. Creates an instance of the + * publisher, which is used to manage Widgets and Widget's Items. + * Please note that attempt of usage, with aDataObserver = NULL + * is asserted. + * + * @code + * class ObserverClass : public IHsDataObserver + * { + * void handleEvent( std::string aWidgetName, + * IHsDataObserver::EEvent aEvent) + * { + * } + * + * void handleItemEvent( std::string aWidgetName, + * std::string aWidgetItemName, + * IHsDataObserver::EItemEvent aEvent) + * { + * } + * } + * + * ObserverClass* dataObserver = new ObserverClass(); + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * @endcode + * + * Client should not completely rely on exceptions while creating + * the API. Except for exceptions thrown one should check if + * the memory was allocated properly. + * @code + * + * ObserverClass* dataObserver = new ObserverClass(); + * + * try + * { + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher(dataObserver); + * if (hsPublisher) + * { + * // do the operations on the API here + * } + * } + * catch (HsException& exception) + * { + * int errReason = exception.getReason(); + * } + * @endcode + * + * @param aDataObserver Callback interface for handling actions. + * @exception HsPException + */ + IMPORT_C HsWidgetPublisher( IHsDataObserver* aDataObserver ); + + /** + * Destructor of the HsWidgetPublisher. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * delete hsPublisher; + * @endcode + * @exception HsException + */ + IMPORT_C ~HsWidgetPublisher(); + + /** + * Creates a new widget. + * + * If widget already created, fails and throws a HsException containing + * KErrAlreadyExists error code. May throw HsException with different + * system-wide error codes if error occurs during registration. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidgetWithDesc( + * "templateName", "widgetName", "uniqueIdentifier", + * "A short widget description.", "c:\\data\\Installs\\an_icon.jpg" ); + * @endcode + * + * @param aTemplateName Name of the Template. + * @param aWidgetName Name of the Widget + * @param aIdentifier Unique widget indentifier. It is recommended to use + * your application's UID3 as the identifier. If your application + * creates two different HsWidgets, their identifiers must be unique + * too, in such case consider using UID3 with an extra suffix, e.g. + * 0xE2DA0574_1 for the first widget and 0xE2DA0574_2 for the second + * one. + * @param aDescription A short widget description (e.g. 'Displays latest + * news and wheather forecast.') + * @param aIconLocation A location of a logo icon that will be displayed + * alongside the short description. There are 4 ways in which icon + * location can be specified:
+ * 1. system path (e.g. c:\\data\\Installs\\icon1.jpg)
+ * 2. MIF file (e.g. c:\\data\\Installs\\templateIcons.mif 16384 16385)
+ * 3. skin with MIF file fallback + * (e.g. skin(major_id minor_id):mif(c:\\data\\icons.mif 16386 16387)
+ * 4.icon from AppArc (e.g. uid(0x12345678)) + * @return The newly created widget. + * + * @exception HsException + */ + IMPORT_C HsWidget& createHsWidgetWithDesc( std::string aTemplateName, + std::string aWidgetName, std::string aIdentifier, + std::string aDescription, std::string aIconLocation ); + + /** + * DEPRECATED. This method is here only to maintain compatibility with + * legacy widgets. Please use createHsWidgetWithDesc instead of this method. + * + * Method creates a new widget. + * Attempt to create already existing widget will cause exception + * with KErrAlreadyExists reason. + * Other exception reasons are possible and are caused by widget + * registration. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * @endcode + * @param aTemplateName Name of the Template. + * @param aWidgetName Name of the Widget + * @param aIdentifier Unique identification of the content. + * @return A widget is returned. If no such widget existed a newly + * created one. + * @exception HsException Exception is thrown when with code + * KErrAlreadyExists + * when attempting to create a widget that already exists. Other cases + * when excpetion is thrown include problems with widget registration. + */ + IMPORT_C HsWidget& createHsWidget( std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ); + + /** + * Method publishes the provided widget. + * Widget needs to be published in order for the content + * to be seen by the HS. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * HsWidget& widget = hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * hsPublisher->publishHsWidget( widget ); + * @endcode + * @param aWidget Reference to a widget object. + * @exception HsException + */ + IMPORT_C void publishHsWidget( HsWidget& aWidget ); + + /** + * Method removes a widget. + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * publisher->removeHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * @endcode + * @param aTemplateName Name of the Template. + * @param aWidgetName Name of the Widget + * @param aIdentifier Unique identification of the content. + * @exception HsException + */ + IMPORT_C void removeHsWidget( std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ); + + /** + * Obtains a Widget from Homescreen Publishing Api. + * Attempt of obtaining Widget that was not created cause exception + * with KErrNotFound rason. + * + * + * @code + * HsWidgetPublisher* hsPublisher = new HsWidgetPublisher( dataObserver ); + * hsPublisher->createHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * HsWidget& widget = hsPublisher->getHsWidget( + * "templateName", "widgetName", "uniqueIdentifier" ); + * @endcode + * @param aTemplateName Name of the Template. + * @param aWidgetName Name of the Widget + * @param aIdentifier Unique identification of the content. + * @return Error code. + * @exception HsException + */ + IMPORT_C HsWidget& getHsWidget( std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ); + + +private: //members + + std::auto_ptr mImpl; + + }; +} + +#endif // __HSWIDGETPUBLISHER_H__ + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: Updates applications and icons in Operator Tile. +* +*/ + + +#ifndef __HSWIDGETPUBLISHERIMPL_H__ +#define __HSWIDGETPUBLISHERIMPL_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hsdataobserver.h" + +namespace Hs { + +class HsWidget; + +typedef std::map WidgetContentIdMapType; + +class HsWidgetPublisherImpl : + public MLiwNotifyCallback + { +public://MLiwNotifyCallback + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList); + +public: + /** + */ + HsWidgetPublisherImpl(); + + /** + */ + virtual ~HsWidgetPublisherImpl(); + + /** + */ + HsWidget& CreateWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier, + std::string& aDescription, + std::string& aIconLocation ); + + /** + */ + void RemoveWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier ); + + /** + */ + void SetDataObserver( IHsDataObserver* aDataObserver ); + + /** + */ + HsWidget& GetWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier ); + + /** + */ + void PublishWidget( HsWidget& aWidget ); + + +private: + /** + */ + MLiwInterface* GetServiceInterfaceL(); + + /** + */ + void RegisterNotificationL( HsWidget& aWidget ); + + /** + */ + void UnegisterNotificationL(); + + /** + */ + void PublishWidgetActionsL( HsWidget& aWidget ); + + /** + */ + void PublishWidgetDataL( HsWidget& aWidget ); + + /** + */ + void RemoveWidgetL( HsWidget& aWidget ); + + /** + */ + void RemoveFromCpsL( CLiwDefaultMap* aCpDataMap, const TDesC& aType ); + + /** + */ + void TranslateObserverAction( const TDesC8& aActionDes, + IHsDataObserver::EEvent& aAction ); + + /** + */ + HsWidget* GetWidgetL( const CLiwMap* aMap ); + + /** + */ + int HandleWidgetActionL( const TDesC8& aActionDes, + HsWidget& aWidget ); + + /** + */ + int HandleWidgetItemActionL( const TDesC8& aActionDes, + HsWidget& aWidget ); + + /** + */ + bool CheckIfWidgetExist( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier, + TBool aAdjustToIdentifier ); + + /** + */ + std::string ToStringL( const TDesC& aText ); + + /** + */ + std::wstring ToWideStringL( const TDesC& aText ) const; + + /** + */ + void InsertWidgetIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ); + + /** + */ + void InsertWidgetDataIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ); + + /** + */ + void InsertWidgetInfoL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ); + + /** + */ + void InsertWidgetItemsL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ); + + /** + */ + TInt ObtainErrorCode( const CLiwGenericParamList& aOutParamList ); + + /** + */ + TInt TranslateServiceError( TInt32 aServiceErrorCode ); + + /** + */ + void InsertItemsTriggersL( HsWidget& aWidget, + CLiwDefaultMap* aTriggerMap ); + + /** + */ + void InsertWidgetACLL( CLiwDefaultMap* aDataMap ); + + /** + * Returns publisher name that should be used with a certain widget + * when registering the widget, writing/deleting widget data or + * requesting event notification. + * + * @param aWidget A valid widget object. + * @return Publisher name. + */ + std::string GetPublisherNameL( HsWidget& aWidget ); + + /** + * Parses publisher name in order to determine widget identifier. + * Will leave with KErrNotFound if publisher name is invalid. + * + * @param aPublisherName Publisher name + * @return Widget identifier. + */ + std::string GetWidgetIdentifierFromPublisherNameL( + const TDesC& aPublisherName ); + + /** + * Wraps CnvUtfConverter::ConvertToUnicodeFromUtf8. + * + * @param aSrcString 8-bit utf8-encoded string. + * @return Converted unicode-encoded (16 bit) string. + */ + HBufC* Utf8ToUnicodeLC( const TDesC8& aSrcString ) const; + + /** + * A convenient std::string to HBufC converter. + * + * @param aSrcString utf8-encoded std::string. + * @return Converted unicode-encoded (16 bit) string. + */ + HBufC* StdStringToUnicodeLC( const std::string& aSrcString ) const; + +private: + + std::vector mWidgets; + WidgetContentIdMapType mWidgetContentIds; + CLiwServiceHandler* mServiceHandler; + MLiwInterface* mServiceInterface; + IHsDataObserver* mHsDataObserver; + TInt32 iWidgetUid; + }; +} + +#endif /*__HSWIDGETPUBLISHERIMPL_H__*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/rom/hswidgetpublisher.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/rom/hswidgetpublisher.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: IBY file for the content publishing +* +*/ + + +#ifndef HSWIDGETPUBLISHER_IBY +#define HSWIDGETPUBLISHER_IBY + +file=ABI_DIR\BUILD_DIR\hswidgetpublisher.dll SHARED_LIB_DIR\hswidgetpublisher.dll + +#endif // HSWIDGETPUBLISHER_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/src/hsexception.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hsexception.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "hsexception.h" + +using namespace Hs; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C int HsException::getReason() + { + return mLeaveCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsException::HsException( int aLeaveCode ): + mLeaveCode( aLeaveCode ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsException::~HsException() + { + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/src/hswidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidget.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "hswidget.h" +#include "hswidgetitem.h" +#include "hsexception.h" +#include + +using namespace Hs; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HsWidget::setItem( std::string aItemName, int aValue ) + { + HsWidgetItem* item = getWidgetItem( aItemName ); + if( !item ) + { + item = new HsWidgetItem( aItemName, aValue ); + if( !item ) + { + throw HsException( KErrNoMemory ); + } + mItems.push_back( item ); + } + item->setValue( aValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HsWidget::setItem( std::string aItemName, std::string aValue ) + { + HsWidgetItem* item = getWidgetItem( aItemName ); + if( !item ) + { + item = new HsWidgetItem( aItemName, aValue ); + if( !item ) + { + throw HsException( KErrNoMemory ); + } + mItems.push_back( item ); + } + item->setValue( aValue ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HsWidget::removeItem( std::string aItemName ) + { + HsWidgetItem* ret( 0 ); + int count = mItems.size(); + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = mItems.at( index ); + if( !aItemName.compare( item->getItemName() ) ) + { + ret = item; + mItems.erase( mItems.begin() + index ); + break; + } + } + if( !ret ) + { + throw HsException( KErrNotFound ); + } + delete ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidget::HsWidget( std::string& aTemplateName, + std::string& aWidgetName, std::string& aIdentifier, + std::string& aDescription, std::string& aIconLocation ): + mWidgetName(aWidgetName), mTemplateName(aTemplateName), + mIdentifier(aIdentifier), mDescription( aDescription ), + mIconLocation( aIconLocation ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidget::~HsWidget() + { + int count = mItems.size(); + for( int index = 0; index < count; index++ ) + { + HsWidgetItem* const item = mItems.at( index ); + delete item; + } + mItems.erase( mItems.begin(), mItems.end() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetItem* HsWidget::getWidgetItem( + std::string& aItemName ) + { + HsWidgetItem* ret( 0 ); + int count = mItems.size(); + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = mItems.at( index ); + if( !aItemName.compare( item->getItemName() ) ) + { + ret = item; + break; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidget::getIdentifier() + { + return mIdentifier; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidget::getWidgetName() + { + return mWidgetName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidget::getTemplateName() + { + return mTemplateName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +int HsWidget::itemsCount() + { + return mItems.size(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetItem* HsWidget::getWidgetItem( int aIndex ) + { + return mItems.at( aIndex ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +bool HsWidget::checkIfWidgetItemExist( + std::string& aItemName ) + { + bool itemExist( false ); + int count = mItems.size(); + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = mItems.at( index ); + if( !aItemName.compare( item->getItemName() ) ) + { + itemExist = true; + break; + } + } + return itemExist; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidget::getDescription() const + { + return mDescription; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidget::getIconLocation() const + { + return mIconLocation; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "hswidgetitem.h" +#include "hsexception.h" +#include + + +using namespace Hs; +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetItem::HsWidgetItem(std::string& aItemName, std::string& aValue): + mItemName(aItemName), mItemString(aValue), mItemInt(0), mIsString(true) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetItem::HsWidgetItem( std::string& aItemName, int aValue ): + mItemName(aItemName), mItemString(), mItemInt(aValue), mIsString(false) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetItem::~HsWidgetItem() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetItem::setValue( int aValue ) + { + mItemInt = aValue; + mIsString = false; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetItem::setValue( std::string& aValue ) + { + mItemString = aValue; + mIsString = true; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidgetItem::getItemName() + { + return mItemName; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const std::string& HsWidgetItem::getItemValue() + { + return mItemString; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +int HsWidgetItem::getItemValueInt() + { + return mItemInt; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +bool HsWidgetItem::isStringValue() + { + return mIsString; + } + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 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: CCPSApi DLL source +* +*/ + +// Include Files + +#include "hswidgetpublisher.h" +#include "hswidgetpublisherimpl.h" +#include "hswidget.h" + + +// Member Functions + +using namespace Hs; +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsWidgetPublisher::HsWidgetPublisher( IHsDataObserver* aDataObserver): + mImpl( new HsWidgetPublisherImpl() ) + { + mImpl->SetDataObserver( aDataObserver ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsWidgetPublisher::~HsWidgetPublisher() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HsWidgetPublisher::publishHsWidget( HsWidget& aTemplate ) + { + mImpl->PublishWidget( aTemplate ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsWidget& HsWidgetPublisher::createHsWidgetWithDesc( + std::string aTemplateName, std::string aWidgetName, + std::string aIdentifier, std::string aDescription, + std::string aIconLocation ) + { + return mImpl->CreateWidget( aTemplateName, aWidgetName, aIdentifier, + aDescription, aIconLocation ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsWidget& HsWidgetPublisher::createHsWidget( std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ) + { + std::string emptyString(""); + return mImpl->CreateWidget( aTemplateName, aWidgetName, aIdentifier, + emptyString, emptyString ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C void HsWidgetPublisher::removeHsWidget( std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ) + { + mImpl->RemoveWidget( aTemplateName, aWidgetName, aIdentifier ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C HsWidget& HsWidgetPublisher::getHsWidget( + std::string aTemplateName, + std::string aWidgetName, + std::string aIdentifier ) + { + return mImpl->GetWidget( aTemplateName, aWidgetName, aIdentifier ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1043 @@ +/* +* Copyright (c) 2009 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: CPSApiDll.cpp - main DLL source +* +*/ + +#include + +#include "hswidgetpublisherimpl.h" +#include "hswidget.h" +#include "hswidgetitem.h" +#include "hsglobals.h" +#include "hsexception.h" +#include "hsserviceerrno.h" + +const TInt KSAPIContentNameMaxLength = 255; +const TInt KUnicodeSize = 4; + +using namespace Hs; +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetPublisherImpl::HsWidgetPublisherImpl() + { + mServiceInterface = 0; + TInt err; + TRAP( err, + mServiceHandler = CLiwServiceHandler::NewL(); + ) + if( err != KErrNone ) + { + throw HsException( err ); + } + RProcess process; + iWidgetUid = process.Identity().iUid; + process.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidgetPublisherImpl::~HsWidgetPublisherImpl() + { + TRAP_IGNORE( UnegisterNotificationL() ); + + if( mServiceInterface ) + { + mServiceInterface->Close(); + } + if( mServiceHandler ) + { + mServiceHandler->Reset(); + delete mServiceHandler; + } + + const int count = mWidgets.size(); + for( int index = 0; index < count; index++ ) + { + HsWidget* const widget = mWidgets.at( index ); + mWidgets[index] = NULL; + delete widget; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidget& HsWidgetPublisherImpl::CreateWidget( std::string& aTemplateName, + std::string& aWidgetName, std::string& aIdentifier, + std::string& aDescription, std::string& aIconLocation) + { + if( CheckIfWidgetExist( aTemplateName, aWidgetName, aIdentifier, EFalse ) ) + { + throw HsException( KErrAlreadyExists ); + } + HsWidget* widget= new HsWidget( aTemplateName, aWidgetName, + aIdentifier, aDescription, aIconLocation ); + if( !widget) + { + throw HsException( KErrNoMemory ); + } + mWidgets.push_back( widget); + TInt err( KErrNone ); + TRAP( err, + PublishWidgetActionsL( *widget ); + RegisterNotificationL( *widget ); + ) + if( err != KErrNone ) + { + throw HsException( err ); + } + + return *widget; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HsWidgetPublisherImpl::HandleNotifyL( + TInt /*aCmdId*/, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/) + { + if( !mHsDataObserver ) + { + return 1; + } + + TInt pos(0); + aEventParamList.FindFirst(pos, KChangeInfo); + if (pos != KErrNotFound) + { + // Get list of maps + TLiwVariant variant = (aEventParamList)[pos].Value(); + variant.PushL(); + const CLiwList* changeMapsList = variant.AsList(); + + TBuf8 operation; + TBuf8 trigger; + // Iter through list content + for (TInt index = 0; index < changeMapsList->Count(); ++index) + { + if ( changeMapsList->AtL(index, variant) ) + { + const CLiwMap* map = variant.AsMap(); + HsWidget* widget = GetWidgetL( map ); + if( !widget ) + { + break; + } + if ( map->FindL(KOperation, variant) ) + {// Check what triggered a notification + variant.Get(operation); + } + variant.Reset(); + if ( operation == KOperationExecute ) + { + if( map->FindL( KActionTrigger, variant) ) + { + variant.Get(trigger ); + } + if( !HandleWidgetActionL( trigger, *widget ) ) + { + break; + } + HandleWidgetItemActionL( trigger, *widget ); + } + } + } + CleanupStack::PopAndDestroy(1); + } + return 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +int HsWidgetPublisherImpl::HandleWidgetActionL( const TDesC8& aActionDes, + HsWidget& aWidget ) + { + int ret( 1 );//not found + IHsDataObserver::EEvent action( IHsDataObserver::EUnknown ); + TranslateObserverAction( aActionDes, action ); + if( action == IHsDataObserver::EActivate || + action == IHsDataObserver::EDeactivate || + action == IHsDataObserver::EResume || + action == IHsDataObserver::ESuspend ) + { + TInt observerError = KErrNone; + try + { + mHsDataObserver->handleEvent( + aWidget.getWidgetName(), action ); + } + catch( HsException& exception ) + { + observerError = exception.getReason(); + } + + if ( action == IHsDataObserver::EDeactivate ) + { + // remove widget data when widget removed from screen + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + // removal may fail if the client has already removed the data + TRAP_IGNORE( RemoveFromCpsL( cpdatamap, KCpData ) ); + mWidgetContentIds.erase( aWidget.getIdentifier() ); + CleanupStack::PopAndDestroy( cpdatamap ); + } + + User::LeaveIfError( observerError ); + ret = 0; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::TranslateObserverAction( const TDesC8& aActionDes, + IHsDataObserver::EEvent& aAction ) + { + if( !aActionDes.Compare( KActive() ) ) + { + aAction = IHsDataObserver::EActivate; + } + if( !aActionDes.Compare( KDeActive() ) ) + { + aAction = IHsDataObserver::EDeactivate; + } + if( !aActionDes.Compare( KSuspend() ) ) + { + aAction = IHsDataObserver::ESuspend; + } + if( !aActionDes.Compare( KResume() ) ) + { + aAction = IHsDataObserver::EResume; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +int HsWidgetPublisherImpl::HandleWidgetItemActionL( const TDesC8& aActionDes, + HsWidget& aWidget ) + { + int ret( 1 ); + TBuf8 itemName( aActionDes ); + std::string strItemName( (char*) itemName.PtrZ() ); + if( aWidget.checkIfWidgetItemExist( strItemName ) ) + { + std::string widgetName( aWidget.getWidgetName() ); + try + { + mHsDataObserver->handleItemEvent( widgetName, + strItemName, + IHsDataObserver::ESelect ); + } + catch( HsException& exception ) + { + User::Leave( exception.getReason() ); + } + ret = 0; + } + else if (aActionDes.Compare(KSelected) == 0) + { + std::string widgetName( aWidget.getWidgetName() ); + int count = aWidget.itemsCount(); + + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = aWidget.getWidgetItem( index ); + try + { + mHsDataObserver->handleItemEvent( widgetName, + item->getItemName(), + IHsDataObserver::ESelect ); + } + catch( HsException& exception ) + { + User::Leave( exception.getReason() ); + } + } + ret = 0; + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MLiwInterface* HsWidgetPublisherImpl::GetServiceInterfaceL( ) + { + CLiwGenericParamList* inParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParam ); + CLiwGenericParamList* outParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParam ); + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( KLiwCmdAsStr, + KCPInterface, KCPService ); + crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); + + RCriteriaArray a; + a.AppendL(crit); + mServiceHandler->AttachL(a); + mServiceHandler->ExecuteServiceCmdL( *crit, *inParam, *outParam ); + delete crit; + a.Reset(); + + // find service interface + TInt pos = 0; + MLiwInterface* msgInterface( 0 ); + outParam->FindFirst( pos, KCPInterface ); + if ( pos != KErrNotFound ) + { + msgInterface = (*outParam)[pos].Value().AsInterface(); + } + + outParam->Reset(); + inParam->Reset(); + CleanupStack::PopAndDestroy( outParam ); + CleanupStack::PopAndDestroy( inParam ); + + return msgInterface; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::SetDataObserver( IHsDataObserver* aDataObserver ) + { + __ASSERT_ALWAYS( aDataObserver, User::Panic( KStartUpFailed, 0) ); + mHsDataObserver = aDataObserver; + TInt err( KErrNone ); + TRAP( err, + mServiceInterface = GetServiceInterfaceL(); + ); + if( err != KErrNone ) + { + throw HsException( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::RegisterNotificationL( HsWidget& aWidget ) + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + CLiwDefaultMap* reqFilter = CLiwDefaultMap::NewLC(); + + HBufC* publisherName = StdStringToUnicodeLC( GetPublisherNameL( aWidget ) ); + + reqFilter->InsertL( KPublisherId, TLiwVariant( *publisherName ) ); + reqFilter->InsertL( KContentType, TLiwVariant( KAll ) ); + reqFilter->InsertL( KContentId, TLiwVariant( KAll )); + reqFilter->InsertL( KOperation, TLiwVariant( KOperationExecute )); + + inParam->AppendL(TLiwGenericParam(KType, TLiwVariant( + KContentAndPublisher_Registry))); + inParam->AppendL(TLiwGenericParam(KFilter, TLiwVariant(reqFilter))); + + mServiceInterface->ExecuteCmdL( KRequestNotification, + *inParam, *outParam, 0, this ); + TInt ret = ObtainErrorCode( *outParam ); + + outParam->Reset(); + inParam->Reset(); + CleanupStack::PopAndDestroy( publisherName ); + CleanupStack::PopAndDestroy( reqFilter ); + User::LeaveIfError( ret ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::UnegisterNotificationL() + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + mServiceInterface->ExecuteCmdL( KRequestNotification, + *inParam, *outParam, KLiwOptCancel, this ); + TInt ret= ObtainErrorCode( *outParam ); + + outParam->Reset(); + inParam->Reset(); + User::LeaveIfError( ret ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::PublishWidget( HsWidget& aWidget ) + { + TRAPD( err, + PublishWidgetDataL( aWidget ); + ); + if( err != KErrNone ) + { + throw HsException( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::PublishWidgetDataL( HsWidget& aWidget ) + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + TLiwGenericParam type(KType, TLiwVariant(KCpData)); + inParam->AppendL(type); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + InsertWidgetItemsL( aWidget, datamap ); + cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); + InsertWidgetACLL( cpdatamap ); + + int count = aWidget.itemsCount(); + if( count > 0 ) + { + CLiwDefaultMap* triggermap = CLiwDefaultMap::NewLC(); + InsertItemsTriggersL( aWidget, triggermap ); + cpdatamap->InsertL( KActionMap, TLiwVariant( triggermap ) ); + CleanupStack::PopAndDestroy( triggermap ); + } + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + inParam->AppendL( item ); + mServiceInterface->ExecuteCmdL( KAdd, + *inParam, *outParam); + TInt ret= ObtainErrorCode( *outParam ); + + CleanupStack::PopAndDestroy( datamap ); + CleanupStack::PopAndDestroy( cpdatamap ); + + item.Reset(); + type.Reset(); + outParam->Reset(); + inParam->Reset(); + User::LeaveIfError( ret ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::PublishWidgetActionsL( HsWidget& aWidget ) + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + TLiwGenericParam type(KType, TLiwVariant(KPublisher)); + inParam->AppendL(type); + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + InsertWidgetIdentifiersL( aWidget, cpdatamap ); + + CLiwDefaultMap* mapAction = CLiwDefaultMap::NewLC(); + + CLiwDefaultMap* activateAction = CLiwDefaultMap::NewLC(); + activateAction->InsertL( KPluginId, TLiwVariant( KCASpaAppLauncherPlugin ) ); + + CLiwDefaultMap* activate = CLiwDefaultMap::NewLC(); + activate->InsertL( KType, TLiwVariant( KActionValueLaunchApplication ) ); + activate->InsertL( KLaunchMethod, TLiwVariant( KLaunchMethodValueCmdLine ) ); + activate->InsertL( KApplicationUid, TLiwVariant( iWidgetUid ) ); + activate->InsertL( KApaCommand, TLiwVariant( KApaCommandBackground ) ); + + activateAction->InsertL( KData, TLiwVariant( activate ) ); + + mapAction->InsertL(KActive, TLiwVariant( activateAction )); + mapAction->InsertL(KDeActive, TLiwVariant(KTriggerMap)); + mapAction->InsertL(KSuspend, TLiwVariant(KTriggerMap)); + mapAction->InsertL(KResume, TLiwVariant(KTriggerMap)); + mapAction->InsertL(KSelected, TLiwVariant(activateAction)); + + cpdatamap->InsertL( KActionMap, TLiwVariant( mapAction ) ); + + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + InsertWidgetInfoL( aWidget, datamap ); + cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); + + InsertWidgetACLL( cpdatamap ); + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + inParam->AppendL( item ); + + mServiceInterface->ExecuteCmdL( KAdd, *inParam, *outParam); + + TInt ret= ObtainErrorCode( *outParam ); + + CleanupStack::PopAndDestroy( datamap ); + CleanupStack::PopAndDestroy( activate ); + CleanupStack::PopAndDestroy( activateAction ); + CleanupStack::PopAndDestroy( mapAction ); + CleanupStack::PopAndDestroy( cpdatamap ); + + item.Reset(); + type.Reset(); + outParam->Reset(); + inParam->Reset(); + User::LeaveIfError( ret ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::RemoveWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier ) + { + HsWidget* ret( 0 ); + int count = mWidgets.size(); + for (int index = 0; index < count; index++) + { + HsWidget* const widget = mWidgets.at( index ); + if ( !aTemplateName.compare( widget->getTemplateName() ) ) + { + if( !aWidgetName.compare( widget->getWidgetName() ) ) + { + if( !aIdentifier.compare( widget->getIdentifier() ) ) + { + ret = widget; + TRAPD( removalErr, RemoveWidgetL( *widget ) ); + if ( removalErr != KErrNone ) + { + throw HsException( removalErr ); + } + mWidgetContentIds.erase( widget->getIdentifier() ); + mWidgets.erase( mWidgets.begin() + index ); + break; + } + } + } + } + if( !ret ) + { + throw HsException( KErrNotFound ); + } + delete ret; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::RemoveWidgetL( HsWidget& aWidget ) + { + // remove widget data + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + TRAPD( err, + InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + RemoveFromCpsL( cpdatamap, KCpData ) ); + if ( err != KErrNotFound ) + { + User::LeaveIfError( err ); + } + CleanupStack::PopAndDestroy( cpdatamap ); + cpdatamap = NULL; + + // remove widget definition (actions and template info) + cpdatamap = CLiwDefaultMap::NewLC(); + InsertWidgetIdentifiersL( aWidget, cpdatamap ); + RemoveFromCpsL( cpdatamap, KPublisher ); + CleanupStack::PopAndDestroy( cpdatamap ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::RemoveFromCpsL( CLiwDefaultMap* aCpDataMap, + const TDesC& aType ) + { + __ASSERT_ALWAYS( aCpDataMap, User::Invariant() ); + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + TLiwGenericParam type( KType, TLiwVariant( aType ) ); + inParam->AppendL( type ); + + TLiwGenericParam item( KItem, TLiwVariant( aCpDataMap )); + inParam->AppendL( item ); + + mServiceInterface->ExecuteCmdL( KDelete, + *inParam, *outParam); + TInt ret= ObtainErrorCode( *outParam ); + + item.Reset(); + type.Reset(); + inParam->Reset(); + outParam->Reset(); + User::LeaveIfError( ret ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidget& HsWidgetPublisherImpl::GetWidget( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier ) + { + HsWidget* ret( 0 ); + int count = mWidgets.size(); + for (int index = 0; index < count; index++) + { + HsWidget* const widget = mWidgets.at( index ); + if ( !aTemplateName.compare( widget->getTemplateName() ) ) + { + if( !aWidgetName.compare( widget->getWidgetName() ) ) + { + if( !aIdentifier.compare( widget->getIdentifier() ) ) + { + ret = widget; + break; + } + } + } + } + if( !ret ) + { + throw HsException( KErrNotFound ); + } + return *ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HsWidget* HsWidgetPublisherImpl::GetWidgetL( const CLiwMap* aMap ) + { + // identifier length + colon char + KHsWidgetPublisher string length + const TInt maxPublisherNameLength = + KSAPIContentNameMaxLength + 1 + KHsWidgetPublisher().Length(); + + HsWidget* ret ( 0 ); + TLiwVariant variant; + variant.PushL(); + + if ( !aMap->FindL( KPublisherId, variant ) ) + { + User::Leave( KErrNotFound ); + } + HBufC* publisherName = HBufC::NewLC( maxPublisherNameLength ); + { // braces for scope only + TPtr16 publisherNameDes = publisherName->Des(); + variant.Get( publisherNameDes ); + } + variant.Reset(); + std::string strIdentifier( GetWidgetIdentifierFromPublisherNameL( + *publisherName ) ); + CleanupStack::PopAndDestroy( publisherName ); + publisherName = 0; + + TBuf contentIdDesc; + if ( !aMap->FindL( KContentId, variant ) ) + { + User::Leave( KErrNotFound ); + } + variant.Get( contentIdDesc ); + CleanupStack::PopAndDestroy( &variant ); + std::wstring contentId( ToWideStringL( contentIdDesc ) ); + + std::string strTemplate; + std::string strWidgetName; + + if( CheckIfWidgetExist(strTemplate, strWidgetName, strIdentifier, ETrue) ) + { + ret = &GetWidget( strTemplate, strWidgetName, strIdentifier); + + // verify that content id does not change + __ASSERT_DEBUG( !mWidgetContentIds.count( ret->getIdentifier() ) || + mWidgetContentIds[ret->getIdentifier()] == contentId, + User::Invariant() ); + + mWidgetContentIds[ret->getIdentifier()] = contentId; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +bool HsWidgetPublisherImpl::CheckIfWidgetExist( std::string& aTemplateName, + std::string& aWidgetName, + std::string& aIdentifier, + TBool aAdjustToIdentifier ) + { + bool widgetExist( false ); + int count = mWidgets.size(); + for (int index = 0; index < count; index++) + { + HsWidget* const widget = mWidgets.at( index ); + if( !aIdentifier.compare( widget->getIdentifier() ) ) + { + if( !aTemplateName.compare( widget->getTemplateName() ) ) + { + if( !aWidgetName.compare( widget->getWidgetName() ) ) + { + widgetExist = true; + break; + } + } + if( aAdjustToIdentifier ) + { + aTemplateName = widget->getTemplateName(); + aWidgetName = widget->getWidgetName(); + widgetExist = true; + break; + } + } + } + return widgetExist; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +std::string HsWidgetPublisherImpl::ToStringL(const TDesC& aText) + { + HBufC8* text = HBufC8::NewL( aText.Length() + 1 /*for ending zero*/ ); + TPtr8 dest( text->Des() ); + CnvUtfConverter::ConvertFromUnicodeToUtf8( dest, aText ); + std::string ret((const char*)dest.PtrZ()); + delete text; + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +std::wstring HsWidgetPublisherImpl::ToWideStringL( const TDesC& aText ) const + { + return std::wstring( + reinterpret_cast( aText.Ptr() ), aText.Length() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ) + { + HBufC* publisherName = StdStringToUnicodeLC( GetPublisherNameL( aWidget ) ); + aDataMap->InsertL( KPublisherId, TLiwVariant( *publisherName )); + aDataMap->InsertL( KContentType, TLiwVariant( KHSTemplate )); + aDataMap->InsertL( KContentId, TLiwVariant( KAll )); + CleanupStack::PopAndDestroy( publisherName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetDataIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ) + { + WidgetContentIdMapType::const_iterator contentIdIter = + mWidgetContentIds.find( aWidget.getIdentifier() ); + if ( contentIdIter == mWidgetContentIds.end() ) + { + User::Leave( KErrNotFound ); + } + TPtrC16 contentId = reinterpret_cast( + contentIdIter->second.c_str() ); + + HBufC* publisherName = StdStringToUnicodeLC( GetPublisherNameL( aWidget ) ); + + aDataMap->InsertL( KPublisherId, TLiwVariant( *publisherName ) ); + aDataMap->InsertL( KContentType, TLiwVariant( KAll ) ); + aDataMap->InsertL( KContentId, TLiwVariant( contentId ) ); + + CleanupStack::PopAndDestroy( publisherName ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetInfoL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ) + { + __ASSERT_ALWAYS( aDataMap, User::Invariant() ); + + HBufC* templateType = StdStringToUnicodeLC( aWidget.getTemplateName() ); + HBufC* widgetName = StdStringToUnicodeLC( aWidget.getWidgetName() ); + + aDataMap->InsertL( KTemplateType, TLiwVariant( *templateType ) ); + aDataMap->InsertL( KWidgetName, TLiwVariant( *widgetName ) ); + aDataMap->InsertL( KWidgetMaxInstance, TLiwVariant( 1 ) ); + + const std::string& widgetDescriptionStd = aWidget.getDescription(); + if ( widgetDescriptionStd.length() ) + { + HBufC* widgetDescription = StdStringToUnicodeLC( widgetDescriptionStd ); + aDataMap->InsertL( KWidgetDesc, TLiwVariant( *widgetDescription ) ); + CleanupStack::PopAndDestroy( widgetDescription ); + } + const std::string& widgetIconLocStd = aWidget.getIconLocation(); + if ( widgetIconLocStd.length() ) + { + HBufC* widgetIconLoc = StdStringToUnicodeLC( widgetIconLocStd ); + aDataMap->InsertL( KWidgetIcon, TLiwVariant( *widgetIconLoc ) ); + CleanupStack::PopAndDestroy( widgetIconLoc ); + } + + CleanupStack::PopAndDestroy( widgetName ); + CleanupStack::PopAndDestroy( templateType ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetItemsL ( HsWidget& aWidget, + CLiwDefaultMap* aDataMap ) + { + int count = aWidget.itemsCount(); + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = aWidget.getWidgetItem( index ); + + TPtrC8 itemName = ((TUint8*)item->getItemName().c_str()); + if( item->isStringValue() ) + { + TPtrC8 itemValue = ((TUint8*)item->getItemValue().c_str()); + HBufC* value = HBufC::NewLC( KUnicodeSize * itemValue.Length() ); + TPtr dest( value->Des() ); + CnvUtfConverter::ConvertToUnicodeFromUtf8( dest, itemValue ); + + aDataMap->InsertL( itemName, TLiwVariant(*value )); + CleanupStack::PopAndDestroy(value); + } + else + { + int itemValue = item->getItemValueInt(); + aDataMap->InsertL( itemName, TLiwVariant( TInt32( itemValue ) )); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HsWidgetPublisherImpl::ObtainErrorCode( + const CLiwGenericParamList& aOutParamList ) + { + TInt errorCode( KErrNone ); + TInt32 serviceErrorCode; + TInt posErr( 0 ); + aOutParamList.FindFirst( posErr, LIW::EGenericParamError ); + if( posErr != KErrNotFound ) + { + // error code found - extract and handle + aOutParamList[posErr].Value().Get( serviceErrorCode ); + errorCode = TranslateServiceError( serviceErrorCode ); + } + return errorCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt HsWidgetPublisherImpl::TranslateServiceError( TInt32 aServiceErrorCode ) + { + TInt ret( KErrNone ); + + switch ( aServiceErrorCode ) + { + case SErrNone: + // KErrNone and KErrCancel are translated into SErrNone + ret = KErrNone; + break; + + case SErrNotFound: + ret = KErrNotFound; + break; + + case SErrNoMemory: + ret = KErrNoMemory; + break; + + case SErrServiceInUse: + ret = KErrInUse; + break; + + case SErrServiceNotSupported: + ret = KErrNotSupported; + break; + + case SErrBadArgumentType: + ret = KErrBadName; + break; + + case SErrInvalidServiceArgument: + ret = KErrArgument; + break; + + case SErrAccessDenied: + ret = KErrPermissionDenied; + break; + + default: + ret = KErrGeneral; + break; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertItemsTriggersL( HsWidget& aWidget, + CLiwDefaultMap* aTriggerMap ) + { + int count = aWidget.itemsCount(); + CLiwDefaultMap* activateAction = CLiwDefaultMap::NewLC(); + activateAction->InsertL( KPluginId, TLiwVariant( KCASpaAppLauncherPlugin ) ); + + CLiwDefaultMap* activate = CLiwDefaultMap::NewLC(); + activate->InsertL( KType, TLiwVariant( KActionValueLaunchApplication ) ); + activate->InsertL( KLaunchMethod, TLiwVariant( KLaunchMethodValueCmdLine ) ); + activate->InsertL( KApplicationUid, TLiwVariant( iWidgetUid ) ); + activate->InsertL( KApaCommand, TLiwVariant( KApaCommandBackground ) ); + + activateAction->InsertL( KData, TLiwVariant( activate ) ); + + for (int index = 0; index < count; index++) + { + HsWidgetItem* const item = aWidget.getWidgetItem( index ); + TPtrC8 itemName = ((TUint8*)item->getItemName().c_str()); + aTriggerMap->InsertL( itemName, TLiwVariant( activateAction )); + } + CleanupStack::PopAndDestroy( activate ); + CleanupStack::PopAndDestroy( activateAction ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetACLL( CLiwDefaultMap* aDataMap ) + { + CLiwDefaultMap* aclMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* writeMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* deleteMap = CLiwDefaultMap::NewLC(); + + RBuf widgetUid; + widgetUid.CleanupClosePushL(); + widgetUid.CreateL(10); + widgetUid.Append( KHexPrefix ); + widgetUid.AppendNum( (TUint)iWidgetUid, EHex ); + + RBuf widgetCHUids; + widgetCHUids.CleanupClosePushL(); + widgetCHUids.CreateL(21); + widgetCHUids.Append( widgetUid ); + widgetCHUids.Append( KColon ); + widgetCHUids.Append( KContentHarvesterUid ); + + writeMap->InsertL( KUIDs, TLiwVariant( widgetUid ) ); + deleteMap->InsertL( KUIDs, TLiwVariant( widgetCHUids ) ); + + aclMap->InsertL( KACLWrite, TLiwVariant( writeMap ) ); + aclMap->InsertL( KACLDelete, TLiwVariant( deleteMap ) ); + + aDataMap->InsertL( KAccessList, TLiwVariant( aclMap ) ); + + CleanupStack::PopAndDestroy( &widgetCHUids ); + CleanupStack::PopAndDestroy( &widgetUid ); + CleanupStack::PopAndDestroy( deleteMap ); + CleanupStack::PopAndDestroy( writeMap ); + CleanupStack::PopAndDestroy( aclMap ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +std::string HsWidgetPublisherImpl::GetPublisherNameL( HsWidget& aWidget ) + { + return aWidget.getIdentifier() + ':' + ToStringL( KHsWidgetPublisher() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +std::string HsWidgetPublisherImpl::GetWidgetIdentifierFromPublisherNameL( + const TDesC& aPublisherName ) + { + TInt colonPos = aPublisherName.LocateReverse(':'); + User::LeaveIfError( colonPos ); + return ToStringL( aPublisherName.Left( colonPos ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* HsWidgetPublisherImpl::Utf8ToUnicodeLC( const TDesC8& aSrcString ) const + { + HBufC* destString = HBufC::NewLC( aSrcString.Length() ); + TPtr destStringDes = destString->Des(); + CnvUtfConverter::ConvertToUnicodeFromUtf8( destStringDes, aSrcString ); + return destString; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +HBufC* HsWidgetPublisherImpl::StdStringToUnicodeLC( + const std::string& aSrcString ) const + { + TPtrC8 srcDescriptor = reinterpret_cast( + aSrcString.c_str() ); + return Utf8ToUnicodeLC( srcDescriptor ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/bmarm/TestHspApiU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/bmarm/TestHspApiU.DEF Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/bwins/TestHspApiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/bwins/TestHspApiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/conf/TestHspApi.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/conf/TestHspApi.cfg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,76 @@ +[Test] +title TestHspApiConstrL +create TestHspApi foobar +foobar TestHspApiConstrL +delete foobar +[Endtest] + +[Test] +title TestHspWidgetAddWidgetItem1L +create TestHspApi foobar +foobar TestHspWidgetAddWidgetItem1L +delete foobar +[Endtest] + +[Test] +title TestHspWidgetAddWidgetItem2L +create TestHspApi foobar +foobar TestHspWidgetAddWidgetItem2L +delete foobar +[Endtest] + +[Test] +title TestHspWidgetAddWidgetItem3L +create TestHspApi foobar +foobar TestHspWidgetAddWidgetItem3L +delete foobar +[Endtest] + +[Test] +title TestHspApiDeleteWidgetL +create TestHspApi foobar +foobar TestHspApiDeleteWidgetL +delete foobar +[Endtest] + +[Test] +title TestHspApiSetDataObserver1L +create TestHspApi foobar +foobar TestHspApiSetDataObserver1L +delete foobar +[Endtest] + +[Test] +title TestHspApiSetDataObserver2L +create TestHspApi foobar +foobar TestHspApiSetDataObserver2L +delete foobar +[Endtest] + +[Test] +title TestHspApiGetWidgetL +create TestHspApi foobar +foobar TestHspApiGetWidgetL +delete foobar +[Endtest] + +[Test] +title TestHspApiWidgetRemoveItem1L +create TestHspApi foobar +foobar TestHspApiWidgetRemoveItem1L +delete foobar +[Endtest] + +[Test] +title TestHspApiWidgetRemoveItem2L +create TestHspApi foobar +foobar TestHspApiWidgetRemoveItem2L +delete foobar +[Endtest] + +[Test] +title TestHspApiExceptionL +create TestHspApi foobar +foobar TestHspApiExceptionL +delete foobar +[Endtest] \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/eabi/TestHspApiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/eabi/TestHspApiu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI11CWaitActive @ 2 NONAME + _ZTV11CWaitActive @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/TestHspApi.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/TestHspApi.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002 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: ?Description +* +*/ + +#include + +TARGET TestHspApi.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +#if defined(EKA2) +CAPABILITY ALL -TCB +/* Remove comments and replace 0x00000000 with correct vendor id */ +// VENDORID 0x00000000 +#endif + +//TARGETPATH ?target_path +DEFFILE TestHspApi.def + +SOURCEPATH ../src +SOURCE TestHspApi.cpp +SOURCE TestHspApiBlocks.cpp +SOURCE waitactive.cpp + + +MW_LAYER_SYSTEMINCLUDE +OS_LAYER_LIBC_SYSTEMINCLUDE +OS_LAYER_STDCPP_SYSTEMINCLUDE + +USERINCLUDE ../inc + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY hswidgetpublisher.lib +LIBRARY libstdcpp.lib +LIBRARY liwservicehandler.lib +LIBRARY libc.lib + +LANG SC +epocallowdlldata +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 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: +* +*/ +PRJ_EXPORTS +../init/TestHspApi.ini c:/testframework/TestHspApi.ini +../conf/TestHspApi.cfg c:/testframework/TestHspApi.cfg + + +PRJ_MMPFILES +TestHspApi.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/createsis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/createsis.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis testhspapi.pkg +signsis testhspapi.sis testhspapi.sisx rd.cer rd-key.pem +pause \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/hsptest.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/hsptest.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +md c:\data\stif\cps_results\ +ATSInterface.exe -testmodule TestScripter -config c:\testframework\testhspapi.cfg \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/rd-key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/rd-key.pem Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 +6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh +7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB +gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX +pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB +yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j +KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 +iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 +2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ +9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 +aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO +TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 +mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/rd.cer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/rd.cer Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z +NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl +cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT +rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa +gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI +f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL +BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud +IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd +IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE +IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G +CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 +Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT +7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR +-----END CERTIFICATE----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/group/testhspapi.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/group/testhspapi.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +; +; Copyright (c) 2009 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: +; +&EN + +; standard SIS file header +#{"testhspapi"},(0x02FE5167),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install + + "\epoc32\release\armv5\urel\TestHspApi.dll" - "!:\sys\bin\TestHspApi.dll" +; "..\init\TestHspApi.ini" - "c:\testframework\TestFramework.ini" + "..\conf\TestHspApi.cfg" - "c:\testframework\testhspapi.cfg" + "hsptest.bat" - "c:\hsptest.bat" diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/inc/TestHspApi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/inc/TestHspApi.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2002 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: ?Description +* +*/ + + + +#ifndef TESTHSPAPI_H +#define TESTHSPAPI_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include "hsdataobserver.h" +#include +#include "hswidgetpublisher.h" + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +// Logging path +_LIT( KTestHspApiLogPath, "\\logs\\testframework\\TestHspApi\\" ); +// Log file +_LIT( KTestHspApiLogFile, "TestHspApi.txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CTestHspApi; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CTestHspApi test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CTestHspApi) : public CScriptBase, public Hs::IHsDataObserver, public MLiwNotifyCallback + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CTestHspApi* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CTestHspApi(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CTestHspApi( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + TInt TestHspApiConstrL( CStifItemParser& aItem ); + TInt TestHspWidgetAddWidgetItem1L( CStifItemParser& aItem ); + TInt TestHspWidgetAddWidgetItem2L( CStifItemParser& aItem ); + TInt TestHspWidgetAddWidgetItem3L( CStifItemParser& aItem ); + TInt TestHspApiDeleteWidgetL( CStifItemParser& aItem ); + TInt TestHspApiSetDataObserver1L( CStifItemParser& aItem ); + TInt TestHspApiSetDataObserver2L( CStifItemParser& aItem ); + TInt TestHspApiGetWidgetL( CStifItemParser& aItem ); + TInt TestHspApiWidgetRemoveItem1L( CStifItemParser& aItem ); + TInt TestHspApiWidgetRemoveItem2L( CStifItemParser& aItem ); + TInt TestHspApiExceptionL( CStifItemParser& aItem ); + + // from IHSPDataObserver + void handleItemEvent( std::string aWidgetName, std::string aTemplateItemName, Hs::IHsDataObserver::EItemEvent aAction); + void handleEvent( std::string aWidgetName, Hs::IHsDataObserver::EEvent aAction ); + + MLiwInterface* GetServiceInterfaceL(); + + CLiwGenericParamList* GetListL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + CLiwGenericParamList* ExecuteActionL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + CLiwGenericParamList* ExecuteActionSelectedL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + TInt CTestHspApi::ExtractItemCountL( + const CLiwGenericParamList& aInParamList ); + + TInt ExtractItemL( const CLiwGenericParamList& aInParamList, + const TDesC8& aItemName, RBuf& aItemValue ); + + void AddTemplate( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + void SendFakeActivateEvent( std::string& aIdentifier ); + + void AddExistingTemplate( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + void AddAndRemoveTemplateItem1( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + void AddAndRemoveTemplateItem2( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ); + + void WaitL(TInt aMicroSec); + + // from MLiwNotifyCallback + TInt HandleNotifyL( TInt /*aCmdId*/, TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ); + + void ThrowHspException(); + + private: // Data + + CLiwServiceHandler* mServiceHandler; + MLiwInterface* mServiceInterface; + TInt iItemActionStatus; + TInt iActionStatus; + + }; + +#endif // TESTHSPAPI_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/inc/waitactive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/inc/waitactive.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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: Plugin Interface +* +*/ + + +#ifndef C_WAITACTIVE_H +#define C_WAITACTIVE_H + +#include + +/** + * Helper wait active class + */ + class CWaitActive : public CTimer + { + +public: + + + static CWaitActive* NewL( ); + + ~CWaitActive(); + + void Wait(TTimeIntervalMicroSeconds32 anInterval); + +protected: + + /** + * From CActive, RunL. + * Handles the active object’s request completion event + */ + void RunL(); + + +private: + + CWaitActive(); + + void ConstructL(); + +private: + + /* + * Own. + */ + CActiveSchedulerWait* iActiveScheduler; + }; + + +#endif // C_WAITACTIVE_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/init/TestHspApi.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/init/TestHspApi.ini Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,178 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\data\stif\testhspapi_results\ +TestReportFileName= hspapi + +TestReportFormat= HTML # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= dom_test2 +#[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +[New_Module] +ModuleName= testscripter + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) + +TestCaseFile= c:\testframework\TestHspApi.cfg + + +[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApi.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2002 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: ?Description +* +*/ + + + +// INCLUDE FILES +#include +#include "TestHspApi.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestHspApi::CTestHspApi +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CTestHspApi::CTestHspApi( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CTestHspApi::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestHspApi::ConstructL() + { + iLog = CStifLogger::NewL( KTestHspApiLogPath, + KTestHspApiLogFile, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + mServiceHandler = CLiwServiceHandler::NewL(); + mServiceInterface = GetServiceInterfaceL(); + iItemActionStatus = KErrGeneral; + iActionStatus = KErrGeneral; + } + +// ----------------------------------------------------------------------------- +// CTestHspApi::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestHspApi* CTestHspApi::NewL( + CTestModuleIf& aTestModuleIf ) + { + CTestHspApi* self = new (ELeave) CTestHspApi( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CTestHspApi::~CTestHspApi() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CTestHspApi::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApiBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/src/TestHspApiBlocks.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,985 @@ +/* +* Copyright (c) 2002 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: ?Description +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include "TestHspApi.h" +#include +#include +#include +#include +#include +#include +#include +#include "waitactive.h" +#include + +_LIT8( KResults, "results" ); + +_LIT8( KType, "type" ); +_LIT( KCpData, "cp_data" ); +_LIT8( KContentIdFormat, "%s:%s"); +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT( KHsPublisher, "ai3templatedwidget" ); +_LIT( KHsWidgetPublisher, "hswidgetpublisher"); +_LIT( KAll, "all" ); +_LIT8( KFilter, "filter" ); +_LIT( KContentAndPublisher_Registry, "cp_data:publisher"); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT( KPublisher, "publisher" ); +_LIT8( KActionTrigger, "action_trigger" ); +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT8( KActive, "active"); +_LIT8( KSelected, "selected"); +_LIT( KFakeContentId, "616" ); + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +LOCAL_C HBufC* StdStringTo16bitDescLC( const std::string& aSrcString ) + { + TPtrC8 srcDescriptor = (TUint8*) aSrcString.c_str(); + HBufC* dstDescriptor = HBufC::NewLC( srcDescriptor.Length() ); + dstDescriptor->Des().Copy( srcDescriptor ); + return dstDescriptor; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestHspApi::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CTestHspApi::Delete() + { + mServiceInterface->Close(); + delete mServiceHandler; + } + +// ----------------------------------------------------------------------------- +// CTestHspApi::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "TestHspApiConstrL", CTestHspApi::TestHspApiConstrL ), + ENTRY( "TestHspWidgetAddWidgetItem1L", CTestHspApi::TestHspWidgetAddWidgetItem1L ), + ENTRY( "TestHspWidgetAddWidgetItem2L", CTestHspApi::TestHspWidgetAddWidgetItem2L ), + ENTRY( "TestHspWidgetAddWidgetItem3L", CTestHspApi::TestHspWidgetAddWidgetItem3L ), + ENTRY( "TestHspApiDeleteWidgetL", CTestHspApi::TestHspApiDeleteWidgetL ), + ENTRY( "TestHspApiSetDataObserver1L", CTestHspApi::TestHspApiSetDataObserver1L ), + ENTRY( "TestHspApiSetDataObserver2L", CTestHspApi::TestHspApiSetDataObserver2L ), + ENTRY( "TestHspApiGetWidgetL", CTestHspApi::TestHspApiGetWidgetL ), + ENTRY( "TestHspApiWidgetRemoveItem1L", CTestHspApi::TestHspApiWidgetRemoveItem1L ), + ENTRY( "TestHspApiWidgetRemoveItem2L", CTestHspApi::TestHspApiWidgetRemoveItem2L ), + ENTRY( "TestHspApiExceptionL", CTestHspApi::TestHspApiExceptionL ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CTestHspApi::ExtractItemCountL( + const CLiwGenericParamList& aInParamList ) + { + TInt result( KErrNotFound ); + TInt count (0); + TInt pos( 0 ); + aInParamList.FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present - extract and return text + { + TLiwVariant variant = aInParamList[pos].Value(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + + while(iterable->NextL( variant )) + { + count++; + } + + iterable->Reset(); + variant.Reset(); + + result = count; + } + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CTestHspApi::ExtractItemL( const CLiwGenericParamList& aInParamList, + const TDesC8& aItemName, RBuf& aItemValue ) + { + TInt result( KErrNotFound ); + TInt count (0); + TInt pos( 0 ); + aInParamList.FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present - extract and return text + { + TLiwVariant variant = aInParamList[pos].Value(); + CLiwIterable* iterable = variant.AsIterable(); + + TLiwVariant item; + while ( iterable->NextL( item ) ) + { + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + item.Get( *map ); + TLiwVariant dataMapVariant; + TBool found = map->FindL( _L8("data_map"), dataMapVariant ); + if ( found ) + { + CLiwDefaultMap *dataMap = CLiwDefaultMap::NewLC(); + dataMapVariant.Get( *dataMap ); + TLiwVariant item1; + found = dataMap->FindL( aItemName, item1 ); + if ( found ) + { + TPtrC ptr; + item1.Get( ptr ); + aItemValue.Create( ptr ); + result = KErrNone; + } + item1.Reset(); + dataMapVariant.Reset(); + CleanupStack::PopAndDestroy( dataMap ); + } + CleanupStack::PopAndDestroy( map ); + } + + iterable->Reset(); + variant.Reset(); + } + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CTestHspApi::GetListL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + TBool res( EFalse ); + + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + TLiwGenericParam type(KType, TLiwVariant(KCpData)); + inParam->AppendL(type); + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + TPtrC8 contentType = ((TUint8*)aContentType.c_str()); + + const TInt KSAPIContentNameMaxLength = 255; + + TBuf8 contentId; + contentId = (TUint8*)aIdentifier.c_str(); + + HBufC* publisherName = StdStringTo16bitDescLC( aIdentifier + ":hswidgetpublisher" ); + cpdatamap->InsertL( KPublisherId, TLiwVariant( *publisherName )); + cpdatamap->InsertL( KContentType, TLiwVariant( KAll )); + cpdatamap->InsertL( KContentId, TLiwVariant( KFakeContentId )); + + TLiwGenericParam filter( KFilter, TLiwVariant( cpdatamap )); + inParam->AppendL( filter ); + mServiceInterface->ExecuteCmdL( _L8("GetList"), + *inParam, *outParam); + + CleanupStack::PopAndDestroy( publisherName ); + CleanupStack::PopAndDestroy( cpdatamap ); + + filter.Reset(); + type.Reset(); + + inParam->Reset(); + + return outParam; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CTestHspApi::HandleNotifyL( + TInt /*aCmdId*/, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/) + { + iActionStatus = KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CTestHspApi::ExecuteActionL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + TBool res( EFalse ); + + // ---------------------------- + // register for notification + // ---------------------------- + + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + CLiwDefaultMap* reqFilter = CLiwDefaultMap::NewLC(); + + //reqFilter->InsertL( KPublisherId, TLiwVariant( KHSPPublisher )); + reqFilter->InsertL( KPublisherId, TLiwVariant( KAll )); + reqFilter->InsertL( KContentType, TLiwVariant( KAll )); + reqFilter->InsertL( KContentId, TLiwVariant( KAll )); + //reqFilter->InsertL( KOperation, TLiwVariant( KOperationExecute )); + + inParam->AppendL(TLiwGenericParam(KType, TLiwVariant(KContentAndPublisher_Registry))); + inParam->AppendL(TLiwGenericParam(KFilter, TLiwVariant(reqFilter))); + + mServiceInterface->ExecuteCmdL( KRequestNotification, + *inParam, *outParam, 0, this ); + + outParam->Reset(); + inParam->Reset(); + CleanupStack::PopAndDestroy( reqFilter ); + + // -------------- + // execute action + // -------------- + + TLiwGenericParam type(KType, TLiwVariant(KPublisher)); + inParam->AppendL(type); + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + TPtrC8 contentType = ((TUint8*)aContentType.c_str()); + + const TInt KSAPIContentNameMaxLength = 255; + + TBuf8 contentId; + contentId = (TUint8*)aIdentifier.c_str(); + + cpdatamap->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); + cpdatamap->InsertL( KContentType, TLiwVariant( KHsPublisher )); + cpdatamap->InsertL( KContentId, TLiwVariant( contentId )); + cpdatamap->InsertL( KActionTrigger, TLiwVariant( KActive )); + + TLiwGenericParam filter( KFilter, TLiwVariant( cpdatamap )); + inParam->AppendL( filter ); + mServiceInterface->ExecuteCmdL( _L8("ExecuteAction"), + *inParam, *outParam ); + + CleanupStack::PopAndDestroy( cpdatamap ); + + filter.Reset(); + type.Reset(); + + inParam->Reset(); + + return outParam; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CLiwGenericParamList* CTestHspApi::ExecuteActionSelectedL( std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + TBool res( EFalse ); + + // ---------------------------- + // register for notification + // ---------------------------- + + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + CLiwDefaultMap* reqFilter = CLiwDefaultMap::NewLC(); + + //reqFilter->InsertL( KPublisherId, TLiwVariant( KHSPPublisher )); + reqFilter->InsertL( KPublisherId, TLiwVariant( KAll )); + reqFilter->InsertL( KContentType, TLiwVariant( KAll )); + reqFilter->InsertL( KContentId, TLiwVariant( KAll )); + //reqFilter->InsertL( KOperation, TLiwVariant( KOperationExecute )); + + inParam->AppendL(TLiwGenericParam(KType, TLiwVariant(KContentAndPublisher_Registry))); + inParam->AppendL(TLiwGenericParam(KFilter, TLiwVariant(reqFilter))); + + mServiceInterface->ExecuteCmdL( KRequestNotification, + *inParam, *outParam, 0, this ); + + outParam->Reset(); + inParam->Reset(); + CleanupStack::PopAndDestroy( reqFilter ); + + // -------------- + // execute action + // -------------- + + TLiwGenericParam type(KType, TLiwVariant(KPublisher)); + inParam->AppendL(type); + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + TPtrC8 contentType = ((TUint8*)aContentType.c_str()); + + const TInt KSAPIContentNameMaxLength = 255; + + TBuf8 contentId; + contentId.Format( KContentIdFormat, + ((TUint8*)aIdentifier.c_str()), + ((TUint8*)aWidgetName.c_str()) ); + + cpdatamap->InsertL( KPublisherId, TLiwVariant( KHsWidgetPublisher )); + cpdatamap->InsertL( KContentType, TLiwVariant( KHsPublisher )); + cpdatamap->InsertL( KContentId, TLiwVariant( contentId )); + cpdatamap->InsertL( KActionTrigger, TLiwVariant( KSelected )); + + TLiwGenericParam filter( KFilter, TLiwVariant( cpdatamap )); + inParam->AppendL( filter ); + mServiceInterface->ExecuteCmdL( _L8("ExecuteAction"), + *inParam, *outParam ); + + CleanupStack::PopAndDestroy( cpdatamap ); + + filter.Reset(); + type.Reset(); + + inParam->Reset(); + + return outParam; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CTestHspApi::WaitL(TInt aMicroSec) + { + CWaitActive* wait = CWaitActive::NewL(); + wait->Wait(aMicroSec); + delete wait; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MLiwInterface* CTestHspApi::GetServiceInterfaceL() + { + CLiwGenericParamList* inParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParam ); + CLiwGenericParamList* outParam = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParam ); +// CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( KLiwCmdAsStr, +// KCPInterface, KCPService ); + CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( KLiwCmdAsStr, + _L8("IContentPublishing"), KCPService ); + + crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); + + RCriteriaArray a; + a.AppendL(crit); + + mServiceHandler->AttachL(a); + mServiceHandler->ExecuteServiceCmdL( *crit, *inParam, *outParam ); + + delete crit; + a.Reset(); + + // find service interface + TInt pos = 0; + MLiwInterface* msgInterface = NULL; + //outParam->FindFirst( pos, KCPInterface ); + outParam->FindFirst( pos, _L8("IContentPublishing") ); + if ( pos != KErrNotFound ) + { + msgInterface = (*outParam)[pos].Value().AsInterface(); + } + + outParam->Reset(); + inParam->Reset(); + CleanupStack::PopAndDestroy( outParam ); + CleanupStack::PopAndDestroy( inParam ); + + return msgInterface; + } + + +// from Observer interface + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::handleItemEvent( std::string aWidgetName, std::string aTemplateItemName, + IHsDataObserver::EItemEvent aAction ) + { + TPtrC8 itemName = ((TUint8*)aTemplateItemName.c_str()); + + iItemActionStatus = KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::handleEvent( std::string aWidgetName, + IHsDataObserver::EEvent aAction ) + { + TPtrC8 widgetName = ((TUint8*)aWidgetName.c_str()); + + iActionStatus = KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiConstrL( CStifItemParser& aItem ) + { + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher(this); + + if ( mHSPApi ) + { + delete mHSPApi; + return KErrNone; + } + else + { + return KErrGeneral; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::AddTemplate( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + Hs::HsWidget& templ = aHspApi->createHsWidget( aContentType, aWidgetName, aIdentifier); + std::string itemName1( "item_name_1" ); + std::string itemValue1( "myimage1_image" ); + templ.setItem( itemName1, itemValue1 ); + std::string itemName2( "item_name_2" ); + templ.setItem( itemName2, 1 ); + std::string itemName3( "item_name_3" ); + std::string itemValue3( "value_3" ); + templ.setItem( itemName3, itemValue3 ); + + templ.setItem( itemName2, 1 ); + templ.setItem( itemName2, itemValue3 ); + + SendFakeActivateEvent( aIdentifier ); + WaitL( 1000000 ); + + aHspApi->publishHsWidget( templ ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::SendFakeActivateEvent( std::string& aIdentifier ) + { + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + TLiwGenericParam type(KType, TLiwVariant(KCpData)); + inParam->AppendL(type); + + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + HBufC* publisherName = StdStringTo16bitDescLC( aIdentifier + ":hswidgetpublisher" ); + map->InsertL( KPublisherId, TLiwVariant( *publisherName ) ); + map->InsertL( KContentType, TLiwVariant( _L("hswidget") ) ); + map->InsertL( KContentId, TLiwVariant( KFakeContentId ) ); + map->InsertL( KType, TLiwVariant( _L("publisher") ) ); + map->InsertL( KActionTrigger, TLiwVariant( _L8("active") ) ); + map->InsertL( _L8("action_trigger16"), TLiwVariant( _L("active") ) ); + map->InsertL( _L8("operation"), TLiwVariant( _L("execute") ) ); + + TLiwGenericParam filter( KFilter, TLiwVariant( map ) ); + inParam->AppendL( filter ); + + mServiceInterface->ExecuteCmdL( _L8("ExecuteAction"), *inParam, *outParam); + + CleanupStack::PopAndDestroy( publisherName ); + CleanupStack::PopAndDestroy( map ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::AddExistingTemplate( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + Hs::HsWidget& templ = aHspApi->createHsWidget( aContentType, aWidgetName, aIdentifier); + std::string itemName1( "item_name_1" ); + std::string itemValue1( "myimage1_image" ); + templ.setItem( itemName1, itemValue1 ); + Hs::HsWidget& temp2 = aHspApi->createHsWidget( aContentType, aWidgetName, aIdentifier); + aHspApi->publishHsWidget( templ ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::AddAndRemoveTemplateItem1( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + Hs::HsWidget& templ = aHspApi->createHsWidget( aContentType, aWidgetName, aIdentifier); + std::string itemName1( "item_name_1" ); + std::string itemValue1( "myimage1_image" ); + templ.setItem( itemName1, itemValue1 ); + std::string itemName2( "item_name_2" ); + templ.setItem( itemName2, 1 ); + std::string itemName3( "item_name_3" ); + std::string itemValue3( "value_3" ); + templ.setItem( itemName3, itemValue3 ); + templ.removeItem( itemName3 ); + + SendFakeActivateEvent( aIdentifier ); + WaitL( 1000000 ); + + aHspApi->publishHsWidget( templ ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::AddAndRemoveTemplateItem2( Hs::HsWidgetPublisher* aHspApi, std::string& aContentType, + std::string& aIdentifier, std::string& aWidgetName ) + { + Hs::HsWidget& templ = aHspApi->createHsWidget( aContentType, aWidgetName, aIdentifier); + std::string itemName1( "item_name_1" ); + std::string itemValue1( "myimage1_image" ); + templ.setItem( itemName1, itemValue1 ); + std::string itemName2( "item_name_2" ); + templ.setItem( itemName2, 1 ); + std::string itemName3( "item_name_3" ); + templ.removeItem( itemName3 ); + aHspApi->publishHsWidget( templ ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspWidgetAddWidgetItem1L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddTemplate( mHSPApi, contentType, identifier, widgetName ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + TInt count = ExtractItemCountL( *res ); + + delete mHSPApi; + + if ( count != 1 ) + { + err = KErrGeneral; + } + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspWidgetAddWidgetItem2L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddTemplate( mHSPApi, contentType, identifier, widgetName ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + + // check if item was really removed + RBuf value; + err = ExtractItemL( *res, _L8("item_name_3"), value ); + + if ( value.Compare( _L("value_3") ) ) + { + err = KErrGeneral; + } + + value.Close(); + + delete mHSPApi; + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspWidgetAddWidgetItem3L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + TInt reason( KErrNone ); + try + { + // this should throw an exception with KAlreadyExists reason + AddExistingTemplate( mHSPApi, contentType, identifier, widgetName ); + } + catch ( Hs::HsException& e ) + { + reason = e.getReason(); + } + + if ( KErrAlreadyExists != reason ) + { + err = reason; + } + + delete mHSPApi; + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiDeleteWidgetL( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddTemplate( mHSPApi, contentType, identifier, widgetName ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + TInt count = ExtractItemCountL( *res ); + + if ( count != 1 ) + { + err = KErrGeneral; + } + + res->Reset(); + + mHSPApi->removeHsWidget( contentType, widgetName, identifier ); + + res = GetListL( contentType, identifier, widgetName ); + count = ExtractItemCountL( *res ); + res->Reset(); + + if ( count != KErrNotFound ) + { + err = KErrGeneral; + } + + delete mHSPApi; + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiSetDataObserver1L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddTemplate( mHSPApi, contentType, identifier, widgetName ); + + ExecuteActionL( contentType, identifier, widgetName ); + + WaitL( 1000000 ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + TInt count = ExtractItemCountL( *res ); + + if ( count != 1 ) + { + err = KErrGeneral; + } + + res->Reset(); + + mHSPApi->removeHsWidget( contentType, widgetName, identifier ); + + res = GetListL( contentType, identifier, widgetName ); + count = ExtractItemCountL( *res ); + res->Reset(); + + if ( count != KErrNotFound ) + { + err = KErrGeneral; + } + + delete mHSPApi; + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiSetDataObserver2L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddTemplate( mHSPApi, contentType, identifier, widgetName ); + + ExecuteActionSelectedL( contentType, identifier, widgetName ); + + WaitL( 1000000 ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + TInt count = ExtractItemCountL( *res ); + + if ( count != 1 ) + { + err = KErrGeneral; + } + + res->Reset(); + + mHSPApi->removeHsWidget( contentType, widgetName, identifier ); + + res = GetListL( contentType, identifier, widgetName ); + count = ExtractItemCountL( *res ); + res->Reset(); + + if ( count != KErrNotFound ) + { + err = KErrGeneral; + } + + delete mHSPApi; + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiGetWidgetL( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType1( "ct1" ); + std::string identifier1( "id1" ); + std::string widgetName1( "wn1" ); + + AddTemplate( mHSPApi, contentType1, identifier1, widgetName1 ); + + Hs::HsWidget& templ1 = mHSPApi->getHsWidget( contentType1, widgetName1, identifier1 ); + + if (! &templ1 ) + { + err = KErrGeneral; + } + + std::string contentType2( "ct2" ); + std::string identifier2( "id2" ); + std::string widgetName2( "wn2" ); + + try + { + Hs::HsWidget& templ2 = mHSPApi->getHsWidget( contentType2, widgetName2, identifier2 ); + if ( &templ2 ) + { + err = KErrCancel; + } + } + catch ( ... ) + { + + } + + delete mHSPApi; + + return err; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiWidgetRemoveItem1L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + AddAndRemoveTemplateItem1( mHSPApi, contentType, identifier, widgetName ); + + CLiwGenericParamList* res = GetListL( contentType, identifier, widgetName ); + + // check if item was really removed + RBuf value; + TInt ret = ExtractItemL( *res, _L8("item_name_3"), value ); + + if ( ret != KErrNotFound ) + { + err = ret; + } + + delete mHSPApi; + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiWidgetRemoveItem2L( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + + Hs::HsWidgetPublisher* mHSPApi = new Hs::HsWidgetPublisher( this ); + + std::string contentType( "ct" ); + std::string identifier( "id" ); + std::string widgetName( "wn" ); + + TInt reason( KErrNone ); + + try + { + AddAndRemoveTemplateItem2( mHSPApi, contentType, identifier, widgetName ); + } + catch( Hs::HsException& exception ) + { + reason = exception.getReason(); + } + + if ( KErrNotFound != reason ) + { + err = reason; + } + + delete mHSPApi; + return err; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CTestHspApi::ThrowHspException() + { + throw Hs::HsException( KErrGeneral ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CTestHspApi::TestHspApiExceptionL( CStifItemParser& aItem ) + { + TInt err( KErrNone ); + TInt reason( KErrNone ); + try + { + ThrowHspException(); + } + catch( Hs::HsException& exception ) + { + reason = exception.getReason(); + } + + if ( KErrGeneral != reason ) + { + err = reason; + } + return err; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/hs_widget_publisher_api/tsrc/src/waitactive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/hs_widget_publisher_api/tsrc/src/waitactive.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 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: +* +*/ + +#include "waitactive.h" + +// ======== MEMBER FUNCTIONS ======== + + +void CWaitActive::ConstructL() + { + CTimer::ConstructL(); + iActiveScheduler = new ( ELeave ) CActiveSchedulerWait(); + } + + +CWaitActive* CWaitActive::NewL() + { + CWaitActive* self = new( ELeave ) CWaitActive; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ---------------------------------------------------------------------------- +// CIsvTelCallAppTelephony::CIsvTelCallAppTelephony() +// Default constructor. +// ---------------------------------------------------------------------------- +// +CWaitActive::CWaitActive() + :CTimer( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CWaitActive::~CWaitActive() + { + Cancel(); + delete iActiveScheduler; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +void CWaitActive::Wait(TTimeIntervalMicroSeconds32 anInterval) + { + After(anInterval); + iActiveScheduler->Start(); + + } + + + +// ---------------------------------------------------------------------------- +// void CIsvTelCallAppTelephony::RunL() +// Handles the active object’s request completion event. +// ---------------------------------------------------------------------------- +// +void CWaitActive::CWaitActive::RunL() + { + // CActiveScheduler::Stop(); + iActiveScheduler->AsyncStop(); + + } + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 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: File that exports the files belonging to idlefw +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/aiuicontrolleruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiuicontrolleruid.hrh) +../inc/aiconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(aiconsts.h) +../inc/aifweventhandler.h MW_LAYER_PLATFORM_EXPORT_PATH(aifweventhandler.h) +../inc/aiuicontroller.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuicontroller.h) +../inc/aiuiframeworkobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuiframeworkobserver.h) +../inc/aiuiidleintegration.h MW_LAYER_PLATFORM_EXPORT_PATH(aiuiidleintegration.h) +../inc/debug.h MW_LAYER_PLATFORM_EXPORT_PATH(debug.h) // needed? +../inc/aifwdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aifwdefs.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aiconsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aiconsts.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2002-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: Common constants used in multiple modules +* +*/ + + +#ifndef INC_AICONSTS_H +#define INC_AICONSTS_H + +// ========== INCLUDE FILES =================================================== + +#include + +// ========== CONSTANTS ======================================================= + +// Plug-in event separator character +const TText16 KPluginEventSeparator = '/'; +const TInt KPluginEventSeparatorLength = 1; + +// Event parameter separator character +const TText16 KEventParameterSeparator = '('; +const TText16 KEventParameterSeparatorEnd = ')'; +const TInt KEventParameterSeparatorLength = 1; + +#endif // INC_AICONSTS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aifwdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aifwdefs.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: Internal array type definition +* +*/ + + +#ifndef AIFWDEFS_H +#define AIFWDEFS_H + + +#include +#include + +/** + * Array of publisher Content publisher info records. + */ +typedef RArray RAiPublisherInfoArray; + +_LIT(KOnline_Offline, "online_offline"); + +enum TAifwStates + { + EAifwOffline, + EAifwOnline, + EAifwPageSwitch + }; + +#endif // AIFWDEFS_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aifweventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aifweventhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* 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: Active Idle Framework internal event handling interface. +* +*/ + + +#ifndef M_AIFWEVENTHANDLER_H +#define M_AIFWEVENTHANDLER_H + +#include +#include + +class CAiUiController; +class CAiContentPublisher; + +/** + * Active Idle Framework internal event handling interface. + * Events from UI controllers are forwarded to this interface for processing + * on the Active Idle Framework side. + * + * @since S60 3.2 + */ +class MAiFwEventHandler +{ +public: + /** + * Application environment ready callback. Main UI controller calls this + * method when application framework is initialized. + */ + virtual void AppEnvReadyL() = 0; + + /** + * UI ready event handler. + * + * @param aUiController Active Idle UI Controller which manages the UI + * that is ready. + */ + virtual void HandleUiReadyEventL( CAiUiController& aUiController ) = 0; + + /** + * UI activation event handler. + * + */ + virtual void HandleActivateUI() = 0; + + /** + * UI shutdown event handler. + * + * @param aUiController Active Idle UI Controller which manages the UI + * that was shut down. + */ + virtual void HandleUiShutdown( CAiUiController& aUiController ) = 0; + + /** + * UI has changed, load data plugin. + * + * @param aPublisherInfo Publisher info describing plugin to load. + */ + virtual void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ) = 0; + + /** + * UI has changed, destroy data plugin. + * + * @param aPublisherInfo Publisher info describing plugin to destroy. + */ + virtual void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ) = 0; + + /** + * Active Idle Framework Plug-in event handler. UI controllers forward + * events that are targeted to Active Idle Content Publisher Plug-ins + * to this method. + * + * @param aParam event parameters from the UI model. + */ + virtual void HandlePluginEvent( const TDesC& aParam ) = 0; + + /** + * Active Idle Framework Plug-in event handler. UI controllers forward + * events that are targeted to Active Idle Content Publisher Plug-ins + * to this method. + * + * @param aPublisherInfo publisher info. + * @param aParam event parameters from the UI model. + */ + virtual void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ) = 0; + + /** + * Queries if a Content Publiseher Plug-in has settings + * + * @param aPublisherInfo publisher info. + * @param aMenuItem menuitem type. + */ + virtual TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ) = 0; + + /** + * Refresh content request. UI controller can use this interface to request + * a content publisher plug-in to refresh (re-publish) a specific content + * item. + * + * @param aContentCid Textual identifier of the content to refresh. + * @return True if the content publisher plug-in is found and the plugin + * will refresh the content by calling its content observer. + * False otherwise. + */ + virtual TBool RefreshContent( const TDesC& aContentCid ) = 0; + + /** + * Service to check if menu is open. + * + * @return ETrue if menu is open, EFalse otherwise + */ + virtual TBool QueryIsMenuOpen() = 0; + + /** + * Service to process the state changes + * + * @param aState changed state + */ + virtual void ProcessStateChange( TAifwStates aState ) = 0; + +protected: + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiFwEventHandler() { } + }; + +#endif // M_AIEVENTHANDLEREXTENSION_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aiuicontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aiuicontroller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2005-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: UI controller API +* +*/ + + +#ifndef C_AIUICONTROLLER_H +#define C_AIUICONTROLLER_H + +#include +#include "aicontentmodel.h" +#include "aifwdefs.h" +#include "aiuicontrolleruid.hrh" +#include "aipluginsettings.h" + +class MAiContentObserver; +class MAiFwEventHandler; +class MAiUiFrameworkObserver; +class CCoeEnv; +class CAiContentPublisher; +class MAiMainUiController; +class MAiSecondaryUiController; + +/** + * ECom interface UID for CAiUiContoller + */ +const TUid KInterfaceUidUiController = { AI_UID_ECOM_INTERFACE_UICONTROLLER }; + +/** + * UI Controller ECom interface for Active Idle. + * + * @since Series 60 3.2 + */ +class CAiUiController : public CBase + { +public: + +// Constructors and destructor + + /** + * Static factory method. + * + * @since Series 60 3.2 + * @param ECom implementatoin uid + * @return class instance + */ + inline static CAiUiController* NewL(TUid aImpUid); + + /** + * Static factory method. + * + * @since Series 60 3.2 + * @param mimetype + * @return class instance + */ + inline static CAiUiController* NewL(const TDesC8& aMime); + + /** + * Destructor. + */ + inline virtual ~CAiUiController(); + +// New functions + + /** + * Instructs this UI controller to load its UI definition. + * + * @since Series 60 3.2 + */ + virtual void LoadUIDefinitionL() = 0; + + /** + * Retrieves the Content Publisher Plug-in list defined in this UI + * controller's UI model. + * + * @since Series 60 3.2 + */ + virtual void GetPluginsL(RAiPublisherInfoArray& aPlugins) = 0; + + /** + * Retrieves plug-in settings specified in this UI controller's UI definition. + * + * @param aPubInfo Publisher info of the plug-in for which to + * retrieve settings for. + * @param aSettings array to get settings items to. + */ + virtual void GetSettingsL(const TAiPublisherInfo& aPubInfo, + RAiSettingsItemArray& aSettings) = 0; + + /** + * Activate UI managed by this UI controller. + * + * @since Series 60 3.2 + */ + virtual void ActivateUI() = 0; + + /** + * Returns content observer interface implemented by this UI controller. + * + * @since Series 60 3.2 + * @return reference to content observer implementation. + */ + virtual MAiContentObserver& GetContentObserver() = 0; + + /** + * Sets the Active Idle Framework event handler for this UI Controller. + * + * @since Series 60 3.2 + * @param aEventHandler Framework event handler for this UI controller. + * Set to NULL to disable event callbacks from this + * UI Controller. + */ + virtual void SetEventHandler(MAiFwEventHandler& aEventHandler) = 0; + + /** + * Remove specified plugin from the UI. + * + * @param aPlugin plugin that is removed. + */ + virtual void RemovePluginFromUI( MAiPropertyExtension& aPlugin ) = 0; + + /** + * Returns the main UI Controller interface, or NULL if this is not the + * main UI controller. + */ + virtual MAiMainUiController* MainInterface() = 0; + + /** + * Returns the secondary UI Controller interface, or NULL if this is not + * a secondary UI controller. + */ + virtual MAiSecondaryUiController* SecondaryInterface() = 0; + +private: // Data + + TUid iDestructKey; // An identifier used during destruction + + }; + +inline CAiUiController* CAiUiController::NewL(TUid aImplUid) + { + TAny* ptr = REComSession::CreateImplementationL(aImplUid, + _FOFF(CAiUiController, iDestructKey)); + + return reinterpret_cast (ptr); + } + +inline CAiUiController* CAiUiController::NewL(const TDesC8& aMime) + { + TEComResolverParams params; + params.SetDataType(aMime); + TAny* ptr = REComSession::CreateImplementationL(KInterfaceUidUiController, + _FOFF(CAiUiController, iDestructKey), params); + return reinterpret_cast (ptr); + } + +inline CAiUiController::~CAiUiController() + { + REComSession::DestroyedImplementation(iDestructKey); + } + + +/** + * Main UI Controller interface for Active Idle. + * + * @see CAiUiController + * @since S60 3.2 + */ +class MAiMainUiController + { +public: + /** + * Starts application framework and application event loop. + * This function returns only when the application is shut down. + * + * @exception Any of the system-wide error codes in case application + * creation or execution fails with an error. + */ + virtual void RunApplicationL() = 0; + + /** + * Returns the CONE environment object this main UI controller uses. + */ + virtual CCoeEnv& CoeEnv() = 0; + + /** + * Sets UI framework observer for this main UI controller. + */ + virtual void SetUiFrameworkObserver( MAiUiFrameworkObserver& aObserver ) = 0; + + /** + * Exits the main ui controller + **/ + virtual void Exit() = 0; + + /** + * Only main ui controller might know if menu is open. + */ + virtual TBool IsMenuOpen() = 0; + }; + +/** + * Secondary UI Controller interface for Active Idle. + * + * @see CAiUiController + * @since S60 3.2 + */ +class MAiSecondaryUiController + { +public: + /** + * Sets the CONE environment object for this secondary UI controller to use. + * + * @param aCoeEnv the CONE environment object to use. + */ + virtual void SetCoeEnv( CCoeEnv& aCoeEnv ) = 0; + + /** + * Returns the UI framework observer of this secondary UI controller. + * + * @return The UI framework observer, or NULL if observer is not supported. + */ + virtual MAiUiFrameworkObserver* UiFrameworkObserver() = 0; + }; + +#endif // C_AIUICONTROLLER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aiuicontrolleruid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aiuicontrolleruid.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* 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: Resource headers for aiuicontroller +* +*/ + + +#ifndef AIUICONTROLLERUID_HRH +#define AIUICONTROLLERUID_HRH + +/** + * Ecom interface uid for CAiUiController. + */ +#define AI_UID_ECOM_INTERFACE_UICONTROLLER 0x102750EF + +#endif // AIUICONTROLLERUID_HRH diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aiuiframeworkobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aiuiframeworkobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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: Observer interface for UI framework events +* +*/ + + +#ifndef M_AIUIFRAMEWORKOBSERVER_H +#define M_AIUIFRAMEWORKOBSERVER_H + +#include + +/** + * MAiUiFrameworkObserver observes UI framework events. + * + * @since S60 v3.2 + */ +class MAiUiFrameworkObserver + { + +public: + + /** + * Event handler for resource change in UI framework. + * + * @param aType resource change type. + */ + virtual void HandleResourceChange( TInt aType ) = 0; + + /** + * Event handler for focus change event. + * + * @param aForeground ETrue if UI is foreground. + */ + virtual void HandleForegroundEvent( TBool aForeground ) = 0; + +protected: + + virtual ~MAiUiFrameworkObserver() {}; + + }; + + +#endif // M_AIUIFRAMEWORKOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/aiuiidleintegration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aiuiidleintegration.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 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: Window server plug-in manager. +* +*/ + + +#ifndef C_AIUIIDLEINTEGRATION_H +#define C_AIUIIDLEINTEGRATION_H + +#include + +class CCoeControl; +class TWsEvent; +class CEikonEnv; +class TVwsViewId; +class CAknKeySoundSystem; +class MAiFwEventHandler; + +struct TAiIdleKeySoundConfig + { + /** + * Default constructor. Resets all config fields to null values. + */ + TAiIdleKeySoundConfig() : iKeySounds(NULL), iContextResId(0) { } + + /// Pointer to AVKON Key sound system + CAknKeySoundSystem* iKeySounds; + + /// Key sound context resource id + TInt iContextResId; + }; + +/** + * Handles Idle integration related tasks and events for Active Idle main UI + * Controller. + */ +class CAiUiIdleIntegration : public CBase + { + +public: + + IMPORT_C static CAiUiIdleIntegration* NewL( + CEikonEnv& aEikEnv, + const TAiIdleKeySoundConfig& aKeySoundConfig, + MAiFwEventHandler* aAiFwEventHandler ); + + ~CAiUiIdleIntegration() { } + + /** + * Tries to bring Active Idle UI to the foreground. + */ + virtual void ActivateUI() = 0; + + /** + * Call from entry to Main UI Controller AppUi HandleWsEventL. + */ + virtual void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) = 0; + }; + +#endif // C_AIUIIDLEINTEGRATION_H + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/idlefw_api/inc/debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/debug.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,335 @@ +/* +* 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: Debug helpers +* +*/ + + +#ifndef __AI2_DEBUG_H__ +#define __AI2_DEBUG_H__ + +#include + +// Uncomment to turn on RD logging +//#define AI_ENABLE_RD_LOGGING + +#ifdef __WINS__ + // On the emulator log to debug output + #define AI_RD_LOG_TO_DEBUG_OUTPUT +#endif + +#ifndef AI_ENABLE_RD_LOGGING +// RD logging is off + +// Empty definitions of logging macros when RD logging is turned off +#define __TIME_MARK(_var) +#define __TIME_ENDMARK(_msg, _var) +#define __TIME(_msg, _code) _code; +#define __TICK(_msg) +#define __HEAP(_msg) +#define __DBG_FORMAT(_fmt) TAiEmptyDebugFormat() +#define __PRINT __impl_print_empty +#define __DBG_FORMAT8(_fmt) TAiEmptyDebugFormat() +#define __PRINT8 __impl_print_empty +#define __PRINTS(_str) +#define __PRINT_IF_ERROR(_stmt, _fmt) (void)_stmt; +#define __TRAP_AND_PRINT_IF_ERROR(_stmt, _fmt) TRAP_IGNORE(_stmt); + +// Unnamed namespace to keep debug functions out of global namespace +namespace { + +/** + * Zero-overhead definition for an empty debug formatting string. + * @see macro __DBG_FORMAT + */ +NONSHARABLE_STRUCT(TAiEmptyDebugFormat) + { + }; + +/// Zero-overhead RD log print implementation when RD logging is turned off +inline void __impl_print_empty(const TAiEmptyDebugFormat&) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2,T3) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2,T3,T4) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2,T3,T4,T5) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2,T3,T4,T5,T6) { } + +/// Zero-overhead RD log print implementation when RD logging is turned off +template inline +void __impl_print_empty(const TAiEmptyDebugFormat&,T0,T1,T2,T3,T4,T5,T6,T7) { } + +} // namespace + +#else +// RD logging is on + +#include +#include +#include + +/** + * Stores the current time as microsecond value. + * + * @param _var A name, which will be declared as a TInt, and will receive the + * current time value. After the macro, _var remains in scope until + * the end of its enclosing block. + * @see __TIME_ENDMARK + */ +#define __TIME_MARK(_var) TTime _var;_var.UniversalTime(); + +/** + * Logs the microsecond difference between current value and stored earlier + * with __TIME_MARK macro. + * + * @param _msg textual message to write to the RD log file. + * @param _var the start time, the value is set by __TIME_MARK macro. + * @see __TIME_MARK + */ +#define __TIME_ENDMARK(_msg, _var) __impl_time_endmark(_L(_msg), _var); + +/** + * Measures the execution time of a code statement + * + * @param _msg textual message to write to the RD log file. + * @param _code code statements to be measured. + */ +#define __TIME(_msg, _code) {TTime _time;_time.UniversalTime();_code;__impl_time_endmark(_L(_msg),_time);}; + +/* + * Prints a message and current time as ms to the RD log file. + * + * @param _msg textual message to write to the log file. + */ +#define __TICK(_msg) __impl_tick(_L(_msg)); + +/* + * Prints a message and current heap memory status to the log file. + * + * @param _msg textual message to write to the log file. + */ +#define __HEAP(_msg) __impl_heap(_L(_msg)); + +/** + * Defines an UNICODE RD logging format string. Used with __PRINT macro. + * @see __PRINT + */ +#define __DBG_FORMAT(_fmt) _L(_fmt) + +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + /** + * Prints a printf-style formatted message to the debug output. + * Format string needs to be defined with the __DBG_FORMAT macro. + */ + #define __PRINT RDebug::Print +#else + /** + * Prints a printf-style formatted message to the RD log file. + * Format string needs to be defined with the __DBG_FORMAT macro. + */ + #define __PRINT __impl_print +#endif + +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + /** + * Defines a 8-bit RD logging format string. Used with __PRINT8 macro. + * @see __PRINT8 + */ + #define __DBG_FORMAT8(_fmt) _fmt + + /** + * Prints a printf-style formatted message to the debug output. + * The format string (first parameter) needs to be a 8-bit literal + * C string. + */ + #define __PRINT8 RDebug::Printf +#else + /** + * Defines a 8-bit RD logging format string. Used with __PRINT8 macro. + * @see __PRINT8 + */ + #define __DBG_FORMAT8(_fmt) _L8(_fmt) + + /** + * Prints a printf-style formatted message to the debug output. + * The format string (first parameter) needs to be a 8-bit literal + * C string. + */ + #define __PRINT8 __impl_print8 +#endif + +/** + * Prints a string to the RD log. + * + * @param _msg textual message to write to the log file. + */ +#define __PRINTS(_msg) __impl_prints(_L(_msg)); + +/** + * Prints a message to the RD log if a statement returns an error code other + * than KErrNone. + * + * @param _stmt statment to check for error return code. + * @param _fmt textual message to write to the log file. If the message string + * contains %d directive it is replaced with the error code that + * _stmt returned. + */ +#define __PRINT_IF_ERROR(_stmt, _fmt) { TInt _error = _stmt; if (_error != KErrNone) __PRINT(_L(_fmt), _error); }; + +/** + * Prints a message to the RD log if a statement leaves with an error code. + * + * @param _stmt statment to check for leave. + * @param _fmt textual message to write to the log file. If the message string + * contains %d directive it is replaced with the error code that + * _stmt leaved with. + */ +#define __TRAP_AND_PRINT_IF_ERROR(_stmt, _fmt) { TRAPD(_error, _stmt); if (_error != KErrNone) __PRINT(_L(_fmt), _error); }; + +/** + * Directory under C:\Logs in the device filesystem where the ActiveIdle2 RD + * log file is stored. + */ +#define D_LOG_DIR _L("ActiveIdle2") + +/** + * Name of the ActiveIdle2 RD log file under D_LOG_DIR. + */ +#define D_LOG_FILE _L("debug.log") + +// Unnamed namespace to keep debug functions out of global namespace +namespace { + +// ---------------------------------------------------------------------------- +// +// Performance logging operation, give results in microseconds 10^-6 +// The metricts are based on the measurment current value of microseconds in +// the begining of operation and in the end. The time difference is actual result +// +// The logging operations take about 5ms, which should be considered if inner +// tag are used. +// +// Examples: +// +// __TIME_MARK(t) +// DoOperation(...); +// __TIME_ENDMARK(_L("Message 1"), t); +// +// __TIME(_L("Message 1"), DoOperation(...)) +// +// ---------------------------------------------------------------------------- +// + +// +// Actual implementation of +// Logs the microsecond difference between current value and stored earlier +// aMsg - textual message stored to the log file +// aStart - the start time, the value is set by previous macros +// +inline void __impl_time_endmark(const TDesC& aMsg, TTime aStart) +{ + TTime now; + now.UniversalTime(); + TTimeIntervalMicroSeconds delta = now.MicroSecondsFrom(aStart); +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + RDebug::Print( _L("\t[T]\t%S\tTime:\t%Ld"), &aMsg, delta.Int64() ); +#else + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, _L("\t[T]\t%S\tTime:\t%Ld"), &aMsg, delta.Int64()); +#endif +} + +// +// Prints the message and current ms value to the log file +// +inline void __impl_tick(const TDesC& aMsg) +{ + //Gets the nanokernel tick count. This is the current value of the machine's millisecond tick counter. + TUint32 nTick = User::NTickCount(); +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + RDebug::Print( _L("\t[T]\t%S\tMicro Sec:\t%d000"), &aMsg, nTick ); +#else + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, _L("\t[T]\t%S\tMicro Sec:\t%d000"), &aMsg, nTick); +#endif +} + +// ---------------------------------------------------------------------------- +// +// Logs the amout of used heap to log file. Notes that the Heap value equals +// to the result provided by Goofy tool. +// +// ---------------------------------------------------------------------------- +// +inline void __impl_heap(const TDesC& aMsg) + { + TInt size; + User::Heap().AllocSize(size); +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + RDebug::Print( _L("\t[M]\t%S\tAlloc:\t%d\tHeap:\t%d"), &aMsg, size, User::Heap().Size() ); +#else + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, _L("\t[M]\t%S\tAlloc:\t%d\tHeap:\t%d"), &aMsg, size, User::Heap().Size()); +#endif + } + +inline void __impl_print(TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, aFmt, list); + VA_END(list); + } + +inline void __impl_print8(TRefByValue aFmt, ...) + { + VA_LIST list; + VA_START(list,aFmt); + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, aFmt, list); + VA_END(list); + } + +inline void __impl_prints(const TDesC& aMsg) + { +#ifdef AI_RD_LOG_TO_DEBUG_OUTPUT + RDebug::Print( aMsg ); +#else + RFileLogger::WriteFormat(D_LOG_DIR, D_LOG_FILE, EFileLoggingModeAppend, _L("\t[I]\t%S"), &aMsg); +#endif + } + +} // namespace + +#endif // AI_ENABLE_DEBUG_LOGGING + +#endif // !__AI2_DEBUG_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: Menu content Services +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/mcsmenuutils.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuutils.h) +../inc/mcsinternaltypes.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsinternaltypes.h) +../inc/mcsdef.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsdef.h) +../inc/mcsmenu.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenu.h) +../inc/mcsmenuitem.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuitem.h) +../inc/mcsmenufilter.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenufilter.h) +../inc/mcsmenunotifier.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenunotifier.h) +../inc/mcsmenuoperation.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuoperation.h) +../inc/mcsmenuhandler.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuhandler.h) +../inc/mcsmenuhandlerplugin.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuhandlerplugin.h) +../inc/mcsmenuhandlerplugin.inl MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuhandlerplugin.inl) +../inc/mcsmenuhandlerplugin.hrh MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuhandlerplugin.hrh) +../inc/mcsmenuiconutility.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenuiconutility.h) + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsdef.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of different constants +* +*/ + + +#ifndef __MCSDEF_H__ +#define __MCSDEF_H__ + +#include +#include "mcsinternaltypes.h" + + +// CONSTANTS +const TUid KMmUid3 = { 0x101f4cd2 }; +const TUid KCRUidMenu = { 0x101F8847 }; +const TUint32 KMenuHideApplication = 0x00000008; +const TUint32 KMenuHideCPApplication = 0x0000000a; +const TUint32 KMenuHideCPFolder = 0x0000000b; +const TInt KCenRepBufferSize = 255; + +// +// Internal types, cannot be accessed (KErrArgument). +// + +_LIT( KMenuTypeData, "menu:data" ); ///< Internal type, cannot be accessed or created. + + +// +// Internal attributes, cannot be accessed (KErrArgument). +// + +_LIT( KMenuAttrFlags, "flags" ); ///< Internal attribute, cannot be accessed. Use Flags(). +_LIT( KMenuAttrId, "id" ); ///< Internal attribute, cannot be accessed. Use Id(). + +// +// Attributes commonly used for all items. +// These are the attributes that are normally used when displaying a menu of items +// in a menu UI. To get a consistent look of various items, it is recommended that +// some of these attributes are properly set (at least one of the xxx_name, and +// some kind of icon information for non-applications). +// Note, however, that none of these is guaranteed to be set, or be used by a menu UI. +// Menu clients always need to check that the necessary attributes are present. +// + +_LIT( KMenuAttrTitleName, "title_name" ); ///< Title name (displayed in Title Pane). +_LIT( KMenuAttrShortName, "short_name" ); ///< Short name. +_LIT( KMenuAttrLongName, "long_name" ); ///< Long name. +_LIT( KMenuAttrIconFile, "icon_file" ); ///< Custom icon file (MIF or MBM). +_LIT( KMenuAttrIconId, "icon_id" ); ///< Icon index into "icon_file". +_LIT( KMenuAttrMaskId, "mask_id" ); ///< Mask index into "icon_file". +_LIT( KMenuAttrM3gIconFile, "m3g_icon_file" ); ///< Custom M3G icon file. +_LIT( KMenuAttrIconSkinMajorId, "icon_skin_major_id" ); ///< Icon major skin id. +_LIT( KMenuAttrIconSkinMinorId, "icon_skin_minor_id" ); ///< Icon minor skin id. + +_LIT( KMenuAttrDrmProtection, "drm_protection" ); ///< DRM Protection status +_LIT( KMenuDrmUnknown, "unknown" ); ///< Value of the DRM Protection attribute +_LIT( KMenuDrmNotProtected, "not_protected" ); ///< Value of the DRM Protection attribute +_LIT( KMenuDrmProtected, "protected" ); ///< Value of the DRM Protection attribute +_LIT( KMenuDrmRightsExpired, "expired" ); ///< Value of the DRM Protection attribute + +_LIT( KMenuAttrNative, "native" ); +_LIT( KMenuTrue, "1" ); +_LIT( KMenuFalse, "0" ); + +// Built-in types and attributes. +// + +// Folder. +_LIT( KMenuTypeFolder, "menu:folder" ); ///< Menu folder type. +_LIT( KMenuAttrAppGroupName, "applicationgroup_name" ); ///< Application Group name. +_LIT( KMenuAttrDefault, "default" ); ///< Default folder. +_LIT( KChildrenCount, "children_count"); +_LIT( KRunningStatus, "RunningStatus" ); + +// Application. +_LIT( KMenuTypeApp, "menu:application" ); ///< Menu application type. +_LIT( KMenuTypeSuite, "menu:suite" ); +_LIT( KMenuAttSuiteName, "suite_name" ); +_LIT( KMenuAttSuiteAdded, "suite_added" ); +_LIT( KMenuAttrUid, "uid" ); ///< UID. +_LIT( KMenuAttrView, "view" ); ///< View. +_LIT( KMenuAttrHideIfInstalledUid, "hide_if_installed_uid" ); ///< Hide app if installed other app with uid. + +// URL. +_LIT( KMenuTypeUrl, "menu:url" ); ///< Menu url type. +_LIT( KMenuAttrUrl, "url" ); ///< URL. + +// Link. +_LIT( KMenuTypeLink, "menu:link" ); ///< Menu link type. +_LIT( KMenuAttrRefId, "ref_id" ); ///< Referred id. Refers to Id() of some other item. + +// +// Command strings. +// + +_LIT8( KMenuCmdOpen, "open" ); ///< Open item. +_LIT8( KMenuCmdRemove, "remove" ); ///< Remove item. + + +_LIT( KMenuSatUiUid, "0x101F4CE0" ); + +const TInt KDefaultGranularity = 5; +const TUint KBackSlashSuite = '\\'; +const TUint KDot = '.'; +_LIT(KXmlExt, "xml"); +_LIT(KImportDir, "import"); + + +_LIT( KColen, ":" ); +const TUid KSatUid = { 0x101F4CE0 }; +const TUint32 KMenuSatUIIconId = 0x00000004; + +const TUint32 KMenuShowSatUI = 0x00000002; +const TUint32 KMenuSatUIName = 0x00000003; + +_LIT(KComma, ","); +_LIT(KHex, "0x"); + +//Constants +_LIT8(KMenuAttrId8, "id"); +_LIT8(KInData, "InData"); +_LIT8(KFilter, "Filter"); +_LIT8(KType, "type"); +_LIT8(KMenuParentId, "parent_id"); +_LIT8(KAddRemove, "add_remove"); +_LIT8(KReorder, "reorder"); +_LIT8(KAttributeChange, "attribute_change"); +_LIT8(KParentId, "parent_id"); +_LIT8(KBeforeId, "before_item"); +_LIT8(KRecursiveSearch, "recursive_search"); +_LIT8(KChildren, "children"); +_LIT8(KFlatResult, "flat_result"); +_LIT8(KParentOnly, "parent_only"); +_LIT8(KIncludeParent, "include_parent"); +_LIT8(KIgnoreAttributes, "ignore_attributes"); +_LIT8(KRequiredAttributes, "required_attributes"); +// Flags +_LIT8(KNameLocked, "name_locked"); +_LIT8(KIconLocked, "icon_locked"); +_LIT8(KDeleteLocked, "delete_locked"); +_LIT8(KMoveLocked, "move_locked"); +_LIT8(KAddingLocked, "adding_locked"); +_LIT8(KHidden, "hidden"); +_LIT8(KMissing, "missing"); + +_LIT8( KBitmapBuffer, "bitmap_buffer"); +_LIT8( KMaskBuffer, "mask_buffer"); +_LIT8( KRunning, "running"); +_LIT8( KIconAttributes, "icon_attributes"); +_LIT8(KReturnValue, "ReturnValue"); + +// Prefix hex format +_LIT(KHexFormat, "0x%X"); +_LIT(KHexPrefix, "0x"); + + + +#endif // __MCSDEF_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsinternaltypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsinternaltypes.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of different constants +* Version : %version: e003sa35#2 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef __MCSINTERNALTYPES_H__ +#define __MCSINTERNALTYPES_H__ + +#include + +// +// Limit constants. +// + +LOCAL_D const TInt KMenuMaxTypeLen = 64; ///< Maximum length of item type. +LOCAL_D const TInt KMenuMaxAttrNameLen = 64; ///< Maximum length of attribute name. +LOCAL_D const TInt KMenuMaxAttrValueLen = 512; ///< Maximum length of attribute value. + +// +// Types +// +typedef TBuf TAttributeName; + + + + +#endif // __MCSINTERNALTYPES_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenu.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of the session to the Menu +* +*/ + + +#ifndef __MCSMENU_H__ +#define __MCSMENU_H__ + +#include +#include "mcsinternaltypes.h" +class TMenuItem; +class CMenuItem; +class CMenuOperation; +class CMenuFilter; + +/** + * Menu session. + * The menu is an ID-based tree structure of menu folders and items. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenu ): public RSessionBase + { + + /** + * RMenu acts on behalf on CMenuItem (CMenuItem is not a subsession object). + * Data returned by the methods below usually exists in the transfer + * buffer -> use it immediately or copy, because the buffer will be + * overwritten very soon! + */ + friend class CMenuItem; + +public: + + /** + * Constructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + RMenu() { iData = NULL; } + + /** + * Close the session. Safe to call if not open. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void Close(); + + /** + * Open the session. + * @since S60 v5.0 + * @param aName Name of the menu content to open. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void OpenL( const TDesC& aName ); + + /** + * Get ID of the root folder. + * @since S60 v5.0 + * @return ID of the root folder. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C TInt RootFolderL(); + + /** + * Get list of items. + * @since S60 v5.0 + * @param aItemArray Array receiving item list. Existing content not touched + * (new items are appended). + * @param aFolder Get items from this folder. + * @param aFilter Filter criteria or NULL for unfiltered results. + * @param aRecursive ETrue to recurse folders, EFalse for immediate + * children only. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void GetItemsL( + RArray& aItemArray, + TInt aFolder, + const CMenuFilter* aFilter = NULL, + TBool aRecursive = EFalse ); + + /** + * Get array of running applications + */ + IMPORT_C void GetRunningAppsL( RArray& aArray ); + + /** + * Remove item. + * @since S60 v5.0 + * @param aId ID of item to be removed. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability ECapabilityWriteDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C CMenuOperation* RemoveL( TInt aId, TRequestStatus& aStatus ); + + /** + * Move items to another folder. + * @since S60 v5.0 + * @param aItems ID-s of items to be to be moved. All items must be in + * the same folder. + * @param aFolder Target folder. + * @param aMoveBefore. In the target folder, items will be inserted before + * this item (if found). If the target folder contains no item with that ID, + * the moved items are appended to the end of existing items. Pass 0 to + * append to the end. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability ECapabilityWriteDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C CMenuOperation* MoveToFolderL( + const RArray& aItems, + TInt aFolder, + TInt aMoveBefore, + TRequestStatus& aStatus ); + + /** + * Move item to a different position in its current folder. + * @since S60 v5.0 + * @param aId ID-s of item to be to be reordered. + * @param aMoveBefore. Move the item before this item (if found). + * If aMoveBefore is not found, the aItem is moved to the end. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability ECapabilityWriteDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C CMenuOperation* ReorderL( + TInt aId, + TInt aMoveBefore, + TRequestStatus& aStatus ); + + /** + * Start checking the number of allocated object through this session. + * @since S60 v5.0 + * @capability ECapabilityAllFiles. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void ResourceMark(); + + /** + * Check that the number of allocated object through this session + * matches the same of when the last call to ResourceMark was made. + * @since S60 v5.0 + * @capability ECapabilityAllFiles. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void ResourceCheck(); + + /** + * Get number of allocated object through this session. + * @since S60 v5.0 + * @return Number of allocated object through this session. + * @capability ECapabilityAllFiles. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C TInt ResourceCount(); + + /** + * Simulate a heap allocation failure for server heap. Has empty + * implementation for the UDEB server. + * @since S60 v5.0 + * @param aType Type of heap failure simulation. + * @param aRate Rate of failure. + * @capability ECapabilityAllFiles. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void __DbgSetAllocFail + ( RAllocator::TAllocFail aType, TInt aRate ); + +private: + + /** + * Connect session. + * @return Error code. + */ + TInt ConnectSession(); + + /** + * Get item attribute value. + * @param aId Item ID. + * @param aAttrName. Attribute name. + * @return Attribute value, or NULL if attribute is not defined. + * Owner is the caller. + */ + HBufC* GetAttributeL( TInt aId, const TDesC& aAttrName ); + + + /** + * Get item attribute name list. + * @param aId Item ID. + * @param aList Attribute item list. + */ + void GetAttributeListL( TInt aId, RArray& aList ); + + /** + * Get item header. + * @param aId Item ID. + * @return Item header. The header is in the transfer buffer, copy it. + */ + const TMenuItem& GetHdrL( TInt aId ); + + /** + * Handle command. + * @param aItem Item. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: // data + + class TData; + TData* iData; ///< Private data. Own. + + }; + +#endif // __MCSMENU_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenufilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenufilter.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu item filter criteria +* +*/ + + +#ifndef __MCSMENUFILTER_H__ +#define __MCSMENUFILTER_H__ + +#include "mcsdef.h" +#include + +class RWriteStream; +class RReadStream; + +/** + * Menu item filter criteria. + * Allows querying items filtered by flags, type and attributes. + * Wildcards are not supported (neither in attributes, nor in + * type). + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuFilter ): public CBase + { + +public: + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C virtual ~CMenuFilter(); + + /** + * Two phased constructor. + * @since S60 v5.0 + * @return The created object. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C static CMenuFilter* NewL(); + + /** + * Two phased constructor. + * @since S60 v5.0 + * @return The created object. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C static CMenuFilter* NewLC(); + +// getters + + /** + * Get flag filter criteria: these flags must be on. + * @since S60 v5.0 + * @return Flags that must be on. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TUint32 FlagsOn() const; + + /** + * Get flag filter criteria: these flags must be off. + * @since S60 v5.0 + * @return Flags that must be off. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TUint32 FlagsOff() const; + + /** + * Get type filter criteria. + * @since S60 v5.0 + * @return Type filter. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TPtrC Type() const; + + /** + * Get number of attribute filter criteria. + * @since S60 v5.0 + * @return Number of attribute filter criteria. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TInt NumAttributes() const; + + /** + * Get attribute filter criteria by index. (Attribute must be defined and + * have a certain value, or it must be undefined). + * @since S60 v5.0 + * @param aIndex Index of attribute filter criteria. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value (if defined) is returned here. + * @return ETrue if attribute aAttrName must be defined and having value + * aAttrValue. EFalse if attribute aAttrName must NOT be defined. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TBool GetAttribute + ( TInt aIndex, TPtrC& aAttrName, TPtrC& aAttrValue ) const; + +// setters + + /** + * Reset filter (==pass all). + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void Reset(); + + /** + * Set on and off flag filter criteria. + * @since S60 v5.0 + * @param aFlagsOn These flags must be on. (0=="flag on" filter off) + * @param aFlagsOff These flags must be off. (0=="flag off" filter off) + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void SetFlags( TUint32 aFlagsOn, TUint32 aFlagsOff ); + + /** + * Set type filter criteria. + * @since S60 v5.0 + * @param aType Type filter. (empty==type filter off) + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void SetType( const TDesC& aType ); + + /** + * Add/replace attribute filter criteria. + * The attribute must exist and have the given value. + * @since S60 v5.0 + * @param aAttrName Attribute name. Previous attribute filter with + * the same name is replaced. + * aAttrValue Attribute must have this value. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void HaveAttributeL + ( const TDesC& aAttrName, const TDesC& aAttrValue ); + + /** + * Add/replace attribute filter criteria. + * The attribute must not exist. + * @since S60 v5.0 + * @param aAttrName Attribute name. Previous attribute filter with + * the same name is replaced. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void DoNotHaveAttributeL( const TDesC& aAttrName ); + + /** + * Remove attribute filter criteria. + * @since S60 v5.0 + * @param aAttrName Attribute name. Previous attribute filter with + * the same name (if any) is removed. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void RemoveAttribute( const TDesC& aAttrName ); + +// not exported public + + /** + * Externalize object. + * @param aStream Stream to externalize into. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize object. + * @param aStream Stream to externalize from. + */ + void InternalizeL( RReadStream& aStream ); + +private: + + /** + * Constructor. + */ + CMenuFilter(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +private: // data + + class TData; + TData* iData; ///< Private data. Own. + + }; + +#endif // __MCSMENUFILTER_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu handler interface +* +*/ + + +#ifndef __MCSMENUHANDLER_H__ +#define __MCSMENUHANDLER_H__ + +#include + +class RMenu; +class CMenuOperation; +class CMenuItem; + +/** + * Menu handler interface. + * Menu handlers execute menu commands. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +class CMenuHandler: public CBase + { + +public: + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C virtual ~CMenuHandler(); + + /** + * Query support for item type. + * @since S60 v5.0 + * @param aType Type. + * @return ETrue if handler supports this type, EFalse otherwise. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C virtual TBool SupportsType( const TDesC& aType ); + + /** + * Handle command. + * @since S60 v5.0 + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability None. + * @throws This implementation throws KErrNotSupported. + * @panic None. + */ + IMPORT_C virtual CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +protected: + + /** + * Constructor. + * @since S60 v5.0 + * @param aMenu Menu. + */ + IMPORT_C CMenuHandler( RMenu &aMenu ); + + /** + * Second phase constructor. + * @since S60 v5.0 + */ + IMPORT_C void BaseConstructL(); + +protected: // data + + RMenu& iMenu; ///< Menu. + +private: // data + + class TData; + TData* iData; ///< Private data. Own. + + }; + +#endif // __MCSMENUHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu handler plugin interface +* +*/ + + +#ifndef __MCSMENUHANDLERPLUGIN_H__ +#define __MCSMENUHANDLERPLUGIN_H__ + +#include "mcsmenuhandler.h" +#include +#include + +/** + * Menu handler plugin interface. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +class CMenuHandlerPlugin : public CMenuHandler + { + +public: + + /** + * Instantiate Menu Handler plugin. + * @since S60 v5.0 + * @param aImplementationUid Implementation UID. + * @param aMenu Menu. + * @return The created plugin. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + inline static CMenuHandlerPlugin* NewL + ( TUid aImplementationUid, RMenu& aMenu ); + + /** + * Constructor. + * @since S60 v5.0 + * @param aMenu Menu. + * @capability None. + * @throws None. + * @panic None. + */ + inline CMenuHandlerPlugin( RMenu &aMenu ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + inline virtual ~CMenuHandlerPlugin(); + +private: + + TUid iDtor_ID_Key; ///< Destructor ID key. + + }; + +#include "mcsmenuhandlerplugin.inl" + +#endif // __MCSMENUHANDLERPLUGIN_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of different UIDs used in MenuContentService +* +*/ + + +#ifndef __MCSMENUHANDLERPLUGIN_HRH__ +#define __MCSMENUHANDLERPLUGIN_HRH__ + +/// Definition of the MCS Handler ECom plugin interface. +#define MENU_HANDLER_IF_UID 0x200113DF + +#endif // __MCSMENUHANDLERPLUGIN_HRH__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuhandlerplugin.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu handler plugin interface +* +*/ + +// ----------------------------------------------------------------------------- +// CMenuHandlerPlugin::NewL +// ----------------------------------------------------------------------------- +// +inline CMenuHandlerPlugin* CMenuHandlerPlugin::NewL +( TUid aImplementationUid, RMenu& aMenu ) + { + TAny* ptr = REComSession::CreateImplementationL( + aImplementationUid, + _FOFF( CMenuHandlerPlugin, iDtor_ID_Key ), + &aMenu ); + return reinterpret_cast( ptr ); + } + +// ----------------------------------------------------------------------------- +// CMenuHandlerPlugin::CMenuHandlerPlugin +// ----------------------------------------------------------------------------- +// +inline CMenuHandlerPlugin::CMenuHandlerPlugin( RMenu &aMenu ) +: CMenuHandler( aMenu ) + { + } + +// ----------------------------------------------------------------------------- +// CMenuHandlerPlugin::~CMenuHandlerPlugin +// ----------------------------------------------------------------------------- +// +inline CMenuHandlerPlugin::~CMenuHandlerPlugin() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuiconutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuiconutility.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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 requesting raw bitmaps +* +*/ + + +#ifndef __MCSMENUICONUTILITY_H__ +#define __MCSMENUICONUTILITY_H__ + +#include +class CMenuItem; + + +/** + * Icon utility. + * This is a utilitiy class providing method(s) for querying raw bitmap data + * belonging to menu items + * @lib mcsextendedmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( MenuIconUtility ) + { +public: + + /** + * Creates the icon that belongs to a menu item. + * @since S60 v5.0. + * @param aItem The menu item the icon is querried for + * @return the icon of the specified menu item. The ownership of the icon + * object is transferred to the caller. + */ + + IMPORT_C static CAknIcon* GetItemIconL( CMenuItem& aItem ); + }; + +#endif // __MENUICONUTILITY_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,445 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu item +* +*/ + + + +#ifndef __MCSMENUITEM_H__ +#define __MCSMENUITEM_H__ + +#include "mcsdef.h" +#include +class RMenu; +class CMenuOperation; +class RWriteStream; +class RReadStream; + +/** + * Menu item header. + * Partial data from a menu item (the administrative part). + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( TMenuItem ) + { + +public: + + enum TFlags ///< Item flags. + { + ELockDelete = 0x1, ///< Item cannot be deleted. + ELockName = 0x2, ///< Item cannot be renamed. + ELockIcon = 0x4, ///< Icon cannot be changed. + ELockMoveInto = 0x8, ///< Cannot add items into this folder. + ELockItem = 0x10, ///< Item cannot be moved to other folder, or reordered. + EHidden = 0x20, ///< Hidden item (do not display). + EMissing = 0x40 ///< Missing item (do not display). + }; + +public: + + /** + * Constructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + TMenuItem(): iId( 0 ), iParent( 0 ), iFlags( 0 ) {} + +// getters + + /** + * Get item ID. + * @since S60 v5.0 + * @return Item ID. + * @capability None. + * @throws None. + * @panic None. + */ + TInt Id() const { return iId; } + + /** + * Get parent folder ID. + * @since S60 v5.0 + * @return Parent Folder ID. + * @capability None. + * @throws None. + * @panic None. + */ + TInt Parent() const { return iParent; } + + /** + * Get flags. + * @since S60 v5.0 + * @return Flags. + * @capability None. + * @throws None. + * @panic None. + */ + TUint32 Flags() const { return iFlags; } + + /** + * Get type. + * @since S60 v5.0 + * @return Type. + * @capability None. + * @throws None. + * @panic None. + */ + TPtrC Type() const { return TPtrC( iType ); } + + +// setters + + /** + * Set item ID. + * @since S60 v5.0 + * @param aId Item ID. + * @capability None. + * @throws None. + * @panic None. + */ + void SetId( TInt aId ) { iId = aId; } + + /** + * Set parent folder ID. + * @since S60 v5.0 + * @param aParent Parent folder ID. + * @capability None. + * @throws None. + * @panic None. + */ + void SetParent( TInt aParent ) { iParent = aParent; } + + /** + * Set flags. + * @since S60 v5.0 + * @param aFlags Flags. + * @capability None. + * @throws None. + * @panic None. + */ + void SetFlags( TUint32 aFlags ) { iFlags = aFlags; } + + /** + * Set type. + * @since S60 v5.0 + * @param aType Type. Maximum length is KMenuMaxTypeLen. + * @capability None. + * @throws None. + * @panic None. + */ + void SetType( const TDesC& aType ) { iType = aType; } + + +// not exported public + + /** + * Externalize object. + * @param aStream Stream to externalize into. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize object. + * @param aStream Stream to externalize from. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + void InternalizeL( RReadStream& aStream ); + +private: // data + + TInt iId; ///< Item ID. + TInt iParent; ///< Parent folder ID. + TUint32 iFlags; ///< Flags. + TBuf iType; ///< Type. + + }; + +/** + * Menu item. + * This class holds client-side local copy of requested item attributes. + * CMenuItem and the underlying storage are very losely coupled: + * - Changes to this class are not automatically comitted to menu. Call SaveL() + * to commit changes. + * - Changes (made by others) to the underyling item are not reflected back + * in this CMenuItem object. ==> CMenuItem users are expected to open + * notifiers on the menu and watch for changes. If change is reported for + * the folder which contains any open CMenuItems, users should discard the + * objects and OpenL() them anew. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuItem ): public CBase + { + +public: + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C virtual ~CMenuItem(); + + /** + * Create new menu item. The item is not created until are committed with a + * call to SaveL(). + * @since S60 v5.0. + * @param aMenu Menu session. + * @param aType Type. Maximum length is KMenuMaxTypeLen. + * @param aFolder Parent folder. + * @param aMoveBefore. In the target folder, the new item will be inserted + * before this item (if found). If the target folder contains no item with + * that ID, the new item is appended to the end of existing items. Pass 0 to + * append to the end. + * @return New unsaved menu item. + * @capability None. + * @throws KErrArgument if aType is KMenuTypeData. + * System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C static CMenuItem* CreateL( + RMenu& aMenu, + const TDesC& aType, + TInt aFolder, + TInt aInsertBefore ); + + /** + * Open existing menu item. + * @since S60 v5.0 + * @param aMenu Menu session. + * @param aId Item ID. + * @return Local copy of menu item. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C static CMenuItem* OpenL( RMenu& aMenu, TInt aId ); + + /** + * Open existing menu item. + * @since S60 v5.0 + * @param aMenu Menu session. + * @param aHdr Item header. Validity is not checked - it is assumed that it + * was retrieved by a call to RMenu::GetItemsL(). + * (It is no use in modifying an existing header, because the changes are + * not reflected back in the server side data). + * @return Local copy of menu item. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C static CMenuItem* OpenL( RMenu& aMenu, const TMenuItem& aHdr ); + + /** + * Get item ID. + * @since S60 v5.0 + * @return Item ID. (0 for unsaved new items.) + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TInt Id() const; + + /** + * Get parent folder ID. + * @since S60 v5.0 + * @return Parent folder ID + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TInt Parent() const; + + /** + * Get flags. + * @since S60 v5.0 + * @return Flags. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TUint32 Flags() const; + + /** + * Set or clear flags. + * @since S60 v5.0 + * @param aMask Flags to set or clear. + * @param aOn ETrue to set, EFalse to clear flags. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C void SetFlags( TUint32 aMask, TBool aOn ); + + /** + * Get type. + * @since S60 v5.0 + * @return Type. + * @capability None. + * @throws None. + * @panic None. + */ + IMPORT_C TPtrC Type() const; + + /** + * Get attribute value. + * @since S60 v5.0 + * @param aAttrName Attribute name. + * @param aAttrExists Will be set to indicate whether attribute exists + * or not. + * @return Attribute value. Empty string if attribute does not exist. + * @capability ECapabilityReadDeviceData. + * @throws KErrArgument in case of invalid attribute name. + * System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C TPtrC GetAttributeL( const TDesC& aAttrName, TBool& aAttrExists ); + + + /** + * Get attribute name list. + * @since S60 v5.0 + * @param aList Attribute name list. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void GetAttributeListL( RArray& aList ); + + /** + * Get running status folders and applications. + * @return TBool. + * @capability None. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C TBool RunningStatusL(); + + /** + * Set attribute value. + * @since S60 v5.0 + * @param aAttrName Attribute name. + * @param aAttrValue Attribute value. + * @capability ECapabilityWriteDeviceData. + * @throws KErrArgument in case of invalid attribute name or value. + * System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void SetAttributeL( const TDesC& aAttrName, const TDesC& aAttrValue ); + + /** + * Remove attribute. + * @since S60 v5.0 + * @param aAttrName Attribute name. + * @capability ECapabilityWriteDeviceData. + * @throws KErrArgument in case of invalid attribute name. + * System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C void RemoveAttributeL( const TDesC& aAttrName ); + + /** + * Save item (commit changes). + * If the item is a new item (created with CreateL()), its ID is generated + * now. However, the item with that ID does not exist until the operation + * successfully completes! + * @since S60 v5.0 + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability ECapabilityWriteDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C CMenuOperation* SaveL( TRequestStatus& aStatus ); + + /** + * Handle command. + * @since S60 v5.0 + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + * @capability None. + * @throws KErrNotSupported if no handler was found for the given type of + * item. System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C CMenuOperation* HandleCommandL( + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: + + /** + * Constructor. + */ + CMenuItem(); + + /** + * Factory method. + * @param aMenu Menu. + * @return Menu item. + */ + static CMenuItem* NewLC( RMenu& aMenu ); + + /** + * Add new item. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* AddL( TRequestStatus& aStatus ); + + /** + * Update item. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* UpdateL( TRequestStatus& aStatus ); + + /** + * Check if there are unsaved changes. + * @return ETrue if there are unsaved changes. + */ + TBool Changed() const; + + /** + * Mark the item as unchanged. + */ + void ClearChanged(); + +private: // data + + class TData; + TData* iData; ///< Private data. Own. + + }; + +#endif // __MCSMENUITEM_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenunotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenunotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu change notifier +* +*/ + + +#ifndef __MCSMENUNOTIFIER_H__ +#define __MCSMENUNOTIFIER_H__ + +#include + +class RMenu; + +/** + * Menu change notifier. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenuNotifier ): public RSubSessionBase + { + +public: + + enum TEvent ///< Menu events. + { + EItemsNone = 0,///< Nothing changed. + EItemsAddedRemoved = 0x1, ///< Items added and/or removed in folder. + EItemsReordered = 0x2, ///< Items reordered in folder. + EItemAttributeChanged = 0x4, ///< Item attribute and/or flag changed. + }; + +public: + + /** + * Constructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + RMenuNotifier(){ iData = NULL; }; + + /** + * Close the notifier. Safe to call if not open. + * Outstanding request, if any, is cancelled. + * @since S60 v5.0 + * @capability ECapabilityReadDeviceData. + * @throws None. + * @panic None. + */ + IMPORT_C void Close(); + + /** + * Open the notifier. + * @since S60 v5.0 + * @param aMenu Menu. + * @return Error code. + * @capability ECapabilityReadDeviceData. + * @throws System-wide error codes if an error occurs. + * @panic None. + */ + IMPORT_C TInt Open( RMenu& aMenu ); + + /** + * Request notification of menu events occurring in specified folder. + * @since S60 v5.0 + * @param aFolder Folder to observe. Pass 0 to observe all folders + * (the whole menu). + * @param aEvents Events to be notified about. A combination of TEvent bits. + * @param aStatus Completes when menu events occur in the specified folder, + * or on error. Completion value is error code (if negative), or a combination + * of events specified in aEvents (if positive). Note, more than one event + * bit can be set. + * @capability ECapabilityReadDeviceData. + * @throws None. + * @panic None. + */ + IMPORT_C void Notify( TInt aFolder, TInt aEvents, TRequestStatus &aStatus ); + + /** + * Cancel notification request. + * @since S60 v5.0 + * @capability ECapabilityReadDeviceData. + * @throws None. + * @panic None. + */ + IMPORT_C void Cancel(); + +private: // data + + class TData; + TData* iData; ///< Private data. Own. + + }; + +#endif // __MCSMENUNOTIFIER_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuoperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of asynchronous menu operation base class +* +*/ + + +#ifndef __MCSMENUOPERATION_H__ +#define __MCSMENUOPERATION_H__ + +#include + +class RMenu; + +/** + * Asynchronous menu operation base class. + * Defines ownership and cancellation of asynchronous menu operations; + * does not define the operation itself. + * Concrete derived classes must provide: + * - A request function which sets the observer status to KRequesPending; + * - DoCancel() which cancels the operation; + * - RunL() which should, in addition to any other required functionality, + * always end by completing the observer request status. + * @lib - + * @since S60 v5.0 + */ +class CMenuOperation : public CActive + { + +protected: + + /** + * Constructor. + * @param aMenu Menu. + * @param aPriority Active Object priority. + * @param aObserverStatus Completes when the operation is finished. + * @capability None. + * @throws None. + * @panic None. + */ + CMenuOperation( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus ) + : CActive( aPriority ), iMenu( aMenu ), iObserverStatus( aObserverStatus ) {} + +protected: // data + + RMenu& iMenu; ///< Menu. + TRequestStatus& iObserverStatus; ///< Observer request status. + + }; + +#endif // __MCSMENUOPERATION_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/inc/mcsmenuutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuutils.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +NONSHARABLE_CLASS( MenuUtils ) + { + public: + /** + * Gets TUint from a aStr - HEX or Decimal + * + * @return error code + */ + IMPORT_C static TInt GetTUint( const TDesC& aStr, TUint& aInt ); + + /** + * Sets TUint in a aStr - HEX + * + */ + IMPORT_C static void SetTUint( TDes& aStr, TUint aInt ); + }; \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/menu_content_service_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/menu_content_service_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + +menu content service api +API for menu content service +c++ +menucontentsrv + + + + + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/conf/ui_mcsapitest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/conf/ui_mcsapitest.cfg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,464 @@ +[StifSettings] +CheckHeapBalance= off +[EndStifSettings] + +############################################################## +# Test +############################################################## + +[Test] +title Test_RMenuConstructorL +create mcsapitest mcs +mcs Test_RMenuConstructorL +delete mcs +[Endtest] + +[Test] +title Test_RMenuClose +create mcsapitest mcs +mcs Test_RMenuClose +delete mcs +[Endtest] + +[Test] +title Test_RMenuOpen +create mcsapitest mcs +mcs Test_RMenuOpen +delete mcs +[Endtest] + +[Test] +title Test_RMenuRootFolder +create mcsapitest mcs +mcs Test_RMenuRootFolder +delete mcs +[Endtest] + +[Test] +title Test_RMenuRootGetItems +create mcsapitest mcs +mcs Test_RMenuRootGetItems +delete mcs +[Endtest] + +[Test] +title Test_RMenuGetRunningApps +create mcsapitest mcs +mcs Test_RMenuGetRunningApps +delete mcs +[Endtest] + +[Test] +title Test_RMenuRemove +create mcsapitest mcs +mcs Test_RMenuRemove +delete mcs +[Endtest] + +[Test] +title Test_RMenuMoveToFolder +create mcsapitest mcs +mcs Test_RMenuMoveToFolder +delete mcs +[Endtest] + +[Test] +title Test_RMenuReorder +create mcsapitest mcs +mcs Test_RMenuReorder +delete mcs +[Endtest] + +[Test] +title Test_RMenuResourceMark +create mcsapitest mcs +mcs Test_RMenuResourceMark +delete mcs +[Endtest] + +[Test] +title Test_RMenuResourceCheck +create mcsapitest mcs +mcs Test_RMenuResourceCheck +delete mcs +[Endtest] + +[Test] +title Test_RMenuResourceCount +create mcsapitest mcs +mcs Test_RMenuResourceCount +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterDestructorL +create mcsapitest mcs +mcs Test_CMenuFilterDestructorL +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemCreate +create mcsapitest mcs +mcs Test_CMenuItemCreate +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemOpenId +create mcsapitest mcs +mcs Test_CMenuItemOpenId +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemOpenHdr +create mcsapitest mcs +mcs Test_CMenuItemOpenHdr +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemId +create mcsapitest mcs +mcs Test_CMenuItemId +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemParent +create mcsapitest mcs +mcs Test_CMenuItemParent +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemFlags +create mcsapitest mcs +mcs Test_CMenuItemFlags +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemSetFlags +create mcsapitest mcs +mcs Test_CMenuItemSetFlags +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemType +create mcsapitest mcs +mcs Test_CMenuItemType +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemGetAttribute +create mcsapitest mcs +mcs Test_CMenuItemGetAttribute +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemGetAttributeList +create mcsapitest mcs +mcs Test_CMenuItemGetAttributeList +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemRunningStatus +create mcsapitest mcs +mcs Test_CMenuItemRunningStatus +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemSetAttribute +create mcsapitest mcs +mcs Test_CMenuItemSetAttribute +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemRemoveAttribute +create mcsapitest mcs +mcs Test_CMenuItemRemoveAttribute +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemSave +create mcsapitest mcs +mcs Test_CMenuItemSave +delete mcs +[Endtest] + +[Test] +title Test_CMenuItemHandleCommand +create mcsapitest mcs +mcs Test_CMenuItemHandleCommand +delete mcs +[Endtest] + +[Test] +title Test_RMenuNotifierConstructorL +create mcsapitest mcs +mcs Test_RMenuNotifierConstructorL +delete mcs +[Endtest] + +[Test] +title Test_RMenuNotifierOpenL +create mcsapitest mcs +mcs Test_RMenuNotifierOpenL +delete mcs +[Endtest] + +[Test] +title Test_RMenuNotifierNotifyL +create mcsapitest mcs +mcs Test_RMenuNotifierNotifyL +delete mcs +[Endtest] + +[Test] +title Test_RMenuNotifierCloseL +create mcsapitest mcs +mcs Test_RMenuNotifierCloseL +delete mcs +[Endtest] + +[Test] +title Test_RMenuNotifierCancelL +create mcsapitest mcs +mcs Test_RMenuNotifierCancelL +delete mcs +[Endtest] + + +[Test] +title Test_CMenuFilterNewL +create mcsapitest mcs +mcs Test_CMenuFilterNewL +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterNewLC +create mcsapitest mcs +mcs Test_CMenuFilterNewLC +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterFlagsOn +create mcsapitest mcs +mcs Test_CMenuFilterFlagsOn +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterFlagsOff +create mcsapitest mcs +mcs Test_CMenuFilterFlagsOff +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterType +create mcsapitest mcs +mcs Test_CMenuFilterType +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterNumAttributes +create mcsapitest mcs +mcs Test_CMenuFilterNumAttributes +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterGetAttribute +create mcsapitest mcs +mcs Test_CMenuFilterGetAttribute +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterReset +create mcsapitest mcs +mcs Test_CMenuFilterReset +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterSetFlags +create mcsapitest mcs +mcs Test_CMenuFilterSetFlags +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterSetType +create mcsapitest mcs +mcs Test_CMenuFilterSetType +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterHaveAttributeL +create mcsapitest mcs +mcs Test_CMenuFilterHaveAttributeL +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterDoNotHaveAttributeL +create mcsapitest mcs +mcs Test_CMenuFilterDoNotHaveAttributeL +delete mcs +[Endtest] + +[Test] +title Test_CMenuFilterRemoveAttribute +create mcsapitest mcs +mcs Test_CMenuFilterRemoveAttribute +delete mcs +[Endtest] + +[Test] +title Test_McsIconUtilityGetItemIconL +create mcsapitest mcs +mcs Test_McsIconUtilityGetItemIconL +delete mcs +[Endtest] + +[Test] +title Test_MenuUtilsGetTUint +create mcsapitest mcs +mcs Test_MenuUtilsGetTUint +delete mcs +[Endtest] + +[Test] +title Test_MenuUtilsSetTUint +create mcsapitest mcs +mcs Test_MenuUtilsSetTUint +delete mcs +[Endtest] + +[Test] +title Test_MenuHandlerPluginNewL +create mcsapitest mcs +mcs Test_MenuHandlerPluginNewL +delete mcs +[Endtest] + +[Test] +title Test_MenuHandlerPluginDeleteL +create mcsapitest mcs +mcs Test_MenuHandlerPluginDeleteL +delete mcs +[Endtest] + +[Test] +title Test_MenuHandlerPluginConstructL +create mcsapitest mcs +mcs Test_MenuHandlerPluginConstructL +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemConstructorL +create mcsapitest mcs +mcs Test_TMenuItemConstructorL +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemId +create mcsapitest mcs +mcs Test_TMenuItemId +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemParent +create mcsapitest mcs +mcs Test_TMenuItemParent +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemFlags +create mcsapitest mcs +mcs Test_TMenuItemFlags +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemType +create mcsapitest mcs +mcs Test_TMenuItemType +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemSetId +create mcsapitest mcs +mcs Test_TMenuItemSetId +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemSetParent +create mcsapitest mcs +mcs Test_TMenuItemSetParent +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemSetFlags +create mcsapitest mcs +mcs Test_TMenuItemSetFlags +delete mcs +[Endtest] + +[Test] +title Test_TMenuItemSetType +create mcsapitest mcs +mcs Test_TMenuItemSetType +delete mcs +[Endtest] + + +[Test] +title Test_CMenuHandlerSupportsType +create mcsapitest mcs +mcs Test_CMenuHandlerSupportsType +delete mcs +[Endtest] + +[Test] +title Test_CMenuHandlerHandleCommandL +create mcsapitest mcs +mcs Test_CMenuHandlerHandleCommandL +delete mcs +[Endtest] + +[Test] +title Test_CMenuHandlerDestructor +create mcsapitest mcs +mcs Test_CMenuHandlerDestructor +delete mcs +[Endtest] + +[Test] +title Test_RMenu__DbgSetAllocFailL +create mcsapitest mcs +mcs Test_RMenu__DbgSetAllocFailL +delete mcs +[Endtest] diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/data/c/sapitest_menudata.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/data/c/sapitest_menudata.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/data/mcsapi.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/data/mcsapi.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +rem /* +rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem * All rights reserved. +rem * This component and the accompanying materials are made available +rem * under the terms of "Eclipse Public License v1.0" +rem * which accompanies this distribution, and is available +rem * at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem * +rem * Initial Contributors: +rem * Nokia Corporation - initial contribution. +rem * +rem * Contributors: +rem * +rem * Description: +rem * +rem */ +md c:\data\stif\menu_results\ +ATSInterface.exe -testmodule TestScripter -config c:\testframework\ui_mcsapitest.cfg \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/eabi/mcsapitestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/eabi/mcsapitestu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI10CTestUtils @ 2 NONAME + _ZTI11CWaitActive @ 3 NONAME + _ZTI17CMCSMenuOpWatcher @ 4 NONAME + _ZTI19CMCSReqNotification @ 5 NONAME + _ZTV10CTestUtils @ 6 NONAME + _ZTV11CWaitActive @ 7 NONAME + _ZTV17CMCSMenuOpWatcher @ 8 NONAME + _ZTV19CMCSReqNotification @ 9 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../init/ui_mcsapitest.ini c:/testframework/ui_mcsapitest.ini +../conf/ui_mcsapitest.cfg c:/testframework/ui_mcsapitest.cfg +../data/mcsapi.bat c:/mcsapi.bat +../data/c/sapitest_menudata.xml c:/testing/data/MCSAPI/sapitest_menudata.xml + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +mcsapitest.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/group/mcsapitest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/group/mcsapitest.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +TARGET mcsapitest.dll +TARGETTYPE dll +UID 0x1000008D 0x02FE5167 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE mcsapitest.cpp +SOURCE mcsapitestblocks.cpp mcsapiutils.cpp mcsmenuopwatcher.cpp waitactive.cpp testutils.cpp +SOURCE mcsrequestnotification.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY stiftestinterface.lib +LIBRARY efsrv.lib +LIBRARY bafl.lib +LIBRARY liwservicehandler.lib +LIBRARY sqldb.lib +LIBRARY estor.lib +LIBRARY apgrfx.lib +LIBRARY cone.lib +LIBRARY apparc.lib +LIBRARY eikcore.lib +LIBRARY aknskins.lib aknskinsrv.lib aknswallpaperutils.lib +LIBRARY mcsmenu.lib +LIBRARY mcsextendedmenu.lib +LIBRARY centralrepository.lib + +LIBRARY ws32.lib + +LIBRARY fbscli.lib + +LIBRARY swinstcli.lib +LIBRARY aknicon.lib +///Sat +LIBRARY menuinterface.lib +LIBRARY mcsmenuutils.lib + +LANG SC + +EPOCALLOWDLLDATA + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/group/mcsapitest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/group/mcsapitest.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +; +; Copyright (c) 2009 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: +; +; obrtester.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"mcsapitest"},(0x02FE51A7),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install + + "\epoc32\release\armv5\urel\mcsapitest.dll" - "!:\sys\bin\mcsapitest.dll" + "..\init\ui_mcsapitest.ini" -"!:\testframework\ui_mcsapitest.ini" + "..\conf\ui_mcsapitest.cfg" -"!:\testframework\ui_mcsapitest.cfg" + "..\data\c\sapitest_menudata.xml" -"!:\testing\data\MCSAPI\sapitest_menudata.xml" + "..\data\mcsapi.bat" -"!:\mcsapi.bat" \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsapitest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsapitest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2009 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 TESTCLASS_H +#define TESTCLASS_H + +// INCLUDES + + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "testutils.h" + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CtestClass test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CMCSAPITest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMCSAPITest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CMCSAPITest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CMCSAPITest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Test methods are listed below. + */ + TInt Test_RMenuConstructorL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuCloseL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuOpenL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuRootFolderL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuRootGetItemsL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuGetRunningAppsL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuRemoveL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuMoveToFolderL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuReorderL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuResourceMarkL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuResourceCheckL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuResourceCountL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenu__DbgSetAllocFailL(CStifItemParser& /*aItem*/ ); + + + TInt Test_TMenuItemConstructorL(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemId(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemParent(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemFlags(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemType(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemSetId(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemSetParent(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemSetFlags(CStifItemParser& /*aItem*/ ); + TInt Test_TMenuItemSetType(CStifItemParser& /*aItem*/ ); + + TInt Test_CMenuItemCreateL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemOpenIdL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemOpenHdrL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemIdL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemParentL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemFlagsL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemSetFlagsL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemTypeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemGetAttributeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemGetAttributeListL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemRunningStatusL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemSetAttributeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemRemoveAttributeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemSaveL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuItemHandleCommandL(CStifItemParser& /*aItem*/ ); + + TInt Test_RMenuNotifierConstructorL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuNotifierOpenL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuNotifierNotifyL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuNotifierCloseL(CStifItemParser& /*aItem*/ ); + TInt Test_RMenuNotifierCancelL(CStifItemParser& /*aItem*/ ); + + TInt Test_CMenuFilterDestructorL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterNewL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterNewLC(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterFlagsOn(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterFlagsOff(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterType(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterNumAttributes(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterGetAttribute(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterReset(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterSetFlags(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterSetType(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterHaveAttributeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterDoNotHaveAttributeL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuFilterRemoveAttribute(CStifItemParser& /*aItem*/ ); + TInt Test_McsIconUtilityGetItemIconL(CStifItemParser& /*aItem*/ ); + TInt Test_MenuUtilsGetTUint(CStifItemParser& /*aItem*/ ); + TInt Test_MenuUtilsSetTUint(CStifItemParser& /*aItem*/ ); + + TInt Test_MenuHandlerPluginNewL(CStifItemParser& /*aItem*/ ); + TInt Test_MenuHandlerPluginDeleteL(CStifItemParser& /*aItem*/ ); + TInt Test_MenuHandlerPluginConstructL(CStifItemParser& /*aItem*/ ); + + TInt Test_CMenuHandlerSupportsType(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuHandlerHandleCommandL(CStifItemParser& /*aItem*/ ); + TInt Test_CMenuHandlerDestructor(CStifItemParser& /*aItem*/ ); + + /** + * Utility methods are listed below. + */ + TInt SetupMenuL(RMenu& aMenu); + void WaitL(TInt aMicroSec); + TInt SaveL(CMenuItem *aItem); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + CTestUtils *iTestUtils; + TInt iSetupSuffix; + + }; + +#endif // TESTCLASS_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsmenuopwatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsmenuopwatcher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSMENUOPWATCHER_H +#define __MCSMENUOPWATCHER_H + +#include + +class CMenuOperation; + +/** + * This class implements MCS SAPI menu action watcher for async calls. + * + */ +class CMCSMenuOpWatcher: public CActive + { + public: + + /** + * Two-phased constructor. + * @param iObserver Menu operation observer object. + * @return CMCSMenuOpWatcher reference. + */ + static CMCSMenuOpWatcher* NewL( TBool aStopScheduler = 0); + + /** + * Destructor. + */ + virtual ~CMCSMenuOpWatcher(); + + /** + * Watch menu operation watcher. + * @param iObserver Menu operation observer object. + * @return CMCSMenuOpWatcher reference. + */ + void Watch( CMenuOperation& aOperation); + + TInt GetStatus(); + + private: + + /** + * Default constructor. + * @param iObserver Menu operation observer object. + */ + CMCSMenuOpWatcher( TBool aStopScheduler ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + void RunL(); + + /** + * Inherited from CActive class + */ + void DoCancel(); + + private: + + /** Menu operation */ + CMenuOperation* iOperation; + + TBool iStopScheduler; + }; + +#endif /*__MCSMENUOPWATCHER_H*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsrequestnotification.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/inc/mcsrequestnotification.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSREQUESTNOTIFICATION_H_ +#define __MCSREQUESTNOTIFICATION_H_ + +#include +#include "mcsmenunotifier.h" + +//class MMCSCallback; + +/** + * This class implements MCS SAPI core logic for Request Notification async requests. + * + */ +class CMCSReqNotification: public CActive + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSRunningApps reference. + */ + static CMCSReqNotification* NewL(RMenu& aMCS); + + /** + * Destructor. + */ + virtual ~CMCSReqNotification(); + + TInt GetStatus(); + + private: + + /** + * Default constructor. + */ + CMCSReqNotification(); + + /** + * ConstructL + * @param aMCS MenuContentService object. + */ + void ConstructL(RMenu& aMCS); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + public : + + /** + * Starts the notification of events. + * @param aFolderId folder id to observe the events. + * @param aEvent events to notificy. + */ + void StartNotificationL(TInt aFolderId, TInt aEvent ); + + + private: + + RMenuNotifier iNotifier; + /** Folder it to watch owned. */ + + /** iMCS reference. Not owned. */ + RMenu iMCS; + + TInt iStat; + }; + +#endif /*__MCSREQUESTNOTIFICATION_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/inc/testutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/inc/testutils.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +class CTestUtils: public CBase +{ +public: + + /**/ + virtual ~CTestUtils(); + + /**/ + static CTestUtils* NewL(); + + /**/ + static CTestUtils* NewLC(); + + TInt Copy( const TDesC& aFileName, TInt aSuffix = 0 ); + TInt CopyImport( const TDesC& aFileName, TInt aSuffix = 0 ); + TInt Copy( const TDesC& aSource, const TDesC& aDest ); + TInt Delete( /*const TDesC& aFilePath*/ ); + void InstallSisL( const TDesC& aName ); + void UninstallSisL( const TDesC& aName ); + +private: + + + CTestUtils(); + + void ConstructL(); + + +private: + RFs iFs; + CFileMan* iFileManager; +}; diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/inc/waitactive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/inc/waitactive.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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: Plugin Interface +* +*/ + + +#ifndef C_WAITACTIVE_H +#define C_WAITACTIVE_H + +#include + +/** + * Helper wait active class + */ + class CWaitActive : public CTimer + { + +public: + + + static CWaitActive* NewL( ); + + ~CWaitActive(); + + void Wait(TTimeIntervalMicroSeconds32 anInterval); + +protected: + + /** + * From CActive, RunL. + * Handles the active object’s request completion event + */ + void RunL(); + + +private: + + CWaitActive(); + + void ConstructL(); + +private: + + /* + * Own. + */ + CActiveSchedulerWait* iActiveScheduler; + }; + + +#endif // C_WAITACTIVE_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/init/ui_mcsapitest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/init/ui_mcsapitest.ini Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,181 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\data\stif\menu_results\ +TestReportFileName= Utils + +TestReportFormat= HTML # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND +UITestingSupport= YES # Possible values: YES or NO +SeparateProcesses= YES # Possible values: YES or NO (default: NO) +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= dom_test2 +#[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +[New_Module] +ModuleName= testscripter + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) + +TestCaseFile= c:\testframework\ui_mcsapitest.cfg + + +[End_Module] + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapitest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapitest.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1565 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES + +#include +#include +#include "mcsapitest.h" +#include "mcsmenuopwatcher.h" +#include "mcsrequestnotification.h" +#include "mcsmenuhandlerplugin.h" +#include "mcsmenuhandlerplugin.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuConstructorL(CStifItemParser& /*aItem*/ ) + { + RMenu menu; + CleanupClosePushL(menu); + // Didn't panick during construction, so it's ok + CleanupStack::PopAndDestroy(&menu); + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuCloseL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + menu.Close(); + result = KErrNone; + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuOpenL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + //TRAPD (err, menu.OpenL(_L("sapitest_menudata"))); + TRAPD (err, SetupMenuL(menu); ); + result = err; + menu.Close(); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuRootFolderL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + SetupMenuL(menu); + CleanupClosePushL(menu); + + TInt root; + TRAPD(err, root = menu.RootFolderL()); + + if (err == KErrNone && root > 0) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuRootGetItemsL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + RArray itemArray; + const TInt KRootId = 1; + + CleanupClosePushL(menu); + CleanupClosePushL(itemArray); + + SetupMenuL(menu); + TRAPD(err, menu.GetItemsL(itemArray, KRootId)); + + if (err == KErrNone && itemArray.Count() > 0) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy(&itemArray); + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuGetRunningAppsL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + RArray uidArray; + + CleanupClosePushL(menu); + CleanupClosePushL(uidArray); + SetupMenuL(menu); + TRAPD(err, menu.GetRunningAppsL(uidArray)); + + WaitL(1000000); + + if (err == KErrNone && uidArray.Count() > 0) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy(&uidArray); + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuRemoveL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + const TInt KRootId = 1; + + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMCSMenuOpWatcher* watcher = CMCSMenuOpWatcher::NewL(ETrue); + CleanupStack::PushL(watcher); + + CMenuOperation* oper = menu.RemoveL(101, watcher->iStatus) ; + watcher->Watch( *oper); + CActiveScheduler::Start(); + WaitL( 1000000); + + result = watcher->GetStatus(); + + CleanupStack::PopAndDestroy(watcher); + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuMoveToFolderL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + TInt moveId = 3; + TInt moveBefore = 2; + TInt folder = 90; + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + RArray items; + CleanupClosePushL(items); + items.Append(moveId); + + CMCSMenuOpWatcher* watcheriMCS = CMCSMenuOpWatcher::NewL(); + CleanupStack::PushL(watcheriMCS); + + CMenuOperation* operationiMCS = menu.MoveToFolderL( items, folder, moveBefore, + watcheriMCS->iStatus ); + + watcheriMCS->Watch( *operationiMCS); + + WaitL( 200000); + result = watcheriMCS->GetStatus(); + + CleanupStack::PopAndDestroy(watcheriMCS); + CleanupStack::PopAndDestroy(&items); + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuReorderL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + TInt moveId = 3; + TInt moveBefore = 2; + TInt revMoveBefore = 6; + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMCSMenuOpWatcher* watcheriMCS = CMCSMenuOpWatcher::NewL(); + CleanupStack::PushL(watcheriMCS); + CMenuOperation* operationiMCS = menu.ReorderL(moveId, moveBefore, + watcheriMCS->iStatus); + watcheriMCS->Watch( *operationiMCS); + + WaitL( 200000); + TInt status = watcheriMCS->GetStatus(); + CleanupStack::PopAndDestroy(watcheriMCS); + + watcheriMCS = CMCSMenuOpWatcher::NewL(); + CleanupStack::PushL(watcheriMCS); + operationiMCS = menu.ReorderL(moveId, revMoveBefore, watcheriMCS->iStatus); + watcheriMCS->Watch( *operationiMCS); + WaitL( 200000); + + result = status; + CleanupStack::PopAndDestroy(watcheriMCS); + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +TInt CMCSAPITest::Test_RMenuResourceMarkL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + menu.ResourceCheck(); + // Didn't panicked till now, must be ok + result = KErrNone; + + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuResourceCheckL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + menu.ResourceMark(); + // Didn't panicked till now, must be ok + result = KErrNone; + + CleanupStack::PopAndDestroy(&menu); + + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuResourceCountL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + TInt res = menu.ResourceCount(); + if (res == 0) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenu__DbgSetAllocFailL(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + menu.__DbgSetAllocFail(RAllocator::ERandom, 0); + result = KErrNone; + + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemConstructorL(CStifItemParser& /*aItem*/ ) + { + TMenuItem hdr; + // Didn't panicked so it passed + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemId(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + if (hdr.Id() == 0) + { + // Id was called with no problems + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemParent(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + if (hdr.Parent() == 0) + { + // Parent was called with no problems + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemFlags(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + if (hdr.Flags() == 0) + { + // Flags was called with no problems + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemType(CStifItemParser& /*aItem*/ ) + { + TMenuItem hdr; + hdr.Type(); + // Didn't panicked during Type call, so it passed + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemSetId(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + hdr.SetId(1); + if (hdr.Id() == 1) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemSetParent(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + hdr.SetParent(1); + if (hdr.Parent() == 1) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemSetFlags(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + hdr.SetFlags(1); + if (hdr.Flags() == 1) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_TMenuItemSetType(CStifItemParser& /*aItem*/ ) + { + TInt result(KErrGeneral); + TMenuItem hdr; + hdr.SetType(KMenuTypeUrl); + if (hdr.Type() == KMenuTypeUrl) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemCreateL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TInt beforeId(2); + TInt folderId(2); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::CreateL(menu, KMenuTypeUrl, folderId, beforeId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemOpenIdL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TInt itemId(2); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemOpenHdrL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem *item; + TMenuItem* hdr = new (ELeave) TMenuItem(); + CleanupStack::PushL(hdr); + hdr->SetId(85); + hdr->SetParent(1); + hdr->SetType(KMenuTypeUrl); + + + TRAPD(err, item = CMenuItem::OpenL(menu, *hdr)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(hdr); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemIdL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TInt itemId(2); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)) + ; + CleanupStack::PushL(item); + if (err == KErrNone && item->Id() == itemId) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemParentL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(2); + TInt parentId(1); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)) + ; + CleanupStack::PushL(item); + if (err == KErrNone && item->Parent() == parentId) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemFlagsL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(111); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone && (item->Flags() & TMenuItem::ELockDelete) != 0) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemSetFlagsL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(111); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)) + ; + CleanupStack::PushL(item); + if (err == KErrNone) + { + item->SetFlags(TMenuItem::ELockMoveInto, ETrue); + if ((item->Flags() & TMenuItem::ELockMoveInto) != 0) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemTypeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(111); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)) + ; + CleanupStack::PushL(item); + if (err == KErrNone && item->Type() == KMenuTypeUrl) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemGetAttributeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(2); + _LIT(KExpectedLongName, "long__"); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + TBool attrExists(EFalse); + TPtrC longName = item->GetAttributeL(KMenuAttrLongName, attrExists); + if (attrExists && longName == KExpectedLongName) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemGetAttributeListL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(2); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + RArray attrList; + CleanupClosePushL(attrList); + item->GetAttributeListL(attrList); + if (attrList.Count() > 0) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(&attrList); + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemRunningStatusL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(2); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + result = KErrCancel; + if (item->RunningStatusL() == EFalse) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemSetAttributeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + TInt itemId(2); + _LIT(KNewLongName, "newlong__"); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + item->SetAttributeL(KMenuAttrLongName, KNewLongName); + SaveL(item); + + TBool attrExists(EFalse); + TPtrC longName = item->GetAttributeL(KMenuAttrLongName, attrExists); + if (attrExists && longName == KNewLongName) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemRemoveAttributeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TInt itemId(2); + _LIT(KNewLongName, "newlong__"); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem *item; + TRAPD(err, item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + if (err == KErrNone) + { + item->RemoveAttributeL(KMenuAttrLongName); + SaveL(item); + TBool attrExists(EFalse); + TPtrC longName = item->GetAttributeL(KMenuAttrLongName, attrExists); + if (attrExists == EFalse) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(item); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemSaveL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TInt itemId(2); + _LIT(KNewLongName, "newlong__"); + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem* menuitem = CMenuItem::OpenL(menu, itemId); + CleanupStack::PushL(menuitem); + + menuitem->SetAttributeL(KMenuAttrLongName, KNewLongName); + + CMCSMenuOpWatcher* watcher = CMCSMenuOpWatcher::NewL(ETrue); + CleanupStack::PushL(watcher); + + CMenuOperation* oper = menuitem->SaveL(watcher->iStatus); + watcher->Watch( *oper); + CActiveScheduler::Start(); + WaitL( 1000000); + + result = watcher->GetStatus(); + + CleanupStack::PopAndDestroy(watcher); + CleanupStack::PopAndDestroy(menuitem); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuItemHandleCommandL(CStifItemParser& /*aItem*/) + { + + TInt result(KErrGeneral); + TInt itemId(2); + TInt uid = 0x10005901; + RMenu menu; + CleanupClosePushL(menu); + SetupMenuL(menu); + + CMenuItem* menuitem = CMenuItem::OpenL(menu, itemId); + CleanupStack::PushL(menuitem); + + CMCSMenuOpWatcher* watcher = CMCSMenuOpWatcher::NewL(ETrue); + CleanupStack::PushL(watcher); + + CMenuOperation* oper = menuitem->HandleCommandL( KMenuCmdOpen, _L8("") , watcher->iStatus); + watcher->Watch( *oper); + CActiveScheduler::Start(); + WaitL( 1000000); + + result = watcher->GetStatus(); + + // Close opened app + RWsSession session; + TInt error = session.Connect(); + TUid uidApp( TUid::Uid( uid )) ; + TApaTaskList taskList( session ); + TApaTask task = taskList.FindApp( uidApp ); + + if( task.Exists() ) + { + task.EndTask(); + } + else + { + result = KErrNotFound; + } + + WaitL( 1000000 ); + session.Close(); + WaitL( 1000000 ); + + CleanupStack::PopAndDestroy(watcher); + CleanupStack::PopAndDestroy(menuitem); + CleanupStack::PopAndDestroy(&menu); + return result; + + } + +TInt CMCSAPITest::Test_RMenuNotifierConstructorL(CStifItemParser& /*aItem*/ ) + { + TInt result ( KErrGeneral ); + + RMenuNotifier notifier; // Construction + CleanupClosePushL( notifier ); + CleanupStack::PopAndDestroy( ¬ifier ); + // Didn't panicked during construction so it's ok + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuNotifierOpenL(CStifItemParser& /*aItem*/ ) + { + TInt result ( KErrGeneral ); + + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + RMenuNotifier notifier; + notifier.Open( menu ); + + notifier.Close(); + CleanupStack::PopAndDestroy( &menu ); + result = KErrNone; + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuNotifierNotifyL(CStifItemParser& /*aItem*/ ) + { + TInt result ( KErrGeneral ); + TInt folderId = 110; + + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMCSReqNotification * request = CMCSReqNotification::NewL( menu ); + CleanupStack::PushL( request ); + WaitL( 200000 ); + request->StartNotificationL( folderId, RMenuNotifier::EItemsReordered ); + WaitL( 200000 ); + + if( request->GetStatus() == KErrNone ) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy( request ); + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuNotifierCloseL(CStifItemParser& /*aItem*/ ) + { + TInt result ( KErrGeneral ); + RMenuNotifier iNotifier; + iNotifier.Close(); + result = KErrNone; + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_RMenuNotifierCancelL(CStifItemParser& /*aItem*/ ) + { + TInt result ( KErrGeneral ); + TInt folderId = 110; + + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMCSReqNotification * request = CMCSReqNotification::NewL( menu ); + CleanupStack::PushL( request ); + WaitL( 200000 ); + request->StartNotificationL( folderId, RMenuNotifier::EItemsReordered ); + WaitL( 200000 ); + + if( request->GetStatus() == KErrNone ) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy( request ); + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterDestructorL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + CMenuFilter* filter; + filter = CMenuFilter::NewL(); + + // Check destructor + delete filter; + // Didn't panicked so it's ok + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterNewL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + CMenuFilter* filter = NULL; + TRAPD (err, filter = CMenuFilter::NewL()); + result = err; + CleanupStack::PushL( filter ); + CleanupStack::PopAndDestroy( filter ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterNewLC(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter= NULL; + TRAPD (err, filter = CMenuFilter::NewLC(); + CleanupStack::PopAndDestroy( filter )); + result = err; + return result; + } +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterFlagsOn(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + TUint32 flag( 0); + flag = filter->FlagsOn(); + if (flag ==KErrNone) + { + filter->SetFlags(TMenuItem::EHidden, 0); + flag = filter->FlagsOn(); + if (flag == TMenuItem::EHidden) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterFlagsOff(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + TUint32 flag( 0); + flag = filter->FlagsOff(); + if (flag ==KErrNone) + { + filter->SetFlags( 0, TMenuItem::EHidden); + flag = filter->FlagsOff(); + if (flag == TMenuItem::EHidden) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterType(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + TPtrC type(filter->Type() ); + if (type == KNullDesC() ) + { + filter->SetType( _L("test")); + TPtrC type2(filter->Type() ); + if (type2 == _L("test")) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterNumAttributes(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + TInt count(filter->NumAttributes() ); + if (count == KErrNone) + { + filter->HaveAttributeL( _L("test1"), _L("test1")); + filter->HaveAttributeL( _L("test2"), _L("test2")); + filter->HaveAttributeL( _L("test3"), _L("test3")); + filter->HaveAttributeL( _L("test4"), _L("test4")); + filter->HaveAttributeL( _L("test5"), _L("test5")); + filter->HaveAttributeL( _L("test6"), _L("test6")); + count = filter->NumAttributes(); + if (count == 6) + { + result = KErrNone; + } + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterGetAttribute(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + TPtrC nameAttribute(KNullDesC); + TPtrC valueAttribute(KNullDesC); + filter->HaveAttributeL( _L("test"), _L("Valuetest")); + if (filter->GetAttribute( 0, nameAttribute, valueAttribute) + && nameAttribute == _L("test") && valueAttribute == _L("Valuetest")) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterReset(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->HaveAttributeL( _L("test"), _L("Valuetest")); + filter->SetType( _L("test")); + filter->SetFlags(TMenuItem::EHidden, TMenuItem::EHidden); + filter->Reset(); + TPtrC nameAttribute(KNullDesC); + TPtrC valueAttribute(KNullDesC); + TPtrC type(filter->Type() ); + filter->HaveAttributeL( _L("test3"), _L("Valuetest3")); + if (filter->GetAttribute( 0, nameAttribute, valueAttribute) + && filter->FlagsOn() == KErrNone && filter->FlagsOff() == KErrNone + && type == KNullDesC() && nameAttribute == _L("test3") && valueAttribute == _L("Valuetest3")) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterSetFlags(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->SetFlags(TMenuItem::EHidden, TMenuItem::EHidden); + if (filter->FlagsOn() == TMenuItem::EHidden && filter->FlagsOff() + == TMenuItem::EHidden) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterSetType(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->SetType( _L("test")); + TPtrC type(filter->Type() ); + if (type == _L("test")) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterHaveAttributeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->HaveAttributeL( _L("test"), _L("Valuetest")); + filter->HaveAttributeL( _L("test"), _L("Valuetest2")); + TPtrC nameAttribute(KNullDesC); + TPtrC valueAttribute(KNullDesC); + if (filter->GetAttribute( 0, nameAttribute, valueAttribute) + && nameAttribute == _L("test") && valueAttribute == _L("Valuetest2")) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterDoNotHaveAttributeL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->HaveAttributeL( _L("test"), _L("Valuetest")); + filter->DoNotHaveAttributeL( _L("test")); + TPtrC nameAttribute(KNullDesC); + TPtrC valueAttribute(KNullDesC); + if ( !filter->GetAttribute( 0, nameAttribute, valueAttribute) + && nameAttribute == _L("test") && valueAttribute == KNullDesC() ) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuFilterRemoveAttribute(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->HaveAttributeL( _L("test"), _L("Valuetest")); + filter->RemoveAttribute( _L("test")); + TPtrC nameAttribute(KNullDesC); + TPtrC valueAttribute(KNullDesC); + filter->HaveAttributeL( _L("test2"), _L("Valuetest2")); + if (filter->GetAttribute( 0, nameAttribute, valueAttribute) + && nameAttribute == _L("test2") && valueAttribute == _L("Valuetest2")) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(filter); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_McsIconUtilityGetItemIconL(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + RMenu menu; + CleanupClosePushL(menu); + RArray itemArray; + CleanupClosePushL(itemArray); + + SetupMenuL(menu); + CMenuFilter* filter = CMenuFilter::NewLC(); + filter->HaveAttributeL( _L("uid"), _L("0x1028311D")); + TRAPD(err, menu.GetItemsL(itemArray, 29, filter)); + + if (err == KErrNone && itemArray.Count() == 1) + { + CMenuItem* menuitem = CMenuItem::OpenL(menu, itemArray[0].Id() ); + CleanupStack::PushL(menuitem); + CAknIcon* icon = MenuIconUtility::GetItemIconL( *menuitem); + if (icon) + { + result = KErrNone; + } + delete icon; + CleanupStack::PopAndDestroy(menuitem); + } + + CleanupStack::PopAndDestroy(filter); + CleanupStack::PopAndDestroy(&itemArray); + CleanupStack::PopAndDestroy(&menu); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_MenuUtilsGetTUint(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TPtrC descTUint(_L("0x12345")); + TUint intTUint(KErrNone); + MenuUtils::GetTUint(descTUint, intTUint); + if (intTUint == 74565) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_MenuUtilsSetTUint(CStifItemParser& /*aItem*/) + { + TInt result(KErrGeneral); + TBuf<8> descTUint; + MenuUtils::SetTUint(descTUint, 12345); + if (descTUint == _L("0x3039")) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_MenuHandlerPluginNewL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + + CMenuHandlerPlugin* plugin = CMenuHandlerPlugin::NewL( TUid::Uid(0x200113E1), menu ); + CleanupStack::PushL( plugin ); + if( plugin ) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy( plugin ); + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_MenuHandlerPluginDeleteL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMenuHandlerPlugin* plugin = CMenuHandlerPlugin::NewL( TUid::Uid( 0x200113E1 ), menu ); + //CMenuHandlerPlugin* plugin; + //TRAPD(err, plugin = CMenuHandlerPlugin::NewL( TUid::Uid( MENU_HANDLER_IF_UID ), menu )); + delete plugin; + plugin = NULL; + result = KErrNone; + + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_MenuHandlerPluginConstructL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMenuHandlerPlugin* plugin = new CMenuHandlerPlugin( menu ); + delete plugin; + plugin = NULL; + + result = KErrNone; + + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuHandlerSupportsType(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMenuHandlerPlugin* plugin = CMenuHandlerPlugin::NewL( TUid::Uid(0x200113E1), menu ); + CleanupStack::PushL( plugin ); + + + if( plugin && !plugin->SupportsType(KNullDesC)) + { + result = KErrNone; + } + + CleanupStack::PopAndDestroy( plugin ); + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuHandlerHandleCommandL(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + TInt itemId(2); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMenuItem *item; + TRAP_IGNORE(item = CMenuItem::OpenL(menu, itemId)); + CleanupStack::PushL(item); + WaitL( 200000 ); + + CMenuHandlerPlugin* plugin = CMenuHandlerPlugin::NewL( TUid::Uid(0x200113E0), menu ); + CleanupStack::PushL( plugin ); + + + if( plugin && plugin->SupportsType(KMenuTypeApp)) + { + CMCSMenuOpWatcher* watcher = CMCSMenuOpWatcher::NewL(); + CleanupStack::PushL( watcher ); + + TRAPD(err, plugin->HandleCommandL( *item, _L8("NonExistingOpperation"), KNullDesC8, watcher->iStatus)); + if ( err == KErrNotSupported) + { + result = KErrNone; + } + CleanupStack::PopAndDestroy(watcher); + result = KErrNone; + } + + CleanupStack::PopAndDestroy( plugin ); + CleanupStack::PopAndDestroy( item ); + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSAPITest::Test_CMenuHandlerDestructor(CStifItemParser& /*aItem*/ ) + { + TInt result (KErrGeneral); + RMenu menu; + CleanupClosePushL( menu ); + SetupMenuL( menu ); + WaitL( 200000 ); + + CMenuHandlerPlugin* plugin = CMenuHandlerPlugin::NewL( TUid::Uid(0x200113E1), menu ); + + if( plugin ) + { + // Destructor call by delete + delete plugin; + result = KErrNone; + } + + CleanupStack::PopAndDestroy( &menu ); + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapitestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapitestblocks.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES +#include +#include +#include +#include "mcsapitest.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMCSAPITest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CMCSAPITest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + + ENTRY( "Test_RMenuClose", CMCSAPITest::Test_RMenuCloseL ), + ENTRY( "Test_RMenuOpen", CMCSAPITest::Test_RMenuOpenL ), + ENTRY( "Test_RMenuRootFolder", CMCSAPITest::Test_RMenuRootFolderL ), + ENTRY( "Test_RMenuRootGetItems", CMCSAPITest::Test_RMenuRootGetItemsL ), + ENTRY( "Test_RMenuGetRunningApps", CMCSAPITest::Test_RMenuGetRunningAppsL ), + ENTRY( "Test_RMenuRemove", CMCSAPITest::Test_RMenuRemoveL ), + ENTRY( "Test_RMenuMoveToFolder", CMCSAPITest::Test_RMenuMoveToFolderL ), + ENTRY( "Test_RMenuReorder", CMCSAPITest::Test_RMenuReorderL ), + ENTRY( "Test_RMenuResourceMark", CMCSAPITest::Test_RMenuResourceMarkL ), + ENTRY( "Test_RMenuResourceCheck", CMCSAPITest::Test_RMenuResourceCheckL ), + ENTRY( "Test_RMenuResourceCount", CMCSAPITest::Test_RMenuResourceCountL ), + ENTRY( "Test_RMenu__DbgSetAllocFailL", CMCSAPITest::Test_RMenu__DbgSetAllocFailL ), + ENTRY( "Test_CMenuItemCreate", CMCSAPITest::Test_CMenuItemCreateL ), + ENTRY( "Test_CMenuItemOpenId", CMCSAPITest::Test_CMenuItemOpenIdL ), + ENTRY( "Test_CMenuItemOpenHdr", CMCSAPITest::Test_CMenuItemOpenHdrL ), + ENTRY( "Test_CMenuItemId", CMCSAPITest::Test_CMenuItemIdL ), + ENTRY( "Test_CMenuItemParent", CMCSAPITest::Test_CMenuItemParentL ), + ENTRY( "Test_CMenuItemFlags", CMCSAPITest::Test_CMenuItemFlagsL ), + ENTRY( "Test_CMenuItemSetFlags", CMCSAPITest::Test_CMenuItemSetFlagsL ), + ENTRY( "Test_CMenuItemType", CMCSAPITest::Test_CMenuItemTypeL ), + ENTRY( "Test_CMenuItemGetAttribute", CMCSAPITest::Test_CMenuItemGetAttributeL ), + ENTRY( "Test_CMenuItemGetAttributeList", CMCSAPITest::Test_CMenuItemGetAttributeListL ), + ENTRY( "Test_CMenuItemRunningStatus", CMCSAPITest::Test_CMenuItemRunningStatusL ), + ENTRY( "Test_CMenuItemSetAttribute", CMCSAPITest::Test_CMenuItemSetAttributeL ), + ENTRY( "Test_CMenuItemRemoveAttribute", CMCSAPITest::Test_CMenuItemRemoveAttributeL ), + ENTRY( "Test_CMenuItemSave", CMCSAPITest::Test_CMenuItemSaveL ), + ENTRY( "Test_CMenuItemHandleCommand", CMCSAPITest::Test_CMenuItemHandleCommandL ), + ENTRY( "Test_CMenuFilterNewL", CMCSAPITest::Test_CMenuFilterNewL ), + ENTRY( "Test_CMenuFilterNewLC", CMCSAPITest::Test_CMenuFilterNewLC ), + ENTRY( "Test_CMenuFilterFlagsOn", CMCSAPITest::Test_CMenuFilterFlagsOn ), + ENTRY( "Test_CMenuFilterFlagsOff", CMCSAPITest::Test_CMenuFilterFlagsOff ), + ENTRY( "Test_CMenuFilterType", CMCSAPITest::Test_CMenuFilterType ), + ENTRY( "Test_CMenuFilterNumAttributes", CMCSAPITest::Test_CMenuFilterNumAttributes ), + ENTRY( "Test_CMenuFilterGetAttribute", CMCSAPITest::Test_CMenuFilterGetAttribute ), + ENTRY( "Test_CMenuFilterReset", CMCSAPITest::Test_CMenuFilterReset ), + ENTRY( "Test_CMenuFilterSetFlags", CMCSAPITest::Test_CMenuFilterSetFlags ), + ENTRY( "Test_CMenuFilterSetType", CMCSAPITest::Test_CMenuFilterSetType ), + ENTRY( "Test_CMenuFilterHaveAttributeL", CMCSAPITest::Test_CMenuFilterHaveAttributeL ), + ENTRY( "Test_CMenuFilterDoNotHaveAttributeL", CMCSAPITest::Test_CMenuFilterDoNotHaveAttributeL ), + ENTRY( "Test_CMenuFilterRemoveAttribute", CMCSAPITest::Test_CMenuFilterRemoveAttribute ), + ENTRY( "Test_McsIconUtilityGetItemIconL", CMCSAPITest::Test_McsIconUtilityGetItemIconL ), + ENTRY( "Test_MenuUtilsGetTUint", CMCSAPITest::Test_MenuUtilsGetTUint ), + + ENTRY( "Test_RMenuNotifierOpenL", CMCSAPITest::Test_RMenuNotifierOpenL ), + ENTRY( "Test_RMenuNotifierNotifyL", CMCSAPITest::Test_RMenuNotifierNotifyL ), + ENTRY( "Test_RMenuNotifierCloseL", CMCSAPITest::Test_RMenuNotifierCloseL ), + ENTRY( "Test_RMenuNotifierCancelL", CMCSAPITest::Test_RMenuNotifierCancelL ), + + ENTRY( "Test_CMenuFilterNewL", CMCSAPITest::Test_CMenuFilterNewL ), + ENTRY( "Test_CMenuFilterNewLC", CMCSAPITest::Test_CMenuFilterNewLC ), + ENTRY( "Test_CMenuFilterFlagsOn", CMCSAPITest::Test_CMenuFilterFlagsOn ), + ENTRY( "Test_CMenuFilterFlagsOff", CMCSAPITest::Test_CMenuFilterFlagsOff ), + ENTRY( "Test_CMenuFilterType", CMCSAPITest::Test_CMenuFilterType ), + ENTRY( "Test_CMenuFilterNumAttributes", CMCSAPITest::Test_CMenuFilterNumAttributes ), + ENTRY( "Test_CMenuFilterGetAttribute", CMCSAPITest::Test_CMenuFilterGetAttribute ), + ENTRY( "Test_CMenuFilterReset", CMCSAPITest::Test_CMenuFilterReset ), + ENTRY( "Test_CMenuFilterSetFlags", CMCSAPITest::Test_CMenuFilterSetFlags ), + ENTRY( "Test_CMenuFilterSetType", CMCSAPITest::Test_CMenuFilterSetType ), + ENTRY( "Test_CMenuFilterHaveAttributeL", CMCSAPITest::Test_CMenuFilterHaveAttributeL ), + ENTRY( "Test_CMenuFilterDoNotHaveAttributeL", CMCSAPITest::Test_CMenuFilterDoNotHaveAttributeL ), + ENTRY( "Test_CMenuFilterRemoveAttribute", CMCSAPITest::Test_CMenuFilterRemoveAttribute ), + ENTRY( "Test_McsIconUtilityGetItemIconL", CMCSAPITest::Test_McsIconUtilityGetItemIconL ), + ENTRY( "Test_MenuUtilsGetTUint", CMCSAPITest::Test_MenuUtilsGetTUint ), + ENTRY( "Test_MenuUtilsSetTUint", CMCSAPITest::Test_MenuUtilsSetTUint ), + + ENTRY( "Test_MenuHandlerPluginNewL", CMCSAPITest::Test_MenuHandlerPluginNewL ), + ENTRY( "Test_MenuHandlerPluginDeleteL", CMCSAPITest::Test_MenuHandlerPluginDeleteL ), + ENTRY( "Test_MenuHandlerPluginConstructL", CMCSAPITest::Test_MenuHandlerPluginConstructL ), + + + ENTRY( "Test_TMenuItemConstructorL", CMCSAPITest::Test_TMenuItemConstructorL ), + ENTRY( "Test_TMenuItemId", CMCSAPITest::Test_TMenuItemId ), + ENTRY( "Test_TMenuItemParent", CMCSAPITest::Test_TMenuItemParent ), + ENTRY( "Test_TMenuItemFlags", CMCSAPITest::Test_TMenuItemFlags ), + ENTRY( "Test_TMenuItemType", CMCSAPITest::Test_TMenuItemType ), + ENTRY( "Test_TMenuItemSetId", CMCSAPITest::Test_TMenuItemSetId ), + ENTRY( "Test_TMenuItemSetParent", CMCSAPITest::Test_TMenuItemSetParent ), + ENTRY( "Test_TMenuItemSetFlags", CMCSAPITest::Test_TMenuItemSetFlags ), + ENTRY( "Test_TMenuItemSetType", CMCSAPITest::Test_TMenuItemSetType ), + ENTRY( "Test_RMenuConstructorL", CMCSAPITest::Test_RMenuConstructorL ), + ENTRY( "Test_CMenuFilterDestructorL", CMCSAPITest::Test_CMenuFilterDestructorL ), + ENTRY( "Test_CMenuHandlerSupportsType", CMCSAPITest::Test_CMenuHandlerSupportsType ), + ENTRY( "Test_CMenuHandlerHandleCommandL", CMCSAPITest::Test_CMenuHandlerHandleCommandL ), + ENTRY( "Test_CMenuHandlerDestructor", CMCSAPITest::Test_CMenuHandlerDestructor ), + ENTRY( "Test_RMenuNotifierConstructorL", CMCSAPITest::Test_RMenuNotifierConstructorL ), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapiutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsapiutils.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "mcsapitest.h" +#include "waitactive.h" +#include "mcsmenuopwatcher.h" + +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CClientServiceTester::CClientServiceTester +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// + + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMCSAPITest::CMCSAPITest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem ); + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMCSAPITest::ConstructL() + { + iTestUtils = CTestUtils::NewL(); + iSetupSuffix = 0; + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMCSAPITest* CMCSAPITest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CMCSAPITest* self = new (ELeave) CMCSAPITest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CMCSAPITest::~CMCSAPITest() + { + REComSession::FinalClose(); + delete iTestUtils; + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CMCSAPITest::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +TInt CMCSAPITest::SetupMenuL(RMenu& aMenu) + { +// aMenu.OpenL(_L("sapitest_menudata")); +// return KErrNone; + _LIT(KFileName, "sapitest_menudata"); + TBool deleteErr = iTestUtils->Delete( ); + TBool copyErr = iTestUtils->Copy( KFileName , ++iSetupSuffix); + WaitL( 20000 ); + TBuf<50> fileName(KFileName); + fileName.AppendNum(iSetupSuffix); + aMenu.OpenL(fileName); + return KErrNone; + + + } + +void CMCSAPITest::WaitL(TInt aMicroSec) + { + CWaitActive* wait = CWaitActive::NewL(); + wait->Wait(aMicroSec); + delete wait; + } + +TInt CMCSAPITest::SaveL(CMenuItem *aItem) + { + TInt result (KErrGeneral); + CMCSMenuOpWatcher* watcher = CMCSMenuOpWatcher::NewL(ETrue); + CleanupStack::PushL( watcher ); + + CMenuOperation* oper = aItem->SaveL(watcher->iStatus); + watcher->Watch( *oper ); + CActiveScheduler::Start(); + WaitL( 1000000 ); + result = watcher->GetStatus(); + CleanupStack::PopAndDestroy( watcher ); + return result; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/mcsmenuopwatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsmenuopwatcher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "mcsmenuopwatcher.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher* CMCSMenuOpWatcher::NewL( TBool aStopScheduler ) + { + CMCSMenuOpWatcher* self = new (ELeave) CMCSMenuOpWatcher(aStopScheduler); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher::CMCSMenuOpWatcher( TBool aStopScheduler ) + : CActive( CActive::EPriorityStandard ), + iStopScheduler(aStopScheduler) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher::~CMCSMenuOpWatcher() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// Watch Async +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::Watch( CMenuOperation& aOperation) + { + __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); + __ASSERT_DEBUG( !iOperation, User::Invariant() ); + iOperation = &aOperation; + SetActive(); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::RunL() + { + delete iOperation; + iOperation = NULL; + //TRAP_IGNORE( iObserver.MenuOpCompletedL(iStatus.Int() ) ); + if (iStopScheduler) + { + CActiveScheduler::Stop(); + } + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::DoCancel() + { + //iOperation->Cancel(); + delete iOperation; + iOperation = NULL; + } + +TInt CMCSMenuOpWatcher::GetStatus() + { + return iStatus.Int(); + } \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/mcsrequestnotification.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/mcsrequestnotification.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "mcsdef.h" +#include "mcsmenu.h" + +#include "mcsrequestnotification.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSReqNotification* CMCSReqNotification::NewL( RMenu& aMCS ) + { + CMCSReqNotification* self = new (ELeave) CMCSReqNotification(); + CleanupStack::PushL( self ); + self->ConstructL(aMCS); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSReqNotification::~CMCSReqNotification() + { + Cancel(); + iNotifier.Close(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSReqNotification::CMCSReqNotification() : CActive( EPriorityStandard ) + { + CActiveScheduler::Add ( this ); + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSReqNotification::ConstructL( RMenu& aMCS) + { + iStat = -2; + TInt err = KErrNone; + err = iNotifier.Open(aMCS); + iMCS = aMCS; + if(err != KErrNone) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::DoCancel() + { + iNotifier.Cancel(); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::RunL() + { + iStat = iStatus.Int(); + } + +// --------------------------------------------------------------------------- +// Start event's notifications +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::StartNotificationL(TInt aFolderId, + TInt aEvent ) + { + if(IsActive() ) + { + User::Leave( KErrInUse ); + } + iNotifier.Notify(aFolderId, aEvent, iStatus ); + SetActive(); + iStat = KErrNone; + } + +// --------------------------------------------------------------------------- +// Stop event's notifications +// --------------------------------------------------------------------------- +// +TInt CMCSReqNotification::GetStatus() + { + return iStat; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/testutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/testutils.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "testutils.h" + +_LIT(KMcsFolderC, "C:\\private\\200113dd\\content\\"); +_LIT(KMcsFolderImportC, "C:\\private\\200113dd\\import\\content\\"); +_LIT(KTestdataMCSFolder, "C:\\testing\\data\\MCSAPI\\"); +_LIT(KTestdataMCSFolderImport, "C:\\testing\\data\\MCSAPI\\import\\"); + +_LIT(KMcsFolderAllFilesC, "C:\\private\\200113dd\\content\\*.*"); + +//----------------------------------------------------------------------- +// CONSTRUCTION +// --------------------------------------------------------------------------- +// +CTestUtils* CTestUtils::NewL() + { + CTestUtils* self = CTestUtils::NewLC(); + CleanupStack::Pop(); + + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CTestUtils* CTestUtils::NewLC() + { + CTestUtils* self = new( ELeave ) CTestUtils(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor (virtual by CBase) +// --------------------------------------------------------------------------- +// +CTestUtils::~CTestUtils() + { + delete iFileManager; + iFs.Close(); + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CTestUtils::CTestUtils() + { + + } + +// --------------------------------------------------------------------------- +// Second phase construct +// --------------------------------------------------------------------------- +// +void CTestUtils::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + iFileManager = CFileMan::NewL( iFs ); + iFs.MkDirAll(KMcsFolderC); + iFs.MkDirAll(KMcsFolderImportC); + } + + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +TInt CTestUtils::Copy( const TDesC& aFileName, TInt aSuffix ) + { + _LIT(KXml, ".xml"); + TBuf<150> source(KTestdataMCSFolder); + TBuf<150> dest(KMcsFolderC); + source.Append( aFileName ); + source.Append( KXml ); + + dest.Append( aFileName ); + dest.AppendNum( aSuffix ); + dest.Append( KXml ); + + + return iFileManager->Copy(source, dest); + } + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +TInt CTestUtils::CopyImport( const TDesC& aFileName, TInt aSuffix ) + { + _LIT(KXml, ".xml"); + TBuf<150> source(KTestdataMCSFolderImport); + TBuf<150> dest(KMcsFolderImportC); + source.Append( aFileName ); + source.Append( KXml ); + + dest.Append( aFileName ); + dest.AppendNum( aSuffix ); + dest.Append( KXml ); + + + return iFileManager->Copy(source, dest); + } + + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +TInt CTestUtils::Copy( const TDesC& aSource, const TDesC& aDest ) + { + return iFileManager->Copy(aSource, aDest); + } + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +TInt CTestUtils::Delete( /*const TDesC& aFilePath*/ ) + { + return iFileManager->Delete( KMcsFolderAllFilesC ); + } + + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +void CTestUtils::InstallSisL( const TDesC& aName ) + { + + } + + +//----------------------------------------------------------------------- +// +//----------------------------------------------------------------------- +void CTestUtils::UninstallSisL( const TDesC& aName ) + { + + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_content_service_api/tsrc/src/waitactive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_content_service_api/tsrc/src/waitactive.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 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: +* +*/ + +#include "waitactive.h" + +// ======== MEMBER FUNCTIONS ======== + + +void CWaitActive::ConstructL() + { + CTimer::ConstructL(); + iActiveScheduler = new ( ELeave ) CActiveSchedulerWait(); + } + + +CWaitActive* CWaitActive::NewL() + { + CWaitActive* self = new( ELeave ) CWaitActive; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ---------------------------------------------------------------------------- +// CIsvTelCallAppTelephony::CIsvTelCallAppTelephony() +// Default constructor. +// ---------------------------------------------------------------------------- +// +CWaitActive::CWaitActive() + :CTimer( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CWaitActive::~CWaitActive() + { + Cancel(); + delete iActiveScheduler; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +void CWaitActive::Wait(TTimeIntervalMicroSeconds32 anInterval) + { + After(anInterval); + iActiveScheduler->Start(); + + } + + + +// ---------------------------------------------------------------------------- +// void CIsvTelCallAppTelephony::RunL() +// Handles the active object’s request completion event. +// ---------------------------------------------------------------------------- +// +void CWaitActive::CWaitActive::RunL() + { + // CActiveScheduler::Stop(); + iActiveScheduler->AsyncStop(); + + } + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_model_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_model_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: Menu model API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/menu2internalCRkeys.h MW_LAYER_PLATFORM_EXPORT_PATH(menu2internalcrkeys.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_model_api/inc/menu2internalCRkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_model_api/inc/menu2internalCRkeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 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 MENU2INTERNALCRKEYS_H +#define MENU2INTERNALCRKEYS_H + +// Menu API + +const TUid KCRUidMenu = {0x101f8847}; +// TARM KEYS +const TUint32 KMenuHideApplication = 0x00000008; +//#ifdef _CP_HIDDEN_APPS_AND_FOLDER +const TUint32 KMenuHideCPApplication = 0x0000000a; +const TUint32 KMenuHideCPFolder = 0x0000000b; +//#endif +// IN 3.1 this key is used only for setting status pane size +// 0 = normal status pane, 1 = flat status pane +const TUint32 KMenuGridMode = 0x00000007; + +const TUint32 KMenuForceShowAnimation = 0x0000000d; + +#endif // MENU2INTERNALCRKEYS_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_model_api/menu_model_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_model_api/menu_model_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,16 @@ + + + Menu model API + Interface with CR keys to MCS + c++ + menucontentsrv + + + + + + + no + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: Menu SAT interface API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/MenuSatInterface.h MW_LAYER_PLATFORM_EXPORT_PATH(MenuSatInterface.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/inc/MenuSatInterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/inc/MenuSatInterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002-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: Implements application shell SAT interface for external +* applications. +* +*/ + + + +#ifndef MENUSATINTERFACE_H +#define MENUSATINTERFACE_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Interface for accessing application shell externally. +* +* @lib MenuInterface.dll +* @since Series 60 3.1 +*/ +class CMenuSATInterface : public CBase + { + + public: // Constructors and destructor + /** + * + * Constructor + * + */ + IMPORT_C CMenuSATInterface(); + + public: // New functions + /** + * + * Shows/Hides Sat UI (SIM Services) from + * application shell. + * Uses Shared Data to pass the update info + * to AppShell + * @since Series 60 3.1 + * @param aVisible Flag to indicate if Sat Ui is + * made visible or hidden. + * @param aName New name for the application. + * @return Error code + */ + IMPORT_C TInt MakeSatUiVisible(TBool aVisible, const TDesC& aName=KNullDesC()); + + /** + * + * Shows/Hides Sat UI (SIM Services) from application shell. + * Uses Shared Data to pass the update info to AppShell + * @since Series 60 3.1 + * @param aVisible Flag to indicate if Sat Ui is made visible or hidden. + * @param aName New name for the application. + * @param aIconInfoId ID for icon info that can be used by AppShell for + * fecthing SatUi icon from SatServer. + * @return Error code + */ + IMPORT_C TInt MakeSatUiVisible + (TBool aVisible, const TDesC& aName, TUint8 aIconInfoId); + + private: + + /** + * Function for changing the values in central repository. Internal. + */ + TInt SetSatUiVisibilityData( TBool aVisible, const TDesC& aName, + TInt8 aIconInfoId ); +}; +#endif // MENUSATINTERFACE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/menu_sat_interface_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/menu_sat_interface_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + Menu SAT interface API + Interface for externally accessing SAT item in Application Shell. + c++ + menucontentsrv + + + + + + + + + no + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/conf/ui_menusatinterfacetest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/conf/ui_menusatinterfacetest.cfg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +[StifSettings] +[StifSettings] +CheckHeapBalance= off +[EndStifSettings] + +############################################################## +# Test +############################################################## + + +[Test] +title Test_SatUiVisibleL +create menusatinterfacetest msi +msi Test_SatUiVisibleL +delete msi +[Endtest] + +[Test] +title Test_SatUiVisibleIconIdL +create menusatinterfacetest msi +msi Test_SatUiVisibleIconIdL +delete msi +[Endtest] + +[Test] +title Test_SatInterfaceConstructL +create menusatinterfacetest msi +msi Test_SatInterfaceConstructL +delete msi +[Endtest] diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/data/satapi.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/data/satapi.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +rem /* +rem * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem * All rights reserved. +rem * This component and the accompanying materials are made available +rem * under the terms of "Eclipse Public License v1.0" +rem * which accompanies this distribution, and is available +rem * at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem * +rem * Initial Contributors: +rem * Nokia Corporation - initial contribution. +rem * +rem * Contributors: +rem * +rem * Description: +rem * +rem */ +md c:\data\stif\sat_results\ +ATSInterface.exe -testmodule TestScripter -config c:\testframework\ui_menusatinterfacetest.cfg \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/eabi/menusatinterfacetestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/eabi/menusatinterfacetestu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI11CWaitActive @ 2 NONAME + _ZTV11CWaitActive @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../init/ui_menusatinterfacetest.ini c:/testframework/ui_menusatinterfacetest.ini +../conf/ui_menusatinterfacetest.cfg c:/testframework/ui_menusatinterfacetest.cfg +../data/satapi.bat c:/satapi.bat + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +menusatinterfacetest.mmp + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/group/menusatinterfacetest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/group/menusatinterfacetest.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +TARGET menusatinterfacetest.dll +TARGETTYPE dll +UID 0x1000008D 0x02FE5167 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE menusatinterfacetest.cpp +SOURCE menusatinterfacetestblocks.cpp menusatinterfacetestutils.cpp waitactive.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY MenuInterface.lib + +LANG SC + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/group/menusatinterfacetest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/group/menusatinterfacetest.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +; +; Copyright (c) 2009 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: +; +; obrtester.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"satapitest"},(0x02FE5168),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install + + "\epoc32\release\armv5\urel\menusatinterfacetest.dll" - "!:\sys\bin\menusatinterfacetest.dll" + "..\init\ui_menusatinterfacetest.ini" -"!:\testframework\ui_menusatinterfacetest.ini" + "..\conf\ui_menusatinterfacetest.cfg" -"!:\testframework\ui_menusatinterfacetest.cfg" + "..\data\satapi.bat" -"!:\satapi.bat" diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/group/rd-key.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/group/rd-key.pem Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 +6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh +7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB +gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX +pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB +yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j +KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 +iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 +2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ +9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 +aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO +TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 +mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/group/rd.cer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/group/rd.cer Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z +NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl +cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT +rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa +gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI +f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL +BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud +IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD +ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd +IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE +IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G +CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 +Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT +7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR +-----END CERTIFICATE----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/inc/menusatinterfacetest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/inc/menusatinterfacetest.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2009 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 TESTCLASS_H +#define TESTCLASS_H + +// INCLUDES +#include +#include +#include +#include +#include +#include + + +#include + +// CLASS DECLARATION + +/** +* CMenuSatInterfaceTest test class for STIF Test Framework TestScripter. +* Class for testing CMenuSATInterface. +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CMenuSatInterfaceTest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMenuSatInterfaceTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CMenuSatInterfaceTest(); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + private: + + /** + * C++ default constructor. + */ + CMenuSatInterfaceTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Test methods are listed below. + */ + TInt Test_SatUiVisibleL(CStifItemParser& /*aItem*/ ); + TInt Test_SatUiVisibleIconIdL(CStifItemParser& /*aItem*/ ); + TInt Test_SatInterfaceConstructL(CStifItemParser& /*aItem*/ ); + + /** + * Utility methods are listed below. + */ + void WaitL(TInt aMicroSec); + + private: // Data + /** + * Data tosave enviroment statebefore testing. + */ + TInt iIconId; + + }; + +#endif // TESTCLASS_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/inc/waitactive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/inc/waitactive.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* 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: Plugin Interface +* +*/ + + +#ifndef C_WAITACTIVE_H +#define C_WAITACTIVE_H + +#include + +/** + * Helper wait active class + */ + class CWaitActive : public CTimer + { + +public: + + + static CWaitActive* NewL( ); + + ~CWaitActive(); + + void Wait(TTimeIntervalMicroSeconds32 anInterval); + +protected: + + /** + * From CActive, RunL. + * Handles the active object’s request completion event + */ + void RunL(); + + +private: + + CWaitActive(); + + void ConstructL(); + +private: + + /* + * Own. + */ + CActiveSchedulerWait* iActiveScheduler; + }; + + +#endif // C_WAITACTIVE_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/init/ui_menusatinterfacetest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/init/ui_menusatinterfacetest.ini Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,181 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\data\stif\sat_results\ +TestReportFileName= menusatinterfacetest_test_report + +TestReportFormat= HTML # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND +UITestingSupport= YES # Possible values: YES or NO +SeparateProcesses= YES # Possible values: YES or NO (default: NO) +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +#[New_Module] +#ModuleName= dom_test2 +#[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +[New_Module] +ModuleName= testscripter + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) + +TestCaseFile= c:\testframework\ui_menusatinterfacetest.cfg + + +[End_Module] + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIFTestFramework logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetest.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES +#include +#include +#include "menusatinterfacetest.h" + +//MCS +#include + +// CONSTANTS +_LIT( KSatName, "Plus Mega" ); + +// ============================ MEMBER FUNCTIONS =============================== + + +TInt CMenuSatInterfaceTest::Test_SatUiVisibleL(CStifItemParser& ) + { + TInt result (KErrGeneral); + + TBool visible = ETrue; + CMenuSATInterface* interface = new(ELeave) CMenuSATInterface(); + CleanupStack::PushL( interface ); + interface->MakeSatUiVisible( visible, KSatName ); + CleanupStack::PopAndDestroy( interface ); + + TBuf<256> name; + TInt error = RProperty::Get( KCRUidMenu, KMenuSatUIName, name ); + + if( name == KSatName() + && error == KErrNone ) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMenuSatInterfaceTest::Test_SatUiVisibleIconIdL(CStifItemParser& ) + { + TInt result (KErrGeneral); + + TBool visible = ETrue; + TUint8 iconInfoId = 21; + CMenuSATInterface* interface = new(ELeave) CMenuSATInterface(); + CleanupStack::PushL( interface ); + interface->MakeSatUiVisible( visible, KSatName, iconInfoId ); + CleanupStack::PopAndDestroy( interface ); + + TInt iconInfoIdTest = -1; + RProperty::Get( KCRUidMenu, KMenuSatUIIconId, iconInfoIdTest ); + + if( iconInfoIdTest == iconInfoId ) + { + result = KErrNone; + } + return result; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMenuSatInterfaceTest::Test_SatInterfaceConstructL(CStifItemParser& ) + { + TInt result (KErrGeneral); + + CMenuSATInterface* interface = new(ELeave) CMenuSATInterface(); + if( interface ) + { + result = KErrNone; + } + return result; + } + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetestblocks.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// INCLUDE FILES +#include +#include +#include +#include "menusatinterfacetest.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMenuSatInterfaceTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CMenuSatInterfaceTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + ENTRY( "Test_SatUiVisibleL", CMenuSatInterfaceTest::Test_SatUiVisibleL), + ENTRY( "Test_SatUiVisibleIconIdL", CMenuSatInterfaceTest::Test_SatUiVisibleIconIdL), + ENTRY( "Test_SatInterfaceConstructL", CMenuSatInterfaceTest::Test_SatInterfaceConstructL), + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetestutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/src/menusatinterfacetestutils.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include "menusatinterfacetest.h" +#include "waitactive.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CClientServiceTester::CClientServiceTester +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// + + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMenuSatInterfaceTest::CMenuSatInterfaceTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem ); + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMenuSatInterfaceTest::ConstructL() + { + ///save preconditions + RProperty::Get( KCRUidMenu, KMenuSatUIIconId, iIconId ); + //save preconditions + } + +// ----------------------------------------------------------------------------- +// CClientServiceTester::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMenuSatInterfaceTest* CMenuSatInterfaceTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CMenuSatInterfaceTest* self = new (ELeave) CMenuSatInterfaceTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CMenuSatInterfaceTest::~CMenuSatInterfaceTest() + { + ///load preconditions + RProperty::Set( KCRUidMenu, KMenuSatUIIconId, iIconId ); + //load preconditions + WaitL(20000); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CMenuSatInterfaceTest::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + + +void CMenuSatInterfaceTest::WaitL(TInt aMicroSec) + { + CWaitActive* wait = CWaitActive::NewL(); + wait->Wait(aMicroSec); + delete wait; + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/menu_sat_interface_api/tsrc/src/waitactive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/menu_sat_interface_api/tsrc/src/waitactive.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 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: +* +*/ + +#include "waitactive.h" + +// ======== MEMBER FUNCTIONS ======== + + +void CWaitActive::ConstructL() + { + CTimer::ConstructL(); + iActiveScheduler = new ( ELeave ) CActiveSchedulerWait(); + } + + +CWaitActive* CWaitActive::NewL() + { + CWaitActive* self = new( ELeave ) CWaitActive; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ---------------------------------------------------------------------------- +// CIsvTelCallAppTelephony::CIsvTelCallAppTelephony() +// Default constructor. +// ---------------------------------------------------------------------------- +// +CWaitActive::CWaitActive() + :CTimer( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CWaitActive::~CWaitActive() + { + Cancel(); + delete iActiveScheduler; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +void CWaitActive::Wait(TTimeIntervalMicroSeconds32 anInterval) + { + After(anInterval); + iActiveScheduler->Start(); + + } + + + +// ---------------------------------------------------------------------------- +// void CIsvTelCallAppTelephony::RunL() +// Handles the active object’s request completion event. +// ---------------------------------------------------------------------------- +// +void CWaitActive::CWaitActive::RunL() + { + // CActiveScheduler::Stop(); + iActiveScheduler->AsyncStop(); + + } + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/data/actionhandlerplugins.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/data/actionhandlerplugins.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: App for Action handler +* +*/ + + +#include +#include "ahpluginuids.hrh" + +// --------------------------------------------------------------------------- +// theInfo +// Declares info for implementations +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x10282E64; + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = KAHPluginInterfaceUid; + implementations = + { + // Info for App Handler + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282E5F; + version_no = 1; + display_name = "Implementation 1"; + default_data = "1"; + opaque_data = ""; + }, + // Info for Tel Handler + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282E61; + version_no = 1; + display_name = "Implementation 2"; + default_data = "2"; + opaque_data = ""; + }, + // Info for Message Handler + IMPLEMENTATION_INFO + { + implementation_uid = 0x10282E62; + version_no = 1; + display_name = "Implementation 3"; + default_data = "3"; + opaque_data = ""; + }, + // Info for HelpLauncher + IMPLEMENTATION_INFO + { + implementation_uid = 0x2001B285; + version_no = 1; + display_name = "Implementation 4"; + default_data = "4"; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/ahplugins.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2002-2004 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: Active Space Action Handler Plugins +* +*/ + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET actionhandlerplugins.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x10282E64 + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE proxy.cpp +SOURCE ahpapplauncher.cpp +SOURCE ahmessagehandler.cpp +SOURCE ahtelkeyhandler.cpp +SOURCE ahhelplauncher.cpp + + +SOURCEPATH ../data + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc + +APP_LAYER_SYSTEMINCLUDE + +start resource actionhandlerplugins.rss +HEADER +TARGET actionhandlerplugins.rsc +TARGETPATH resource/plugins +END + +LIBRARY euser.lib +LIBRARY ECom.lib +LIBRARY cone.lib +LIBRARY liwservicehandler.lib //LIW Framework +LIBRARY servicehandler.lib //AIW Framework +LIBRARY aiwdialdata.lib +LIBRARY apgrfx.lib +LIBRARY apparc.lib +LIBRARY sendui.lib +LIBRARY hlplch.lib +LIBRARY ws32.lib + + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002-2004 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: Active Space Action Handler Plugins +* +*/ + + + +PRJ_EXPORTS + + +PRJ_MMPFILES +ahplugins.mmp + + + +//End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahhelplauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahhelplauncher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,75 @@ +/* +* 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: ECOM Component + * +*/ + + +#ifndef C_ACTION_HANDLER_HELPLAUNCHER_H +#define C_ACTION_HANDLER_HELPLAUNCHER_H + +#include "ahplugin.h" +// FORWARD DECLARATION +class CLiwMap; + +/** + * Action Handler Help Launcher Plugin + * + * + * @lib ?library + * @since S60 v3.0 + */ +class CAHHelpLauncher : public CAHPlugin + { + +public: + + /** + * Two phase contruction + */ + static CAHHelpLauncher* NewL(); + + /** + * Two phase contruction + */ + static CAHHelpLauncher* NewLC(); + + /** + * Destructor + */ + ~CAHHelpLauncher(); + + /** + * Executes provided action + * + * @return status code + */ + + TInt ExecuteActionL( const CLiwMap* aMap ); +private: + + /** + * 2nd phase contructor + */ + void ConstructL(); + + TInt ExtractDesL( const CLiwMap* aMap, RBuf& aString, + const TDesC8& aMapName ); + + TInt ExtractUidL( const CLiwMap* aMap, TUid& aUid, + const TDesC8& aMapName ); + + }; + +#endif // C_ACTION_HANDLER_HELPLAUNCHER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahmessagehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahmessagehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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: ECOM Component + * +*/ + + +#ifndef C_ACTIVE_SPACE_MESSAGEHANDLER_H +#define C_ACTIVE_SPACE_MESSAGEHANDLER_H + +#include +#include "ahplugin.h" +// FORWARD DECLARATIONS +/** + * ActiveSpace Sms Handler Plugin + * + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CAHMessageHandler : public CAHPlugin + { + +public: + + /** + * Two phase contruction + */ + static CAHMessageHandler* NewL(); + + /** + * Two phase contruction + */ + static CAHMessageHandler* NewLC(); + + /** + * Destructor + */ + ~CAHMessageHandler(); + + /** + * Executes provided action + * + * @return status code + */ + TInt ExecuteActionL( const CLiwMap* aMap ); + +private: + + /** + * 2nd phase contructor + */ + void ConstructL(); + + }; + +#endif // C_ACTIVE_SPACE_MESSAGEHANDLER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahpapplauncher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahpapplauncher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,98 @@ +/* +* 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: ECOM Component + * +*/ + + +#ifndef C_ACTION_HANDLER_APPLAUNCHER_H +#define C_ACTION_HANDLER_APPLAUNCHER_H +#include +#include "ahplugin.h" +// FORWARD DECLARATION +class CEikonEnv; +class CLiwMap; +class TLiwVariant; +class TVwsViewId; + +/** + * Application Launcher Plugin + * + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CAHAppLauncher : public CAHPlugin + { + +public: + + /** + * Two phase contruction + */ + static CAHAppLauncher* NewL(); + + /** + * Two phase contruction + */ + static CAHAppLauncher* NewLC(); + + /** + * Destructor + */ + ~CAHAppLauncher(); + + /** + * Executes provided action + * + * @return status code + */ + TInt ExecuteActionL( const CLiwMap* aMap ); +private: + + TInt ExecuteTypeLaunchL( const CLiwMap* aMap ); + TInt ExecuteCommmandLineL( const CLiwMap* aMap ); + TInt ExecuteApaMessageL( const CLiwMap* aMap ); + TInt ExecuteActivateViewL( const CLiwMap* aMap ); + TInt StartDocumentL( const CLiwMap* aMap ); + TInt StartAppL( const CLiwMap* aMap ); + + TInt ExtractDesL( const CLiwMap* aMap, RBuf& aString, + const TDesC8& aMapName ); + + TInt ExtractDes8L( const CLiwMap* aMap, RBuf8& aString, + const TDesC8& aMapName ); + + TInt ExtractUidL( const CLiwMap* aMap, TUid& aUid, + const TDesC8& aMapName ); + + TInt ExtractViewIdL( const CLiwMap* aMap, TVwsViewId& aViewId ); + + TApaCommand GetCommandL( const CLiwMap* aMap ); + + /** + * 2nd phase contructor + */ + void ConstructL(); + +private: + //data + + /** + * A static CEikonEnv + */ + CEikonEnv* iEnv; + }; + +#endif // C_ACTION_HANDLER_APPLAUNCHER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/inc/ahtelkeyhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,61 @@ +/* +* 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: ECOM Component + * +*/ + + +#ifndef C_ACTIVE_SPACE_TELKEYHANDLER_H +#define C_ACTIVE_SPACE_TELKEYHANDLER_H + +#include +#include "ahplugin.h" +// FORWARD DECLARATIONS +class CAiwServiceHandler; + +/** + * ActiveSpace Telephony Key Handler Plugin + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CAHTelKeyHandler : public CAHPlugin + { + +public: + + static CAHTelKeyHandler* NewL(); + + static CAHTelKeyHandler* NewLC(); + + ~CAHTelKeyHandler(); + + /** + * Executes provided action + * + * @return status code + */ + TInt ExecuteActionL( const CLiwMap* aMap ); + +private: + + void ConstructL(); + +private: + + CAiwServiceHandler* iServiceHandler; + + }; + +#endif // C_ACTIVE_SPACE_TELKEYHANDLER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahhelplauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahhelplauncher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* 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: App for Action handler + * +*/ + + +#include +#include // help launcher +#include + +#include "ahproperties.hrh" +#include "ahhelplauncher.h" + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CAHHelpLauncher::ConstructL() + { + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHHelpLauncher* CAHHelpLauncher::NewL() + { + CAHHelpLauncher* self = CAHHelpLauncher::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHHelpLauncher* CAHHelpLauncher::NewLC() + { + CAHHelpLauncher* self = new( ELeave ) CAHHelpLauncher; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CAHHelpLauncher::~CAHHelpLauncher() + { + + } + +TInt CAHHelpLauncher::ExecuteActionL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TUid appUid= TUid::Null( ); + + RBuf helpString; + CleanupClosePushL( helpString ); + + if ( !ExtractUidL( aMap, appUid, KHelpUid ) + && !ExtractDesL( aMap, helpString, KHelpTopic ) ) + { + CArrayFixFlat* array = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL( array ); + array->AppendL( TCoeHelpContext( appUid, helpString ) ); + CleanupStack::Pop( array ); + HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession( ), array ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &helpString ); + + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHHelpLauncher::ExtractDesL( const CLiwMap* aMap, + RBuf& aString, const TDesC8& aMapName ) + { + TInt errCode(KErrNotFound); + TLiwVariant variant; + variant.PushL( ); + TPtrC tempString( KNullDesC ); + if ( aMap->FindL( aMapName, variant ) ) + { + variant.Get( tempString ); + aString.ReAllocL( tempString.Length( ) ); + aString.Append( tempString ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHHelpLauncher::ExtractUidL( const CLiwMap* aMap, TUid& aUid, + const TDesC8& aMapName ) + { + TInt errCode(KErrNotFound); + TInt32 temp( 0); + TLiwVariant variant; + variant.PushL( ); + if ( aMap->FindL( aMapName, variant ) ) + { + variant.Get( temp ); + aUid = TUid::Uid( temp ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahmessagehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahmessagehandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include +#include +#include +#include + +#include "ahmessagehandler.h" +#include "ahproperties.hrh" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAHMessageHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CAHMessageHandler::ConstructL() + { + //empty + } + +// ---------------------------------------------------------------------------- +// CAHMessageHandler::NewL +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHMessageHandler* CAHMessageHandler::NewL() + { + CAHMessageHandler* self = CAHMessageHandler::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAHMessageHandler::NewLC +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHMessageHandler* CAHMessageHandler::NewLC() + { + CAHMessageHandler* self = new( ELeave ) CAHMessageHandler; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// CAHMessageHandler::~CAHMessageHandler +// Destructor +// --------------------------------------------------------------------------- +CAHMessageHandler::~CAHMessageHandler() + { + + } +// --------------------------------------------------------------------------- +// CAHMessageHandler::ExecuteActionL +// Executes provided action +// --------------------------------------------------------------------------- +// +TInt CAHMessageHandler::ExecuteActionL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TLiwVariant variantAddress; + variantAddress.PushL( ); + TLiwVariant variantType; + variantType.PushL( ); + if ( aMap->FindL( KType, variantType ) + && aMap->FindL( KAddress, variantAddress ) ) + { + TPtrC request( KNullDesC ); + TPtrC address( KNullDesC ); + if ( variantType.Get( request ) && variantAddress.Get( address ) ) + { + TPtrC alias( KNullDesC ); + TLiwVariant variantAlias; + variantAlias.PushL( ); + if ( aMap->FindL( KAlias, variantAlias ) ) + { + variantAlias.Get( alias ); + } + CleanupStack::PopAndDestroy( &variantAlias ); + CMessageData* message = CMessageData::NewLC( ); + message->AppendToAddressL( address, alias ); + CSendUi* sendUi = CSendUi::NewLC( ); + if ( !request.Compare( KActionValueSendSMS ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, message, + TUid::Null( ), EFalse ); + } + else if ( !request.Compare( KActionValueSendMMS ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmMmsUid, message, + TUid::Null( ), EFalse ); + } + else if ( !request.Compare( KActionValueSendEmail ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmSmtpUid, message, + TUid::Null( ), EFalse ); + } + // clean up + CleanupStack::PopAndDestroy( sendUi ); + CleanupStack::PopAndDestroy( message ); + errCode= KErrNone; + } + } + CleanupStack::PopAndDestroy( &variantType ); + CleanupStack::PopAndDestroy( &variantAddress ); + return errCode; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahpapplauncher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,406 @@ +/* +* 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: App for Action handler + * +*/ + + +#include +#include +#include +#include +#include +#include +#include + +#include "ahproperties.hrh" +#include "ahpapplauncher.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CAHAppLauncher::ConstructL() + { + iEnv = CEikonEnv::Static( ); + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHAppLauncher* CAHAppLauncher::NewL() + { + CAHAppLauncher* self = CAHAppLauncher::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CAHAppLauncher* CAHAppLauncher::NewLC() + { + CAHAppLauncher* self = new( ELeave ) CAHAppLauncher; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CAHAppLauncher::~CAHAppLauncher() + { + } + +// --------------------------------------------------------------------------- +// Executes provided action +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExecuteTypeLaunchL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + RBuf launchMethod; + CleanupClosePushL( launchMethod ); + + if ( !ExtractDesL( aMap, launchMethod, KLaunchMethod ) ) + { + if ( !launchMethod.CompareF( KLaunchMethodValueCmdLine ) ) + { + errCode = ExecuteCommmandLineL( aMap ); + } + else if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithDoc ) + || !launchMethod.CompareF( KLaunchMethodValueMessageWithTail ) ) + { + errCode = ExecuteApaMessageL( aMap ); + } + } + + CleanupStack::PopAndDestroy( &launchMethod ); + return errCode; + } + +// --------------------------------------------------------------------------- +// Executes provided command line action +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExecuteCommmandLineL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TUid appUid= TUid::Null( ); + + if ( !ExtractUidL( aMap, appUid, KApplicationUid ) ) + { + RApaLsSession appSession; + CleanupClosePushL( appSession ); + User::LeaveIfError( appSession.Connect( ) ); + + CApaCommandLine* cmd = CApaCommandLine::NewLC( ); + cmd->SetCommandL( GetCommandL( aMap ) ); + RBuf documentNameValue; + CleanupClosePushL( documentNameValue ); + if( !ExtractDesL( aMap, documentNameValue, KDocumentName ) ) + { + cmd->SetDocumentNameL( documentNameValue ); + } + TApaAppInfo appInfo; + appSession.GetAppInfo( appInfo, appUid ); + cmd->SetExecutableNameL( appInfo.iFullName ); + errCode = appSession.StartApp( *cmd ); + + CleanupStack::PopAndDestroy( &documentNameValue ); + CleanupStack::PopAndDestroy( cmd ); + CleanupStack::PopAndDestroy( &appSession ); + } + return errCode; + } + +// --------------------------------------------------------------------------- +// Executes provided apa message action +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExecuteApaMessageL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TUid appUid= TUid::Null( ); + if ( !ExtractUidL( aMap, appUid, KApplicationUid ) ) + { + TApaTaskList taskList( iEnv->WsSession() ); + TApaTask task = taskList.FindApp( appUid ); + if ( task.Exists( ) ) + { + TUid messageUid= TUid::Null( ); + + RBuf8 additionalData; + CleanupClosePushL( additionalData ); + if ( !ExtractUidL( aMap, messageUid, KMessageUid ) + && !ExtractDes8L( aMap, additionalData, KAdditionalData ) ) + { + errCode = task.SendMessage( messageUid, additionalData ); + } + CleanupStack::PopAndDestroy( &additionalData ); + } + else + { // app not yet running + RBuf launchMethod; + CleanupClosePushL( launchMethod ); + if ( !ExtractDesL( aMap, launchMethod, KLaunchMethod ) ) + { + if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithDoc ) ) + { + errCode = StartDocumentL( aMap ) ; + } + else if ( !launchMethod.CompareF( KLaunchMethodValueMessageWithTail ) ) + { + errCode = StartAppL( aMap ); + } + } + CleanupStack::PopAndDestroy( &launchMethod ); + } + } + return errCode; + + } +// --------------------------------------------------------------------------- +// Start document +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::StartDocumentL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TUid appUid= TUid::Null( ); + RBuf documentNameValue; + CleanupClosePushL( documentNameValue ); + if ( !ExtractUidL( aMap, appUid, KApplicationUid ) + && !ExtractDesL( aMap, documentNameValue, KDocumentName ) ) + { + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); + User::LeaveIfError( appArcSession.Connect( ) ); + TThreadId id; + errCode = appArcSession.StartDocument( documentNameValue, appUid, id ); + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( &documentNameValue ); + return errCode; + } +// --------------------------------------------------------------------------- +// Starts application +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::StartAppL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TUid appUid= TUid::Null( ); + RBuf8 additionalData; + CleanupClosePushL( additionalData ); + if ( !ExtractUidL( aMap, appUid, KApplicationUid ) + && !ExtractDes8L( aMap, additionalData, KAdditionalData ) ) + { + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); + User::LeaveIfError( appArcSession.Connect( ) ); + TApaAppInfo appInfo; + errCode = appArcSession.GetAppInfo( appInfo, appUid ); + if ( errCode == KErrNone ) + { + CApaCommandLine* cmdLine = CApaCommandLine::NewLC( ); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + cmdLine->SetTailEndL( additionalData ); + + errCode = appArcSession.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy( cmdLine ); + } + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( &additionalData ); + return errCode; + } +// ---------------------------------------------------------------------------- +// Executes provided action - activate view +// ---------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExecuteActivateViewL( const CLiwMap* aMap ) + { + TInt errCode(KErrGeneral); + if ( iEnv ) + { + CCoeAppUi* appui = iEnv-> EikAppUi( ); + if ( appui ) + { + TUid messageUid= TUid::Null( ); + TVwsViewId viewId; + if ( !ExtractViewIdL( aMap, viewId ) ) + { + RBuf8 additionalData; + CleanupClosePushL( additionalData ); + if ( !ExtractUidL( aMap, messageUid, KMessageUid ) + && !ExtractDes8L( aMap, additionalData, KAdditionalData ) ) + { + appui->ActivateViewL( viewId, messageUid, additionalData ); + } + else + { + appui->ActivateViewL( viewId ); + } + errCode = KErrNone; + CleanupStack::PopAndDestroy( &additionalData ); + } + } + } + return errCode; + } + +// --------------------------------------------------------------------------- +// Executes provided action +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExecuteActionL( const CLiwMap* aMap ) + { + TInt errCode(KErrNotFound); + RBuf type; + CleanupClosePushL( type ); + errCode = ExtractDesL( aMap, type, KType ); + + if ( errCode == KErrNone ) + { + if ( !type.CompareF( KActionValueLaunchApplication ) ) + { + errCode = ExecuteTypeLaunchL( aMap ); + } + else if ( !type.CompareF( KActionValueViewActivation ) ) + { + errCode = ExecuteActivateViewL( aMap ); + } + } + CleanupStack::PopAndDestroy( &type ); + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExtractDesL( const CLiwMap* aMap, + RBuf& aString, const TDesC8& aMapName ) + { + TInt errCode(KErrNotFound); + TLiwVariant variant; + variant.PushL( ); + TPtrC tempString( KNullDesC ); + if ( aMap->FindL( aMapName, variant ) ) + { + variant.Get( tempString ); + aString.ReAllocL( tempString.Length( ) ); + aString.Append( tempString ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExtractDes8L( const CLiwMap* aMap, + RBuf8& aString, const TDesC8& aMapName ) + { + TInt errCode(KErrNotFound); + TLiwVariant variant; + variant.PushL( ); + TPtrC8 tempString( KNullDesC8 ); + if ( aMap->FindL( aMapName, variant ) ) + { + variant.Get( tempString ); + aString.ReAllocL( tempString.Length( ) ); + aString.Append( tempString ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExtractUidL( const CLiwMap* aMap, TUid& aUid, + const TDesC8& aMapName ) + + { + TInt errCode(KErrNotFound); + TInt32 temp; + TLiwVariant variant; + variant.PushL( ); + if ( aMap->FindL( aMapName, variant ) ) + { + variant.Get( temp ); + aUid = TUid::Uid( temp ); + errCode = KErrNone; + } + CleanupStack::PopAndDestroy( &variant ); + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAHAppLauncher::ExtractViewIdL( const CLiwMap* aMap, TVwsViewId& aViewId ) + + { + TInt errCode(KErrNotFound); + TLiwVariant variant; + if ( aMap->FindL( KViewId, variant ) ) + { + variant.Get( aViewId.iViewUid.iUid ); + variant.Reset( ); + if ( aMap->FindL( KViewAppUid, variant ) ) + { + variant.Get( aViewId.iAppUid.iUid ); + variant.Reset( ); + errCode = KErrNone; + } + } + + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TApaCommand CAHAppLauncher::GetCommandL( const CLiwMap* aMap ) + { + TApaCommand command(EApaCommandOpen); + RBuf appCommand; + CleanupClosePushL( appCommand ); + if ( ExtractDesL( aMap, appCommand, KApaCommand ) == KErrNone ) + { + if( appCommand.Compare( KApaCommandBackground ) == KErrNone ) + { + command = EApaCommandBackground; + } + } + CleanupStack::PopAndDestroy( &appCommand ); + return command; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/ahtelkeyhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include // AIW +#include //include\oem +#include + +#include "ahtelkeyhandler.h" +#include "ahproperties.hrh" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// 2nd phase constructor may leave +// --------------------------------------------------------------------------- +void CAHTelKeyHandler::ConstructL() + { + iServiceHandler = CAiwServiceHandler::NewL( ); + TAiwServiceCommands serviceCommand = KAiwCmdCall; + + //service command used as criteria item ID + _LIT8( KStar, "*" ); + CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( serviceCommand, + serviceCommand, KStar ); + + RCriteriaArray interest; + CleanupClosePushL( interest ); + // We are using a base service. + TUid base( KNullUid); + base.iUid = KAiwClassBase; + criteria->SetServiceClass( base ); + User::LeaveIfError( interest.Append( criteria ) ); + iServiceHandler->AttachL( interest ); + CleanupStack::PopAndDestroy( &interest ); + CleanupStack::PopAndDestroy( criteria ); + } + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +CAHTelKeyHandler* CAHTelKeyHandler::NewL() + { + CAHTelKeyHandler* self = CAHTelKeyHandler::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +CAHTelKeyHandler* CAHTelKeyHandler::NewLC() + { + CAHTelKeyHandler* self = new( ELeave ) CAHTelKeyHandler; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CAHTelKeyHandler::~CAHTelKeyHandler() + { + delete iServiceHandler; + } + +// --------------------------------------------------------------------------- +// Executes provided action +// --------------------------------------------------------------------------- +// +TInt CAHTelKeyHandler::ExecuteActionL( const CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + TLiwVariant variantNumber; + variantNumber.PushL( ); + if ( aMap->FindL( KNumber, variantNumber ) ) + { + TPtrC number( KNullDesC ); + if ( variantNumber.Get( number ) ) + { + CAiwDialData* dialData = CAiwDialData::NewLC( ); + dialData->SetCallType( CAiwDialData::EAIWVoice ); + dialData->SetPhoneNumberL( number ); + dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle ); + // Attach the interest to the AIW framework. + + // Set parameters for the AIW call + CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC( ); + CAiwGenericParamList& paramListOut = + iServiceHandler->OutParamListL( ); + + dialData->FillInParamListL( *paramList ); + iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, *paramList, + paramListOut, 0, NULL ); + errCode = KErrNone; + paramListOut.Reset( ); + CleanupStack::PopAndDestroy( paramList ); + CleanupStack::PopAndDestroy( dialData ); + } + } + CleanupStack::PopAndDestroy( &variantNumber ); + return errCode; + } +//End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerplugins/src/proxy.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2002-2004 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: Action Handler Plugins' Implementation Proxy + * +*/ + + +#include +#include +#include "ahpapplauncher.h" +#include "ahmessagehandler.h" +#include "ahtelkeyhandler.h" +#include "ahhelplauncher.h" + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x10282E5F, CAHAppLauncher::NewL ), + IMPLEMENTATION_PROXY_ENTRY( 0x10282E61, CAHTelKeyHandler::NewL ), + IMPLEMENTATION_PROXY_ENTRY( 0x10282E62, CAHMessageHandler::NewL ), + IMPLEMENTATION_PROXY_ENTRY( 0x2001B285, CAHHelpLauncher::NewL ), +}; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = + sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + + return ImplementationTable; + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/data/actionhandlerservice.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/data/actionhandlerservice.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 8000 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: Resource file +* +*/ + + +#include +#include + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x2000E538; + interfaces = + { + INTERFACE_INFO + { + // Base service class + interface_uid = KLiwClassBase; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000E539; + version_no = 1; + display_name = "Action Handler Service Provider"; + default_data = "Service.ActionHandler"; + opaque_data = "IDataAction"; + } + }; + } + }; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/actionhandlerservice.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/actionhandlerservice.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* 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: Project definition file for Action Handler Service +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET actionhandlerservice.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2000E538 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE actionhandlerservice.cpp +SOURCE actionhandlerinterface.cpp + +SOURCEPATH ../data +START RESOURCE actionhandlerservice.rss +TARGET actionhandlerservice.rsc +TARGETPATH /resource/plugins +END // RESOURCE + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY liwservicehandler.lib +LIBRARY estor.lib +LIBRARY ECom.lib +LIBRARY pluginvalidator.lib \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Build information file for project ?myapp +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +actionhandlerservice.mmp diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -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: + * +*/ + + +#ifndef C_ACTIONHANDLERINTERFACE_H +#define C_ACTIONHANDLERINTERFACE_H + +#include + +class CPluginValidator; +class CLiwMap; + +/** + * Class implements Action Handler Service Interface + * + * Action Handler itself is a component which enables + * to execute different kind of actions. + * + * @since S60 v3.2 + */ +class CActionHandlerInterface : public CBase, public MLiwInterface + { +public: + + static CActionHandlerInterface* NewL(); + + static CActionHandlerInterface* NewLC(); + + ~CActionHandlerInterface(); + + // from base class MLiwInterface + + /** + * The consumer application should call this method to execute a service + * command directly on the interface. + * + * @param aCmdName the name of the service command to invoke + * @param aInParamList the input parameter list, can be empty list + * @param [in,out] aOutParamList the output parameter list, can be empty. + * @param aCmdOptions Options for the command + * @param aCallback callback to be registered by consumer application + * + */ + void ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ); + + /** + * The consumer application should call this method if there + * are no more service commands to be executed on the interface. + * + */ + virtual void Close(); + +private: + + CActionHandlerInterface(); + + void ConstructL(); + + /** + * Get uid of the required plugin from aInParamList + * + * @since S60 v3.2 + * @param aInParamList param received from service client + * @param aUid source for the extracted uid of the plugin + * @return errCode + */ + TInt ExtractUid( const CLiwGenericParamList& aInParamList, TUid& aUid ); + + /** + * Get map from aInParamList + * + * @since S60 v3.2 + * @param aInParamList param received from service client + * @param aMap source for the exctracted map + * @return errCode + */ + TInt ExtractMap( const CLiwGenericParamList& aInParamList, CLiwMap* aMap ); + + TInt32 ErrCodeConversion( TInt code ); + + void ExecuteActionL( const TUid aUid, const CLiwMap* aMap ); + +private: + + // data + CPluginValidator* iPluginManager; + + }; + +#endif // C_ACTIONHANDLERINTERFACE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/actionhandlerservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,81 @@ +/* +* 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: + * +*/ + + +#ifndef C_ACTIONHANDLERSERVICE_H +#define C_ACTIONHANDLERSERVICE_H + +/** + * Class implements Action Handler Service Provider + * + * Action Handler itself is a component which enables + * to execute different kind of actions. + * + * @since S60 v3.2 + */ +class CActionHandlerService : public CLiwServiceIfBase + { +public: + + static CActionHandlerService* NewL(); + + ~CActionHandlerService(); + + // from base class CLiwServiceIfBase + + /** + * From CLiwServiceIfBase. + * Called by the LIW framework to initialise necessary information + * from the Service Handler. This method is called when the consumer makes + * the attach operation. + * + * @since S60 v3.2 + * @param aFrameworkCallback Framework provided callback + * @param aInterest List of criteria items which invoked the provider. + */ + void InitialiseL( MLiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest ); + + /** + * Executes generic service commands included in criteria. + * + * @param aCmdId Command to be executed. + * @param aInParamList Input parameters, can be an empty list. + * @param aOutParamList Output parameters, can be an empty list. + * @param aCmdOptions Options for the command + * @param aCallback Callback for asynchronous command handling, + * @leave KErrArgument Callback is missing when required. + * @leave KErrNotSupported No provider supports service. + */ + virtual void HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0, + const MLiwNotifyCallback* aCallback = NULL ); + +private: + + CActionHandlerService(); + + TInt32 ErrCodeConversion( TInt code ); + +private: + // data + + + }; + +#endif // C_ACTIONHANDLERSERVICE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/serviceerrno.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/inc/serviceerrno.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 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: Top level service provider error codes. +* +*/ + + +#ifndef SERVICEERRNO_H +#define SERVICEERRNO_H + +#define SERRBASE 1000 + +enum SapiErrors + { + + SErrNone , + + SErrInvalidServiceArgument = SERRBASE, + SErrUnknownArgumentName , + SErrBadArgumentType , + SErrMissingArgument , + SErrServiceNotSupported , + SErrServiceInUse , + SErrServiceNotReady , + SErrNoMemory , + SErrHardwareNotAvailable , + SErrServerBusy , + SErrEntryExists , + SErrAccessDenied , + SErrNotFound , + SErrUnknownFormat , + SErrGeneralError , + SErrCancelSuccess, + SErrServiceTimedOut + + }; + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,245 @@ +/* +* 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: + * +*/ + + +#include "ahplugin.h" +#include "cpluginvalidator.h" +#include "actionhandlerinterface.h" +#include "ahplugindefs.h" +#include "serviceerrno.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerInterface::CActionHandlerInterface() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CActionHandlerInterface::ConstructL() + { + iPluginManager = CPluginValidator::NewL( + TUid::Uid( KAHPluginInterfaceUid ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerInterface* CActionHandlerInterface::NewL() + { + CActionHandlerInterface* self = CActionHandlerInterface::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerInterface* CActionHandlerInterface::NewLC() + { + CActionHandlerInterface* self = new( ELeave ) CActionHandlerInterface; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerInterface::~CActionHandlerInterface() + { + delete iPluginManager; + } + +// --------------------------------------------------------------------------- +// Executes the SAPI as per params +// --------------------------------------------------------------------------- +// +void CActionHandlerInterface::ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + TInt errCode(KErrNotSupported); + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( ErrCodeConversion( KErrNone ) ) ) ); + // Check the command name;Cmd name should be Execute + if ( !aCmdName.Compare( KExecute ) && !aCallback && !aCmdOptions ) + { + TUid pluginUid= TUid::Null( ); + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + //extract command params + if ( !ExtractUid( aInParamList, pluginUid ) &&!ExtractMap( + aInParamList, map ) ) + { + TRAP(errCode, ExecuteActionL( pluginUid, map )); + } + else + { + errCode = KErrNotSupported; + } + CleanupStack::PopAndDestroy( map ); + } + if ( errCode != KErrNone ) + { + aOutParamList.Reset( ); + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( ErrCodeConversion( errCode ) ) ) ); + } + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CActionHandlerInterface::Close() + { + delete this; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CActionHandlerInterface::ExtractUid( + const CLiwGenericParamList& aInParamList, TUid& aUid ) + + { + TInt errCode(KErrArgument); + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aInParamList.FindFirst( pos, KPluginUid ); + if ( param && pos !=KErrNotFound ) + { + //get plugin uid + if ( param->Value().Get( aUid ) ) + { + errCode = KErrNone; + } + else + { + TUint plugin( 0 ); + if ( param->Value().Get( plugin ) ) + { + aUid = TUid::Uid( plugin ); + errCode = KErrNone; + } + } + } + return errCode; + } + +// --------------------------------------------------------------------------- +// Extract Map +// --------------------------------------------------------------------------- +// +TInt CActionHandlerInterface::ExtractMap( + const CLiwGenericParamList& aInParamList, CLiwMap* aMap ) + { + TInt errCode(KErrArgument); + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aInParamList.FindFirst( pos, KMap ); + if ( param && pos !=KErrNotFound ) + { + //get action type + if ( param->Value().Get( *aMap ) ) + { + errCode = KErrNone; + } + } + return errCode; + } + +// --------------------------------------------------------------------------- +// ErrCode Conversion +// --------------------------------------------------------------------------- +// +TInt32 CActionHandlerInterface::ErrCodeConversion( TInt code ) + { + TInt32 err; + switch ( code ) + { + case KErrNone: + err= SErrNone; + break; + + case KErrNotFound: + err= SErrNotFound; + break; + + case KErrNoMemory: + err = SErrNoMemory; + break; + + case KErrInUse: + err = SErrServiceInUse; + break; + + case KErrNotSupported: + err = SErrServiceNotSupported; + break; + + case KErrBadName: + err = SErrBadArgumentType; + break; + + case KErrArgument: + err = SErrInvalidServiceArgument; + break; + + default: + err = SErrGeneralError; + break; + } + + return err; + + } + +// --------------------------------------------------------------------------- +// CActionHandlerInterface::ExecuteActionL +// Gets required plugin and triggers action execution +// --------------------------------------------------------------------------- +// +void CActionHandlerInterface::ExecuteActionL( const TUid aUid, + const CLiwMap* aMap ) + { + __ASSERT_DEBUG( aMap , User::Panic( _L("actionhandlerinterface"), 0 ) ); + CAHPlugin* pluginInstance = + static_cast( iPluginManager->GetImplementation( aUid ) ); + + if ( pluginInstance ) + { + User::LeaveIfError( pluginInstance->ExecuteActionL( aMap ) ); + } + else + { + User::Leave( KErrNotFound ); + } + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/actionhandlerservice/src/actionhandlerservice.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,166 @@ +/* +* 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: + * +*/ + + +#include +#include +#include + +#include "ahplugindefs.h" +#include "actionhandlerservice.h" +#include "serviceerrno.h" + +#include "actionhandlerinterface.h" + +const TInt implUid( 0x2000E539); + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerService::CActionHandlerService() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerService* CActionHandlerService::NewL() + { + return new(ELeave) CActionHandlerService(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CActionHandlerService::~CActionHandlerService() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CActionHandlerService::InitialiseL( + MLiwNotifyCallback& /*aFrameworkCallback*/, const RCriteriaArray& /*aInterest*/) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CActionHandlerService::HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + const MLiwNotifyCallback* aCallback ) + + { + TInt errCode( KErrNotSupported ); + // Check the command name;Cmd name should be Execute + if ( aCmdId == KLiwCmdAsStr && !aCallback && !aCmdOptions ) + { + TInt pos = 0; + TPtrC8 cmdName; + const TLiwGenericParam* cmd= NULL; + cmd = aInParamList.FindFirst( pos, KCommand ); + if ( cmd && pos != KErrNotFound ) + { + cmdName.Set( cmd->Value().AsData( ) ); + if ( !cmdName.CompareF( KActionHandlerInterface ) ) + { + //Create interface pointer and return the output param + CActionHandlerInterface* ifp = + CActionHandlerInterface::NewLC( ); + aOutParamList.AppendL( TLiwGenericParam( + KActionHandlerInterface, TLiwVariant( ifp ) ) ); + CleanupStack::Pop( ifp ); + errCode = KErrNone; + } + } + else + { + errCode = KErrArgument; + } + } + if ( errCode != KErrNone ) + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( ErrCodeConversion( errCode ) ) ) ); + } + } + +// --------------------------------------------------------------------------- +// ErrCode Conversion +// --------------------------------------------------------------------------- +// +TInt32 CActionHandlerService::ErrCodeConversion( TInt code ) + { + TInt32 err; + switch ( code ) + { + + case KErrNotFound: + err= SErrNotFound; + break; + + case KErrNoMemory: + err = SErrNoMemory; + break; + + case KErrNotSupported: + err = SErrServiceNotSupported; + break; + + case KErrArgument: + err = SErrInvalidServiceArgument; + break; + + default: + err = SErrGeneralError; + break; + } + + return err; + + } + +// --------------------------------------------------------- +// Map the interface UIDs to implementation factory functions +// --------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( implUid,CActionHandlerService::NewL) + }; + +// --------------------------------------------------------- +// Exported proxy for instantiation method resolution +// --------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: Build information file for project +* +*/ + +#include +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../rom/actionhandler.iby CORE_MW_LAYER_IBY_EXPORT_PATH(actionhandler.iby) + +PRJ_MMPFILES +#include "../actionhandlerplugins/group/bld.inf" +#include "../actionhandlerservice/group/bld.inf" + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/inc/ahplugindefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/inc/ahplugindefs.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: Plugin Interface definistions / plugins uids + * +*/ + + + +#ifndef C_ACTION_HANDLER_PLUGINDEFS_H +#define C_ACTION_HANDLER_PLUGINDEFS_H + +#include "ahpluginuids.hrh" + +_LIT8( KActionHandlerInterface, "IDataAction" ); +_LIT8( KCommand, "cmd" ); + +// UID of this interface +const TInt32 KAHPluginInterface = + { + KAHPluginInterfaceUid + }; //{0x10089990}; + +//Supported Commands +_LIT8( KExecute, "Execute" ); + +// Input arguments +_LIT8( KPluginUid, "plugin_id" ); +_LIT8( KMap, "data" ); + +#endif //C_ACTION_HANDLER_PLUGINDEFS_H +//End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/inc/ahproperties.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/inc/ahproperties.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,70 @@ +/* +* 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: Resource headers for Action handler + * +*/ + + +#ifndef T_ACTIONHANDLERPROPERTIES_HRH +#define T_ACTIONHANDLERPROPERTIES_HRH + +const TUid KServerUid = + { + 0x20016B7B + }; + +/** Publisher activate*/ +enum TPublisherActivate + { + ECPDeActivate = 0, + ECPActivate = 1 + }; + +/** Possible types of an action */ +//map values +_LIT( KActionValueLaunchApplication, "launch_application" ); +_LIT( KActionValueViewActivation, "view_activation" ); +_LIT( KActionValueSendSMS, "send_sms" ); +_LIT( KActionValueSendMMS, "send_mms" ); +_LIT( KActionValueSendEmail, "send_email" ); +_LIT( KLaunchMethodValueCmdLine, "cmd_line" ); +_LIT( KLaunchMethodValueMessageWithDoc, "message_with_doc" ); +_LIT( KLaunchMethodValueMessageWithTail, "message_with_tail" ); +/** The application is to open the document specified on the command line. */ +_LIT( KApaCommandOpen, "apa_command_open" ); +/** The application is to open the last used document and to run in the background. */ +_LIT( KApaCommandBackground, "apa_command_background" ); + +//map kyes +_LIT8( KApplicationUid, "application_uid" ); +_LIT8( KMessageUid, "message_uid" ); +_LIT8( KViewId, "view_id" ); +_LIT8( KApaCommand, "apa_command" ); +_LIT8( KViewAppUid, "view_app_uid" ); +_LIT8( KAdditionalData, "additional_data" ); +_LIT8( KDocumentName, "document_name" ); + +_LIT8( KType, "type" ); +_LIT8( KLaunchMethod, "launch_method" ); +_LIT8( KAddress, "address" ); +_LIT8( KNumber, "number" ); +_LIT8( KAlias, "alias" ); + +_LIT8( KHelpUid, "help_uid" ); +_LIT8( KHelpTopic, "help_topic" ); + +_LIT8( KPublisher_Uid, "publisher_Uid" ); +_LIT8( KActivate, "Activate" ); + +#endif // T_ACTIONHANDLERPROPERTIES_HRH diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/rom/actionhandler.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/rom/actionhandler.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: IBY file for the Active space subsystem +* +*/ + + +#ifndef ACTIONHANDLER_IBY +#define ACTIONHANDLER_IBY + + +ECOM_PLUGIN(actionhandlerplugins.dll,actionhandlerplugins.rsc) +ECOM_PLUGIN(actionhandlerservice.dll,actionhandlerservice.rsc) + +#endif // ACTIONHANDLER_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_actionhandler/sapi_actionhandler.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_actionhandler/sapi_actionhandler.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,13 @@ + + +sapi_actionhandler +Action Handler Service API +c++ +contentpublishingsrv + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/data/bsservice.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/data/bsservice.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* 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: Resource definitions for project Back Stepping Service +* +*/ + + +#include +#include + +// --------------------------------------------------------------------------- +// theInfo +// ECOM plug-in registration info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x2000F83F; + interfaces = + { + INTERFACE_INFO + { + // Base service class + interface_uid = KLiwClassBase; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000F840; + version_no = 1; + display_name = "Back Stepping Service Provider"; + default_data = "Service.BackStepping"; + opaque_data = "IBackStepping"; + } + }; + } + }; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Build information file for project Back Stepping Service +* +*/ + +// MW_LAYER_PLATFORM_EXPORT_PATH macro definitions +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_MMPFILES +bsservice.mmp + +PRJ_EXPORTS +../rom/sapi_backstepping.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sapi_backstepping.iby) + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/group/bsservice.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/group/bsservice.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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: Project definition file for project Back Stepping Service +* +*/ + + +#include +#include + +TARGET bsservice.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2000F83F + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE bsclient.cpp +SOURCE bsserviceprovider.cpp +SOURCE bsserviceinterface.cpp + +SOURCEPATH ../data +START RESOURCE bsservice.rss +HEADER +TARGET bsservice.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // RESOURCE + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +MW_LAYER_SYSTEMINCLUDE + + +LIBRARY euser.lib +LIBRARY liwservicehandler.lib diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/inc/bsserviceinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/inc/bsserviceinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,174 @@ +/* +* 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: Back Stepping Service Interface + * +*/ + + +#ifndef C_BS_SERVICE_INTERFACE_H +#define C_BS_SERVICE_INTERFACE_H + +#include + +#include "bsclient.h" + +/** + * Back Stepping Service Interface. + * LIW interface for communication with BS Server. + * + * @since S60 v3.2 + */ +class CBSServiceInterface : public CBase, public MLiwInterface + { + +public: + + /** + * Two-phase constructor. + */ + static CBSServiceInterface* NewLC(); + + /** + * Destructor. + */ + ~CBSServiceInterface(); + + // from base class MLiwInterface + /** + * The consumer application should call this method to execute a service + * command directly on the interface. + * + * @param aCmdName the name of the service command to invoke + * @param aInParamList the input parameter list, can be empty list + * @param [in,out] aOutParamList the output parameter list, can be empty. + * @param aCmdOptions Options for the command + * @param aCallback callback to be registered by consumer application + * + */ + void ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0, + MLiwNotifyCallback* aCallback = 0 ); + + /** + * The consumer application should call this method if there + * are no more service commands to be executed on the interface. + */ + void Close(); + +private: + + // construction + /** + * Constructor. + */ + CBSServiceInterface(); + + /** + * Symbian 2nd phace constructor. + */ + void ConstructL(); + + // service handling methods + /** + * Handles Initialize command. + * + * @param aInParamList input parameter list + * @param aOutParamList output parameter list + */ + void InitializeL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Handles ForwardActivationEvent command. + * + * @param aInParamList input parameter list + * @param aOutParamList output parameter list + */ + void ForwardActivationEventL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Handles HandleBackCommand command. + * + * @param aInParamList input parameter list + * @param aOutParamList output parameter list + */ + void HandleBackCommandL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + // result handling + /** + * Appends error code to output parameter list. + * + * @param aOutParamList output parameter list + * @param aError error code + */ + void HandleErrorL( CLiwGenericParamList& aOutParamList, + const TInt aError ); + + /** + * Appends service result to output parameter list. + * + * @param aOutParamList output parameter list + * @param aError error code + */ + void HandleResultL( CLiwGenericParamList& aOutParamList, + const TInt aResult ); + + // utility methods + /** + * Extracts a TPtrC8 param from input parameter list. + * + * @param aInParamList input parameter list + * @param aParamName param name + * @param aPtr returned value + * @retutn Symbian error code + */ + TInt GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TPtrC8& aPtr ) const; + + /** + * Extracts a TInt32 param from input parameter list. + * + * @param aInParamList input parameter list + * @param aParamName param name + * @param aNumber returned value + * @retutn Symbian error code + */ + TInt GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TInt32& aNumber ) const; + + /** + * Extracts a TBool param from input parameter list. + * + * @param aInParamList input parameter list + * @param aParamName param name + * @param aBool returned value + * @retutn Symbian error code + */ + TInt GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TBool& aBool ) const; + +private: + // data + + /** + * BS Server client. + */ + RBSClient iBSClient; + + }; + +#endif // C_BS_SERVICE_INTERFACE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/inc/bsserviceprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/inc/bsserviceprovider.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* 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: Back Stepping Service Provider + * +*/ + + +#ifndef C_BS_SERVICE_PROVIDER_H +#define C_BS_SERVICE_PROVIDER_H + +#include + +/** + * Back Stepping Service Provider + * Serves as a LIW provider for the BS Service Interface. + * + * @since S60 v3.2 + */ +class CBSServiceProvider : public CLiwServiceIfBase + { + +public: + + /** + * Two-phase constructor. + */ + static CBSServiceProvider* NewL(); + + /** + * Destructor. + */ + ~CBSServiceProvider(); + + // from CLiwServiceIfBase + /** + * Called by the LIW framework to initialise necessary information + * from the Service Handler. This method is called when the consumer makes + * the attach operation. + * + * @since S60 v3.2 + * @param aFrameworkCallback Framework provided callback + * @param aInterest List of criteria items which invoked the provider + */ + void InitialiseL( MLiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest ); + + /** + * Executes generic service commands included in criteria. + * + * @param aCmdId Command to be executed + * @param aInParamList Input parameters, can be an empty list + * @param aOutParamList Output parameters, can be an empty list + * @param aCmdOptions Options for the command + * @param aCallback Callback for asynchronous command handling + */ + void HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0, + const MLiwNotifyCallback* aCallback = NULL ); + +private: + + /** + * Constructor. + */ + CBSServiceProvider(); + + // error handling + /** + * Appends error code to output parameter list. + * + * @param aOutParamList output parameter list + * @param aError error code + */ + void HandleErrorL( CLiwGenericParamList& aOutParamList, + const TInt aError ); + +private: + // data + + }; + +#endif // C_BS_SERVICE_PROVIDER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/rom/sapi_backstepping.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/rom/sapi_backstepping.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: +* +*/ + + +#ifndef SAPI_BACKSTEPPING_IBY +#define SAPI_BACKSTEPPING_IBY + +ECOM_PLUGIN(bsservice.dll,bsservice.rsc) + +#endif // SAPI_BACKSTEPPING_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/sapi_backstepping.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/sapi_backstepping.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,13 @@ + + +sapi_backstepping +Back Stepping Service API +c++ +backsteppingsrv + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/src/bsclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/src/bsclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Client session for BS engine + * +*/ + + +#include "bsclient.h" +#include "bsengineglobals.h" + +// Number of message slots to reserve for this client server session. +const TUint KDefaultMessageSlots( 5); + +// Function prototypes +static TInt StartServer(); +static TInt CreateServerProcess(); + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +RBSClient::RBSClient() : + RSessionBase() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// Connect to Active Data Server session. +// ----------------------------------------------------------------------------- +// +TInt RBSClient::Connect() + { + TInt error =:: StartServer(); + + if ( error == KErrNone ) + { + error = CreateSession( KBSEngineName, + Version(), + KDefaultMessageSlots ); + } + return error; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- + +TInt RBSClient::Initialize( TUid aApp ) + { + return SendReceive( EBSEngineInitialize, TIpcArgs( aApp.iUid ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- + +TInt RBSClient::ForwardActivationEvent( const TDesC8& aState, TBool aIsItem ) + { + TPtr8 state( (TUint8*) aState.Ptr( ), aState.Size( ), aState.Size( )); + return SendReceive( EBSEngineHandleActivationEvent, TIpcArgs( &state, + aIsItem ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- + +TInt RBSClient::HandleBackCommand( const TDesC8& aState, TBool aCheckOnly ) + { + TPtr8 state( (TUint8*) aState.Ptr( ), aState.Size( ), aState.Size( )); + return SendReceive( EBSEngineHandleBackCommand, TIpcArgs( &state, + aCheckOnly ) ); + } + +// ----------------------------------------------------------------------------- +// Version information. +// ----------------------------------------------------------------------------- +// +TVersion RBSClient::Version() const + { + return (TVersion( KBSEngineMajorVersionNumber, + KBSEngineMinorVersionNumber, KBSEngineBuildVersionNumber ) ); + } + +// ----------------------------------------------------------------------------- +// Static method to start the server. +// ----------------------------------------------------------------------------- +// +static TInt StartServer() + { + TInt result; + + TFindServer findServer( KBSEngineName ); + TFullName name; + + result = findServer.Next( name ); + if ( result != KErrNone ) + { + // Server not running + result = CreateServerProcess( ); + } + return result; + } + +// ----------------------------------------------------------------------------- +// Static method to create the server process. +// ----------------------------------------------------------------------------- +// +static TInt CreateServerProcess() + { + const TUidType serverUid( KNullUid, KNullUid, KServerUid3); + RProcess server; + TInt result; + result = server.Create( KBSEngineFilename, KNullDesC, serverUid ); + if ( result == KErrNone ) + { + TRequestStatus stat = KRequestPending; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); // abort startup + } + else + { + server.Resume( ); // logon OK - start the server + } + + User::WaitForRequest( stat ); // wait for start or death + // we can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + result = (server.ExitType( ) == EExitPanic ) ? KErrGeneral + : stat.Int( ); + } + server.Close( ); + return result; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/src/bsserviceinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/src/bsserviceinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,271 @@ +/* +* 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: Back Stepping Service Interface + * +*/ + + +#include "bsserviceinterface.h" +#include "bsserviceconstants.h" + +using namespace LIW; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceInterface::CBSServiceInterface() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::ConstructL() + { + User::LeaveIfError( iBSClient.Connect( ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceInterface* CBSServiceInterface::NewLC() + { + CBSServiceInterface* self = new( ELeave ) CBSServiceInterface; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceInterface::~CBSServiceInterface() + { + iBSClient.Close( ); + } + +// --------------------------------------------------------------------------- +// Executes the SAPI as per params +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + if ( !aCallback && !aCmdOptions ) + { + if ( !aCmdName.Compare( KBSCmdInitialize ) ) + { + InitializeL( aInParamList, aOutParamList ); + } + else if ( !aCmdName.Compare( KBSCmdForwardActivationEvent ) ) + { + ForwardActivationEventL( aInParamList, aOutParamList ); + } + else if ( !aCmdName.Compare( KBSCmdHandleBackCommand ) ) + { + HandleBackCommandL( aInParamList, aOutParamList ); + } + else + { + HandleErrorL( aOutParamList, KErrNotSupported ); + } + } + else + { + HandleErrorL( aOutParamList, KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::Close() + { + delete this; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::InitializeL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt32 appUid; + TInt err = GetParam( aInParamList, KBSInParamAppUid, appUid ); + if ( err == KErrNone ) + { + TInt retVal = iBSClient.Initialize( TUid::Uid( appUid ) ); + HandleResultL( aOutParamList, retVal ); + return; + } + + HandleErrorL( aOutParamList, err ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::ForwardActivationEventL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TPtrC8 state; + TInt err = GetParam( aInParamList, KBSInParamState, state ); + if ( err == KErrNone ) + { + TBool enter; + err = GetParam( aInParamList, KBSInParamEnter, enter ); + if ( err == KErrNone ) + { + TInt retVal = iBSClient.ForwardActivationEvent( state, enter ); + HandleResultL( aOutParamList, retVal ); + return; + } + } + + HandleErrorL( aOutParamList, err ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::HandleBackCommandL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TPtrC8 state; + TInt err = GetParam( aInParamList, KBSInParamState, state ); + + TBool checkOnly(EFalse); + if ( GetParam( aInParamList, KBSInParamCheckOnly, checkOnly ) != KErrNone ) + { + // use default value if parameter isn't correct + checkOnly = EFalse; + } + + if ( err == KErrNone ) + { + TInt retVal = iBSClient.HandleBackCommand( state, checkOnly ); + HandleResultL( aOutParamList, retVal ); + return; + } + + HandleErrorL( aOutParamList, err ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::HandleErrorL( CLiwGenericParamList& aOutParamList, + const TInt aError ) + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( aError ) ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceInterface::HandleResultL( CLiwGenericParamList& aOutParamList, + const TInt aResult ) + { + TLiwGenericParam statusInfo; + statusInfo.SetNameAndValueL( KBSOutParamStatusInfo, TLiwVariant( aResult ) ); + aOutParamList.AppendL( statusInfo ); + statusInfo.Reset( ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CBSServiceInterface::GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TPtrC8& aPtr ) const + { + TInt errCode(KErrArgument); + + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aInParamList.FindFirst( pos, aParamName ); + if ( param && (pos != KErrNotFound ) ) + { + if ( param->Value().Get( aPtr ) ) + { + errCode = KErrNone; + } + } + + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CBSServiceInterface::GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TInt32& aNumber ) const + { + TInt errCode(KErrArgument); + + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aInParamList.FindFirst( pos, aParamName ); + if ( param && (pos != KErrNotFound ) ) + { + if ( param->Value().Get( aNumber ) ) + { + errCode = KErrNone; + } + } + + return errCode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CBSServiceInterface::GetParam( const CLiwGenericParamList& aInParamList, + const TDesC8& aParamName, TBool& aBool ) const + { + TInt errCode(KErrArgument); + + const TLiwGenericParam* param= NULL; + TInt pos( 0); + param = aInParamList.FindFirst( pos, aParamName ); + if ( param && (pos != KErrNotFound ) ) + { + if ( param->Value().Get( aBool ) ) + { + errCode = KErrNone; + } + } + + return errCode; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_backstepping/src/bsserviceprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_backstepping/src/bsserviceprovider.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Back Stepping Service Provider + * +*/ + + +#include +#include + +#include "bsserviceprovider.h" +#include "bsserviceconstants.h" +#include "bsserviceinterface.h" + +using namespace LIW; + +// ======== LOCAL FUNCTIONS ========= + +// --------------------------------------------------------------------------- +// Map the interface UIDs to implementation factory functions +// --------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KBSServiceImplUid, CBSServiceProvider::NewL ) + }; + +// --------------------------------------------------------------------------- +// Exported proxy for instantiation method resolution +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceProvider::CBSServiceProvider() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceProvider* CBSServiceProvider::NewL() + { + return new (ELeave) CBSServiceProvider(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CBSServiceProvider::~CBSServiceProvider() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceProvider::InitialiseL( + MLiwNotifyCallback& /*aFrameworkCallback*/, const RCriteriaArray& /*aInterest*/) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceProvider::HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + const MLiwNotifyCallback* aCallback ) + + { + if ( (aCallback ) || (aCmdOptions ) ) + { + // report error if request is anything other than synchronous + // or user sends a callback parameter + HandleErrorL( aOutParamList, KErrNotSupported ); + return; + } + + TPtrC8 cmdName; + const TLiwGenericParam* cmd= NULL; + if ( aCmdId == KLiwCmdAsStr ) + { + TInt pos( 0); + cmd = aInParamList.FindFirst( pos, KGenericParamServiceCmdIDStr ); + if ( cmd ) + { + cmdName.Set( cmd->Value().AsData( ) ); + } + else + { + HandleErrorL( aOutParamList, KErrArgument ); + } + } + else + { + HandleErrorL( aOutParamList, KErrNotSupported ); + } + + if ( !cmdName.CompareF( KBSInterface ) ) + { + // create interface pointer and return the output param + CBSServiceInterface* ifp = CBSServiceInterface::NewLC( ); + aOutParamList.AppendL( TLiwGenericParam( KBSInterface, + TLiwVariant( ifp ) ) ); + CleanupStack::Pop( ifp ); + return; + } + else + { + HandleErrorL( aOutParamList, KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CBSServiceProvider::HandleErrorL( CLiwGenericParamList& aOutParamList, + const TInt aError ) + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( aError ) ) ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/data/cpclient.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/data/cpclient.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* 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: Resource file +* +*/ + + +#include +#include + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x20016B7D; + interfaces = + { + INTERFACE_INFO + { + // Base service class + interface_uid = KLiwClassBase; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20016B7E; + version_no = 1; + display_name = "Content Publisher Client Service Provider"; + default_data = "Service.ContentPublishing"; + opaque_data = "IDataSource"; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x2001955F; + version_no = 1; + display_name = "Content Publisher Client Service Provider"; + default_data = "Service.ContentPublishing"; + opaque_data = "IContentPublishing"; + } + }; + } + }; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 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: Build information file for Content Publisher Service +* +*/ + +#include + +PRJ_PLATFORMS + +DEFAULT + + +PRJ_EXPORTS +../rom/sapi_contentpublishing.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sapi_contentpublishing.iby) + + +PRJ_MMPFILES +cpclient.mmp + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/group/cpclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/group/cpclient.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 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: ?Description +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET cpclient.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20016B7D + +CAPABILITY CAP_ECOM_PLUGIN + +VENDORID VID_DEFAULT + +LANG SC + +SOURCEPATH ../src +SOURCE cpclient.cpp +SOURCE cpclientsession.cpp +SOURCE cpclientactivenotifier.cpp +SOURCE cdatasourceinterface.cpp +SOURCE ccontentpublishinginterface.cpp +SOURCE cpclientiterable.cpp +SOURCE cpclientservice.cpp + + +SOURCEPATH ../data +START RESOURCE cpclient.rss +TARGET cpclient.rsc +TARGETPATH /resource/plugins +END // RESOURCE + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY efsrv.lib +LIBRARY liwservicehandler.lib +LIBRARY cputils.lib + +#ifdef CONTENT_PUBLISHER_DEBUG +LIBRARY cpdebug.lib +#endif + +//end of file + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/ccontentpublishinginterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/ccontentpublishinginterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* 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: CPS Service Content Interface + * +*/ + + +#ifndef CCONTENTPUBLISHINGINTERFACE_H +#define CCONTENTPUBLISHINGINTERFACE_H + +#include "cdatasourceinterface.h" + +/** + * CPS Service Interface + * + * This class implements interface to CPS Service. + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +class CContentPublishingInterface : public CDataSourceInterface + { +public: + + /** + * Two-phased constructor. + */ + static CContentPublishingInterface* NewL(); + + /** + * Two-phased constructor. + */ + static CContentPublishingInterface* NewLC(); + + /** + * Desctructor. + */ + ~CContentPublishingInterface(); + +private: + + /** + * C++ default constructor. + */ + CContentPublishingInterface(); + + /** + * Perform the second phase construction of a CCPClientInterface object. + */ + void ConstructL(); + + /** + * Proccess request issued by service client. + * + * @param aCmdName the name of the service command to invoke + * @param aInParamList the input parameter list, can be empty list + * @param [in,out] aOutParamList the output parameter list, can be empty. + * @param aCmdOptions Options for the command + * @param aCallback callback to be registered by consumer application + * + */ + virtual void ProcessCommandL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ); + +private: + // data + + }; + +#endif // CCONTENTPUBLISHINGINTERFACE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cdatasourceinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cdatasourceinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* 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: CPS Service Interface + * +*/ + + +#ifndef CDATASOURCEINTERFACE_H +#define CDATASOURCEINTERFACE_H + +#include + +class CCPClient; + +/** + * CPS Service Interface + * + * This class implements interface to CPS Service. + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +class CDataSourceInterface : public CBase, public MLiwInterface + { +public: + + /** + * Two-phased constructor. + */ + static CDataSourceInterface* NewL(); + + /** + * Two-phased constructor. + */ + static CDataSourceInterface* NewLC(); + + /** + * Desctructor. + */ + ~CDataSourceInterface(); + + // from base class MLiwInterface + + /** + * The consumer application should call this method to execute a service + * command directly on the interface. + * + * @param aCmdName the name of the service command to invoke + * @param aInParamList the input parameter list, can be empty list + * @param [in,out] aOutParamList the output parameter list, can be empty. + * @param aCmdOptions Options for the command + * @param aCallback callback to be registered by consumer application + * + */ + void ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ); + + /** + * The consumer application should call this method if there + * are no more service commands to be executed on the interface. + * + */ + virtual void Close(); + +protected: + + /** + * C++ default constructor. + */ + CDataSourceInterface(); + /** + * Perform the second phase construction of a CCPClientInterface object. + */ + void ConstructL(); + + /** + * Proccess request issued by service client. + * + * @param aCmdName the name of the service command to invoke + * @param aInParamList the input parameter list, can be empty list + * @param [in,out] aOutParamList the output parameter list, can be empty. + * @param aCmdOptions Options for the command + * @param aCallback callback to be registered by consumer application + * + */ + virtual void ProcessCommandL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ); + +public: + + /** + * Converse error code + * @param code the error + * @return TInt32 the error code after converse + */ + static TInt32 ErrCodeConversion( TInt code ); + +protected: + // data + + /** + * Client to CPS Server. Containing active object + * to handle asynchornous requests. + * Own. + */ + CCPClient* iCPClient; + }; + +#endif // CDATASOURCEINTERFACE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclient.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 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: Content Publisher server client + * +*/ + + +#ifndef CPCLIENT_H +#define CPCLIENT_H + +// INCLUDES +#include "cpclientsession.h" + +// FORWARD DECLARATIONS +#ifdef CONTENT_PUBLISHER_DEBUG +class CCPDebug; +#endif +class CLiwGenericParamList; +class CCPActiveNotifier; +class CCPLiwMap; +class MLiwNotifyCallback; +class CLiwDefaultMap; + +// CLASS DECLARATION + +/** + * Client-side interface to Content Publisher + * + * This class provides the client-side interface to the Content Publisher + * server. + * + * @lib cpclient.dll + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + */ +class CCPClient : public CBase + { +public: + + /** + * Two-phased constructor. + */ + static CCPClient* NewL(); + + /** + * Two-phased constructor. + */ + static CCPClient* NewLC(); + + /** + * Destructor. + */ + ~CCPClient(); + + /** + * Send command to server to GetList of data from Content Publisher Database + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list (filter) + * @param aOutParamList output parameter list (iterable of maps) + */ + void GetListL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Send command to server to Add data to Content Publisher Database + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list (data to add) + * @param aOutParamList output parameter list (id of data or error code) + * @param aCmdOptions options for the command + */ + void AddL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions ); + + /** + * Send command to server to Delete data from Content Publisher Database + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list (filter) + */ + void DeleteL( const CLiwGenericParamList& aInParamList ); + + /** + * Send command to server to Register observer for notifications + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aObserver + */ + void RegisterObserverL( MLiwNotifyCallback* aObserver, + const CLiwGenericParamList& aInParamList, TInt32 aTransactionId ); + + /** + * Unregister observer if Transaction Id provided or all observers if not + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list (transactionId) + */ + void UnregisterObserversL( const CLiwGenericParamList& aInParamList ); + + /** + * Send command to server to ExecuteAction + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list (filter) + * @param aOutParamList output action_map + */ + void ExecuteActionL( const CLiwGenericParamList& aInParamList ); + + /** + * Check second param from IDataSource interface + * + * @since S6CCPActiveNotifierNotifier v 5.CCPActiveNotifierNotifier + * @param aInParamList input parameter list + * @param aKey key with map + */ + void CheckMapL( const CLiwGenericParamList& aInParamList, + const TDesC8& aKey ); + +private: + + /** + * C++ default constructor. + */ + CCPClient(); + + /** + * Perform the second phase construction of a CCPClient object. + */ + void ConstructL(); + +private: + //data + + /** + * Client-server session + */ + RCPServerClient iServerClient; + /** + * Pointer to an active object + * Own. + */ + CCPActiveNotifier * iActiveNotifier; + +#ifdef CONTENT_PUBLISHER_DEBUG + CCPDebug* iDebug; +#endif + + }; + +#endif // CPCLIENT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cpclientactivenotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientactivenotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,155 @@ +/* +* 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: Active notifier class + * +*/ + + +#ifndef CPCLIENTACTIVENOTIFIER_H +#define CPCLIENTACTIVENOTIFIER_H + +// INCLUDES +#include +#include "cpclientsession.h" + +class MLiwNotifyCallback; +/** + * Content publisher active notifier class + * + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +class CCPActiveNotifier : public CActive + { +public: + + /** + * Two-phased constructor. + * + */ + static CCPActiveNotifier* NewL( RCPServerClient& aServerClient ); + + /** + * Desctructor. + */ + ~CCPActiveNotifier(); + + /** + * Register observer + * + * @param aObserver Pointer for callback + * @param aMap Map containing parameters + * @param aTransactionId Integer transaction id + */ + void RegisterL( MLiwNotifyCallback* aObserver, TInt32 aTransactionId, + CCPLiwMap* aMap ); + + /** + * Unregister observer + * + * @since S60 v 5.0 + */ + void UnregisterL(); + + /** + * Unregister observer + * + * @since S60 v 5.0 + * @param aTransactionId Integer transaction id + * @return returns ETrue if last observer was unregistered + */ + TBool UnregisterL( TInt32 aTransactionId ); + + + /** + * Unregister all observers + * @since S60 v 5.0 + */ + void UnregisterAllL( ); + +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. + * Implements cancellation of an outstanding request. + */ + TInt RunError( TInt aError ); + +private: + + /** + * C++ default constructor. + */ + CCPActiveNotifier( RCPServerClient& aServerClient ); + + /** + * Perform the second phase construction of a CCPActiveNotifier object. + */ + void ConstructL(); + + /* + * Notify all observers + */ + void NotifyObserversL( TInt aErrorCode, + CLiwGenericParamList* aEventParamList ); + + /* + * Register observer + */ + void RegisterAgainL( ); + + +private: + + /** + * Descriptor where server can write to when passing data + * Own. + */ + HBufC8 *iObserverBuf; + + /** + * Size of the descriptor passed between server and client + * Own. + */ + TPckgBuf* iSizeDes; + + + /** + * Client-server session + * Not Own. + */ + RCPServerClient iServerClient; + + /* + * Array containing all observers + * Own + */ + RHashMap iObservers; + + }; + +#endif // CPCLIENTACTIVENOTIFIER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cpclientiterable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientiterable.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2006-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: CPS Client iterable + * +*/ + + +#ifndef C_CPSERVERITERABLE_H +#define C_CPSERVERITERABLE_H + +#include + +/** + * Implemenation of abstract interface to iterate over data items + * returned by CPS Server + * + * @see CLiwIterable + * + */ +class CCPClientIterable : public CLiwIterable + { +public: + + /** + * Two-phase Constructor + * @param aList list to be iterated + * @return new CIterableCalList object + */ + static CCPClientIterable* NewL( CLiwGenericParamList* aList ); + + /** + * Resets the iterator. + * + * @return void + */ + void Reset(); + + /** + * Iterates over the collection entries to fetch the next data element. + * + * @param aValue contains the next data element + * + * @return false if there are no more data elements to be fetched; + * true otherwise + */ + TBool NextL( TLiwVariant& aValue ); + + /** + * Destructor. + */ + ~CCPClientIterable(); + +private: + + /** + * C++ default constructor. + */ + CCPClientIterable( CLiwGenericParamList* aList ); + + /** + * Exctracts maps stored inside aMap as binaries and + * inserts them as CLiwDefaultMap + * + * @param aMap Source and target of the operation + */ + void ExctractBinariesL( CLiwDefaultMap& aMap ); + +private: + + /** + * CLiwGenericParamList class pointer + * Own. + */ + CLiwGenericParamList* iList; + + /** + * Position on iList + * Own. + */ + TInt iPos; + + }; + +#endif // C_CPSERVERITERABLE_H +// end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cpclientservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: CPS Client Service + * +*/ + + +#ifndef CPCLIENTSERVICE_H +#define CPCLIENTSERVICE_H + +/** + * CPS Service Provider + * + * This class implements new LIW Service Provider. + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +class CCPClientService : public CLiwServiceIfBase + { +public: + + /** + * Two-phase Constructor + */ + static CCPClientService* NewL(); + + /** + * Destructor. + */ + ~CCPClientService(); + + // from base class CLiwServiceIfBase + + /** + * From CLiwServiceIfBase. + * Called by the LIW framework to initialise necessary information + * from the Service Handler. This method is called when the consumer makes + * the attach operation. + * + * @since S60 v3.2 + * @param aFrameworkCallback Framework provided callback + * @param aInterest List of criteria items which invoked the provider. + */ + void InitialiseL( MLiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest ); + + /** + * Executes generic service commands included in criteria. + * + * @param aCmdId Command to be executed. + * @param aInParamList Input parameters, can be an empty list. + * @param aOutParamList Output parameters, can be an empty list. + * @param aCmdOptions Options for the command + * @param aCallback Callback for asynchronous command handling, + * @leave KErrArgument Callback is missing when required. + * @leave KErrNotSupported No provider supports service. + */ + virtual void HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0, + const MLiwNotifyCallback* aCallback = NULL ); + +private: + + /** + * C++ default constructor. + */ + CCPClientService(); + +private: + // data + + + }; + +#endif // CPCLIENTSERVICE_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/cpclientsession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* +* 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: Content Publisher server client + * +*/ + + +#ifndef CPCLIENTSESSION_H +#define CPCLIENTSESSION_H + +// INCLUDES + +#include + +// FORWARD DECLARATIONS +class CLiwGenericParamList; +class CCPActive; +class CCPLiwMap; + +// CLASS DECLARATION +/** + * Client-side interface to CPS Server + * + * This class provides the client-side interface to the active data server session, + * it just passes requests to the server. + * + */ +class RCPServerClient : public RSessionBase + { +public: + + /** + * Construct the object. + */ + RCPServerClient(); + + /** + * Connects to the server and create a session. + * When the server is not running, the function starts the server. + * @return error code + */ + TInt Connect(); + + /** + * Pass Add request to the server + * + * @since S60 v 5.0 + * @param aInParamList const reference to the input list + * @param aOutParamList reference to the output list + */ + void AddL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions ); + + /** + * Pass GetList request to the server + * + * @since S60 v 5.0 + * @param aInParamList const reference to the input list + * @param aOutParamList reference to the output list + */ + void GetListL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList ); + + /** + * Pass Delete request to the server + * + * @since S60 v 5.0 + * @param aInParamList const reference to the input list + */ + void DeleteL( const CCPLiwMap& aMapt ); + + /** + * Pass RegisterObserver request to the server + * + * @since S60 v 5.0 + * @param aStatus ? + * @param aBuf ? + * @param aSize ? + * @return error code + */ + void RegisterObserverL( TRequestStatus& aStatus, TIpcArgs& aArgs ); + + /** + * Pass AddObserver request to the server + * + * @since S60 v 5.0 + * @return error code + */ + void AddObserver( TIpcArgs& aArgs ); + + /** + * Pass RemoveObserver request to the server + * + * @since S60 v 5.0 + * @return error code + */ + void RemoveObserver( TIpcArgs& aArgs ); + + /** + * Pass ExecuteAction request to the server + * + * @since S60 v 5.0 + * @param aInParamList const reference to the input list + */ + void ExecuteActionL( const CCPLiwMap& aMap ); + + /** + * Pass GetChangeInfoData request to server + * @param aBuf reference to the input list + * @return error code + */ + TInt GetChangeInfoData( TDes8& aBuf ); + /** + * Pass Activate request to the server + * + * @since S60 v 5.0 + * @param aInParamList const reference to the input list + */ + void ActivateL( const CCPLiwMap& aMap, TUint aOptions = 0 ); + + /** + * Pass UnregisterObserver request to the server + * + * @since S60 v 5.0 + * @return error code + */ + void UnregisterObserver(); + + /** + * Closes session + * + * @since S60 v 5.0 + */ + void Close(); + + /** + * Return version information + */ + TVersion Version() const; + +private: + //private methods + + }; + +#endif // CPCLIENTSESSION_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/inc/serviceerrno.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/inc/serviceerrno.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 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: Top level service provider error codes. +* +*/ + +#ifndef SERVICEERRNO_H +#define SERVICEERRNO_H + +#define SERRBASE 1000 + +enum SapiErrors + { + + SErrNone , + + SErrInvalidServiceArgument = SERRBASE, + SErrUnknownArgumentName , + SErrBadArgumentType , + SErrMissingArgument , + SErrServiceNotSupported , + SErrServiceInUse , + SErrServiceNotReady , + SErrNoMemory , + SErrHardwareNotAvailable , + SErrServerBusy , + SErrEntryExists , + SErrAccessDenied , + SErrNotFound , + SErrUnknownFormat , + SErrGeneralError , + SErrCancelSuccess, + SErrServiceTimedOut + + }; + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/rom/sapi_contentpublishing.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/rom/sapi_contentpublishing.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: IBY file for the content publishing +* +*/ + + +#ifndef SAPI_CONTENTPUBLISHING_IBY +#define SAPI_CONTENTPUBLISHING_IBY + +ECOM_PLUGIN(cpclient.dll,cpclientservice.rsc) + +#endif // SAPI_CONTENTPUBLISHING_IBY + +// End of File \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/sapi_contentpublishing.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/sapi_contentpublishing.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,13 @@ + + +sapi_contentpublishing +Content Publishing Service API +c++ +contentpublishingsrv + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/ccontentpublishinginterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +/* +* 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: + * +*/ + + +#include + +#include "ccontentpublishinginterface.h" +#include "cpdebug.h" +#include "cpglobals.h" +#include "cpclient.h" +#include "cpclientiterable.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CContentPublishingInterface* CContentPublishingInterface::NewL() + { + CContentPublishingInterface* self = CContentPublishingInterface::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CContentPublishingInterface* CContentPublishingInterface::NewLC() + { + CContentPublishingInterface* self = + new( ELeave ) CContentPublishingInterface; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CContentPublishingInterface::~CContentPublishingInterface() + { + CP_DEBUG( _L8("CContentPublishingInterface::~CContentPublishingInterface") ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CContentPublishingInterface::CContentPublishingInterface() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentPublishingInterface::ConstructL() + { + CP_DEBUG( _L8("CContentPublishingInterface::ConstructL") ); + CDataSourceInterface::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CContentPublishingInterface::ProcessCommandL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + CP_DEBUG( _L8("CContentPublishingInterface::ProcessCommandL") ); + + if ( aCmdName.CompareF( KExecuteAction ) == 0 ) + { + iCPClient->ExecuteActionL( aInParamList ); + } + else + { + CDataSourceInterface::ProcessCommandL(aCmdName, + aInParamList, aOutParamList, aCmdOptions, aCallback); + } + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cdatasourceinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cdatasourceinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,238 @@ +/* +* 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: + * +*/ + + +#include + +#include "cdatasourceinterface.h" +#include "cpdebug.h" +#include "cpglobals.h" +#include "cpclient.h" +#include "serviceerrno.h" +#include "cpclientiterable.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CDataSourceInterface* CDataSourceInterface::NewL() + { + CDataSourceInterface* self = CDataSourceInterface::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CDataSourceInterface* CDataSourceInterface::NewLC() + { + CDataSourceInterface* self = new( ELeave ) CDataSourceInterface; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CDataSourceInterface::~CDataSourceInterface() + { + CP_DEBUG( _L8("CDataSourceInterface::~CDataSourceInterface") ); + delete iCPClient; + } + +// --------------------------------------------------------------------------- +// Executes the SAPI as per params +// --------------------------------------------------------------------------- +// +void CDataSourceInterface::ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + CP_DEBUG( _L8("CCPClientInterface::ExecuteCmdL") ); + TInt errCode(KErrNone); + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( ErrCodeConversion( KErrNone ) ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( ErrCodeConversion( KErrNone ) ) ) ); + // Check the command name + TRAP( errCode , ProcessCommandL( aCmdName, aInParamList, + aOutParamList, + aCmdOptions, + aCallback ) ); + if ( errCode != KErrNone ) + { + aOutParamList.Reset( ); + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( ErrCodeConversion( errCode ) ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( ErrCodeConversion( errCode ) ) ) ); + } + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CDataSourceInterface::Close() + { + delete this; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CDataSourceInterface::CDataSourceInterface() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CDataSourceInterface::ConstructL() + { + iCPClient = CCPClient::NewL( ); + CP_DEBUG( _L8("CDataSourceInterface::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CDataSourceInterface::ProcessCommandL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + CP_DEBUG( _L8("CCPClientInterface::ProcessCommandL") ); + TInt32 transactionId( -1 ); + if ( aCmdName.CompareF( KGetList ) == 0 ) + { + CLiwGenericParamList* list = CLiwGenericParamList::NewL( ); + CleanupStack::PushL( list ); + iCPClient->GetListL( aInParamList, *list ); + CCPClientIterable* iterable = CCPClientIterable::NewL( list ); + CleanupStack::Pop( list ); + iterable->PushL( ); + aOutParamList.AppendL( TLiwGenericParam( KResults, + TLiwVariant( iterable ) ) ); + CleanupStack::PopAndDestroy( iterable ); + } + else if ( aCmdName.CompareF( KAdd ) == 0 ) + { + iCPClient->AddL( aInParamList, aOutParamList, aCmdOptions ); + } + else if ( aCmdName.CompareF( KDelete ) == 0 ) + { + iCPClient->DeleteL( aInParamList ); + } + else if ( aCmdName.CompareF( KRequestNotification ) == 0 ) + { + if ( !(aCmdOptions & KLiwOptCancel) ) + { + if ( !aCallback ) + { + User::Leave( KErrPathNotFound ); + } + transactionId = aCallback->GetTransactionID(); + iCPClient->RegisterObserverL( aCallback, aInParamList, transactionId ); + } + else + { + iCPClient->UnregisterObserversL( aInParamList ); + } + } + else if ( aCmdName.CompareF( KCmdCancel ) == 0 ) + { + if ( aCmdOptions & KLiwOptCancel ) + { + iCPClient->UnregisterObserversL( aInParamList ); + } + } + else + { + User::Leave( KErrNotSupported ); + } + if ( transactionId != -1 ) + { + aOutParamList.AppendL( TLiwGenericParam( KTransactionID, + TLiwVariant( TInt32( transactionId ) ) ) ); + } + } + +// --------------------------------------------------------------------------- +// ErrCode Conversion +// --------------------------------------------------------------------------- +// +TInt32 CDataSourceInterface::ErrCodeConversion( TInt code ) + { + TInt32 err; + switch ( code ) + { + case KErrCancel: + // Returning KErrNone incase of KErrCancel + case KErrNone: + err= SErrNone; + break; + + case KErrNotFound: + err= SErrNotFound; + break; + + case KErrNoMemory: + err = SErrNoMemory; + break; + + case KErrInUse: + err = SErrServiceInUse; + break; + + case KErrNotSupported: + err = SErrServiceNotSupported; + break; + + case KErrBadName: + err = SErrBadArgumentType; + break; + + case KErrArgument: + err = SErrInvalidServiceArgument; + break; + + case KErrPermissionDenied: + err = SErrAccessDenied; + break; + + case KErrPathNotFound: + err = SErrMissingArgument; + break; + + default: + err = SErrGeneralError; + break; + } + return err; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclient.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,226 @@ +/* +* 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: + * +*/ + + +#include + +#include "cpliwmap.h" +#include "cpclient.h" +#include "cpserverdef.h" +#include "cpdebug.h" +#include "cpclientactivenotifier.h" + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPClient::CCPClient() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::ConstructL() + { + +#ifdef CONTENT_PUBLISHER_DEBUG + if(!CCPDebug::Enable()) + { + iDebug = CCPDebug::NewL( KCPDebugFileName ); + } +#endif + CP_DEBUG( _L8("CCPClient::ConstructL()") ); + User::LeaveIfError( iServerClient.Connect( ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPClient* CCPClient::NewL() + { + CCPClient* self = CCPClient::NewLC( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPClient* CCPClient::NewLC() + { + CCPClient* self = new( ELeave ) CCPClient; + CleanupStack::PushL( self ); + self->ConstructL( ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CCPClient::~CCPClient() + { + CP_DEBUG( _L8("CCPClient::~CCPClient()") ); + delete iActiveNotifier; + iServerClient.Close( ); +#ifdef CONTENT_PUBLISHER_DEBUG + delete iDebug; +#endif + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::GetListL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + CP_DEBUG( _L8("CCPClient::GetListL()") ); + CheckMapL( aInParamList, KFilter ); + CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); + inMapForServer->PushL( ); + inMapForServer->IsValidForGetListL( ); + iServerClient.GetListL( *inMapForServer, aOutParamList ); + CleanupStack::PopAndDestroy( inMapForServer ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::AddL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions ) + { + CP_DEBUG( _L8("CCPClient::AddL()") ); + CheckMapL( aInParamList, KItem ); + CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ; + inMapForServer->PushL( ); + inMapForServer->IsValidForAddL( ); + iServerClient.AddL( *inMapForServer, aOutParamList, aCmdOptions ); + CleanupStack::PopAndDestroy( inMapForServer ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList ) + { + CP_DEBUG( _L8("CCPClient::DeleteL()") ); + CheckMapL( aInParamList, KData ); + CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); + inMapForServer->PushL( ); + inMapForServer->IsValidForDeleteL( ); + iServerClient.DeleteL( *inMapForServer ); + CleanupStack::PopAndDestroy( inMapForServer ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::RegisterObserverL( MLiwNotifyCallback* aObserver, + const CLiwGenericParamList& aInParamList, TInt32 aTransactionId ) + { + CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); + CheckMapL( aInParamList, KFilter ); + CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); + inMapForServer->PushL( ); + inMapForServer->IsValidForNotificationL( ); + if ( !iActiveNotifier ) + { + iActiveNotifier = CCPActiveNotifier::NewL( iServerClient ); + } + iActiveNotifier->RegisterL( aObserver, aTransactionId, inMapForServer ); + CleanupStack::PopAndDestroy( inMapForServer ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList ) + { + CP_DEBUG( _L8("CCPClient::UnregisterObservers()") ); + if ( !iActiveNotifier ) + { + User::Leave( KErrNotFound ); + } + TInt32 transactionId( -1 ); + const TLiwGenericParam* param = NULL; + TInt pos( 0 ); + param = aInParamList.FindFirst( pos, KTransactionID ); + if( !param || + pos == KErrNotFound || + !param->Value().Get( transactionId ) || + transactionId < 0 ) + { + iActiveNotifier->UnregisterAllL( ); + delete iActiveNotifier; + iActiveNotifier = NULL; + } + else + { + if( iActiveNotifier->UnregisterL( transactionId ) ) + { + //delete only if it was the last observer + delete iActiveNotifier; + iActiveNotifier = NULL; + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList ) + { + CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); + CheckMapL( aInParamList, KFilter ); + CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); + inMapForServer->PushL( ); + inMapForServer->IsValidForActionL( ); + iServerClient.ExecuteActionL( *inMapForServer ); + CleanupStack::PopAndDestroy( inMapForServer ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCPClient::CheckMapL( const CLiwGenericParamList& aInParamList, + const TDesC8& aKey ) + { + const TLiwGenericParam* param = NULL; + TInt pos( 0 ); + param = aInParamList.FindFirst( pos, aKey ); + if( pos !=KErrNotFound ) + { + if( param->Value().TypeId( ) != LIW::EVariantTypeMap ) + { + User::Leave( KErrBadName ); + } + } + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientactivenotifier.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include +#include +#include "cpclientactivenotifier.h" +#include "ccontentmap.h" +#include "cpdebug.h" +#include "cpglobals.h" +#include "cpserverdef.h" +#include "cdatasourceinterface.h" + +using namespace LIW; + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CCPActiveNotifier* CCPActiveNotifier::NewL( RCPServerClient& aServerClient ) + { + CCPActiveNotifier* self = new( ELeave ) + CCPActiveNotifier ( aServerClient ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CCPActiveNotifier::~CCPActiveNotifier() + { + CP_DEBUG( _L8("CCPActiveNotifier::CCPActiveNotifier()" ) ); + Cancel( ); + iObservers.Close( ); + delete iObserverBuf; + delete iSizeDes; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::RegisterL( MLiwNotifyCallback* aObserver, + TInt32 aTransactionId, CCPLiwMap* aMap ) + { + CP_DEBUG( _L8("CCPActiveNotifier::RegisterL()" ) ); + TIpcArgs args; + + if(iObservers.Find( aTransactionId )) + { + User::Leave( KErrInUse ); + } + + iObservers.InsertL( aTransactionId, aObserver ); + delete iObserverBuf; + iObserverBuf = NULL; + iObserverBuf = aMap->PackForServerLC( ); + CleanupStack::Pop( iObserverBuf ); + args.Set( KDescriptorPosition, &*iObserverBuf ); + args.Set( KTransactionPosition, aTransactionId ); + + if ( !IsActive( ) ) + { + iSizeDes = new (ELeave) TPckgBuf( ); + args.Set( KReturnPosition, iSizeDes ); + iServerClient.RegisterObserverL( iStatus, args ); + SetActive( ); + } + else + { + iServerClient.AddObserver( args ); + } + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::UnregisterL() + { + CP_DEBUG( _L8("CCPActiveNotifier::UnregisterL()" ) ); + if ( !IsActive( ) ) + { + User::Leave( KErrNotFound ); + } + else + { + Cancel( ); + delete iSizeDes; + iSizeDes = NULL; + } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TBool CCPActiveNotifier::UnregisterL( TInt32 aTransactionId ) + { + TBool last(EFalse); + CP_DEBUG( _L8("CCPActiveNotifier::UnregisterL()" ) ); + + MLiwNotifyCallback** observer = iObservers.Find(aTransactionId); + if (observer) + { + CLiwGenericParamList* changeInfoList = + CLiwGenericParamList::NewL( ); + CleanupStack::PushL( changeInfoList ); + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL( ); + CleanupStack::PushL( inParamList ); + + changeInfoList->AppendL(TLiwGenericParam(EGenericParamError, + TLiwVariant(CDataSourceInterface::ErrCodeConversion(KErrNone)))); + changeInfoList->AppendL(TLiwGenericParam(KErrorCode, TLiwVariant( + CDataSourceInterface::ErrCodeConversion(KErrNone)))); + + (*observer)->HandleNotifyL( aTransactionId, KLiwEventCanceled, *changeInfoList, + *inParamList ); + + CleanupStack::PopAndDestroy( inParamList ); + CleanupStack::PopAndDestroy( changeInfoList ); + } + else + { + User::Leave(KErrNotFound); + } + + TIpcArgs args; + args.Set( KTransactionPosition, aTransactionId ); + iServerClient.RemoveObserver( args ); + + iObservers.Remove( aTransactionId ); + + if( !iObservers.Count() ) + { + UnregisterL(); + last = ETrue; + } + return last; + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::UnregisterAllL( ) + { + CP_DEBUG( _L8("CCPActiveNotifier::UnregisterAllL()" ) ); + if (!iObservers.Count()) + { + User::Leave( KErrNotFound ); + } + THashMapIter iter( iObservers ); + const TInt32* transaction = iter.NextKey(); + while( transaction ) + { + UnregisterL( *transaction ); + transaction = iter.NextKey( ); + } + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::RunL() + { + CP_DEBUG( _L8("CCPActiveNotifier::RunL()" ) ); + CLiwGenericParamList* eventParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL(eventParamList); + + TInt error = iStatus.Int(); + if (KErrNone == error) + { + RBuf8 outbuf; + outbuf.CleanupClosePushL(); + outbuf.CreateL((*iSizeDes)()); + error = iServerClient.GetChangeInfoData(outbuf); + RDesReadStream stream(outbuf); + CleanupClosePushL(stream); + eventParamList->InternalizeL(stream); + CleanupStack::PopAndDestroy(&stream); + delete iSizeDes; + iSizeDes = NULL; + CleanupStack::PopAndDestroy(&outbuf); + } + RegisterAgainL(); + + NotifyObserversL(error, eventParamList); + CleanupStack::PopAndDestroy(eventParamList); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::NotifyObserversL( TInt aErrorCode, + CLiwGenericParamList* aEventParamList ) + { + TInt event( KLiwEventInProgress ); + if ( aErrorCode == KErrCancel ) + { + event = KLiwEventCanceled; + } + else if ( aErrorCode != KErrNone ) + { + event = KLiwEventStopped; + } + + for ( TInt i = 0; iCount(); i++ ) + { + TLiwGenericParam param; + param.PushL(); + TLiwVariant mapsV; + mapsV.PushL(); + aEventParamList->AtL( i, param ); + mapsV = param.Value(); + CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( ); + if (mapsV.Get( *listOfMatchingMaps )) + { + TLiwVariant transV; + transV.PushL(); + TInt transIndex (listOfMatchingMaps->Count()-1); + listOfMatchingMaps->AtL(transIndex ,transV); + TInt32 transactionId ( KErrNotFound ); + transV.Get( transactionId ); + MLiwNotifyCallback** observer = iObservers.Find( transactionId ); + + if ( observer ) + { + listOfMatchingMaps->Remove( transIndex ); + CLiwGenericParamList* changeInfoList = + CLiwGenericParamList::NewL( ); + CleanupStack::PushL( changeInfoList ); + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL( ); + CleanupStack::PushL( inParamList ); + + changeInfoList->AppendL( TLiwGenericParam( KChangeInfo, + TLiwVariant( listOfMatchingMaps ) ) ); + + changeInfoList->AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( CDataSourceInterface::ErrCodeConversion( aErrorCode ) ) ) ); + changeInfoList->AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( CDataSourceInterface::ErrCodeConversion( aErrorCode ) ) ) ); + (*observer)->HandleNotifyL( transactionId, event, *changeInfoList, + *inParamList ); + + CleanupStack::PopAndDestroy( inParamList ); + CleanupStack::PopAndDestroy( changeInfoList ); + }//if + + CleanupStack::PopAndDestroy( &transV ); + }//if + CleanupStack::PopAndDestroy( listOfMatchingMaps ); + CleanupStack::PopAndDestroy( &mapsV ); + CleanupStack::PopAndDestroy( ¶m ); + }//for + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::DoCancel() + { + CP_DEBUG( _L8("CCPActiveNotifier::DoCancel()" ) ); + iServerClient.UnregisterObserver( ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TInt CCPActiveNotifier::RunError( TInt /*aError*/) + { + TRAP_IGNORE( RegisterAgainL( ) ); + return KErrNone; + } +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +CCPActiveNotifier::CCPActiveNotifier( RCPServerClient& aServerClient ) : + CActive(EPriorityStandard) + { + iServerClient = aServerClient; + CActiveScheduler::Add( this ); + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::ConstructL() + { + + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPActiveNotifier::RegisterAgainL() + { + CP_DEBUG( _L8("CCPActiveNotifier::RegisterAgainL()" ) ); + + if (!IsActive()) + { + TIpcArgs args; + args.Set(KTransactionPosition, KErrAlreadyExists); + if (iSizeDes) + { + delete iSizeDes; + iSizeDes = NULL; + } + iSizeDes = new (ELeave) TPckgBuf (); + args.Set(KReturnPosition, iSizeDes); + iServerClient.RegisterObserverL(iStatus, args); + SetActive(); + } + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cpclientiterable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientiterable.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,127 @@ +/* +* 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: + * +*/ + +#include + +#include "cpclientiterable.h" +#include "cpglobals.h" +#include "cpdebug.h" + +using namespace LIW; + +// --------------------------------------------------------------------------- +// Two-Phase constructor +// --------------------------------------------------------------------------- +// +CCPClientIterable* CCPClientIterable::NewL( CLiwGenericParamList* aList ) + { + return new(ELeave) CCPClientIterable( aList ); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CCPClientIterable::CCPClientIterable( CLiwGenericParamList* aList ) : + iList(aList) + { + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCPClientIterable::~CCPClientIterable() + { + delete iList; + } + +// --------------------------------------------------------------------------- +// Reset the list +// --------------------------------------------------------------------------- +// +void CCPClientIterable::Reset() + { + iPos = 0; + } + +// --------------------------------------------------------------------------- +// Gets next element in list +// --------------------------------------------------------------------------- +// +TBool CCPClientIterable::NextL( TLiwVariant& aNext ) + { + CP_DEBUG( _L8("CCPClientIterable::NextL()") ); + TBool retValue = EFalse; + const TLiwGenericParam* param= NULL; + param = iList->FindFirst( iPos, KListMap, EVariantTypeMap ); + + if ( param && iPos !=KErrNotFound ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); + //get map + if ( param->Value().Get( *map ) ) + { + ExctractBinariesL( *map ); + aNext.SetL( map ); + retValue = ETrue; + } + CleanupStack::PopAndDestroy( map ); + iPos++; + } + return retValue; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPClientIterable::ExctractBinariesL( CLiwDefaultMap& aMap ) + { + CP_DEBUG( _L8("CCPClientIterable::ExctractBinariesL()") ); + TLiwVariant buffer; + buffer.PushL( ); + if ( aMap.FindL( KDataMap, buffer ) ) + { + TPtrC8 packedData( KNullDesC8 ); + if ( buffer.Get( packedData ) ) + { + RDesReadStream str(packedData); + CleanupClosePushL( str ); + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC( str ); + aMap.Remove( KDataMap ); + aMap.InsertL( KDataMap, datamap ); + CleanupStack::PopAndDestroy( datamap ); + CleanupStack::PopAndDestroy( &str ); + } + } + if ( aMap.FindL( KActionMap, buffer ) ) + { + TPtrC8 packedAction( KNullDesC8 ); + if ( buffer.Get( packedAction ) ) + { + RDesReadStream str(packedAction); + CleanupClosePushL( str ); + CLiwDefaultMap* actionmap = CLiwDefaultMap::NewLC( str ); + aMap.Remove( KActionMap ); + aMap.InsertL( KActionMap, actionmap ); + CleanupStack::PopAndDestroy( actionmap ); + CleanupStack::PopAndDestroy( &str ); + } + } + CleanupStack::PopAndDestroy( &buffer ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cpclientservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientservice.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* 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: + * +*/ + + +#include +#include +#include + +#include "cpclientservice.h" +#include "cpdebug.h" +#include "cpglobals.h" +#include "cdatasourceinterface.h" +#include "ccontentpublishinginterface.h" + +const TInt implUid( 0x20016B7E ); +const TInt implContentUid( 0x2001955F ); + +using namespace LIW; + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPClientService::CCPClientService() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPClientService* CCPClientService::NewL() + { + return new(ELeave) CCPClientService(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCPClientService::~CCPClientService() + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPClientService::InitialiseL( + MLiwNotifyCallback& /*aFrameworkCallback*/, const RCriteriaArray& /*aInterest*/) + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCPClientService::HandleServiceCmdL( const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + const MLiwNotifyCallback* aCallback ) + { + CP_DEBUG( _L8("CCPClientService::HandleServiceCmdL()") ); + if ( (aCallback ) || (aCmdOptions ) ) + { + // report error if request is anything other than synchronous + //or user sends a callback parameter + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( KErrNotSupported ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( KErrNotSupported ) ) ); + return; + } + + TPtrC8 cmdName; + const TLiwGenericParam* cmd= NULL; + + if ( aCmdId == KLiwCmdAsStr ) + { + TInt pos = 0; + cmd = aInParamList.FindFirst( pos, KCommand ); + if ( cmd ) + { + cmdName.Set( cmd->Value().AsData( ) ); + } + else + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( KErrArgument ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( KErrArgument ) ) ); + } + } + else + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( KErrNotSupported ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( KErrNotSupported ) ) ); + } + if ( !cmdName.CompareF( KCPInterface ) ) + { + //Create interface pointer and return the output param + CDataSourceInterface* ifp =CDataSourceInterface::NewLC( ); + aOutParamList.AppendL( TLiwGenericParam( KCPInterface, + TLiwVariant( ifp ) ) ); + CleanupStack::Pop( ifp ); + return; + } + else if ( !cmdName.CompareF( KCPContentInterface ) ) + { + //Create interface pointer and return the output param + CContentPublishingInterface* ifp = + CContentPublishingInterface::NewLC( ); + aOutParamList.AppendL( TLiwGenericParam( KCPContentInterface, + TLiwVariant( ifp ) ) ); + CleanupStack::Pop( ifp ); + return; + } + else + { + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( KErrNotSupported ) ) ); + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( KErrNotSupported ) ) ); + } + } + +// --------------------------------------------------------- +// Map the interface UIDs to implementation factory functions +// --------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( implUid, CCPClientService::NewL ), + IMPLEMENTATION_PROXY_ENTRY( implContentUid, CCPClientService::NewL ) + }; + +// --------------------------------------------------------- +// Exported proxy for instantiation method resolution +// --------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_contentpublishing/src/cpclientsession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,293 @@ +/* +* 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: + * +*/ + + +#include +#include + +#include "cpserverdef.h" +#include "cpliwmap.h" +#include "cpclientsession.h" +#include "cpglobals.h" +#include "cpdebug.h" +#include "cpclientactivenotifier.h" + +// Number of message slots to reserve for this client server session. +const TUint KDefaultMessageSlots( 1 ); + +// Function prototypes +static TInt StartServer(); +static TInt CreateServerProcess(); + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// RCPServerClient::RCPServerClient +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +RCPServerClient::RCPServerClient() : + RSessionBase() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// RCPServerClient::Connect +// Connect to Content publisher server session. +// ----------------------------------------------------------------------------- +// +TInt RCPServerClient::Connect() + { + TInt error =:: StartServer(); + + if ( error == KErrNone ) + { + error = CreateSession( KCPServerName, + Version(), + KDefaultMessageSlots ); + } + return error; + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::Close() + { + RSessionBase::Close( ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::AddL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions ) + { + CP_DEBUG( _L8("RCPServerClient::AddL()") ); + HBufC8 *inbuf = aMap.PackForServerLC( ); + TInt32 id( 0); + TPckg sizeDes(id); + TIpcArgs args; + args.Set( KDescriptorPosition, &*inbuf ); + args.Set( KReturnPosition, &sizeDes ); + if( aCmdOptions & KDisablePersist ) + { + User::LeaveIfError( SendReceive( ECpServerAddDataNonPersistent, args ) ); + } + else + { + User::LeaveIfError( SendReceive( ECpServerAddData, args ) ); + } + TLiwGenericParam param( KItemId, id); + aOutParamList.AppendL( param ); + CleanupStack::PopAndDestroy( inbuf ); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::GetListL( const CCPLiwMap& aMap, + CLiwGenericParamList& aOutParamList ) + { + CP_DEBUG( _L8("RCPServerClient::GetListL()") ); + TIpcArgs args; + HBufC8 *inbuf = aMap.PackForServerLC( ); + TInt error(KErrNone); + TInt sizeList( 0); + TPckg sizeDes(sizeList); + args.Set( KDescriptorPosition, &*inbuf ); + args.Set( KReturnPosition, &sizeDes ); + error = SendReceive( ECpServerGetListSize, args ); + if ( error == KErrNone ) + { + TIpcArgs args; + RBuf8 outbuf; + outbuf.CleanupClosePushL( ); + outbuf.CreateL( sizeList ); + args.Set( KDescriptorPosition, &outbuf ); + error = SendReceive( ECpServerGetListData, args ); + if ( error == KErrNone ) + { + RDesReadStream stream(outbuf); + CleanupClosePushL( stream ); + aOutParamList.InternalizeL( stream ) ; + CleanupStack::PopAndDestroy( &stream ); + } + CleanupStack::PopAndDestroy( &outbuf ); + } + User::LeaveIfError( error ); + CleanupStack::PopAndDestroy( inbuf ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::ExecuteActionL( const CCPLiwMap& aMap ) + { + CP_DEBUG( _L8("RCPServerClient::ExecuteActionL()") ); + HBufC8 *inbuf = aMap.PackForServerLC( ); + TIpcArgs args; + args.Set( KDescriptorPosition, &*inbuf ); + User::LeaveIfError( SendReceive( ECpServerExecuteAction, args ) ); + CleanupStack::PopAndDestroy( inbuf ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::DeleteL( const CCPLiwMap& aMap ) + { + CP_DEBUG( _L8("RCPServerClient::DeleteL()") ); + HBufC8 *inbuf = aMap.PackForServerLC( ); + TIpcArgs args; + args.Set( KDescriptorPosition, &*inbuf ); + User::LeaveIfError( SendReceive( ECpServerRemoveData, args ) ); + CleanupStack::PopAndDestroy( inbuf ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::RegisterObserverL( TRequestStatus& aStatus, + TIpcArgs& aArgs ) + { + CP_DEBUG( _L8("RCPServerClient::RegisterObserver()") ); + SendReceive( ECpServerRegisterObserver, aArgs, aStatus ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::AddObserver( TIpcArgs& aArgs ) + { + CP_DEBUG( _L8("RCPServerClient::AddObserver()") ); + SendReceive( ECpServerAddObserver, aArgs ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::RemoveObserver( TIpcArgs& aArgs ) + { + CP_DEBUG( _L8("RCPServerClient::AddObserver()") ); + SendReceive( ECpServerRemoveObserver, aArgs ); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt RCPServerClient::GetChangeInfoData( TDes8& aBuf ) + { + CP_DEBUG( _L8("RCPServerClient::GetChangeInfoData()") ); + TIpcArgs args; + args.Set( KDescriptorPosition, &aBuf ); + TInt error = SendReceive( ECpServerGetChangeInfoData, args ); + return error; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void RCPServerClient::UnregisterObserver() + { + CP_DEBUG( _L8("RCPServerClient::UnregisterObserver()") ); + SendReceive( ECpServerUnRegisterObserver ); + } + +// ----------------------------------------------------------------------------- +// RCPServerClient::Version +// Version information. +// ----------------------------------------------------------------------------- +// +TVersion RCPServerClient::Version() const + { + CP_DEBUG( _L8("RCPServerClient::Version()") ); + return (TVersion( KCPServerMajorVersionNumber, + KCPServerMinorVersionNumber, KCPServerBuildVersionNumber ) ); + } + +// ----------------------------------------------------------------------------- +// StartServer +// Static method to start the server. +// ----------------------------------------------------------------------------- +// +static TInt StartServer() + { + TInt result; + + TFindServer findServer( KCPServerName ); + TFullName name; + + result = findServer.Next( name ); + if ( result != KErrNone ) + { + // Server not running + result = CreateServerProcess( ); + } + return result; + } + +// ----------------------------------------------------------------------------- +// CreateServerProcess +// Static method to create the server process. +// ----------------------------------------------------------------------------- +// +static TInt CreateServerProcess() + { + CP_DEBUG( _L8("RCPServerClient::CreateServerProcess()") ); + const TUidType serverUid( KNullUid, KNullUid, KServerUid3); + RProcess server; + TInt result; + result = server.Create( KCPServerFilename, KNullDesC, serverUid ); + if ( result == KErrNone ) + { + TRequestStatus stat = KRequestPending; + server.Rendezvous( stat ); + if ( stat != KRequestPending ) + { + server.Kill( 0 ); // abort startup + } + else + { + server.Resume( ); // logon OK - start the server + } + + User::WaitForRequest( stat ); // wait for start or death + // we can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone + result = (server.ExitType( ) == EExitPanic ) ? KErrGeneral + : stat.Int( ); + } + server.Close( ); + return result; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/data/200159B7.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/data/200159B7.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2001 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: Resource file +* +*/ + + +#include +#include + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x200159B7; + interfaces = + { + INTERFACE_INFO + { + // Base service class + interface_uid = KLiwClassBase; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x200159B8; + version_no = 1; + display_name = "HSPS Service Provider"; + default_data = "Service.HSPS"; + opaque_data = "IConfiguration"; + } + }; + } + }; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* 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: Build information file for HSPS SAPI +* +*/ + +#include +#include + +#include "../hspsservice/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +hspsprovider.mmp + +//gnumakefile build_testcases.mk + +PRJ_EXPORTS +../rom/hspssapi.iby CORE_MW_LAYER_IBY_EXPORT_PATH(hspssapi.iby) + +PRJ_TESTMMPFILES + +// Definition for building the test cases (Eunit installation required) +//#define HSPS_BUILD_TESTCASES + +#ifdef HSPS_BUILD_TESTCASES +#include "../internal/moduletest/group/bld.inf" +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/group/build_testcases.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/group/build_testcases.cmd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo off +rem ************************************ +rem ** Executed from build_testcases.mk +rem ************************************ + +echo Building the test cases... + +cd ..\internal\moduletest\group +call bldmake clean +call bldmake bldfiles +call abld reallyclean +call abld build winscw udeb + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/group/build_testcases.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/group/build_testcases.mk Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,22 @@ +# +# 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: Builds internal test cases if EUnit has been installed +# + +MAKMAKE BLD CLEAN LIB CLEANLIB RESOURCE FREEZE SAVESPACE RELEASABLES : ; + +FINAL : +ifeq (WINSCW,$(findstring WINSCW, $(PLATFORM))) + if exist %epocroot%epoc32\release\winscw\udeb\EUnit.dll call build_testcases.cmd +endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/group/hspsprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/group/hspsprovider.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: Project definition file for hspsprovider +* +*/ + + +#include +#include "../inc/hsps_log_cfg.hrh" + +TARGET hspsprovider.dll +TARGETTYPE PLUGIN + +UID 0x10009D8D 0x200159B7 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE hspsprovider.cpp +SOURCE hspsconfigurationif.cpp +SOURCE hspsliwutilities.cpp +SOURCE hspscallback.cpp + +SOURCEPATH ../data +START RESOURCE 200159B7.rss +TARGET hspsprovider.rsc +END + +USERINCLUDE ../inc +USERINCLUDE ../hspsservice/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY estor.lib +LIBRARY liwservicehandler.lib +LIBRARY hspsservice.lib + +LIBRARY hspsdomdocument.lib +LIBRARY hspsodt.lib +LIBRARY hspsresult.lib + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/bwins/hspsserviceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +EXPORTS + ?GetPluginListL@CHspsPersonalisationService@@QAEXAAVTDesC8@@0KAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 1 NONAME ; void CHspsPersonalisationService::GetPluginListL(class TDesC8 &, class TDesC8 &, unsigned long, class CArrayPtrFlat &) + ?GetODTL@CHspsConfigurationService@@QAEXH@Z @ 2 NONAME ; void CHspsConfigurationService::GetODTL(int) + ?GetAppConfListL@CHspsPersonalisationService@@QAEXHKAAV?$CArrayPtrFlat@VChspsODT@@@@@Z @ 3 NONAME ; void CHspsPersonalisationService::GetAppConfListL(int, unsigned long, class CArrayPtrFlat &) + ?SetConfStateL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00@Z @ 4 NONAME ; void CHspsPersonalisationService::SetConfStateL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &) + ?InvalidateODT@CHspsConfigurationService@@QAEXXZ @ 5 NONAME ; void CHspsConfigurationService::InvalidateODT(void) + ?RemovePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 6 NONAME ; void CHspsPersonalisationService::RemovePluginL(int, class TDesC8 &) + ?SetActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 7 NONAME ; void CHspsPersonalisationService::SetActiveAppConfL(int, class TDesC8 &) + ?RestoreActiveAppConfL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 8 NONAME ; void CHspsPersonalisationService::RestoreActiveAppConfL(int, class TDesC8 &) + ?AddPluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@00AAH@Z @ 9 NONAME ; void CHspsPersonalisationService::AddPluginL(int, class TDesC8 &, class TDesC8 &, class TDesC8 &, int &) + ?SetLogBus@CHspsConfigurationService@@QAEXPAVChspsLogBus@@@Z @ 10 NONAME ; void CHspsConfigurationService::SetLogBus(class ChspsLogBus *) + ?GetAppUidL@CHspsConfigurationService@@QAEXAAH@Z @ 11 NONAME ; void CHspsConfigurationService::GetAppUidL(int &) + ?MovePluginsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAV?$CArrayFixFlat@H@@@Z @ 12 NONAME ; void CHspsPersonalisationService::MovePluginsL(int, class TDesC8 &, class CArrayFixFlat &) + ?RegisterObserverL@CHspsConfigurationService@@QAEHPAVCHspsReqNotifCallback@@@Z @ 13 NONAME ; int CHspsConfigurationService::RegisterObserverL(class CHspsReqNotifCallback *) + ?GetDOML@CHspsConfigurationService@@QAEAAVChspsDomDocument@@XZ @ 14 NONAME ; class ChspsDomDocument & CHspsConfigurationService::GetDOML(void) + ?NewL@CHspsConfigurationService@@SAPAV1@XZ @ 15 NONAME ; class CHspsConfigurationService * CHspsConfigurationService::NewL(void) + ?NewL@CHspsPersonalisationService@@SAPAV1@XZ @ 16 NONAME ; class CHspsPersonalisationService * CHspsPersonalisationService::NewL(void) + ?SetPluginSettingsL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@AAVChspsDomDocument@@H@Z @ 17 NONAME ; void CHspsPersonalisationService::SetPluginSettingsL(int, class TDesC8 &, class ChspsDomDocument &, int) + ?GetFamilyL@CHspsConfigurationService@@QAEXAAK@Z @ 18 NONAME ; void CHspsConfigurationService::GetFamilyL(unsigned long &) + ?ReplacePluginL@CHspsPersonalisationService@@QAEXHABVTDesC8@@0@Z @ 19 NONAME ; void CHspsPersonalisationService::ReplacePluginL(int, class TDesC8 const &, class TDesC8 const &) + ?GetPluginOdtL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@PAVChspsODT@@@Z @ 20 NONAME ; void CHspsPersonalisationService::GetPluginOdtL(int, class TDesC8 &, class ChspsODT *) + ?SetActivePluginL@CHspsPersonalisationService@@QAEXHAAVTDesC8@@@Z @ 21 NONAME ; void CHspsPersonalisationService::SetActivePluginL(int, class TDesC8 &) + ?UnRegisterObserverL@CHspsConfigurationService@@QAEXXZ @ 22 NONAME ; void CHspsConfigurationService::UnRegisterObserverL(void) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/eabi/hspsserviceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +EXPORTS + _ZN25CHspsConfigurationService10GetAppUidLERi @ 1 NONAME + _ZN25CHspsConfigurationService10GetFamilyLERm @ 2 NONAME + _ZN25CHspsConfigurationService13InvalidateODTEv @ 3 NONAME + _ZN25CHspsConfigurationService17RegisterObserverLEP21CHspsReqNotifCallback @ 4 NONAME + _ZN25CHspsConfigurationService19UnRegisterObserverLEv @ 5 NONAME + _ZN25CHspsConfigurationService4NewLEv @ 6 NONAME + _ZN25CHspsConfigurationService7GetDOMLEv @ 7 NONAME + _ZN25CHspsConfigurationService7GetODTLEi @ 8 NONAME + _ZN25CHspsConfigurationService9SetLogBusEP11ChspsLogBus @ 9 NONAME + _ZN27CHspsPersonalisationService10AddPluginLEiR6TDesC8S1_S1_Ri @ 10 NONAME + _ZN27CHspsPersonalisationService12MovePluginsLEiR6TDesC8R13CArrayFixFlatIiE @ 11 NONAME + _ZN27CHspsPersonalisationService13GetPluginOdtLEiR6TDesC8P8ChspsODT @ 12 NONAME + _ZN27CHspsPersonalisationService13RemovePluginLEiR6TDesC8 @ 13 NONAME + _ZN27CHspsPersonalisationService13SetConfStateLEiR6TDesC8S1_S1_ @ 14 NONAME + _ZN27CHspsPersonalisationService14GetPluginListLER6TDesC8S1_mR13CArrayPtrFlatI8ChspsODTE @ 15 NONAME + _ZN27CHspsPersonalisationService14ReplacePluginLEiRK6TDesC8S2_ @ 16 NONAME + _ZN27CHspsPersonalisationService15GetAppConfListLEimR13CArrayPtrFlatI8ChspsODTE @ 17 NONAME + _ZN27CHspsPersonalisationService16SetActivePluginLEiR6TDesC8 @ 18 NONAME + _ZN27CHspsPersonalisationService17SetActiveAppConfLEiR6TDesC8 @ 19 NONAME + _ZN27CHspsPersonalisationService18SetPluginSettingsLEiR6TDesC8R16ChspsDomDocumenti @ 20 NONAME + _ZN27CHspsPersonalisationService21RestoreActiveAppConfLEiR6TDesC8 @ 21 NONAME + _ZN27CHspsPersonalisationService4NewLEv @ 22 NONAME + _ZTI25CHspsConfigurationService @ 23 NONAME + _ZTI27CHspsPersonalisationService @ 24 NONAME + _ZTV25CHspsConfigurationService @ 25 NONAME + _ZTV27CHspsPersonalisationService @ 26 NONAME + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: Build information file for HSPS Service +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +hspsservice.mmp + +PRJ_EXPORTS + +PRJ_TESTMMPFILES diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/group/hspsservice.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/group/hspsservice.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: Project definition file for HSPS Service +* +*/ + + +#include +#include "../../inc/hsps_log_cfg.hrh" + +TARGET hspsservice.dll +TARGETTYPE DLL +UID 0x1000008D 0x2001242B + +CAPABILITY All -TCB +VENDORID VID_DEFAULT + +LANG SC + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE hspsconfigurationservice.cpp +SOURCE hspspersonalisationservice.cpp +SOURCE hspsserviceutilities.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY hspsrequestclient.lib +LIBRARY hspsclient.lib +LIBRARY hspsodt.lib +LIBRARY hspsdomdocument.lib +LIBRARY hspsresource.lib +LIBRARY hspsresult.lib +LIBRARY flogger.lib + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsconfigurationservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsconfigurationservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,202 @@ +/* +* 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: Defination of class CHspsConfigurationService +* +*/ + + +#ifndef C_HSPSCONFIGURATIONSERVICE_H +#define C_HSPSCONFIGURATIONSERVICE_H + + +// SYSTEM INCLUDES + +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class ChspsDomNode; +class ChspsLogBus; +class CHspsReqNotifCallback; + +class ChspsRequestNotificationParams; + +/** + * @ingroup group_hsps_sapi + * This class provides HSPS configuration services. + * + * @since S60 5.0 + */ +class CHspsConfigurationService : public CBase, public MhspsClientRequestServiceObserver + { + + public: + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static CHspsConfigurationService* NewL(); + + /** + * Destructor. + */ + virtual ~CHspsConfigurationService(); + + private: + + /** + * Constructor + */ + CHspsConfigurationService(); + + /** + * Symbian Constructor + */ + void ConstructL(); + + + public: // From base class MXnClientRequestServiceObserver + + /** + * Realisation of MXnClientRequestServiceObserver Interface + * @see MXnClientRequestServiceObserver + * @since S60 5.0 + * @param aMessage contains a service completion message returned from + * the XnClientRequestHandler to its observer. + */ + void HandlehspsRequestClientMessageL( ThspsServiceCompletedMessage aMessage, + ChspsRequestNotificationParams& aParams); + + public: // New methods + + /** + * Gets Dom document. + * + * @since S60 5.0 + * @return Dom document. + */ + IMPORT_C ChspsDomDocument& GetDOML( ); + + /** + * Returns application configuration ODT for the defined application. + * + * @since S60 5.0 + * @param aAppUid Application identifier. + */ + IMPORT_C void GetODTL( const TInt aAppUid ); + + /** + * Gets application UID of active configuration. + * + * @since S60 5.0 + * @param aAppUid requested application UID. + */ + IMPORT_C void GetAppUidL( TInt& aAppUid ); + + /* + * Register observer to get notification from the server. + * + * @since S60 5.0 + * @param aCallBack Pointer to callback instance. + */ + IMPORT_C TInt RegisterObserverL(CHspsReqNotifCallback* aCallBack ); + + /* + * UnRegister observer to get notification from the server. + * + * @since S60 5.0 + */ + IMPORT_C void UnRegisterObserverL( ); + + /* + * Set log bus. Empty implementation in product builds. + * + * @since S60 5.0 + * @param aLogBus Log bus to be set. + */ + IMPORT_C void SetLogBus( ChspsLogBus* aLogBus ); + + /* + * Invalidate stored(cached) ODT. + * + * If stored(cached) ODT is invalidate + * then stored(cached) ODT will be refreshed + * during next call to GetDOML. + * + * This method was implemented due to + * performance improvements. + * + * @since S60 5.0 + */ + IMPORT_C void InvalidateODT(); + + /** + * Gets active application configuration family + * + * @since S60 5.0 + * @param aFamily requested application configuration family + */ + IMPORT_C void GetFamilyL( TUint32& aFamily ); + + private: // Methods + + TInt ParseNotificationDataL(ChspsRequestNotificationParams& aParams); + + + + private: // Data + + /** + * Client-side implementation of MXnMaintenanceService API-definition. + */ + ChspsRequestClient* iHspsRequestClient; + + /** + * ODT + */ + ChspsODT* iHspsODT; + /** + * CHspsReqNotifCallback + */ + CHspsReqNotifCallback* iCallback; + /** + * HSPS notification parameters + */ + ChspsRequestNotificationParams* iNotifyParams; + /** + * Notified PluginId array + */ + RArray iPluginIds; +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. not owned. + */ + ChspsLogBus* iLogBus; +#endif + /** + * ETrue if iHspsODT is invalid. + */ + TBool iInvalidODT; + }; + + +#endif // C_HSPSCONFIGURATIONSERVICE_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspspersonalisationservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,253 @@ +/* +* 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: Defination of class CHspsPersonalisationService +* +*/ + + +#ifndef C_HSPSPERSONALISATIONSERVICE_H +#define C_HSPSPERSONALISATIONSERVICE_H + +// SYSTEM INCLUDES + +#include +#include +#include +#include + +#include +#include + +// USER INCLUDES + + +// FORWARD DECLARATIONS +class ChspsDomNode; + +/** + * @ingroup group_hsps_sapi + * This class provides HSPS personalisation services. + * + * @since S60 5.0 +*/ +class CHspsPersonalisationService : public CBase, public MhspsThemeManagementServiceObserver + { + public: // Constructor and destructor + + /** + * Two-phased constructor. + * + * @since S60 5.0 + */ + IMPORT_C static CHspsPersonalisationService* NewL(); + + /** + * Destructor. + */ + virtual ~CHspsPersonalisationService(); + + private: // Constructors + + /** + * Constructor + */ + CHspsPersonalisationService(); + + /** + * Symbian Constructor + */ + void ConstructL(); + + + public: // From base class MhspsThemeManagementServiceObserver + + /** + * Realisation of MhspsThemeManagementServiceObserver Interface + * @param aMessage contains a service completion message + */ + void HandlehspsClientMessage( ThspsServiceCompletedMessage aMessage ); + + public: // New methods + + /** + * Get the list of plugins ODT headers. + * + * @since S60 5.0 + * @param aInterface Interface of the requested plugins. + * @param aType Type of the requested plugins. + * @param aFamily Requested plugin configuration family + * @param aList List of plugins ODT headers. + */ + IMPORT_C void GetPluginListL( + TDesC8& aInterface, + TDesC8& aType, + TUint32 aFamily, + CArrayPtrFlat& aList + ); + + /** + * Add a new plugin to the defined configuration. + * + * @since S60 5.0 + * @param aAppUid Uid of modified application configuration. + * @param aConfId Id of modified configuration. + * @param aPluginUid Uid of new plugin. + * @param aPosition Position in configurations plugin list. + * @param aPluginId Id of new plugin in modified configuration. + */ + IMPORT_C void AddPluginL( + TInt aAppUid, + TDesC8& aConfId, + TDesC8& aPluginUid, + TDesC8& aPosition, + TInt& aPluginId + ); + + /** + * Remove plugin from the defined configuration. + * + * @since S60 5.0 + * @param aAppUid Uid of modified application configuration. + * @param aPluginId Id of removed plugin in configuration. + */ + IMPORT_C void RemovePluginL( + TInt aAppUid, + TDesC8& aPluginId + ); + + /** + * Sets/changed plugin settings. + * + * @since S60 5.0 + * @param aAppUid Uid of modified application configuration. + * @param aPluginId Id of plugin whose settings are updated. + * @param aDom Dom document of the settings which are changed. + * @param aPluginStoringStatus status to tell whether plugin reference need to be stored. + */ + IMPORT_C void SetPluginSettingsL( + TInt aAppUid, + TDesC8& aPluginId, + ChspsDomDocument& aDom, + TBool aPluginStoringStatus); + + /** + * Updates plugin position in a configuration. + * + * @since S60 5.0 + * @param aAppUid Uid of modified application configuration. + * @param aConfId Id of a configuration whose plugins list is updated. + * @param aPluginIds An array of plugin ids in the new positions. + */ + IMPORT_C void MovePluginsL( + const TInt aAppUid, + TDesC8& aConfId, + CArrayFixFlat& aPluginIds ); + + /** + * Get a list of ODT headers containing the information of available + * configurations for the defined application. + * + * @since S60 5.0 + * @param aAppUid application UID. + * @param aFamily Requested application configuration family + * @param aList An array of available application configurations. + */ + IMPORT_C void GetAppConfListL( + TInt aAppUid, + TUint32 aFamily, + CArrayPtrFlat& aList ); + + /** + * Set active application configuration. + * + * @since S60 5.0 + * @param aAppUid application UID. + * @param aConfUid configuration UID. + */ + IMPORT_C void SetActiveAppConfL( + TInt aAppUid, + TDesC8& aConfUid ); + + /** + * Gets plugin odt. + * + * @since S60 5.0 + * @param aAppUid - application uid. + * @param aPluginUid - plugin's uid to be retrieved. + * @param aPluginOdt - odt. + */ + IMPORT_C void GetPluginOdtL( + TInt aAppUid, + TDesC8& aPluginUid, + ChspsODT* aPluginOdt ); + + /** + * Set configuration state. + * + * @since S60 5.0 + * @param aAppUid - application uid. + * @param aConfId - configuration id. + * @param aState - configuration's next state. + * @param aFilter - configuration selection options + */ + IMPORT_C void SetConfStateL( + TInt aAppUid, + TDesC8& aConfId, + TDesC8& aState, + TDesC8& aFilter ); + + /** + * Restore active application configuration + * @param aAppUid - application uid + * @param aConfId - configuration id + */ + IMPORT_C void RestoreActiveAppConfL( + TInt aAppUid, + TDesC8& aConfUid ); + + /** + * Activates defined plugin in plugin list + * + * @since S60 5.0 + * @param aAppUid Uid of modified application configuration. + * @param aPluginId Id of activated plugin + */ + IMPORT_C void SetActivePluginL( + TInt aAppUid, + TDesC8& aPluginId + ); + + /** + * Replaces a plugin in active application configuration + * @param aAppUid - application uid + * @param aPluginId - id of the plugin to be replaced + * @param aConfUid - uid of the new plugin configuration + */ + IMPORT_C void ReplacePluginL( + const TInt aAppUid, + const TDesC8& aPluginId, + const TDesC8& aConfUid ); + + private: // Methods + + private: // Data + + // Pointer to HSPS Theme server client object + ChspsClient* iHspsClient; + + }; + +#endif // C_HSPSPERSONALISATIONSERVICE_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsserviceutilities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsserviceutilities.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: Defination of class HspsServiceUtilities +* +*/ + + +#ifndef _HSPSSERVICEUTILITIES_H +#define _HSPSSERVICEUTILITIES_H + + +// SYSTEM INCLUDES +#include +#include +#include + +// USER INCLUDES + +/** + * request Notification parameters + */ +struct THspsParamsRequestNotification + { + TInt event; // event + TInt appUid; // uid of the application + TInt appConfUid; // uid of application configuration + TInt pluginUid; // uid of the plugin configuration to be added + TInt pluginId; // Plugin Id + TInt parentPluginId; // Id of the plugins parent plugin + TBuf8 name; // name of the plugin + }; +// FORWARD DECLARATIONS + + /** + * @ingroup group_hsps_sapi + * This class provides common functionalties for HSPS services + */ +class HspsServiceUtilities + { + public: // Static method + + /** + * Converts a hex value string (0xXXXX) to TInt + * @param aStr String containing hex value + * @return corresponding TInt + */ + static TInt HexString2IntL( + const TDesC8& aStr ); + + /** + * Converts a decimal value string to TInt + * @param aStr String containing hex value + * @return corresponding TInt + */ + static TInt DecString2Int( + const TDesC8& aStr ); + + /** + * Converts a configuration type string to the corresponding + * configuration type enumeration. + * @param aTypeStr Configuration type string + * @param aType + */ + static void GetConfigurationTypeL( + const TDesC8& aTypeStr, + TUint& aType ); + + /** + * Converts a configuration state string to the corresponding + * configuration state enumeration. + * @param aStateStr Configuration state string + * @param aState + */ + static void GetConfigurationStateL( + const TDesC8& aStateStr, + ThspsConfigurationState& aState ); + + /** + * Converts a configuration state filter string to the corresponding + * configuration state filter enumeration. + * @param aFilterStr Configuration state filter + * @param aFilter + */ + static void GetConfigurationStateFilterL( + const TDesC8& aFilterStr, + ThspsConfStateChangeFilter& aFilter ); + + }; + +#endif // C_HSPSSERVICEUTILITIES_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsxmlelements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/inc/hspsxmlelements.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009 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 HSPSXMLELEMENTS_H_ +#define HSPSXMLELEMENTS_H_ + +// Xmluiml element +_LIT8( KXmlUimlElement, "xmluiml" ); // Root element +_LIT8( KXmlUimlAttrXmlns, "xmlns"); // Not required + +//common elements +_LIT8( KAttrId, "id" ); +_LIT8( KAttrName, "name" ); + +// Configuration element +_LIT8( KConfigurationElement, "configuration" ); +_LIT8( KConfigurationAttrId, "id" ); // Unique for this configuration +_LIT8( KConfigurationAttrType, "type" ); // root/view/widget +_LIT8( KConfigurationAttrInterface, "interface" ); // AI3/? +_LIT8( KConfigurationAttrUid, "uid" ); // Globally unique uid, identifies specific configuration +_LIT8( KConfigurationAttrName, "name" ); +_LIT8( KConfigurationAttrState, "state" ); +_LIT8( KConfigurationAttrMaxChild, "max_child" ); +_LIT8( KConfigurationAttrMultiInstance, "multiinstance" ); // Multiinstance flag +_LIT8( KConfigurationAttrDescription, "desc" ); // Widget's description +_LIT8( KConfigurationAttrLockingStatus, "locking_status" ); // Locking status + +// Configuration element state attribute values +_LIT8( KConfStateNotConfirmed, "NotConfirmed" ); // Not confirmed state +_LIT8( KConfStateWaitForConfirmation, "WaitForConfirmation" );// Wait for confirmation state +_LIT8( KConfStateConfirmed, "Confirmed" ); // Confirmed state +_LIT8( KConfStateError, "Error" ); // Error state + +// Control element +_LIT8( KControlElement, "control" ); +_LIT8( KControlAttrName, "name" ); // Localized name of the configuration + +// Plugins element +_LIT8( KPluginsElement, "plugins" ); + +// Plugin element +_LIT8( KPluginElement, "plugin" ); +_LIT8( KPluginAttrId, "id" ); // Unique for this configuration +_LIT8( KPluginAttrUid, "uid" ); // Globally unique uid, identifies specific configuration +_LIT8( KPluginAttrInterface, "interface" ); // AI3/? +_LIT8( KPluginAttrName, "name" ); // Localized name of the plugin +_LIT8( KPluginAttrActive, "active" ); // Plugin activation state + +// Settings element +_LIT8( KSettingsElement, "settings" ); +_LIT8( KSettingsAttrId, "id" ); // Identifies the personalized plugin + +// Item +_LIT8( KItemElement, "item" ); // +_LIT8( KItemAttrId, "id" ); // Name of the attributes container +_LIT8( KItemAttrName, "name" ); // Localized name + +// Attribute +_LIT8( KAttributeElement, "attribute" ); +_LIT8( KAttributeAttrKey, "key" ); // References personalized property +_LIT8( KAttributeAttrName, "name" ); // Localized key value + +// Property +_LIT8( KPropertyElement, "property" ); +_LIT8( KPropertyAttrName, "name" ); // Property name +_LIT8( KPropertyAttrValue, "value" ); // Property value + +// Resources +_LIT8( KResourcesElement, "resources" ); + +// Object +_LIT8( KObjectElement, "object" ); +_LIT8( KObjectAttrFilename, "filename" ); +_LIT8( KObjectAttrName, "name" ); +_LIT8( KObjectAttrPath, "path" ); +_LIT8( KObjectAttrMediatype, "mediatype" ); +_LIT8( KObjectAttrTag, "tag" ); +_LIT8( KObjectAttrType, "type" ); + +// Tag values +_LIT8( KObjectAttrTagLogo, "logo"); +_LIT8( KObjectAttrTagPreview, "preview"); +#endif /*HSPSXMLELEMENTS_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsconfigurationservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsconfigurationservice.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,397 @@ +/* +* 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: Interface to HSPS service +* +*/ + +// SYSTEM INCLUDES +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "hspsconfigurationservice.h" +#include "hspsxmlelements.h" +#include "hspscallback.h" +#include "hspsserviceutilities.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +// ======== LOCAL CONSTANTS ======== + + + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsConfigurationService* CHspsConfigurationService::NewL() + { + CHspsConfigurationService* self = new (ELeave) CHspsConfigurationService; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CHspsConfigurationService::~CHspsConfigurationService() + { + iPluginIds.Close(); + if(iHspsRequestClient) + { + iHspsRequestClient->hspsCancelGetODTUpdate(); + } + + if( iCallback ) + { + delete iCallback; + iCallback = NULL; + } + + + delete iHspsRequestClient; + delete iHspsODT; + delete iNotifyParams; + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CHspsConfigurationService::CHspsConfigurationService() : + iInvalidODT ( ETrue ) + { + } + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +void CHspsConfigurationService::ConstructL() + { + iHspsODT = ChspsODT::NewL(); + iHspsRequestClient = ChspsRequestClient::NewL( *this ); + iNotifyParams = ChspsRequestNotificationParams::NewL(); + iPluginIds.Reset(); + } + +// ----------------------------------------------------------------------------- +// Gets requested configuration. +// ----------------------------------------------------------------------------- +EXPORT_C ChspsDomDocument& CHspsConfigurationService::GetDOML() + { + if( !iHspsODT || + !iHspsODT->DomDocument().RootNode() ) + { + //Odt is not parsed, leave. + User::Leave( KErrNotFound ); + } + + // If current ODT is invalidated, then update it. + if( iInvalidODT ) + { + GetODTL( iHspsODT->RootUid() ); + } + + return iHspsODT->DomDocument(); + } + +// ----------------------------------------------------------------------------- +// Gets application configuration ODT +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsConfigurationService::GetODTL( const TInt aAppUid ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "CHspsConfigurationService::GetODTL" ) ); + } +#endif + + // Fetch application configuration + ThspsServiceCompletedMessage retOdt = iHspsRequestClient->hspsGetODT( + aAppUid, + *iHspsODT ); + if ( retOdt != EhspsGetODTSuccess ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "CHspsConfigurationService::GetActiveConfigurationL(): - Failed to find a configuration" ) ); + } +#endif + + User::Leave( KErrNotFound ); + } + else + { + // ODT is now valid. + iInvalidODT = EFalse; + /* + // Start observing ODT changes + if ( EhspsServiceRequestSheduled != iHspsRequestClient->hspsGetODTUpdate() ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "CHspsConfigurationService::GetActiveConfigurationL(): - Failed to start observing" ) ); + } +#endif + + User::Leave( KErrGeneral ); + } + */ + } + +#ifdef HSPS_LOG_ACTIVE + if( iHspsODT && iLogBus ) + { + ChspsOdtDump::Dump( *iHspsODT, *iLogBus ); + } +#endif + } + +// ----------------------------------------------------------------------------- +// Gets application UID of active configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsConfigurationService::GetAppUidL( + TInt& aAppUid ) + { + if( !iHspsODT || + !iHspsODT->DomDocument().RootNode() ) + { + //Odt is not parsed, leave. + User::Leave( KErrNotFound ); + } + aAppUid = iHspsODT->RootUid(); + } + +// ----------------------------------------------------------------------------- +// Set log bus. +// ----------------------------------------------------------------------------- +#ifdef HSPS_LOG_ACTIVE +EXPORT_C void CHspsConfigurationService::SetLogBus( ChspsLogBus* aLogBus ) + { + iLogBus = aLogBus; + } +#else +EXPORT_C void CHspsConfigurationService::SetLogBus( ChspsLogBus* /*aLogBus*/ ) + { + } +#endif + +// ----------------------------------------------------------------------------- +// See header for comments. +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsConfigurationService::InvalidateODT() + { + iInvalidODT = ETrue; + } + +// ----------------------------------------------------------------------------- +// Gets application configuration family +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsConfigurationService::GetFamilyL( + TUint32& aFamily ) + { + if( !iHspsODT || + !iHspsODT->DomDocument().RootNode() ) + { + //Odt is not parsed, leave. + User::Leave( KErrNotFound ); + } + aFamily = iHspsODT->Family(); + } + +// ----------------------------------------------------------------------------- +// Gets application UID of active configuration +// ----------------------------------------------------------------------------- +EXPORT_C TInt CHspsConfigurationService::RegisterObserverL(CHspsReqNotifCallback* aCallBack ) + { + + if( !aCallBack ) + { + return KErrArgument; + } + if ( !iHspsRequestClient ) + { + // Not suppose tp happen since iHspsRequestClient is created during service attach + return KErrGeneral; + } + + if( iCallback ) + { + return KErrInUse; + } + + iHspsRequestClient->hspsCancelGetODTUpdate(); + if( !iCallback ) + { + iCallback = aCallBack; + } + + // Start observing ODT changes + + if ( EhspsServiceRequestSheduled != iHspsRequestClient->hspsGetODTUpdate() ) + { +#ifdef HSPS_LOG_ACTIVE + if( iLogBus ) + { + iLogBus->LogText( _L( "CHspsConfigurationService::GetActiveConfigurationL(): - Failed to start observing" ) ); + } +#endif + + return KErrGeneral; + } + return KErrNone; + } +// ----------------------------------------------------------------------------- +// Gets application UID of active configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsConfigurationService::UnRegisterObserverL() + { + + if ( !iHspsRequestClient ) + { + // Not suppose tp happen since iHspsRequestClient is created during service attach + User::Leave( KErrGeneral ); + } + iHspsRequestClient->hspsCancelGetODTUpdate(); + + if(iCallback) + { + delete iCallback; + iCallback = NULL; + } + } +// --------------------------------------------------------------------------- +// Hsps client request service observer +// --------------------------------------------------------------------------- +// +void CHspsConfigurationService::HandlehspsRequestClientMessageL( ThspsServiceCompletedMessage aMessage, + ChspsRequestNotificationParams& aParams ) + { + if( aMessage == EhspsGetODTUpdateStatus || aMessage == EhspsGetODTUpdateHot ) + { + if(iCallback) + { + if( !ParseNotificationDataL(aParams) ) + { + // Invalidate member ODT for specific events. + if( iNotifyParams->iEvent != EhspsCacheUpdate && + iNotifyParams->iEvent != EhspsClean && + iNotifyParams->iEvent != EhspsNoEvent ) + { + InvalidateODT(); + } + + // Notify. + iCallback->NotifyResultL( KErrNone, *iNotifyParams, iPluginIds ); + + // Reset. + iPluginIds.Reset(); + iNotifyParams->ResetData(); + + } + } + } + if(aMessage == EhspsServiceRequestError) + { + // Invalidate ODT. + InvalidateODT(); + + if(iCallback) + { + iCallback->NotifyResultL( KErrGeneral, *iNotifyParams, iPluginIds); + iPluginIds.Reset(); + iNotifyParams->ResetData(); + } + } + + iHspsRequestClient->hspsCancelGetODTUpdate(); + if( EhspsServiceRequestSheduled != iHspsRequestClient->hspsGetODTUpdate() ) + { + User::Leave( KErrGeneral ); + } + + } + +// --------------------------------------------------------------------------- +// Sends events to observers +// --------------------------------------------------------------------------- +// +TInt CHspsConfigurationService::ParseNotificationDataL( ChspsRequestNotificationParams& aParams ) + { + TInt err = KErrNone; + + // Get client's appuid + const TInt appUid = iHspsODT->RootUid(); + + // If this is a broadcast to all clients + if( aParams.iAppUid == 0 ) + { + // Send widget was installed, uninstalled or updated notifications only + if ( aParams.iEvent != EhspsODTAdded + && aParams.iEvent != EhspsClean + && aParams.iEvent != EhspsODTUpdated ) + { + // Block other notifications + err = KErrGeneral; + } + } + else if ( appUid != aParams.iAppUid ) + { + // Block notifications which were sent to other clients + err = KErrGeneral; + } + + if( !err ) + { + iPluginIds.Reset(); + iNotifyParams->iEvent = aParams.iEvent; + iNotifyParams->iAppUid = aParams.iAppUid; + iNotifyParams->iOrigUid = aParams.iOrigUid; + iNotifyParams->iAppConfUid = aParams.iAppConfUid; + iNotifyParams->iPluginUid = aParams.iPluginUid; + iNotifyParams->iCount = aParams.iCount; + + for(TInt i=0; i < iNotifyParams->iCount; i++ ) + { + iPluginIds.Append( aParams.iPluginIds[i] ); + } + + iNotifyParams->SetNameL(aParams.Name()); + } + + return err; + } + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspspersonalisationservice.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,441 @@ +/* +* 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: Interface to HSPS service +* +*/ + +#include "hspspersonalisationservice.h" +#include "hspsserviceutilities.h" + + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +EXPORT_C CHspsPersonalisationService* CHspsPersonalisationService::NewL() + { + CHspsPersonalisationService* self = new (ELeave) CHspsPersonalisationService; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CHspsPersonalisationService::~CHspsPersonalisationService() + { + if ( iHspsClient ) + { + // Cancel asynchronous requests + + // Delete client + delete iHspsClient; + } + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CHspsPersonalisationService::CHspsPersonalisationService() + { + } + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +void CHspsPersonalisationService::ConstructL() + { + iHspsClient = ChspsClient::NewL( *this ); + } + +// ----------------------------------------------------------------------------- +// Get Plugin list +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::GetPluginListL( + TDesC8& aInterface, + TDesC8& aType, + TUint32 aFamily, + CArrayPtrFlat& aList ) + { + // Setup a mask for finding plugins with defined interface + ChspsODT *searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + TInt interfaceUid = HspsServiceUtilities::HexString2IntL( aInterface ); + searchMask->SetRootUid( interfaceUid ); + if ( aType.Length() > 0 ) + { + TUint type; + HspsServiceUtilities::GetConfigurationTypeL( + aType, + type ); + searchMask->SetConfigurationType( type ); + } + + searchMask->SetFamily( aFamily ); + + TInt err = iHspsClient->hspsGetHeaders( + *searchMask, + aList ); + + CleanupStack::PopAndDestroy( searchMask ); + + if ( err == KErrNotFound ) + { + // Plugin list empty + aList.ResetAndDestroy(); + err = KErrNone; + } + + User::LeaveIfError( err ); + } + +// ----------------------------------------------------------------------------- +// Add plugin to the configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::AddPluginL( + TInt aAppUid, + TDesC8& aConfId, + TDesC8& aPluginUid, + TDesC8& aPosition, + TInt& aPluginId ) + { + + TInt confId = HspsServiceUtilities::DecString2Int( aConfId ); + TInt pluginUid = HspsServiceUtilities::HexString2IntL( aPluginUid ); + if ( confId < 1 || pluginUid < 1 ) + { + User::Leave( KErrArgument ); + } + + TInt position( -1 ); + if ( aPosition.Length() > 0 ) + { + position = HspsServiceUtilities::DecString2Int( aPosition ); + } + + ThspsServiceCompletedMessage ret = iHspsClient->hspsAddPlugin( + aAppUid, + confId, + pluginUid, + position, + aPluginId ); + + if ( ret != EhspsAddPluginSuccess ) + { + // Check if disk full error case. + ChspsResult* errorDetails = ChspsResult::NewL(); + CleanupStack::PushL( errorDetails ); + iHspsClient->GethspsResult( *errorDetails ); + + if( errorDetails->iXuikonError == KErrDiskFull ) + { + User::Leave( KErrDiskFull ); + } + + CleanupStack::PopAndDestroy( errorDetails ); + + // Other error cases. + User::Leave( KErrGeneral ); + } + } + +// ----------------------------------------------------------------------------- +// Remove plugin from the configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::RemovePluginL( + TInt aAppUid, + TDesC8& aPluginId ) + { + + TInt pluginId = HspsServiceUtilities::DecString2Int( aPluginId ); + if ( pluginId < 1 ) + { + User::Leave( KErrArgument ); + } + + ThspsServiceCompletedMessage ret = iHspsClient->hspsRemovePlugin( + aAppUid, + pluginId ); + + if ( ret != EhspsRemovePluginSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Set plugin settings +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::SetPluginSettingsL( + TInt aAppUid, + TDesC8& aPluginId, + ChspsDomDocument& aDom, + TBool aPluginStoringStatus) + { + + // Setup a mask for finding plugins with defined interface + ChspsODT *searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( aAppUid ); + const TInt id = HspsServiceUtilities::DecString2Int( aPluginId ); + ThspsServiceCompletedMessage ret = + iHspsClient->hspsSetPluginSettings( *searchMask, id, aDom, aPluginStoringStatus ); + + CleanupStack::PopAndDestroy( searchMask ); + + if ( ret != EhspsSetPluginSettingsSuccess ) + { + User::Leave( KErrGeneral ); + } + } + +// ----------------------------------------------------------------------------- +// Get plugin Odt +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::GetPluginOdtL( + TInt aAppUid, + TDesC8& aPluginUid, + ChspsODT* aPluginOdt ) + { + const TInt plugUid = HspsServiceUtilities::HexString2IntL( aPluginUid ); + ThspsServiceCompletedMessage ret = iHspsClient->hspsGetPluginOdtL( aAppUid, plugUid, aPluginOdt ); + + if( ret != EhspsGetPluginOdtSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Updates plugin positions in a configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::MovePluginsL( + const TInt aAppUid, + TDesC8& aConfId, + CArrayFixFlat& aPluginIds ) + { + const TInt confId = HspsServiceUtilities::DecString2Int( aConfId ); + if ( confId < 1 ) + { + User::Leave( KErrArgument ); + } + + const ThspsServiceCompletedMessage ret = iHspsClient->hspsMovePluginsL( + aAppUid, + confId, + aPluginIds ); + + if ( ret != EhspsMovePluginsSuccess ) + { + User::Leave( KErrArgument ); + } + } + +// ----------------------------------------------------------------------------- +// Gets a list of available application configurations +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::GetAppConfListL( + TInt aAppUid, + TUint32 aFamily, + CArrayPtrFlat& aList ) + { + // Setup a mask for finding application configurations + ChspsODT *searchMask = ChspsODT::NewL(); + CleanupStack::PushL( searchMask ); + searchMask->SetRootUid( aAppUid ); + searchMask->SetConfigurationType( EhspsAppConfiguration ); + searchMask->SetFamily( aFamily ); + + // Get application configurations + User::LeaveIfError( iHspsClient->hspsGetHeaders( + *searchMask, + aList ) ); + + CleanupStack::PopAndDestroy( searchMask ); + + } + +// ----------------------------------------------------------------------------- +// Set active application configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::SetActiveAppConfL( + TInt aAppUid, + TDesC8& aConfUid ) + { + + const TInt confUid = HspsServiceUtilities::HexString2IntL( aConfUid ); + + // Setup a set mask for active configuration + ChspsODT *setMask = ChspsODT::NewL(); + CleanupStack::PushL( setMask ); + setMask->SetRootUid( aAppUid ); + setMask->SetThemeUid( confUid ); + setMask->SetConfigurationType( EhspsAppConfiguration ); + + ChspsODT *activeConf = ChspsODT::NewL(); + CleanupStack::PushL( activeConf ); + + // Get application configurations + const ThspsServiceCompletedMessage ret = iHspsClient->hspsSetActiveTheme( + *setMask, + *activeConf ); + + CleanupStack::PopAndDestroy( activeConf ); + CleanupStack::PopAndDestroy( setMask ); + + if ( ret != EhspsSetActiveThemeSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Set active application configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::SetConfStateL( + TInt aAppUid, + TDesC8& aConfId, + TDesC8& aState, + TDesC8& aFilter ) + { + + const TInt confId = HspsServiceUtilities::DecString2Int( aConfId ); + + ThspsConfigurationState state; + HspsServiceUtilities::GetConfigurationStateL( aState, state ); + + ThspsConfStateChangeFilter filter; + HspsServiceUtilities::GetConfigurationStateFilterL( aFilter, filter ); + // Set configuration state + const ThspsServiceCompletedMessage ret = iHspsClient->hspsSetConfState( + aAppUid, + confId, + state, + filter ); + + if ( ret != EhspsSetConfStateSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Restore active application configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::RestoreActiveAppConfL( + TInt aAppUid, + TDesC8& aConfUid ) + { + + const TInt confUid = HspsServiceUtilities::HexString2IntL( aConfUid ); + + // Set configuration state + const ThspsServiceCompletedMessage ret = iHspsClient->hspsRestoreActiveAppConf( + aAppUid, + confUid ); + + if ( ret != EhspsRestoreActiveAppConfSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Activates a plugin in active application configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::SetActivePluginL( + TInt aAppUid, + TDesC8& aPluginId ) + { + + TInt pluginId = HspsServiceUtilities::DecString2Int( aPluginId ); + if ( pluginId < 1 ) + { + User::Leave( KErrArgument ); + } + + ThspsServiceCompletedMessage ret = iHspsClient->hspsSetActivePlugin( + aAppUid, + pluginId ); + + if ( ret != EhspsSetActivePluginSuccess ) + { + User::Leave( KErrNotFound ); + } + } + +// ----------------------------------------------------------------------------- +// Repaces a plugin in active application configuration +// ----------------------------------------------------------------------------- +EXPORT_C void CHspsPersonalisationService::ReplacePluginL( + const TInt aAppUid, + const TDesC8& aPluginId, + const TDesC8& aConfUid ) + { + const TInt pluginId = HspsServiceUtilities::DecString2Int( aPluginId ); + const TInt confUid = HspsServiceUtilities::HexString2IntL( aConfUid ); + if ( aAppUid < 1 || pluginId < 1 || confUid < 1 ) + { + User::Leave( KErrArgument ); + } + + const ThspsServiceCompletedMessage ret = iHspsClient->hspsReplacePlugin( + aAppUid, + pluginId, + confUid ); + + if( ret != EhspsReplacePluginSuccess ) + { + // Check if disk full error case. + ChspsResult* errorDetails = ChspsResult::NewL(); + CleanupStack::PushL( errorDetails ); + iHspsClient->GethspsResult( *errorDetails ); + + if( errorDetails->iXuikonError == KErrDiskFull ) + { + User::Leave( KErrDiskFull ); + } + + CleanupStack::PopAndDestroy( errorDetails ); + + // Other error cases. + User::Leave( KErrNotFound ); + } + } + + +// --------------------------------------------------------------------------- +// Hsps client service observer +// --------------------------------------------------------------------------- +// +void CHspsPersonalisationService::HandlehspsClientMessage( ThspsServiceCompletedMessage /*aMessage*/ ) + { + // Asynchronous service handling + + } +// ======== GLOBAL FUNCTIONS =================================================== + + +// End of file + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsserviceutilities.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/hspsservice/src/hspsserviceutilities.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,163 @@ +/* +* 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: HSPS Service utility class +* +*/ + + +#include "hspsserviceutilities.h" +#include "hspsliwvocabulary.hrh" + +// ======== STATIC FUNCTIONS =================================================== + +//---------------------------------------------------------------------------- +// HspsServiceUtilities::HexString2Int +// ---------------------------------------------------------------------------- +// +TInt HspsServiceUtilities::HexString2IntL( + const TDesC8& aStr ) + { + TLex8 lex( aStr ); + TUint value; + lex.Mark(); + + if( lex.Peek() == '0' ) + { + lex.Inc(); + } + if( lex.Peek() == 'x' ) + { + lex.Inc(); + } + lex.Mark(); + while ( lex.Peek().IsHexDigit() ) + { + lex.Inc(); + } + TPtrC8 uidToken = lex.MarkedToken(); + TLex8 uidLex( uidToken ); + User::LeaveIfError( uidLex.Val( value, EHex ) ); + return value; + } + +//---------------------------------------------------------------------------- +// HspsServiceUtilities::DecString2Int +// ---------------------------------------------------------------------------- +// +TInt HspsServiceUtilities::DecString2Int( + const TDesC8& aStr ) + { + TLex8 lex( aStr ); + TInt value(-1); + lex.Mark(); + + while ( lex.Peek().IsDigit() || lex.Peek()== '-' ) + { + lex.Inc(); + } + TPtrC8 uidToken = lex.MarkedToken(); + TLex8 uidLex( uidToken ); + TInt err = uidLex.Val( value ); + if ( err ) + { + value = -1; + } + + return value; + } + +//---------------------------------------------------------------------------- +// HspsServiceUtilities::GetConfigurationTypeL +// ---------------------------------------------------------------------------- +// +void HspsServiceUtilities::GetConfigurationTypeL( + const TDesC8& aTypeStr, + TUint& aType ) + { + if( aTypeStr.CompareF( KHspsLiwApplicationConf ) == 0 ) + { + aType = EhspsAppConfiguration; + } + else if ( aTypeStr.CompareF( KHspsLiwViewConf ) == 0 ) + { + aType = EhspsViewConfiguration; + } + else if ( aTypeStr.CompareF( KHspsLiwWidgetConf ) == 0 ) + { + aType = EhspsWidgetConfiguration; + } + else if ( aTypeStr.CompareF( KHspsLiwTemplateConf ) == 0 ) + { + aType = EhspsTemplateConfiguration; + } + else + { + User::Leave( KErrArgument ); + } + } + +//---------------------------------------------------------------------------- +// HspsServiceUtilities::GetConfigurationStateL +// ---------------------------------------------------------------------------- +// +void HspsServiceUtilities::GetConfigurationStateL( + const TDesC8& aStateStr, + ThspsConfigurationState& aState ) + { + if( aStateStr.CompareF( KHspsLiwConfNotConfirmed ) == 0 ) + { + aState = EhspsConfStateNotConfirmed; + } + else if ( aStateStr.CompareF( KHspsLiwConfWaitForConfirmation ) == 0 ) + { + aState = EhspsConfStateWaitForConfirmation; + } + else if ( aStateStr.CompareF( KHspsLiwConfConfirmed ) == 0 ) + { + aState = EhspsConfStateConfirmed; + } + else if ( aStateStr.CompareF( KHspsLiwConfError ) == 0 ) + { + aState = EhspsConfStateError; + } + else + { + User::Leave( KErrArgument ); + } + } + +//---------------------------------------------------------------------------- +// HspsServiceUtilities::GetConfigurationStateFilterL +// ---------------------------------------------------------------------------- +// +void HspsServiceUtilities::GetConfigurationStateFilterL( + const TDesC8& aFilterStr, + ThspsConfStateChangeFilter& aFilter ) + { + if( aFilterStr.CompareF( KHspsLiwConfFilterPlugins ) == 0 ) + { + aFilter = EhspsConfStateChangePlugins; + } + else if ( aFilterStr.Length() == 0 ) + { + aFilter = EhspsConfStateChangeNoFilter; + } + else + { + User::Leave( KErrArgument ); + } + } + +// End of file + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hsps_log_cfg.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hsps_log_cfg.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002-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: HSPS SAPI centralized logging enable / disable. Only to be included +* in mmp files. +* +*/ + + +#ifndef __HSPS_LOG_CFG_HRH__ +#define __HSPS_LOG_CFG_HRH__ + +// Comment this internal macro to disable logging. +//#define ____HSPS_CFG_LOG_ON____ + +// Following contains actual lines included into target mmp's by c preprocessor. +// These should not be touched when enabling or disabling logging. +#ifdef ____HSPS_CFG_LOG_ON____ + // HSPS_LOG_ACTIVE is visible to all c files in target project. This definition + // Should be used to restrict logging code from production code. + MACRO HSPS_LOG_ACTIVE + + // Link to hspsTools which contains all logging functionality hsps is using. + LIBRARY hspstools.lib +#endif // ____HSPS_CFG_LOG_ON____ + +#endif // __HSPS_LOG_CFG_HRH__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hspscallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspscallback.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* 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: Defination of class CHspsCallback +* +*/ + + +#ifndef __HSPSCALLBACK_H +#define __HSPSCALLBACK_H + +#include +#include +#include + +#include "hspsconfigurationservice.h" + + +/** + * @ingroup group_hsps_sapi + * HSPS callback interface, its pure interface class, application need to + * Write there own callback derriving from this class. + */ + + class MHspsCallback + { + /** + * Handles notifications caused by an asynchronous calls. + * + * @return Success/Error code for the callback. + */ + public: + + virtual void NotifyResultL( TInt aErrCode, ChspsRequestNotificationParams& aParams, RArray& aIds ) = 0; + }; + +/** +* @ingroup group_hsps_sapi +* This class provides asynchronous notifications to HSPS SAPI user +*/ +class CHspsReqNotifCallback : public CBase, public MHspsCallback + { + + public: + + /** + * Two-phase Constructor + * @return CHspsReqNotifCallback* + */ + static CHspsReqNotifCallback* NewL( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList &aPtrInParamList, TInt32 aTransactionId, + CHspsConfigurationService& aHspsService ); + + + /** + * Destructor. + */ + virtual ~CHspsReqNotifCallback(); + + /** + * Gives the result of asynchronous SAPI command Request Notification + * @param aErrCode errcode + * @param aResult Result + * @return void + */ + void NotifyResultL( TInt aErrCode, ChspsRequestNotificationParams& aParams, RArray& aIds ); + private: + + /** + * Constructor + */ + CHspsReqNotifCallback( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList &aPtrInParamList, TInt32 aTransactionId, + CHspsConfigurationService& aMcsService ); + + const TDesC8& ConvertEvent2LiwData( TInt aEvent ); + private: + + MLiwNotifyCallback* iPtrNotifyCallback; + const CLiwGenericParamList* iPtrInParamList; + TInt iTransactionId; + CHspsConfigurationService* iHspsConfigurationService; + }; + + +#endif __HSPSCALLBACK_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hspsconfigurationif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsconfigurationif.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,302 @@ +/* +* 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: Defination of class CHSPSConfigurationIf +* +*/ + + +#ifndef C_CHSPSCONFIGURATIONIF_H +#define C_CHSPSCONFIGURATIONIF_H + +#include +#include +#include +#include "hspsconfigurationservice.h" +#include "hspspersonalisationservice.h" + +//Forward declarations +class CHspsLiwUtilities; + + +#ifdef HSPS_LOG_ACTIVE +class ChspsLogBus; +class ChspsLiwDump; +#endif + +/** + * @ingroup group_hsps_sapi + * This class provides the HSPS SAPI configuration interface to LIW Framework +*/ +NONSHARABLE_CLASS( CHSPSConfigurationIf ) : public CBase, public MLiwInterface + { + public: + + /** + * Two-phased constructor. + * @return CHSPSConfigurationIf* + */ + static CHSPSConfigurationIf* NewL( TDesC8& aAppUid ); + + /** + * Destructor. + */ + virtual ~CHSPSConfigurationIf(); + + private: + + /** + * Constructor + */ + CHSPSConfigurationIf(); + + /** + * Symbian Constructor + * @param aAppUid Application identifier of a configuration. + */ + void ConstructL( TDesC8& aAppUid ); + + public: // From MLiwInterface class + + /** + * Executes the SAPI as per params + * @param aCmdName Command name defining which operation is to be performed + * @param aInParamList Input param list + * @param aOutParamList Output list + * @param aCmdOptions Command option + * @param aCallback Callback object pointer + */ + void ExecuteCmdL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + MLiwNotifyCallback* aCallback = 0 ); + + /** + * Closes the interface + */ + void Close(); + + + private: // New functions + + /** + * Calls SAPI method syncronously + * @param aCmdName Command name defining which operation is to be performed + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void SyncMethodCallL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Calls SAPI method asyncronously + * @param aCmdName Command name defining which operation is to be performed + * @param aInParamList Input param list + * @param aOutParamList Output param list + * @param aCmdOptions asynchronous sapi command options + * @param aCallback Callback object pointer + */ + void AsyncMethodCallL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions, + MLiwNotifyCallback* aCallback ); + + /** + * Returns active configuration of the application + * @param aOutParamList Output param list + */ + void GetActiveAppConfL( + CLiwGenericParamList& aOutParamList ); + + /** + * Returns plugin configuration of defined plugin + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void GetPluginConfL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Returns list of references to installed plugins + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void GetPluginsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Returns list of references to plugins in active application + * configuration + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void GetPluginListL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Adds a new plugin to the defined configuration + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void AddPluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Removes a plugin from the active configuration + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void RemovePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Replaces a plugin from the active configuration + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void ReplacePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Sets plugin settings + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void SetPluginSettingsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Gets plugin settings + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void GetPluginSettingsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Updates plugin positions + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void MovePluginsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + + /** + * Returns list of installed application configurations + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void GetAppConfsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Sets active application configuration + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void SetActiveAppConfL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Change Notification request + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @param aTransactionId Output param for async request to store transaction id + */ + void RequestNotificationL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback, + TInt32& aTransactionId ); + + /** + * Updates the configuration's state + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void SetConfStateL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Activates a plugin in plugin list + * @param aInParamList Input param list + * @param aOutParamList Output param list + */ + void SetActivePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ); + + /** + * Sets an error value to output parameter. + * @param aOutParamList Output param list + * @param aErr an error + * @return void + */ + void SetErrorL( + CLiwGenericParamList& aOutParamList, + TInt32 aErr ); + + private: // Data + + /** + * CHspsConfigurationService class pointer + */ + CHspsConfigurationService* iHspsConfigurationService; + + /** + * CHspsPersonalisationService class pointer + */ + CHspsPersonalisationService* iHspsPersonalisationService; + + /** + * LIW handler + */ + CHspsLiwUtilities* iHspsLiwUtilities; + /** + * CHspsReqNotifCallback class pointer + */ + + + +#ifdef HSPS_LOG_ACTIVE + /** + * Log bus. + */ + ChspsLogBus* iLogBus; + + /** + * Liw dump object. + */ + ChspsLiwDump* iLiwDump; +#endif + }; + + +#endif // C_CHSPSCONFIGURATIONIF_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwutilities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwutilities.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,447 @@ +/* +* 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: Build liw list from a DomDocument. +* +*/ + + +#ifndef _HSPSLIWUTILITIES_H_ +#define _HSPSLIWUTILITIES_H_ + +#include +#include +#include +#include +#include +#include + +#include "hspsliwvocabulary.hrh" +/* +* @ingroup group_hsps_sapi +* CHspsLiwUtilies is used to build liw based lists according to Dom Document received +* from HSPS server. It is also responsible for parsing liw based input parammeter list received from SAPI user. +*/ +class CHspsLiwUtilities : public CBase + { + // Data types + // Plugin map items (bit mask) + enum + { + EPluginMapId = 1, // bit 1 + EPluginMapUid = 2, // bit 2 + EPluginMapName = 4, // bit 3 + EPluginMapType = 8, // bit 4 + EPluginMapActivationState = 16, // bit 5 + EPluginMapDesc = 32, // bit 6 + EPluginMapLocked = 64 // bit 7 + }; + + // + // Construction + // + public: + + virtual ~CHspsLiwUtilities(); + static CHspsLiwUtilities* NewL(); + static CHspsLiwUtilities* NewLC(); + + private: + + CHspsLiwUtilities(); + void ConstructL(); + + // + // New methods + // + public: + /** + * Adds common status element to the output parameter list + * @param aStatus Operation status + * @param aOutParamList Output parameters + */ + static void AppendStatusL( + TInt32 aStatus, + CLiwGenericParamList& aOutParamList ); + + /** + * Configuration interface method. + * Gets a plugin from a configuration. + * @param aReturnName A name to code into return list. + * @param aPluginId An idetifier of the plugin that is to be returned. + * @param aDomDocument A document where the plugin is searched from. + * @param aOutParamList Container for the return value. + */ + void GetConfigurationL( + const TDesC8& aReturnName, + const TDesC8& aPluginId, + ChspsDomDocument& aDomDocument, + CLiwGenericParamList& aOutParamList ); + + /** + * Configuration interface method. + * Gets a settings from a plugin configuration. + * @param aReturnName A name to code into return list. + * @param aPluginId An idetifier of the plugin whose settings are to be returned. + * @param aDomDocument A document where the plugin is searched from. + * @param aSettingsDom value. + * @return an error code. + */ + TInt SetPluginSettingsNodeL( + const CLiwList& aItemList, + TDesC8& aPluginId, + ChspsDomDocument& aDomDocument, + ChspsDomDocument& aSettingsDom ); + + /** + * Creates GetPlugins method output parameter list + * @param aList List of plugin header ODT's + * @param aOutParamList Output parameters + */ + static void GetPluginsOutputL( + CArrayPtrFlat& aList, + CLiwGenericParamList& aOutParamList ); + + /** + * Creates GetPluginList method output parameter list + * @param aDom Dom document of active configuration + * @param aType Requested plugin type + * @param aPluginId Plugin which plugin list is requested + * @param aOutParamList Output parameters + */ + static void GetPluginListOutputL( + ChspsDomNode& aRootNode, + TDesC8& aType, + TDesC8& aPluginId, + CLiwGenericParamList& aOutParamList ); + + /** + * Creates AddPlugin method output parameter list + * @param aPluginId Id of added plugin + * @param aOutParamList Output parameters + */ + static void AddPluginOutputL( + TInt aPluginId, + CLiwGenericParamList& aOutParamList ); + + /** + * Creates RemovePlugin method output parameter list + * @param aOutParamList Output parameters + */ + static void RemovePluginOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Creates ReplacePlugin method output parameter list + * @param aOutParamList Output parameters + */ + static void ReplacePluginOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Creates SetPluginSettings method output parameter list + * @param aOutParamList Output parameters + */ + static void SetPluginSettingsOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Creates GetPluginSettings outputs. + * @param aDom - reference to settings dom + * @param aOutParamList - reference to out params list + */ + void GetPluginSettingsOutputL( + ChspsDomDocument& aDom, + CLiwGenericParamList& aOutParamList ); + + /** + * Creates MovePlugins method output parameter list + * @param aOutParamList Output parameters + */ + static void MovePluginsOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Get list of plugin id's from plugins list + * @param aPluginsList Plugins list + * @param aPluginIdLIst List of plugin id's + */ + static void GetPluginIdListL( + const CLiwList* aPluginsList, + CArrayFixFlat& aPluginIdList ); + + /** + * Creates GetAppConfs method output parameter list + * @param aList List of plugin header ODT's + * @param aOutParamList Output parameters + */ + static void GetAppConfsOutputL( + CArrayPtrFlat& aList, + CLiwGenericParamList& aOutParamList ); + + /** + * Creates SetActiveAppConf method output parameter list + * @param aOutParamList Output parameters + */ + static void SetActiveAppConfOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Creates SetConfState method output parameter list + * @param aOutParamList Output parameters + */ + static void SetConfStateOutputL( + CLiwGenericParamList& aOutParamList ); + + /** + * Returns value of defined attribute + * @param aNode node which attribute value is requested + * @param aAttrId requested attribute + * @param aAttrValue attribute value + */ + static void GetAttributeValueL( + ChspsDomNode& aNode, + const TDesC8& aAttrId, + TPtrC8& aAttrValue ); + + /** + * Finds a root node for liw structure from dom document by identifier. + * @param aNodeIdentifier An Tag. + * @param aNodeIdentifier An Identifier. + * @param aNode A Dom Node where the node is searched from. + * @return Result node. + */ + static ChspsDomNode& FindRootNodeByIdentifierL( const TDesC8& aNodeTag, + const TDesC8& aNodeIdentifier, + ChspsDomNode& aNode ); + + + + /** + * Finds a root node for liw structure from dom document by the tag. + * @param aNodeIdentifier An Tag. + + * @param aDomDocument A document where the node is searched from. + * @return Result node. + */ + ChspsDomNode& FindRootNodeByTagL(const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ); + + /** + * Creates SetActivePlugin method output parameter list + * @param aOutParamList Output parameters + */ + static void SetActivePluginOutputL( + CLiwGenericParamList& aOutParamList ); + + private: + + /** + * Copies a key-value pair to a map. + * @param aMap A Map where the key-value pair is added to. + * @param aAttrList A list where the key is searched from. + * @param aDomName Name of the value for the search. + * @param aLiwName Key name for the map. + * @param aDefaultValue Default value for attribute if not found from dom. + * @return An error code. + */ + static TInt AppendAttributeToMapL( CLiwDefaultMap& aMap, + ChspsDomList& aAttrList, + const TDesC8& aDomName, + const TDesC8& aLiwName, + const TDesC8& aDefaultValue = KHspsLiwEmptyValue() ); + + /** + * Builds a plugin map that contains child plugins, settings and resources. + * @param aConfigurationNode A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @return An error code. + */ + TInt BuildConfigurationMapL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ); + + /** + * Appends a list of flat (Does not contain child plugins, settings or + * resouces) plugins to a map. + * @param aConfigurationNode A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @return An error code. + */ + TInt AppendPluginsFlatL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ); + + /** + * Appends a single (flat) plugin to a map. + * @param aPluginNode A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @param aItemMask Bit mask defining which items are included in plugin map + * @return An error code. + */ + static TInt BuildPluginMapL( + ChspsDomNode& aPluginNode, + CLiwDefaultMap& aMap, + TInt aItemMask ); + + /** + * Builds settings list and appends items to it. + * @param aConfigurationNode A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the list is added to. + * @return An error code. + */ + TInt AppendSettingsL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ); + + /** + * Buils items map and attributes list. + * @param aItem A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @return An error code. + */ + TInt BuildItemsMapL( ChspsDomNode& aItem, CLiwDefaultMap& aMap ); + + /** + * Buils properties map. + * @param aProperty A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @return An error code. + */ + TInt BuildPropertiesMapL( ChspsDomNode& aProperty, CLiwDefaultMap& aMap ); + + /** + * Builds resources list and appends objects to it. + * @param aConfigurationNode A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the list is added to. + * @return An error code. + */ + TInt AppendResourcesL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ); + + /** + * Buils aObject map. + * @param aProperty A Dom node from which the liw structure is + * built from. + * @param aMap A Map where the plugin is added to. + * @return An error code. + */ + TInt BuildObjectMapL( ChspsDomNode& aObject, CLiwDefaultMap& aMap ); + + /** + * Builds item maps from item nodes (child nodes of settings node) + * and appends them to the settings list. + * @param aSettingsNode Settings node + * @param aList Settings list + */ + void AppendItemsL( + ChspsDomNode& aSettingsNode, + CLiwDefaultList& aList ); + + /** + * Buils plugin info list + * @param aList List of plugin ODT headers + * @param aPluginList List of plugin info maps + */ + static void BuildPluginInfoListL( + CArrayPtrFlat& aList, + CLiwDefaultList& aPluginInfoList ); + + /** + * Buils plugin info map + * @param aPluginHeader Plugin ODT header + * @param aPluginInfoMap Plugin info map + */ + static void BuildPluginInfoMapL( + ChspsODT& aPluginHeader, + CLiwDefaultMap& aPluginInfoMap ); + + /** + * Converts a configuration type enumeration to the corresponding + * configuration type string. + * @param aType + * @param aTypeStr Configuration type string + */ + static void GetConfigurationTypeStrL( + const TUint aType, + HBufC8** aTypeStr ); + + + TInt SetPluginPropertyNodeL( + const CLiwList& aPropertyList, + ChspsDomNode& aNode ); + + TInt SetPropertyAttributesL( + TDesC8& aAttrName, + TDesC8& aAttrValue, + ChspsDomNode& aNode ); + + /** + * Finds a child node from the child node list by the tag. + * @param aNodeTag Requested node tag. + * @param aParentNode Parent node + * @param aIndex Start index + * @return Result node and the index where the element was found + */ + static ChspsDomNode* FindChildNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aParentNode, + TInt& aIndex ); + + /** + * Buils application confoguration info list + * @param aList List of application configuration ODT headers + * @param aAppConfInfoList List of application configuration info maps + */ + static void BuildAppConfInfoListL( + CArrayPtrFlat& aList, + CLiwDefaultList& aAppConfInfoList ); + + /** + * Buils plugin info map + * @param aAppConfHeader Application configuration ODT header + * @param aAppConfInfoMap Application configuration info map + */ + static void BuildAppConfInfoMapL( + ChspsODT& aAppConfHeader, + CLiwDefaultMap& aAppConfInfoMap ); + + /** + * Buils plugin list + * @param aRootNode Root node of active application configuration + * @param aType Type of requested plugins + * @param aPluginId Plugin id which plugin list is requested + * @param aPluginList List of plugin maps + */ + static void BuildPluginListL( + ChspsDomNode& aRootNode, + TDesC8& aType, + TDesC8& aPluginId, + CLiwDefaultList& aPluginList ); + + /** + * Finds a parent node by the tag. + * @param aNodeTag Requested node tag. + * @param aChildNode Child node which parent node is requested + * @return Pointer to parent node or NULL if it is not found + */ + static ChspsDomNode* FindParentNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aChildNode ); + }; + +#endif /*HSPSLIWUTILITIES_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsliwvocabulary.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -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: SAPI vocabulary +* +*/ + + +#ifndef HSPSLIWVOCABULARY_HRH +#define HSPSLIWVOCABULARY_HRH +/* +* @ingroup homescreenpluginservice_sapi +* HSPS liw based vocabulary +*/ +//General words +_LIT8( KHspsLiwEmptyValue, "" ); + +// Configuration types +_LIT8( KHspsLiwApplicationConf, "application" ); +_LIT8( KHspsLiwViewConf, "view" ); +_LIT8( KHspsLiwWidgetConf, "widget" ); +_LIT8( KHspsLiwTemplateConf, "template" ); + +// Configuration states +_LIT8( KHspsLiwConfNotConfirmed, "NotConfirmed" ); +_LIT8( KHspsLiwConfWaitForConfirmation, "WaitForConfirmation" ); +_LIT8( KHspsLiwConfConfirmed, "Confirmed" ); +_LIT8( KHspsLiwConfError, "Error" ); + +// Configuration filters +_LIT8( KHspsLiwConfFilterPlugins, "Plugins" ); + +// SAPI methods +_LIT8( KGetActiveAppConf, "GetActiveAppConf" ); +_LIT8( KGetPluginConf, "GetPluginConf" ); +_LIT8( KGetPlugins, "GetPlugins" ); +_LIT8( KGetPluginList, "GetPluginList" ); +_LIT8( KAddPlugin, "AddPlugin" ); +_LIT8( KRemovePlugin, "RemovePlugin" ); +_LIT8( KReplacePlugin, "ReplacePlugin" ); +_LIT8( KSetPluginSettings, "SetPluginSettings" ); +_LIT8( KGetPluginSettings, "GetPluginSettings" ); +_LIT8( KMovePlugins, "MovePlugins" ); +_LIT8( KGetAppConfs, "GetAppConfs" ); +_LIT8( KSetActiveAppConf, "SetActiveAppConf" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KSetConfState, "SetConfState" ); +_LIT8( KSetActivePlugin, "SetActivePlugin" ); + +//Input words. +_LIT8( KPluginId, "pluginId" ); +_LIT8( KHspsLiwAppUid, "appUid" ); +_LIT8( KHspsLiwConfId, "confId" ); +_LIT8( KHspsLiwConfUid, "confUid" ); +_LIT8( KHspsLiwConfState, "state" ); +_LIT8( KHspsLiwPluginUid, "pluginUid" ); +_LIT8( KHspsLiwAppConfUid, "appConfUid" ); +_LIT8( KHspsLiwPosition, "position" ); +_LIT8( KHspsLiwFilter, "filter" ); +_LIT8( KHspsLiwStoringParams, "storingParams" ); //optional +_LIT8( KHspsLiwStorePluginRefence, "storePluginConf" ); +_LIT8( KHspsLiwStoreAppConf, "storeAppConf" ); +//Output words. +_LIT8( KHspsLiwPluginId, "pluginId" ); +_LIT8( KHspsLiwPluginIds, "pluginIds" ); + +_LIT8( KHspsLiwStatus, "status" ); + +_LIT8( KHspsLiwAppConf, "appConf" ); +_LIT8( KHspsLiwPluginConf, "pluginConf" ); +_LIT8( KHspsLiwReturnValue, "ReturnValue" ); +_LIT8( KHspsLiwNotification, "notification" ); +_LIT8( KHspsLiwId, "id" ); +_LIT8( KHspsLiwType, "type" ); +_LIT8( KHspsLiwInterface, "interface" ); +_LIT8( KHspsLiwUid, "uid" ); +_LIT8( KHspsLiwName, "name" ); +_LIT8( KHspsLiwState, "state" ); +_LIT8( KHspsLiwMaxChild, "max_child" ); +_LIT8( KHspsLiwPlugins, "plugins" ); +_LIT8( KHspsLiwAppConfs, "appConfs" ); +_LIT8( KHspsLiwActivationState, "activationstate" ); +_LIT8( KHspsLiwMultiInstance, "multiinstance" ); +_LIT8( KHspsLiwDescription, "desc" ); +_LIT8( KHspsLiwLogo, "logo" ); +_LIT8( KHspsLiwPreview, "preview" ); +_LIT8( KHspsLiwOrigUid, "origUid" ); +_LIT8( KHspsLiwLockingStatus, "locking_status" ); +_LIT8( KHspsLiwLockingNone, "none" ); + +_LIT8( KHspsLiwSettings, "settings" ); +_LIT8( KHspsLiwSettingsId, "settingsId" ); + +_LIT8( KHspsLiwItems, "items" ); +_LIT8( KHspsLiwItemId, "itemId" ); +_LIT8( KHspsLiwItemName, "name" ); + +_LIT8( KHspsLiwAttributes, "attributes" ); +_LIT8( KHspsLiwAttrKey, "key" ); +_LIT8( KHspsLiwAttrName, "name" ); + +_LIT8( KHspsLiwProperties, "properties" ); +_LIT8( KHspsLiwPropertyName, "name" ); +_LIT8( KHspsLiwPropertyValue, "value" ); + +_LIT8( KHspsLiwResources, "resources" ); +_LIT8( KHspsLiwObjectName, "name" ); +_LIT8( KHspsLiwObjectPath, "path" ); +_LIT8( KHspsLiwObjectMediatype, "mediatype" ); +_LIT8( KHspsLiwObjectType, "type" ); +_LIT8( KHspsLiwObjectTag, "tag" ); + +_LIT8(KErrorCode, "ErrorCode"); +_LIT8(KErrorMessage, "ErrorMessage"); +_LIT8(KReturnValue, "ReturnValue"); +_LIT8(KTransactionID, "TransactionID"); + +_LIT8(KReqNotifEvent, "event"); + +_LIT8(KReqNotifPluginInstalledEvent, "PluginInstalled"); +_LIT8(KReqNotifPluginUpdatedEvent, "PluginUpdated"); +_LIT8(KReqNotifPluginUnInstalledEvent, "PluginUninstalled"); +_LIT8(KReqNotifRemovePluginEvent, "PluginRemoved"); +_LIT8(KReqNotifAddPluginEvent, "PluginAdded"); +_LIT8(KReqNotifSettingsChangedEvent, "PluginSettingsChanged"); +_LIT8(KReqNotifAppConfActivetedEvent, "AppConfActivated"); +_LIT8(KReqNotifPluginActivatedEvent, "PluginActivated"); +_LIT8(KReqNotifPluginReplacedEvent, "PluginReplaced"); + +#endif //HSPSLIWVOCABULARY_HRH diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/inc/hspsprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/inc/hspsprovider.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,76 @@ +/* +* 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: Defination of class CHSPSProvider +* +*/ + + +#ifndef C_CHSPSPROVIDER_H +#define C_CHSPSPROVIDER_H + +#include +#include + +/** +* @ingroup group_hsps_sapi +* Provides implementation to HSPS SAPI provider +* +**/ +NONSHARABLE_CLASS( CHSPSProvider ) : public CLiwServiceIfBase + { + public: + static CHSPSProvider* NewL(); + + + // CLiwServiceIfBase member functions + /** + * Called by the LIW framework to initialise necessary information + * from the Service Handler. This method is called when the consumer makes + * the attach operation. + * + * @param aFrameworkCallback Framework provided callback for provider to send + * events to framework. + * @param aInterest List of criteria items which invoked the provider. + */ + void InitialiseL( + MLiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest ); + + /** + * Called by the LIW framework to instantiate the requested interface + * + * @param aCmdId Command to be executed. + * @param aInParamList Input parameters, can be an empty list. + * @param aOutParamList Output parameters, can be an empty list. + * @param aCmdOptions Options for the command, see KLiwOpt* in LiwCommon.hrh. + * @param aCallback Callback for asynchronous command handling, parameter checking, etc. + * @leave KErrArgument Callback is missing when required. + * @leave KErrNotSupported No provider supports service. + */ + void HandleServiceCmdL( + const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + const MLiwNotifyCallback* aCallback = NULL ); + + private: + /** + * Constructor. + */ + CHSPSProvider(); + + }; + +#endif C_CHSPSPROVIDER_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/rom/hspssapi.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/rom/hspssapi.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 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 HSPSSAPI_IBY +#define HSPSSAPI_IBY + +#include + +file=ABI_DIR\BUILD_DIR\hspsservice.dll SHARED_LIB_DIR\hspsservice.dll +ECOM_PLUGIN( hspsprovider.dll, hspsprovider.rsc ) + +// Uncomment following lines to include test environment and test cases. +// file=ABI_DIR\BUILD_DIR\mt_hspsconfigurationif.dll SHARED_LIB_DIR\mt_hspsconfigurationif.dll +// file=ABI_DIR\BUILD_DIR\mt_hspsprovider.dll SHARED_LIB_DIR\mt_hspsprovider.dll +// #include + +#endif \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/src/hspscallback.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspscallback.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "hspscallback.h" +#include "hspsconfigurationservice.h" +#include "hspsliwvocabulary.hrh" +#include "hspsserviceutilities.h" +#include + +// --------------------------------------------------------------------------- +// Two-phase Constructor +// --------------------------------------------------------------------------- +// +CHspsReqNotifCallback* CHspsReqNotifCallback::NewL( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList& aPtrInParamList, + TInt32 aTransactionId, CHspsConfigurationService& aHspsConfigurationService ) + { + return new (ELeave) CHspsReqNotifCallback( aPtrNotifyCallback, aPtrInParamList, aTransactionId, + aHspsConfigurationService ); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CHspsReqNotifCallback::CHspsReqNotifCallback( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList& aPtrInParamList, + TInt32 aTransactionId, CHspsConfigurationService& aHspsConfigurationService ) + { + iPtrNotifyCallback = aPtrNotifyCallback; + iPtrInParamList = &aPtrInParamList; + iTransactionId = aTransactionId; + iHspsConfigurationService = &aHspsConfigurationService; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CHspsReqNotifCallback::~CHspsReqNotifCallback() + { + + } +// --------------------------------------------------------------------------- +// Gives the result of asynchronous SAPI calls +// --------------------------------------------------------------------------- +// +void CHspsReqNotifCallback::NotifyResultL( TInt aErrCode, + ChspsRequestNotificationParams& aParams, RArray& aIds ) + { + + + + CLiwGenericParamList* outParams = CLiwGenericParamList::NewL(); + + CleanupStack::PushL( outParams ); + + + if ( aErrCode == KErrNone ) + { + CLiwDefaultMap* notifMap = CLiwDefaultMap::NewL(); + CleanupStack::PushL( notifMap ); + + + TPtrC8 event = ConvertEvent2LiwData(aParams.iEvent); + + notifMap->InsertL( KReqNotifEvent, TLiwVariant( event ) ); + + if( aParams.iAppConfUid ) + { + TBuf8<10> appConfUid; + appConfUid.Append( '0' ); + appConfUid.Append( 'x' ); + appConfUid.AppendNum( aParams.iAppConfUid, EHex ); + + notifMap->InsertL( KHspsLiwAppConfUid, TLiwVariant( appConfUid ) ); + } + else + { + notifMap->InsertL( KHspsLiwAppConfUid, TLiwVariant( KHspsLiwEmptyValue ) ); + } + + if( aParams.iOrigUid ) + { + TBuf8<10> origUid; + origUid.Append( '0' ); + origUid.Append( 'x' ); + origUid.AppendNum( aParams.iOrigUid, EHex ); + + notifMap->InsertL( KHspsLiwOrigUid, TLiwVariant( origUid ) ); + } + else + { + notifMap->InsertL( KHspsLiwOrigUid, TLiwVariant( KHspsLiwEmptyValue ) ); + } + + if( aParams.Name().Length() > 0 ) + { + TBufC<255> buf(aParams.Name()); + TDesC& name16 = const_cast(aParams.Name()); + //name ( 16 bit string to 8 bit string ) + HBufC8* name8 = HBufC8::NewL( name16.Length() ); + CleanupStack::PushL( name8 ); + TPtr8 namePtr = name8->Des(); + namePtr.Copy( aParams.Name() ); + + notifMap->InsertL( KHspsLiwName, TLiwVariant( namePtr )); + CleanupStack::PopAndDestroy( name8 ); + } + else + { + notifMap->InsertL( KHspsLiwName, TLiwVariant( KHspsLiwEmptyValue )); + } + if( aParams.iPluginUid ) + { + TBuf8<10> pluginUid; + pluginUid.Append( '0' ); + pluginUid.Append( 'x' ); + pluginUid.AppendNum( aParams.iPluginUid, EHex ); + + notifMap->InsertL( KHspsLiwPluginUid, TLiwVariant( pluginUid ) ); + } + else + { + notifMap->InsertL( KHspsLiwPluginUid, TLiwVariant( KHspsLiwEmptyValue )); + } + + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + + + for(TInt i = 0; i< aIds.Count(); i++) + { + TBuf8<10> pluginId; + pluginId.AppendNum( aIds[i], EDecimal ); + list->AppendL(TLiwVariant( pluginId )); + } + notifMap->InsertL(KHspsLiwPluginIds, list); + + + + TLiwVariant rootMapVariant; + rootMapVariant.Set( notifMap ); + //Put iterable into outParamList + TLiwGenericParam rootMapParam; + rootMapParam.SetNameAndValueL( KHspsLiwNotification, rootMapVariant ); + outParams->AppendL( rootMapParam ); + CleanupStack::Pop( list ); + list->DecRef(); + + CleanupStack::Pop( notifMap ); + notifMap->DecRef(); + rootMapParam.Reset(); + rootMapVariant.Reset(); + } + else + { + outParams->AppendL( TLiwGenericParam(KHspsLiwStatus, + TLiwVariant((TInt32) aErrCode ))); + } + + //KLiwEventCompleted is used currently since our test cases and system + //are not supported KLiwEventInProgress type of notification mechanism + TInt event = KLiwEventInProgress; + if ( aErrCode == KErrCancel ) + { + // event = KLiwEventCanceled; + } + else if ( aErrCode != KErrNone ) + { + // event = KLiwEventStopped; + + outParams->AppendL( TLiwGenericParam(KErrorMessage, + TLiwVariant(_L("HSPS:RequestNotification:Notification stopped")))); + } + + ((MLiwNotifyCallback*)iPtrNotifyCallback)->HandleNotifyL( iTransactionId, + event, + *outParams, + *((CLiwGenericParamList*)iPtrInParamList) ); + + CleanupStack::PopAndDestroy( outParams ); + + } +// --------------------------------------------------------------------------- +// Convert plugin Registry notification event to LIW format +// --------------------------------------------------------------------------- +// +const TDesC8& CHspsReqNotifCallback::ConvertEvent2LiwData( TInt aEvent ) + { + + if( aEvent == EhspsODTAdded ) + { + return KReqNotifPluginInstalledEvent; + } + else if( aEvent == EhspsODTUpdated ) + { + return KReqNotifPluginUpdatedEvent; + } + else if( aEvent == EhspsODTRemoved ) + { + return KReqNotifRemovePluginEvent; + } + else if( aEvent == EhspsODTModified ) + { + return KReqNotifAddPluginEvent; + } + else if( aEvent == EhspsSettingsChanged ) + { + return KReqNotifSettingsChangedEvent; + } + else if( aEvent == EhspsODTActivated ) + { + return KReqNotifAppConfActivetedEvent; + } + else if( aEvent == EhspsClean ) + { + return KReqNotifPluginUnInstalledEvent; + } + else if ( aEvent == EhspsPluginActivated ) + { + return KReqNotifPluginActivatedEvent; + } + else if ( aEvent == EhspsPluginReplaced ) + { + return KReqNotifPluginReplacedEvent; + } + else + { + return KNullDesC8; + } + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsconfigurationif.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1165 @@ +/* +* 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: Implementation of CHSPSConfigurationIf class +* +*/ + + +#include +#include + +#include "hspsconfigurationif.h" +#include "hspsliwutilities.h" +#include "hspsliwvocabulary.hrh" +#include "hspsxmlelements.h" +#include "hspscallback.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +using namespace LIW; + + +// ======== LOCAL FUNCTIONS ==================================================== + +// ----------------------------------------------------------------------------- +// Cleanup function for CArrayPtrFlat arrays +// ----------------------------------------------------------------------------- +// +static void DeleteArrayItems( TAny* aObject ) + { + CArrayPtrFlat* array = reinterpret_cast*>( aObject ); + array->ResetAndDestroy(); + delete array; + } + +// ======== MEMBER FUNCTIONS =================================================== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CHSPSConfigurationIf* CHSPSConfigurationIf::NewL( TDesC8& aAppUid ) + { + CHSPSConfigurationIf* self = new (ELeave) CHSPSConfigurationIf(); + CleanupStack::PushL( self ); + self->ConstructL( aAppUid ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CHSPSConfigurationIf::~CHSPSConfigurationIf() + { + delete iHspsConfigurationService; + delete iHspsPersonalisationService; + delete iHspsLiwUtilities; + +#ifdef HSPS_LOG_ACTIVE + // Delete liw dump object before logbus + // since liw dump is dependant from ilogbus. + delete iLiwDump; + iLiwDump = NULL; + delete iLogBus; + iLogBus = NULL; +#endif + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +CHSPSConfigurationIf::CHSPSConfigurationIf() + { + } + +// ----------------------------------------------------------------------------- +// Symbian Constructor +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::ConstructL( TDesC8& aAppUid ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus = ChspsLogBusFile::NewL( ChspsLogBusFile::CreateLogFilename( _L("sapi_configurationIf") ) ); + iLiwDump = ChspsLiwDump::NewL( *iLogBus ); +#endif + + iHspsConfigurationService = CHspsConfigurationService::NewL(); + +#ifdef HSPS_LOG_ACTIVE + iHspsConfigurationService->SetLogBus( iLogBus ); +#endif + + //create ODT. + //Convert appUid. + TInt appIdInt = -1; + //convert appId to a number. + TLex8 input( aAppUid ); + TInt convErr = input.Val( appIdInt ); + if( convErr != KErrNone ) + { + User::Leave( KErrArgument ); + } + iHspsConfigurationService->GetODTL( appIdInt ); + + iHspsPersonalisationService = CHspsPersonalisationService::NewL(); + + iHspsLiwUtilities = CHspsLiwUtilities::NewL(); + } + +// ----------------------------------------------------------------------------- +// Executes the SAPI command +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::ExecuteCmdL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "CHSPSConfigurationIf::ExecuteCmdL" ) ); + iLiwDump->LogLiwListAsText( const_cast( aInParamList ) ); + iLiwDump->LogLiwListAsBinary( const_cast( aInParamList ) ); +#endif + + if ( aCallback ) + { + AsyncMethodCallL( + aCmdName, + aInParamList, + aOutParamList, + aCmdOptions, + aCallback ); + } + else + { + SyncMethodCallL( + aCmdName, + aInParamList, + aOutParamList ); + } + +#ifdef HSPS_LOG_ACTIVE + iLiwDump->LogLiwListAsText( aOutParamList ); + iLiwDump->LogLiwListAsBinary( aOutParamList ); +#endif + } + +// ----------------------------------------------------------------------------- +// Synchronous method calls +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SyncMethodCallL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt err; + //GETACTIVEAPPCONF + if ( aCmdName.CompareF( KGetActiveAppConf ) == 0 ) + { + TRAP( err, GetActiveAppConfL( aOutParamList ) ); + } + //GETPLUGINCONF + else if( aCmdName.CompareF( KGetPluginConf ) == 0 ) + { + TRAP( err, GetPluginConfL( aInParamList, aOutParamList ) ); + } + //GETPLUGINS + else if( aCmdName.CompareF( KGetPlugins ) == 0 ) + { + TRAP( err, GetPluginsL( aInParamList, aOutParamList ) ); + } + //GETPLUGINLIST + else if( aCmdName.CompareF( KGetPluginList ) == 0 ) + { + TRAP( err, GetPluginListL( aInParamList, aOutParamList ) ); + } + //ADDPLUGIN + else if( aCmdName.CompareF( KAddPlugin ) == 0 ) + { + TRAP( err, AddPluginL( aInParamList, aOutParamList ) ); + } + //REMOVEPLUGIN + else if( aCmdName.CompareF( KRemovePlugin ) == 0 ) + { + TRAP( err, RemovePluginL( aInParamList, aOutParamList ) ); + } + //REPLACEPLUGIN + else if( aCmdName.CompareF( KReplacePlugin ) == 0 ) + { + TRAP( err, ReplacePluginL( aInParamList, aOutParamList ) ); + } + //SETPLUGINSETTINGSL + else if( aCmdName.CompareF( KSetPluginSettings ) == 0 ) + { + TRAP( err, SetPluginSettingsL( aInParamList, aOutParamList ) ); + } + //GETPLUGINSETTINGSL + else if( aCmdName.CompareF( KGetPluginSettings ) == 0 ) + { + TRAP( err, GetPluginSettingsL( aInParamList, aOutParamList ) ); + } + //MOVEPLUGINSL + else if( aCmdName.CompareF( KMovePlugins ) == 0 ) + { + TRAP( err, MovePluginsL( aInParamList, aOutParamList ) ); + } + //GETAPPCONFSL + else if( aCmdName.CompareF( KGetAppConfs ) == 0 ) + { + TRAP( err, GetAppConfsL( aInParamList, aOutParamList ) ); + } + //SETACTIVEAPPCONFL + else if( aCmdName.CompareF( KSetActiveAppConf ) == 0 ) + { + TRAP( err, SetActiveAppConfL( aInParamList, aOutParamList ) ); + } + //SETCONFSTATEL + else if( aCmdName.CompareF( KSetConfState ) == 0 ) + { + TRAP( err, SetConfStateL( aInParamList, aOutParamList ) ); + } + //SETACTIVEPLUGIN + else if( aCmdName.CompareF( KSetActivePlugin ) == 0 ) + { + TRAP( err, SetActivePluginL( aInParamList, aOutParamList ) ); + } + //UNKNOWN COMMAND + else + { + // Invalid command + err = KErrArgument; + } + if ( err != KErrNone ) + { + SetErrorL( aOutParamList, err ); + } + } + +// ----------------------------------------------------------------------------- +// Asynchronous method calls +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::AsyncMethodCallL( + const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + TInt err = KErrNotSupported; + TInt32 transactionId = -1; + //REQUEST NOTIFICATION + if(aCmdName.CompareF( KRequestNotification ) == 0) + { + if( aCallback && !(aCmdOptions & KLiwOptCancel) ) + { + TRAP( err, RequestNotificationL( aInParamList, aCallback, transactionId ) ); + } + else + { + if ( aCmdOptions & KLiwOptCancel ) + { + TRAP(err, iHspsConfigurationService->UnRegisterObserverL()); + } + } + } + //UNKNOWN COMMAND + else + { + // Invalid command + err = KErrArgument; + } + // Append transaction id in case of asynchronous requests + if( aCallback && ( KLiwOptASyncronous & aCmdOptions ) && + ( err == KErrNone ) && ( transactionId != -1 ) ) + { + + SetErrorL( aOutParamList, err ); + aOutParamList.AppendL(TLiwGenericParam( KTransactionID, + TLiwVariant( TInt32( transactionId )))); + } + + + if ( err != KErrNone ) + { + SetErrorL( aOutParamList, err ); + } + } + +// ----------------------------------------------------------------------------- +// Error in the parameter. +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SetErrorL( CLiwGenericParamList& aOutParamList, + TInt32 err ) + { + aOutParamList.Reset(); + CHspsLiwUtilities::AppendStatusL( err, aOutParamList ); + } + +// ----------------------------------------------------------------------------- +// Closes the interface +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::Close() + { + delete this; + } + +// ----------------------------------------------------------------------------- +// Gets root plugin of active configuration. +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetActiveAppConfL( + CLiwGenericParamList& aOutParamList ) + { + //InParamList not needed, + TPtrC8 pluginId; + pluginId.Set( KHspsLiwEmptyValue ); + + // Get configuration node of application configuration + ChspsDomNode* node = &( iHspsLiwUtilities->FindRootNodeByTagL( + KConfigurationElement, + *( iHspsConfigurationService->GetDOML().RootNode() ) ) ); + + if ( !node ) + { + User::Leave( KErrNotFound ); + } + + // Get configuration state + TPtrC8 state; + CHspsLiwUtilities::GetAttributeValueL( + *node, + KConfigurationAttrState, + state ); + + if ( state.Compare( KConfStateError ) == 0 ) + { + // Restore active application configuration + TPtrC8 confUid; + CHspsLiwUtilities::GetAttributeValueL( + *node, + KConfigurationAttrUid, + confUid ); + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + iHspsPersonalisationService->RestoreActiveAppConfL( + appUid, + confUid ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + } + + iHspsLiwUtilities->GetConfigurationL( + KHspsLiwAppConf, + pluginId, + iHspsConfigurationService->GetDOML(), + aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Gets plugin of active configuration. +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetPluginConfL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt pos = 0; + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KPluginId ); + + if( inParam ) + { + TPtrC8 pluginId; + TLiwVariant inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + + iHspsLiwUtilities->GetConfigurationL( + KHspsLiwPluginConf, + pluginId, + iHspsConfigurationService->GetDOML(), + aOutParamList ); + } + else + { + User::Leave( KErrArgument ); + } + } + +// ----------------------------------------------------------------------------- +// Gets list of plugins with defined interface +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetPluginsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt pos; + TPtrC8 interface; + TPtrC8 type; + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + + // Get interface parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwInterface ); + + if( inParam ) + { + inParamVariant = inParam->Value(); + interface.Set( inParamVariant.AsData() ); + + // Get type parameter (optional) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwType ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + type.Set( inParamVariant.AsData() ); + } + + // Get headers list of defined interface + TUint32 family; + iHspsConfigurationService->GetFamilyL( family ); + CArrayPtrFlat* list = + new ( ELeave )CArrayPtrFlat( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) ); + iHspsPersonalisationService->GetPluginListL( + interface, + type, + family, + *list ); + + // Create GetPlugins output parameters + CHspsLiwUtilities::GetPluginsOutputL( *list, aOutParamList ); + CleanupStack::PopAndDestroy( list ); + } + else + { + // Invalid method call + User::Leave( KErrArgument ); + } + } + +// ----------------------------------------------------------------------------- +// Gets list of plugins with defined interface +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetPluginListL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + + TInt pos; + TPtrC8 pluginId; + TPtrC8 type; + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + + // Get type parameter + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwType ); + + if( inParam ) + { + inParamVariant = inParam->Value(); + type.Set( inParamVariant.AsData() ); + // Validate plugin type + if ( type.Compare( KHspsLiwViewConf ) != 0 && + type.Compare( KHspsLiwWidgetConf ) != 0 && + type.Compare( KHspsLiwTemplateConf ) != 0 ) + { + User::Leave( KErrArgument ); + } + } + + // Get plugin id parameter + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KPluginId ); + + if ( inParam ) + { + inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + // Check that plugin node exists + ChspsDomNode* node = &( CHspsLiwUtilities::FindRootNodeByIdentifierL( + KPluginElement, + pluginId, + *( iHspsConfigurationService->GetDOML().RootNode() ) ) ); + if ( !node ) + { + User::Leave( KErrNotFound ); + } + } + + // Create GetPluginList output parameters + CHspsLiwUtilities::GetPluginListOutputL( + *iHspsConfigurationService->GetDOML().RootNode(), + type, + pluginId, + aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Add a new plugin to the defined configuration +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::AddPluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt pos; + TPtrC8 confId; + TPtrC8 pluginUid; + TPtrC8 position; + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + TInt pluginId; + TInt err( KErrNone ); + + // Get confId parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwConfId ); + + if( inParam ) + { + inParamVariant = inParam->Value(); + confId.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + err = KErrArgument; + } + if ( err == KErrNone ) + { + // Get pluginUid parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwPluginUid ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + pluginUid.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + err = KErrArgument; + } + } + if ( err == KErrNone ) + { + // Get position parameter (optional) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwPosition ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + position.Set( inParamVariant.AsData() ); + } + } + + User::LeaveIfError( err ); + + // Add plugin + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + + iHspsPersonalisationService->AddPluginL( + appUid, + confId, + pluginUid, + position, + pluginId + ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::AddPluginOutputL( pluginId, aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Removes a plugin from the active configuration +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::RemovePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt err( KErrNone ); + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + TPtrC8 pluginId; + TInt pos; + + // Get pluginId parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KPluginId ); + + if( inParam ) + { + inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + err = KErrArgument; + } + + User::LeaveIfError( err ); + + // Remove plugin + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + + iHspsPersonalisationService->RemovePluginL( + appUid, + pluginId ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::RemovePluginOutputL( aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Replaces a plugin from the active configuration +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::ReplacePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt err( KErrNone ); + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + TPtrC8 pluginId; + TPtrC8 confUid; + TInt pos; + + // Get pluginId parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KPluginId ); + + if( inParam ) + { + inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + err = KErrArgument; + } + + if ( err == KErrNone ) + { + // Get pluginUid parameter (mandatory) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwConfUid ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + confUid.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + err = KErrArgument; + } + } + + + User::LeaveIfError( err ); + + // Get active application uid + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + + // Replace plugin in the application configuration + iHspsPersonalisationService->ReplacePluginL( + appUid, + pluginId, + confUid ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::ReplacePluginOutputL( aOutParamList ); + } + + +// ----------------------------------------------------------------------------- +// Sets plugin settings +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SetPluginSettingsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TInt error = KErrNone; + TPtrC8 pluginId; + TInt pos = 0; + TPtrC8 storingParams; + TBool pluginStoringStatus(EFalse); // EFalse only rootconfiguration is stored. + + const CLiwList* settingsList; + + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KPluginId ); + + if( inParam ) + { + TLiwVariant inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + } + else + { + // Mandatory element missing + error = KErrArgument; + } + + if( error == KErrNone ) + { + pos=0; + const TLiwGenericParam* settingsParam = aInParamList.FindFirst( pos, KHspsLiwSettings ); + TLiwVariant settingsParamVariant; + if( settingsParam ) + { + settingsParamVariant = settingsParam->Value(); + settingsList = settingsParamVariant.AsList(); + } + else + { + // Mandatory element missing + error = KErrArgument; + } + } + if( error == KErrNone ) + { + + ChspsDomDocument& domDocument = iHspsConfigurationService->GetDOML( ); + + ChspsDomDocument* settingsDom = ChspsDomDocument::NewL(); + CleanupStack::PushL( settingsDom ); + + error = iHspsLiwUtilities->SetPluginSettingsNodeL( + *settingsList, + pluginId, + domDocument, + *settingsDom + ); + + if( error == KErrNone ) + { + + // Get position parameter (optional) + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwStoringParams ); + + + if ( inParam ) + { + TLiwVariant inParamVariant = inParam->Value(); + storingParams.Set( inParamVariant.AsData() ); + if( storingParams.Compare( KHspsLiwStorePluginRefence ) == 0) + { + pluginStoringStatus = ETrue; + } + } + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + iHspsPersonalisationService->SetPluginSettingsL( + appUid, + pluginId, + *settingsDom, + pluginStoringStatus + ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + } + + CleanupStack::PopAndDestroy( settingsDom ); + } + + User::LeaveIfError( error ); + + // Create output parameters + CHspsLiwUtilities::SetPluginSettingsOutputL( aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Gets plugin settings +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetPluginSettingsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { +#ifdef HSPS_LOG_ACTIVE + iLogBus->LogText( _L( "CHSPSConfigurationIf::GetPluginSettingsL" ) ); +#endif + + TInt pos = 0; + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KHspsLiwPluginUid ); + + if( inParam ) + { + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + + TPtrC8 pluginUid; + TLiwVariant inParamVariant = inParam->Value(); + pluginUid.Set( inParamVariant.AsData() ); + + ChspsODT* settingsOdt = ChspsODT::NewL(); + CleanupStack::PushL( settingsOdt ); + iHspsPersonalisationService->GetPluginOdtL( appUid, pluginUid, settingsOdt ); + + // Create output parameters + iHspsLiwUtilities->GetPluginSettingsOutputL( settingsOdt->DomDocument(), aOutParamList ); + +#ifdef HSPS_LOG_ACTIVE + iLiwDump->LogLiwListAsText( aOutParamList ); +#endif + + CleanupStack::PopAndDestroy( settingsOdt ); + } + else + { + User::Leave( KErrArgument ); + } + + } + +// Updates plugin positions +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::MovePluginsL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + TPtrC8 confId; + TInt pos = 0; + CArrayFixFlat* idArray = NULL; + + // Get confId + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KHspsLiwConfId ); + if( !inParam ) + { + // Mandatory element missing + User::Leave( KErrArgument ); + } + + TLiwVariant inParamVariant = inParam->Value(); + confId.Set( inParamVariant.AsData() ); + + // Get plugin id list + pos = 0; + const TLiwGenericParam* pluginsParam = aInParamList.FindFirst( pos, KHspsLiwPlugins ); + if( !pluginsParam ) + { + // Mandatory element missing + User::Leave( KErrArgument ); + } + + TLiwVariant pluginsParamVariant; + pluginsParamVariant = pluginsParam->Value(); + const CLiwList* pluginsList = pluginsParamVariant.AsList(); + const TInt KGranularity = 5; + idArray = new ( ELeave )CArrayFixFlat( KGranularity ); + CleanupStack::PushL( idArray ); + CHspsLiwUtilities::GetPluginIdListL( pluginsList, *idArray ); + + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + iHspsPersonalisationService->MovePluginsL( + appUid, + confId, + *idArray ); + + CleanupStack::PopAndDestroy( idArray ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::MovePluginsOutputL( aOutParamList ); + } + +// ----------------------------------------------------------------------------- +// Returns list of installed application configurations +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::GetAppConfsL( + const CLiwGenericParamList& /*aInParamList*/, + CLiwGenericParamList& aOutParamList ) + { + // Get app UID of active configuration + TInt appUid( 0 ); + iHspsConfigurationService->GetAppUidL( appUid ); + + // Get list of application configurations + TUint32 family; + iHspsConfigurationService->GetFamilyL( family ); + CArrayPtrFlat* list = + new ( ELeave )CArrayPtrFlat( KHeaderListGranularity ); + CleanupStack::PushL( TCleanupItem( DeleteArrayItems, list ) ); + + iHspsPersonalisationService->GetAppConfListL( + appUid, + family, + *list ); + + // Create GetAppConfs output parameters + CHspsLiwUtilities::GetAppConfsOutputL( *list, aOutParamList ); + + // Cleanup application configuration list + CleanupStack::PopAndDestroy( list ); + } + +// ----------------------------------------------------------------------------- +// Set application active configuration +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SetActiveAppConfL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + // Get confUid + TPtrC8 confUid; + TInt pos = 0; + const TLiwGenericParam* inParam = aInParamList.FindFirst( + pos, + KHspsLiwConfUid ); + if( !inParam ) + { + // Mandatory element missing + User::Leave( KErrArgument ); + } + + TLiwVariant inParamVariant = inParam->Value(); + confUid.Set( inParamVariant.AsData() ); + + // Get app UID + TInt appUid( 0 ); + iHspsConfigurationService->GetAppUidL( appUid ); + + // Set application configuration + iHspsPersonalisationService->SetActiveAppConfL( appUid, confUid ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::SetActiveAppConfOutputL( aOutParamList ); + + } +// --------------------------------------------------------------------------- +// Change Notification request to HSPS Service +// --------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::RequestNotificationL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback, + TInt32& aTransactionId ) + { + aTransactionId = aCallback->GetTransactionID(); + + CHspsReqNotifCallback* cb = CHspsReqNotifCallback::NewL(aCallback, aInParamList, + aTransactionId, *iHspsConfigurationService ); + + CleanupStack::PushL( cb ); + + TInt status = iHspsConfigurationService->RegisterObserverL( cb ); + // Issue request + if( status == KErrNone) + { + CleanupStack::Pop( cb ); + } + else + { + CleanupStack::PopAndDestroy( cb ); + User::Leave(status); + } + } + +// ----------------------------------------------------------------------------- +// Updates configuration's state +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SetConfStateL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + + // Get confId + TPtrC8 confId; + TInt pos = 0; + const TLiwGenericParam* inParam = aInParamList.FindFirst( + pos, + KHspsLiwConfId ); + if( !inParam ) + { + // Mandatory element missing + User::Leave( KErrArgument ); + } + + TLiwVariant inParamVariant = inParam->Value(); + confId.Set( inParamVariant.AsData() ); + + // Get state + TPtrC8 state; + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwConfState ); + if( !inParam ) + { + // Mandatory element missing + User::Leave( KErrArgument ); + } + + inParamVariant = inParam->Value(); + state.Set( inParamVariant.AsData() ); + + // Get filter parameter (optional) + TPtrC8 filter; + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KHspsLiwFilter ); + if ( inParam ) + { + inParamVariant = inParam->Value(); + filter.Set( inParamVariant.AsData() ); + } + + // Get app UID + TInt appUid( 0 ); + iHspsConfigurationService->GetAppUidL( appUid ); + + // Set application configuration + iHspsPersonalisationService->SetConfStateL( appUid, confId, state, filter ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::SetConfStateOutputL( aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Gets list of plugins with defined interface +// ----------------------------------------------------------------------------- +// +void CHSPSConfigurationIf::SetActivePluginL( + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList ) + { + + TInt pos; + TPtrC8 pluginId; + const TLiwGenericParam* inParam; + TLiwVariant inParamVariant; + + // Get plugin id parameter + pos = 0; + inParam = aInParamList.FindFirst( + pos, + KPluginId ); + + if ( inParam ) + { + inParamVariant = inParam->Value(); + pluginId.Set( inParamVariant.AsData() ); + // Check that plugin node exists + ChspsDomNode* node = &( CHspsLiwUtilities::FindRootNodeByIdentifierL( + KPluginElement, + pluginId, + *( iHspsConfigurationService->GetDOML().RootNode() ) ) ); + if ( !node ) + { + User::Leave( KErrNotFound ); + } + } + else + { + // Manadatory plugin id parameter missing + User::Leave( KErrArgument ); + } + + // Activate plugin + TInt appUid; + iHspsConfigurationService->GetAppUidL( appUid ); + + iHspsPersonalisationService->SetActivePluginL( + appUid, + pluginId ); + + // Invalidate ODT. + iHspsConfigurationService->InvalidateODT(); + + // Create output parameters + CHspsLiwUtilities::SetActivePluginOutputL( aOutParamList ); + + } + +// ======== GLOBAL FUNCTIONS =================================================== + + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsliwutilities.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1545 @@ +/* +* 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: Build liw list from a DomDocument. +* +*/ + +#include +#include +#include +#include + +#include "hspsliwutilities.h" +#include "hspsxmlelements.h" +#include "hspsliwvocabulary.hrh" + +const TInt KMaxTextLength = 16 * 1024; // 16KB. + +_LIT8( KMaxChildDefault, "6" ); + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +CHspsLiwUtilities::CHspsLiwUtilities() + { + + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CHspsLiwUtilities::~CHspsLiwUtilities() + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CHspsLiwUtilities* CHspsLiwUtilities::CHspsLiwUtilities::NewL() + { + CHspsLiwUtilities* self = CHspsLiwUtilities::NewLC(); + CleanupStack::Pop( self ); //self + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CHspsLiwUtilities* CHspsLiwUtilities::CHspsLiwUtilities::NewLC() + { + CHspsLiwUtilities* self = new ( ELeave ) CHspsLiwUtilities(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// 2nd stage constructor +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// Adds common status element to the output parameter list +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::AppendStatusL( + TInt32 aStatus, + CLiwGenericParamList& aOutParamList ) + { + TLiwGenericParam param; + param.SetNameAndValueL( KHspsLiwStatus, TLiwVariant( aStatus ) ); + aOutParamList.AppendL( param ); + + param.Reset(); + + } + +// ----------------------------------------------------------------------------- +// Builds liw list from a dom document. +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetConfigurationL( + const TDesC8& aReturnName, + const TDesC8& aPluginId, + ChspsDomDocument& aDomDocument, + CLiwGenericParamList& aOutParamList ) + { + ChspsDomNode* node( NULL ); + TInt err = KErrNotFound; + //figure out what part of the dom is wanted. + //we have configuration id. + if( aPluginId.Length() > 0 ) + { + //we have plugin id. + //get view/widget configuration. + //finds configuration node with plugin id. + node = &( FindRootNodeByIdentifierL( KPluginElement, aPluginId, *aDomDocument.RootNode() )); + if ( node ) + { + node = &( FindRootNodeByTagL( KConfigurationElement, + *node )); + } + } + else + { + //get application configuration + //finds first configuration node. + node = &( FindRootNodeByTagL( KConfigurationElement, + *aDomDocument.RootNode() )); + } + + if( node ) + { + CLiwDefaultMap* rootMap = CLiwDefaultMap::NewL(); + CleanupStack::PushL( rootMap ); + + err = BuildConfigurationMapL( *node, *rootMap ); + //put map into the iterable. + TLiwVariant rootMapVariant; + rootMapVariant.Set( rootMap ); + //Put iterable into outParamList + TLiwGenericParam rootMapParam; + rootMapParam.SetNameAndValueL( aReturnName, rootMapVariant ); + aOutParamList.AppendL( rootMapParam ); + //Cleanup. + CleanupStack::Pop( rootMap ); + rootMap->DecRef(); + rootMapParam.Reset(); + } + + User::LeaveIfError( err ); + } + +// ----------------------------------------------------------------------------- +// Builds plugins list from plugin header list +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetPluginsOutputL( + CArrayPtrFlat& aList, + CLiwGenericParamList& aOutParamList ) + { + CLiwDefaultList* pluginList = CLiwDefaultList::NewL(); + CleanupStack::PushL( pluginList ); + + BuildPluginInfoListL( aList, *pluginList ); + + TLiwVariant listVariant; + listVariant.Set( pluginList ); + TLiwGenericParam param; + param.SetNameAndValueL( KHspsLiwPlugins, listVariant ); + aOutParamList.AppendL( param ); + + CleanupStack::Pop( pluginList ); + pluginList->DecRef(); + param.Reset(); + + } + +// ----------------------------------------------------------------------------- +// Builds plugins list from plugin node list +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetPluginListOutputL( + ChspsDomNode& aRootNode, + TDesC8& aType, + TDesC8& aPluginId, + CLiwGenericParamList& aOutParamList ) + { + CLiwDefaultList* pluginList = CLiwDefaultList::NewL(); + CleanupStack::PushL( pluginList ); + + BuildPluginListL( + aRootNode, + aType, + aPluginId, + *pluginList ); + + TLiwVariant listVariant; + listVariant.Set( pluginList ); + TLiwGenericParam param; + param.SetNameAndValueL( KHspsLiwPlugins, listVariant ); + aOutParamList.AppendL( param ); + + CleanupStack::Pop( pluginList ); + pluginList->DecRef(); + param.Reset(); + + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for AddPlugin method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::AddPluginOutputL( + TInt aPluginId, + CLiwGenericParamList& aOutParamList ) + { + TBuf8<10>id; + _LIT8(KFormat8, "%d"); + id.AppendFormat( KFormat8, aPluginId ); + + TLiwGenericParam param; + param.SetNameAndValueL( KPluginId, TLiwVariant( id ) ); + aOutParamList.AppendL( param ); + + param.Reset(); + + } +// ----------------------------------------------------------------------------- +// Creates output parmater list for RemovePlugin method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::RemovePluginOutputL( + CLiwGenericParamList& aOutParamList ) + { + + AppendStatusL( KErrNone, aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for ReplacePlugin method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::ReplacePluginOutputL( + CLiwGenericParamList& aOutParamList ) + { + AppendStatusL( KErrNone, aOutParamList ); + } + +// ----------------------------------------------------------------------------- +// Builds settings Dom document from liw list +// ----------------------------------------------------------------------------- +TInt CHspsLiwUtilities::SetPluginSettingsNodeL( + const CLiwList& aItemList, + TDesC8& aPluginId, + ChspsDomDocument& aDomDocument, + ChspsDomDocument& aSettingsDom ) + { + TInt error(KErrNone); + ChspsDomNode* node( NULL ); + ChspsDomNode* settingsNode( NULL ); + ChspsDomNode* itemNode( NULL ); + + if( aPluginId.Length() > 0 ) + { + // get plugin node + node = &( FindRootNodeByIdentifierL( KPluginElement, aPluginId, *aDomDocument.RootNode() )); + if ( node ) + { + // get control node of the plugin + node = &( FindRootNodeByTagL( KControlElement, + *node )); + if( node ) + { + TInt index = 0; + // get settings node (child of control node) + settingsNode = FindChildNodeByTagL( + KSettingsElement, + *node, + index ); + } + } + + + if ( node == NULL || settingsNode == NULL ) + { + // pluginId Not Found + error=KErrNotFound; + } + + TLiwVariant tempVariant; + tempVariant.PushL(); + TInt itemsCount = aItemList.Count(); + if ( (KErrNone == error) && + (itemsCount > 0) ) + { + // Find items for plugin settings + for ( TInt i = 0; ( i < itemsCount && error == KErrNone ); i++ ) + { + error = KErrNotFound; + aItemList.AtL( i, tempVariant ); + const CLiwMap* item = tempVariant.AsMap(); + if ( (item != NULL) && + item->FindL( KHspsLiwItemId, tempVariant ) ) + { + TPtrC8 itemId; + itemId.Set( tempVariant.AsData() ); + + itemNode = &( FindRootNodeByIdentifierL( + KItemElement, itemId, *settingsNode )); + if( itemNode ) + { + item->FindL(KHspsLiwProperties, tempVariant ); + const CLiwList* propertyList = tempVariant.AsList(); + if(propertyList && propertyList->Count() > 0) + { + if ( SetPluginPropertyNodeL( *propertyList, *itemNode) == KErrNone ) + { + error = KErrNone; + } + } + } + } + tempVariant.Reset(); + } + } + else + { + error = KErrNotFound; + } + + CleanupStack::Pop(&tempVariant); + tempVariant.Reset(); + + + if( error == KErrNone ) + { + + // Making Settings Dom + ChspsDomNode* clone = settingsNode->CloneL( aSettingsDom.StringPool() ); + CleanupStack::PushL( clone ); + aSettingsDom.SetRootNode( clone ); + CleanupStack::Pop( clone ); + } + + } + + return error; + } + +// ----------------------------------------------------------------------------- +// Parse Properties from liw list +// ----------------------------------------------------------------------------- +TInt CHspsLiwUtilities::SetPluginPropertyNodeL( const CLiwList& aPropertyList, + ChspsDomNode& aNode ) + { + // Init used local variables. + TInt err = KErrNone; + + TLiwVariant mapVariant; + mapVariant.PushL(); + + TLiwVariant propertyNameVariant; + propertyNameVariant.PushL(); + + TLiwVariant propertyValueVariant; + propertyValueVariant.PushL(); + + const TInt propertiesCount = aPropertyList.Count(); + + // Loop all items in given list. + for( TInt i = 0; ( i < propertiesCount && err == KErrNone ); i++ ) + { + // Extract map. + aPropertyList.AtL( i, mapVariant ); + + const CLiwMap* property = mapVariant.AsMap(); + if( property == NULL ) + { + err = KErrCorrupt; + } + + // Extract property name. + if( !err ) + { + if( !property->FindL( KHspsLiwPropertyName, propertyNameVariant ) ) + { + err = KErrNotFound; + } + } + + TPtrC8 name; + if( !err ) + { + name.Set( propertyNameVariant.AsData() ); + if( name.Length() > KMaxTextLength ) + { + err = KErrArgument; + } + } + + // Extract property value. + if( !err ) + { + if( !property->FindL( KHspsLiwPropertyValue, propertyValueVariant ) ) + { + err = KErrNotFound; + } + } + + TPtrC8 value; + if( !err ) + { + value.Set( propertyValueVariant.AsData() ); + if( value.Length() > KMaxTextLength ) + { + err = KErrArgument; + } + } + + // Set attribute. + if( !err ) + { + err = SetPropertyAttributesL( name, value, aNode ); + } + + mapVariant.Reset(); + propertyNameVariant.Reset(); + propertyValueVariant.Reset(); + } + + // Cleanup. + CleanupStack::Pop( &propertyValueVariant ); + CleanupStack::Pop( &propertyNameVariant ); + CleanupStack::Pop( &mapVariant ); + + return err; + } +//----------------------------------------------------------------------------- +// SetpropertyAttributeL replaces value of property attribute given in parameter +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::SetPropertyAttributesL( + TDesC8& aAttrName, + TDesC8& aAttrValue, + ChspsDomNode& aNode ) + { + + + TInt error(KErrNotFound); + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + TBool replaced(EFalse); + + while( node && !replaced ) + { + const TDesC8& nodeName = node->Name(); + if( nodeName == KPropertyElement ) + { + ChspsDomList& attrList = node->AttributeList(); + ChspsDomAttribute* attr = static_cast( attrList.FindByName(KPropertyAttrName) ); + if ( attr ) + { + const TDesC8& name = attr->Value(); + if (aAttrName.Compare( name )== 0 ) + { + ChspsDomAttribute* attr2 = static_cast( attrList.FindByName(KPropertyAttrValue) ); + if( attr2 ) + { + attr2->SetValueL( aAttrValue ); + replaced=ETrue; + error = KErrNone; + } + } + } + } + if( !replaced ) + { + node = iter->NextL(); + } + } + + CleanupStack::PopAndDestroy( iter ); + + return error; + + } +// ----------------------------------------------------------------------------- +// Creates output parmater list for SetPluginSettings method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::SetPluginSettingsOutputL( + CLiwGenericParamList& aOutParamList ) + { + AppendStatusL( KErrNone, aOutParamList ); + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for GetPluginSettings method +// ----------------------------------------------------------------------------- + +void CHspsLiwUtilities::GetPluginSettingsOutputL( + ChspsDomDocument& aDom, + CLiwGenericParamList& aOutParamList ) + { + TInt pos = 0; + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + ChspsDomNode* node( NULL ); + + node = aDom.RootNode(); + if( !node ) + { + User::Leave( KErrNotFound ); + } + + // get ctrl node (child of control node) + node = FindChildNodeByTagL( + KControlElement, + *node, + pos ); + + if( !node ) + { + User::Leave( KErrNotFound ); + } + + // get settings node (child of control node) + node = FindChildNodeByTagL( + KSettingsElement, + *node, + pos ); + + if ( node ) + { + // append item maps to settings list + AppendItemsL( *node, *list ); + } + else + { + User::Leave( KErrNotFound ); + } + + TLiwVariant listVariant; + listVariant.Set( list ); + + TLiwGenericParam param; + param.SetNameAndValueL( KHspsLiwSettings, listVariant ); + aOutParamList.AppendL( param ); + + CleanupStack::Pop( list ); + list->DecRef(); + param.Reset(); + } + + +// ----------------------------------------------------------------------------- +// Creates output parmater list for MovePlugins method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::MovePluginsOutputL( + CLiwGenericParamList& aOutParamList ) + { + + AppendStatusL( KErrNone, aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Gets list of plugin id's from plugins list +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetPluginIdListL( + const CLiwList* aPluginsList, + CArrayFixFlat& aPluginIdList ) + { + + const TInt pluginsCount = aPluginsList->Count(); + TLiwVariant entry; + entry.PushL(); + for( TInt i = 0; i < pluginsCount; i++ ) + { + aPluginsList->AtL( i, entry ); + TInt id = 0; + TPtrC8 pluginId = entry.AsData(); + TLex8 lex( pluginId ); + User::LeaveIfError( lex.Val( id ) ); + if ( id < 1 ) + { + User::Leave( KErrArgument ); + } + + // Plugin id's must be unique + const TInt pluginIdCount = aPluginIdList.Count(); + for ( TInt j = 0; j < pluginIdCount; j++ ) + { + if ( id == aPluginIdList.At( j ) ) + { + User::Leave( KErrArgument ); + } + } + + aPluginIdList.AppendL( id ); + entry.Reset(); + } + CleanupStack::Pop( &entry ); + + } + +// ----------------------------------------------------------------------------- +// Builds plugins list from plugin header list +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetAppConfsOutputL( + CArrayPtrFlat& aList, + CLiwGenericParamList& aOutParamList ) + { + CLiwDefaultList* pluginList = CLiwDefaultList::NewL(); + CleanupStack::PushL( pluginList ); + + BuildAppConfInfoListL( aList, *pluginList ); + + TLiwVariant listVariant; + listVariant.Set( pluginList ); + TLiwGenericParam param; + param.SetNameAndValueL( KHspsLiwAppConfs, listVariant ); + aOutParamList.AppendL( param ); + + CleanupStack::Pop( pluginList ); + pluginList->DecRef(); + param.Reset(); + + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for SetActiveAppConf method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::SetActiveAppConfOutputL( + CLiwGenericParamList& aOutParamList ) + { + + AppendStatusL( KErrNone, aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for SetConfState method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::SetConfStateOutputL( + CLiwGenericParamList& aOutParamList ) + { + + AppendStatusL( KErrNone, aOutParamList ); + + } + +// ----------------------------------------------------------------------------- +// Returns value of defined attribute +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::GetAttributeValueL( + ChspsDomNode& aNode, + const TDesC8& aAttrId, + TPtrC8& aAttrValue ) + { + + // Get configutation node's ID attribute + ChspsDomList& attrList = aNode.AttributeList(); + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( aAttrId ) ); + if ( !attr ) + { + User::Leave( KErrNotFound ); + } + + aAttrValue.Set( attr->Value() ); + + } + +// ----------------------------------------------------------------------------- +// Finds a node from a dom document. +// Looks for configuration elements and plugin elements by the identifier. +// ----------------------------------------------------------------------------- +ChspsDomNode& CHspsLiwUtilities::FindRootNodeByIdentifierL( + const TDesC8& aNodeTag, + const TDesC8& aNodeIdentifier, + ChspsDomNode& aNode ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* targetNode( NULL ); + ChspsDomNode* node = iter->First(); + TBool found = EFalse; + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( aNodeTag ) == 0) + { + ChspsDomList& attrList = node->AttributeList(); + + ChspsDomAttribute* attr = static_cast( + attrList.FindByName( KAttrId )); + const TDesC8& value = attr->Value(); + if( value.Compare( aNodeIdentifier ) == 0 ) + { + found = ETrue; + targetNode = node; + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + return *targetNode; + } + +// ----------------------------------------------------------------------------- +// Finds a node from a dom document. +// Looks for the next node tag. +// ----------------------------------------------------------------------------- +ChspsDomNode& CHspsLiwUtilities::FindRootNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aDomNode ) + { + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aDomNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* targetNode( NULL ); + ChspsDomNode* node = iter->First(); + TBool found = EFalse; + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( aNodeTag ) == 0 ) + { + found = ETrue; + targetNode = node; + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + return *targetNode; + } + +// ----------------------------------------------------------------------------- +// Appends found attributes into the LIW map instance +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::AppendAttributeToMapL( CLiwDefaultMap& aMap, + ChspsDomList& aAttrList, + const TDesC8& aDomName, + const TDesC8& aLiwName, + const TDesC8& aDefaultValue ) + { + TInt err = KErrNone; + ChspsDomAttribute* attr = static_cast( + aAttrList.FindByName(aDomName) ); + if( attr ) + { + const TDesC8& value = attr->Value(); + aMap.InsertL( aLiwName, TLiwVariant( value ) ); + } + else + { + aMap.InsertL( aLiwName, TLiwVariant( aDefaultValue ) ); + } + return err; + } + +// ----------------------------------------------------------------------------- +// Builds a plugin map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::BuildConfigurationMapL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + //Get plugin info. + const TDesC8& name = aConfigurationNode.Name(); + ChspsDomList& attrList = aConfigurationNode.AttributeList(); + if ( name == KConfigurationElement ) + { + //Add id + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrId, KHspsLiwId ); + //Add pluginUid + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrUid, KHspsLiwUid ); + //Add type + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrType, KHspsLiwType ); + //Add interface + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrInterface, + KHspsLiwInterface ); + //Add name + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrName, KHspsLiwName ); + + //Add multiinstance + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrMultiInstance, + KHspsLiwMultiInstance ); + + //Add desc + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrDescription, + KHspsLiwDescription ); + + // Add state + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrState, KHspsLiwState ); + + // Add max_child + AppendAttributeToMapL( aMap, + attrList, + KConfigurationAttrMaxChild, + KHspsLiwMaxChild, + KMaxChildDefault ); + + //Add list of plugins. + //create list where maps are added. + AppendPluginsFlatL( aConfigurationNode, aMap ); + //Add list of settings. + AppendSettingsL( aConfigurationNode, aMap ); + //Add list of resources. + AppendResourcesL( aConfigurationNode, aMap ); + } + else + { + //should be always configuration element. + } + return err; + } + +// ----------------------------------------------------------------------------- +// Builds and appends a plugins to a map. Plugins are appended without chidren +// plugins, settings or resources. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::AppendPluginsFlatL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + //create a list for plugins. + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( + aConfigurationNode ); + CleanupStack::PushL( iter ); + TBool found = EFalse; + ChspsDomNode* node = iter->First(); + + //find plugins element. + while( !found && node ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( KPluginsElement ) == 0) + { + //iterate plugin information + ChspsDomList& children = node->ChildNodes(); + TInt length = children.Length(); + for( TInt i = 0; i < length; i++ ) + { + ChspsDomNode* plugin; + plugin = static_cast( children.Item( i ) ); + //create a plugin map and add it to the list. + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + CleanupStack::PushL( map ); + + TInt pluginMapItems = ( + CHspsLiwUtilities::EPluginMapId + + CHspsLiwUtilities::EPluginMapUid + + CHspsLiwUtilities::EPluginMapActivationState + + CHspsLiwUtilities::EPluginMapLocked ); + BuildPluginMapL( *plugin, *map, pluginMapItems ); + + //append map to the list + TLiwVariant mapVariant; + mapVariant.Set( map ); + list->AppendL( mapVariant ); + + CleanupStack::Pop( map ); + map->DecRef(); + } + found = ETrue; + } + node = iter->NextL(); + } + + //append list to a map. + TLiwVariant listVariant; + listVariant.Set( list ); + aMap.InsertL( KHspsLiwPlugins, listVariant ); + + CleanupStack::PopAndDestroy( iter ); + CleanupStack::Pop( list ); + list->DecRef(); + + return err; + } + +// ----------------------------------------------------------------------------- +// Builds and appends settings to a map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::AppendSettingsL( + ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ) + { + TInt err( KErrNone ); + TInt index( 0 ); + + //create list + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + //get control (child of configuration node) + ChspsDomNode* node( NULL ); + node = FindChildNodeByTagL( + KControlElement, + aConfigurationNode, + index ); + + if( node ) + { + // get settings node (child of control node) + node = FindChildNodeByTagL( + KSettingsElement, + *node, + index ); + if ( node ) + { + // append item maps to settings list + AppendItemsL( *node, *list ); + } + else + { + // there should always be a settings element + err = KErrNotFound; + } + } + else + { + //there should always be a control element. + err = KErrNotFound; + } + + User::LeaveIfError( err ); + + //append list to a map. + TLiwVariant listVariant; + listVariant.Set( list ); + aMap.InsertL( KHspsLiwSettings, listVariant ); + //cleanup. + CleanupStack::Pop( list ); + list->DecRef(); + + return err; + } + +// ----------------------------------------------------------------------------- +// Builds and appends resources to a map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::AppendResourcesL( ChspsDomNode& aConfigurationNode, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + //create list. + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + //find resources. + ChspsDomList& children = aConfigurationNode.ChildNodes(); + TInt length = children.Length(); + for( TInt i = 0; i < length; i++ ) + { + ChspsDomNode* child; + child = static_cast( children.Item( i ) ); + const TDesC8& childName = child->Name(); + if( childName.Compare( KResourcesElement ) == 0) + { + ChspsDomList& objects = child->ChildNodes(); + TInt length = objects.Length(); + for( TInt i = 0; i < length; i++ ) + { + //put object elements to the list. + ChspsDomNode* object; + object = static_cast( objects.Item( i ) ); + const TDesC8& objectName = object->Name(); + if( objectName.Compare( KObjectElement ) == 0) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + CleanupStack::PushL( map ); + + BuildObjectMapL( *object, *map ); + + ///append object to the list + TLiwVariant mapVariant; + mapVariant.Set( map ); + list->AppendL( mapVariant ); + + CleanupStack::Pop( map ); + map->DecRef(); + } + } + //There should be only one. + break; + } + } + //append list to a map. + TLiwVariant listVariant; + listVariant.Set( list ); + aMap.InsertL( KHspsLiwResources, listVariant ); + //cleanup. + CleanupStack::Pop( list ); + list->DecRef(); + return err; + } + +// ----------------------------------------------------------------------------- +// Builds plugin map without resources, settings or child plugins. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::BuildPluginMapL( + ChspsDomNode& aPluginNode, + CLiwDefaultMap& aMap, + TInt aItemMask ) + { + TInt err( KErrNotFound ); + + // Get plugin info. + const TDesC8& name = aPluginNode.Name(); + ChspsDomList& attrList = aPluginNode.AttributeList(); + + if ( name == KPluginElement ) + { + if ( aItemMask & CHspsLiwUtilities::EPluginMapId ) + { + //Add plugin id + AppendAttributeToMapL( aMap, attrList, KPluginAttrId, KHspsLiwId ); + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapUid ) + { + //Add plugin uid + AppendAttributeToMapL( aMap, attrList, KPluginAttrUid, KHspsLiwUid ); + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapType || + aItemMask & CHspsLiwUtilities::EPluginMapName ) + { + // Get plugin type and name from Configuration node attribute list + TInt index = 0; + ChspsDomNode* confNode = FindChildNodeByTagL( + KConfigurationElement, + aPluginNode, + index ); + if ( confNode ) + { + ChspsDomList&confNodeAttrList = confNode->AttributeList(); + if ( aItemMask & CHspsLiwUtilities::EPluginMapType ) + { + // Add plugin type + AppendAttributeToMapL( aMap, confNodeAttrList, KConfigurationAttrType, KHspsLiwType ); + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapName ) + { + // Add plugin type + AppendAttributeToMapL( aMap, confNodeAttrList, KConfigurationAttrName, KHspsLiwName ); + } + } + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapActivationState ) + { + //Add plugin activation state + AppendAttributeToMapL( aMap, attrList, KPluginAttrActive, KHspsLiwActivationState ); + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapDesc ) + { + //Add plugin description + AppendAttributeToMapL( aMap, attrList, KConfigurationAttrDescription, KHspsLiwDescription ); + } + if ( aItemMask & CHspsLiwUtilities::EPluginMapLocked ) + { + //Add plugin locked status - locked/removable/none(default) + AppendAttributeToMapL( aMap, + attrList, + KConfigurationAttrLockingStatus, + KHspsLiwLockingStatus, + KHspsLiwLockingNone ); + } + + err = KErrNone; + } + + return err; + } + +// ----------------------------------------------------------------------------- +// Builds items map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::BuildItemsMapL( ChspsDomNode& aItem, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + //Append attributes + //create attribute list + ChspsDomList& attrList = aItem.AttributeList(); + //Add itemId + AppendAttributeToMapL( aMap, attrList, KItemAttrId, KHspsLiwItemId ); + //Add name + AppendAttributeToMapL( aMap, attrList, KItemAttrName, KHspsLiwItemName ); + + //create list + CLiwDefaultList* list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + //get children + ChspsDomList& properties = aItem.ChildNodes(); + TInt length = properties.Length(); + for( TInt i = 0; i < length; i++ ) + { + ChspsDomNode* property; + property = static_cast( properties.Item( i ) ); + const TDesC8& name = property->Name(); + if( name.Compare( KPropertyElement ) == 0) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + CleanupStack::PushL( map ); + + //build attribute. + BuildPropertiesMapL( *property, *map ); + + //append attribute to the list + TLiwVariant mapVariant; + mapVariant.Set( map ); + list->AppendL( mapVariant ); + + CleanupStack::Pop( map ); + map->DecRef(); + } + } + //append list to a map. + TLiwVariant listVariant; + listVariant.Set( list ); + aMap.InsertL( KHspsLiwProperties, listVariant ); + //cleanup + CleanupStack::Pop( list ); + list->DecRef(); + return err; + } + +// ----------------------------------------------------------------------------- +// Builds properties map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::BuildPropertiesMapL( ChspsDomNode& aProperty, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + //Append attributes + //create attribute list + ChspsDomList& attrList = aProperty.AttributeList(); + //Add name + AppendAttributeToMapL( aMap, attrList, KPropertyAttrName, KHspsLiwPropertyName ); + //Add value + AppendAttributeToMapL( aMap, attrList, KPropertyAttrValue, KHspsLiwPropertyValue ); + + return err; + } + +// ----------------------------------------------------------------------------- +// Builds object map. +// ----------------------------------------------------------------------------- +// +TInt CHspsLiwUtilities::BuildObjectMapL( ChspsDomNode& aObject, + CLiwDefaultMap& aMap ) + { + TInt err = KErrNone; + + ChspsDomList& attrList = aObject.AttributeList(); + //Add name + AppendAttributeToMapL( aMap, attrList, KObjectAttrName, KHspsLiwObjectName ); + //Add path + AppendAttributeToMapL( aMap, attrList, KObjectAttrPath, KHspsLiwObjectPath ); + //Add mediatype + AppendAttributeToMapL( aMap, attrList, KObjectAttrMediatype, KHspsLiwObjectMediatype ); + //Add tags + AppendAttributeToMapL( aMap, attrList, KObjectAttrTag, KHspsLiwObjectTag ); + + return err; + } + +// ----------------------------------------------------------------------------- +// Buils plugin info list +// ----------------------------------------------------------------------------- +// +void CHspsLiwUtilities::BuildPluginInfoListL( + CArrayPtrFlat& aList, + CLiwDefaultList& aPluginInfoList ) + { + for ( TInt i = 0; i < aList.Count(); i++ ) + { + CLiwDefaultMap* pluginInfoMap = CLiwDefaultMap::NewL(); + CleanupStack::PushL( pluginInfoMap ); + BuildPluginInfoMapL( *( aList[ i ] ), *pluginInfoMap ); + TLiwVariant pluginInfoMapVariant; + pluginInfoMapVariant.Set( pluginInfoMap ); + aPluginInfoList.AppendL( pluginInfoMapVariant ); + CleanupStack::Pop( pluginInfoMap ); + pluginInfoMap->DecRef(); + } + } + +// ----------------------------------------------------------------------------- +// Buils plugin info map +// ----------------------------------------------------------------------------- +// +void CHspsLiwUtilities::BuildPluginInfoMapL( + ChspsODT& aPluginHeader, + CLiwDefaultMap& aPluginInfoMap ) + { + // pluginInfo.uid ( 10 -> uid 32 bit as a hex string, 0xXXXXXXXX ) + TBuf8<10> uid; + uid.Append( '0' ); + uid.Append( 'x' ); + uid.AppendNum( aPluginHeader.ThemeUid(), EHex ); + aPluginInfoMap.InsertL( KHspsLiwUid, TLiwVariant( uid ) ); + // pluginInfo.interface ( 10 -> uid 32 bit as a hex string, 0xXXXXXXXX ) + TBuf8<10> interface; + interface.Append( '0' ); + interface.Append( 'x' ); + interface.AppendNum( aPluginHeader.RootUid(), EHex ); + aPluginInfoMap.InsertL( KHspsLiwInterface, TLiwVariant( interface ) ); + // pluginInfo.type ( enumeration to 8 bit string ) + HBufC8* type; + GetConfigurationTypeStrL( aPluginHeader.ConfigurationType(), &type ); + CleanupStack::PushL( type ); + TPtr8 typePtr = type->Des(); + aPluginInfoMap.InsertL( KHspsLiwType, TLiwVariant( typePtr ) ); + CleanupStack::PopAndDestroy( type ); + // pluginInfo.name ( 16 bit string to 8 bit string ) + HBufC8* name = HBufC8::NewL( ( aPluginHeader.ThemeFullName() ).Length() ); + CleanupStack::PushL( name ); + TPtr8 namePtr = name->Des(); + namePtr.Copy( aPluginHeader.ThemeFullName() ); + aPluginInfoMap.InsertL( KHspsLiwName, TLiwVariant( namePtr ) ); + CleanupStack::PopAndDestroy( name ); + + TBuf8<10> multiInstance; + multiInstance.AppendNum( aPluginHeader.MultiInstance()); + aPluginInfoMap.InsertL( KHspsLiwMultiInstance, + TLiwVariant( multiInstance ) ); + + HBufC8* desc = HBufC8::NewL( ( aPluginHeader.Description() ).Length() ); + CleanupStack::PushL( desc ); + TPtr8 descPtr = desc->Des(); + descPtr.Copy( aPluginHeader.Description() ); + aPluginInfoMap.InsertL( KHspsLiwDescription, TLiwVariant( descPtr ) ); + CleanupStack::PopAndDestroy( desc ); + + if ( aPluginHeader.LogoFile().Length() ) + { + HBufC8* buf8 = HBufC8::NewLC( ( aPluginHeader.LogoFile() ).Length() ); + buf8->Des().Copy( aPluginHeader.LogoFile() ); + aPluginInfoMap.InsertL( KHspsLiwLogo, TLiwVariant( *buf8 ) ); + CleanupStack::PopAndDestroy( buf8 ); + } + if ( aPluginHeader.PreviewFile().Length() ) + { + HBufC8* buf8 = HBufC8::NewLC( ( aPluginHeader.PreviewFile() ).Length() ); + buf8->Des().Copy( aPluginHeader.PreviewFile() ); + aPluginInfoMap.InsertL( KHspsLiwPreview, TLiwVariant( *buf8 ) ); + CleanupStack::PopAndDestroy( buf8 ); + } + } + +//---------------------------------------------------------------------------- +// CHspsLiwUtilities::GetConfigurationTypeL +// ---------------------------------------------------------------------------- +// +void CHspsLiwUtilities::GetConfigurationTypeStrL( + const TUint aType, + HBufC8** aTypeStr ) + { + if ( aType == EhspsAppConfiguration ) + { + *aTypeStr = HBufC8::NewL( KHspsLiwApplicationConf().Length() ); + TPtr8 typePtr = ( *( aTypeStr ) )->Des(); + typePtr.Copy( KHspsLiwApplicationConf ); + } + else if ( aType == EhspsViewConfiguration ) + { + *aTypeStr = HBufC8::NewL( KHspsLiwViewConf().Length() ); + TPtr8 typePtr = ( *( aTypeStr ) )->Des(); + typePtr.Copy( KHspsLiwViewConf ); + } + else if ( aType == EhspsWidgetConfiguration ) + { + *aTypeStr = HBufC8::NewL( KHspsLiwWidgetConf().Length() ); + TPtr8 typePtr = ( *( aTypeStr ) )->Des(); + typePtr.Copy( KHspsLiwWidgetConf ); + } + else if ( aType == EhspsTemplateConfiguration ) + { + *aTypeStr = HBufC8::NewL( KHspsLiwTemplateConf().Length() ); + TPtr8 typePtr = ( *( aTypeStr ) )->Des(); + typePtr.Copy( KHspsLiwTemplateConf ); + } + else + { + User::Leave( KErrArgument ); + } + } + + +//---------------------------------------------------------------------------- +// CHspsLiwUtilities::FindChildNodeByTagL +// ---------------------------------------------------------------------------- +// +ChspsDomNode* CHspsLiwUtilities::FindChildNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aParentNode, + TInt& aIndex ) + { + ChspsDomNode* node( NULL ); + ChspsDomList& items = aParentNode.ChildNodes(); + TInt length = items.Length(); + node = NULL; + for ( TInt i = aIndex; i < length && node == NULL; i++ ) + { + node = static_cast( items.Item( i ) ); + const TDesC8& name = node->Name(); + if( name.Compare( aNodeTag ) != 0 ) + { + node = NULL; + } + else + { + aIndex = i; + } + } + + return node; + } + +//---------------------------------------------------------------------------- +// CHspsLiwUtilities::AppendItemsL +// ---------------------------------------------------------------------------- +// +void CHspsLiwUtilities::AppendItemsL( + ChspsDomNode& aSettingsNode, + CLiwDefaultList& aList ) + { + + ChspsDomNode* itemNode( NULL ); + TInt index = 0; + do + { + itemNode = FindChildNodeByTagL( + KItemElement, + aSettingsNode, + index ); + if ( itemNode ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + CleanupStack::PushL( map ); + + //build item. + BuildItemsMapL( *itemNode, *map ); + + //append item to the list + TLiwVariant mapVariant; + mapVariant.Set( map ); + aList.AppendL( mapVariant ); + + CleanupStack::Pop( map ); + map->DecRef(); + // Find next item element + index++; + } + } while( itemNode ); + } + +// ----------------------------------------------------------------------------- +// Builds app conf info list +// ----------------------------------------------------------------------------- +// +void CHspsLiwUtilities::BuildAppConfInfoListL( + CArrayPtrFlat& aList, + CLiwDefaultList& aAppConfInfoList ) + { + for ( TInt i = 0; i < aList.Count(); i++ ) + { + CLiwDefaultMap* appConfInfoMap = CLiwDefaultMap::NewL(); + CleanupStack::PushL( appConfInfoMap ); + BuildAppConfInfoMapL( *( aList[ i ] ), *appConfInfoMap ); + TLiwVariant appConfInfoMapVariant; + appConfInfoMapVariant.Set( appConfInfoMap ); + aAppConfInfoList.AppendL( appConfInfoMapVariant ); + CleanupStack::Pop( appConfInfoMap ); + appConfInfoMap->DecRef(); + } + } + +// ----------------------------------------------------------------------------- +// Buils app conf info map +// ----------------------------------------------------------------------------- +// +void CHspsLiwUtilities::BuildAppConfInfoMapL( + ChspsODT& aAppConfHeader, + CLiwDefaultMap& aAppConfInfoMap ) + { + // appConfInfo.uid ( 10 -> uid 32 bit as a hex string, 0xXXXXXXXX ) + TBuf8<10> uid; + uid.Append( '0' ); + uid.Append( 'x' ); + uid.AppendNum( aAppConfHeader.ThemeUid(), EHex ); + aAppConfInfoMap.InsertL( KHspsLiwUid, TLiwVariant( uid ) ); + // pluginInfo.name ( 16 bit string to 8 bit string ) + HBufC8* name = HBufC8::NewL( ( aAppConfHeader.ThemeFullName() ).Length() ); + CleanupStack::PushL( name ); + TPtr8 namePtr = name->Des(); + namePtr.Copy( aAppConfHeader.ThemeFullName() ); + aAppConfInfoMap.InsertL( KHspsLiwName, TLiwVariant( namePtr ) ); + CleanupStack::PopAndDestroy( name ); + } + +//---------------------------------------------------------------------------- +// CHspsLiwUtilities::BuildPluginListL +// ---------------------------------------------------------------------------- +// +void CHspsLiwUtilities::BuildPluginListL( + ChspsDomNode& aRootNode, + TDesC8& aType, + TDesC8& aPluginId, + CLiwDefaultList& aPluginList ) + { + + TBool checkPluginId( EFalse ); + TBool checkType( EFalse ); + if ( aPluginId.Length() ) + { + checkPluginId = ETrue; + } + if ( aType.Length() ) + { + checkType = ETrue; + } + + ChspsDomDepthIterator* iter = ChspsDomDepthIterator::NewL( aRootNode ); + CleanupStack::PushL( iter ); + ChspsDomNode* node = iter->First(); + + TBool pluginIdFound( EFalse ); + while( node && !pluginIdFound ) + { + const TDesC8& name = node->Name(); + if ( name.Compare( KPluginsElement ) == 0) + { + if ( checkPluginId ) + { + ChspsDomNode* pluginNode = FindParentNodeByTagL( + KPluginElement, + *node ); + if ( pluginNode ) + { + TPtrC8 pluginId; + GetAttributeValueL( + *pluginNode, + KPluginAttrId, + pluginId ); + if ( aPluginId.Compare( pluginId ) == 0 ) + { + pluginIdFound = ETrue; + } + } + } + if ( !checkPluginId || pluginIdFound ) + { + ChspsDomList& children = node->ChildNodes(); + TInt length = children.Length(); + for( TInt i = 0; i < length; i++ ) + { + ChspsDomNode* plugin; + plugin = static_cast( children.Item( i ) ); + TBool typeMatch( EFalse ); + if ( checkType ) + { + // Check plugin type + TInt index = 0; + ChspsDomNode* confNode = FindChildNodeByTagL( + KConfigurationElement, + *plugin, + index ); + if ( confNode ) + { + TPtrC8 type; + GetAttributeValueL( + *confNode, + KConfigurationAttrType, + type ); + if ( aType.Compare( type ) == 0 ) + { + typeMatch = ETrue; + } + } + } + + if ( typeMatch || !checkType ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewL(); + CleanupStack::PushL( map ); + TInt pluginMapItems = ( + CHspsLiwUtilities::EPluginMapId + + CHspsLiwUtilities::EPluginMapType + + CHspsLiwUtilities::EPluginMapName + + CHspsLiwUtilities::EPluginMapActivationState + + CHspsLiwUtilities::EPluginMapDesc + + CHspsLiwUtilities::EPluginMapLocked ); + BuildPluginMapL( *plugin, *map, pluginMapItems ); + + TLiwVariant mapVariant; + mapVariant.Set( map ); + aPluginList.AppendL( mapVariant ); + + CleanupStack::Pop( map ); + map->DecRef(); + } + } + } + } + node = iter->NextL(); + } + CleanupStack::PopAndDestroy( iter ); + } + +//---------------------------------------------------------------------------- +// CHspsLiwUtilities::FindParentNodeByTagL +// ---------------------------------------------------------------------------- +// +ChspsDomNode* CHspsLiwUtilities::FindParentNodeByTagL( + const TDesC8& aNodeTag, + ChspsDomNode& aChildNode ) + { + + TBool found( EFalse ); + ChspsDomNode* parentNode = aChildNode.Parent(); + while ( !found && parentNode ) + { + if ( aNodeTag.Compare( parentNode->Name() ) == 0 ) + { + found = ETrue; + } + else + { + parentNode = parentNode->Parent(); + } + } + + return parentNode; + } + +// ----------------------------------------------------------------------------- +// Creates output parmater list for SetActivePlugin method +// ----------------------------------------------------------------------------- +void CHspsLiwUtilities::SetActivePluginOutputL( + CLiwGenericParamList& aOutParamList ) + { + + AppendStatusL( KErrNone, aOutParamList ); + + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/src/hspsprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/src/hspsprovider.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,157 @@ +/* +* 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: Implementation of CHSPSProvider class +* +*/ + + +#include + +#include "hspsconfigurationif.h" +#include "hspsprovider.h" +#include "hspsliwvocabulary.hrh" + +using namespace LIW; + +/* HSPS service provider name */ +_LIT8( KHSPSService, "Service.HSPS" ); + +/* HSPS service interface names */ +_LIT8( KHSPSConfigurationInterface, "IConfiguration" ); + +/* Generic Liw command name */ +_LIT8( KCommand, "cmd" ); + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CHSPSProvider* CHSPSProvider::NewL() + { + return new( ELeave ) CHSPSProvider(); + } + +// ----------------------------------------------------------------------------- +// Constructor. +// ----------------------------------------------------------------------------- +// +CHSPSProvider::CHSPSProvider() + { + } + +// ----------------------------------------------------------------------------- +// Called by the LIW framework to initialise necessary information +// from the Service Handler. This method is called when the consumer makes +// the attach operation. +// ----------------------------------------------------------------------------- +// +void CHSPSProvider::InitialiseL( + MLiwNotifyCallback& /*aFrameworkCallback*/, + const RCriteriaArray& aInterest ) + { + TInt count = aInterest.Count(); + for ( TInt index = 0; index < count ; index++ ) + { + if( aInterest[ index ]->ContentType() == KHSPSService ) + { + return; + } + } + + User::Leave( KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// Called by the LIW framework to instantiate the requested service interface +// ----------------------------------------------------------------------------- +// +void CHSPSProvider::HandleServiceCmdL( + const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint /*aCmdOptions*/, + const MLiwNotifyCallback* /*aCallback*/ ) + { + TPtrC8 cmdName; + + if ( aCmdId == KLiwCmdAsStr ) + { + TInt pos = 0; + const TLiwGenericParam* cmd = aInParamList.FindFirst( pos, KCommand ); + if ( cmd ) + { + cmdName.Set( cmd->Value().AsData() ); + } + } + if ( cmdName == KHSPSConfigurationInterface ) + { + //find appUid + TInt pos = 0; + TPtrC8 uid; + const TLiwGenericParam* appUid = aInParamList.FindFirst( pos, + KHspsLiwAppUid ); + if( appUid ) + { + uid.Set( appUid->Value().AsData() ); + //Create interface. + CHSPSConfigurationIf* interface = + CHSPSConfigurationIf::NewL( uid ); + CleanupStack::PushL( interface ); + aOutParamList.AppendL( TLiwGenericParam( + KHSPSConfigurationInterface, TLiwVariant( interface ) ) ); + CleanupStack::Pop( interface ); + } + else + { + aOutParamList.Reset(); + aOutParamList.AppendL( TLiwGenericParam( EGenericParamError, + TLiwVariant( KErrArgument ) ) ); + } + } + else + { + aOutParamList.AppendL( TLiwGenericParam( + EGenericParamError, + TLiwVariant( ( TInt32 )KErrArgument ) ) ); + } + } + +// ======== GLOBAL FUNCTIONS =================================================== + +// ----------------------------------------------------------------------------- +// Map the interface UIDs to implementation factory functions +// ----------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x200159B8, CHSPSProvider::NewL) + }; + +// ----------------------------------------------------------------------------- +// Exported proxy for instantiation method resolution +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hsps.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hsps.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,198 @@ +/* +* 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: Defination of class MT_CHSPS +* +*/ + + +#ifndef C_MT_HSPS_H +#define C_MT_HSPS_H + +#include +#include +#include +#include + +// Service API interface literals +_LIT8( KHSPS, "Service.HSPS" ); +_LIT8( KHSPSConfigurationIf, "IConfiguration" ); +_LIT8( KHSPSTestAppUid, "536874929"); + +// Configuration installation files +_LIT( KHSPSInstallMinimalRootConf, "c:\\data\\mt_hsps\\minimalconf\\root\\manifest.dat"); +_LIT( KHSPSInstallMinimalViewConf, "c:\\data\\mt_hsps\\minimalconf\\view\\manifest.dat"); +_LIT( KHSPSInstallMinimalWidgetConf, "c:\\data\\mt_hsps\\minimalconf\\widget\\manifest.dat"); +_LIT( KHSPSInstallTypicalRootConf, "c:\\data\\mt_hsps\\typicalconf\\root\\manifest.dat"); +_LIT( KHSPSInstallTypicalView1Conf, "c:\\data\\mt_hsps\\typicalconf\\view1\\manifest.dat"); +_LIT( KHSPSInstallTypicalView2Conf, "c:\\data\\mt_hsps\\typicalconf\\view2\\manifest.dat"); +_LIT( KHSPSInstallTypicalWidgetConf, "c:\\data\\mt_hsps\\typicalconf\\widget\\manifest.dat"); +_LIT( KHSPSInstallOperatorRootConf, "c:\\data\\mt_hsps\\operatorconf\\root\\manifest.dat"); +_LIT( KHSPSInstallOperatorViewConf, "c:\\data\\mt_hsps\\operatorconf\\view\\manifest.dat"); +_LIT( KHSPSInstallFinnishWidgetConf, "c:\\data\\mt_hsps\\finnish_widget\\manifest.dat"); +_LIT( KHSPSInstallInstalledWidgetConf, "c:\\data\\mt_hsps\\installed_widget\\manifest.dat"); +_LIT( KHSPSInstallInstalledWidgetConfV2, "c:\\data\\mt_hsps\\installed_widget_v2\\manifest.dat"); + +// Triggers for notifications +enum MT_THSPSTrigger + { + EHspsTriggerRunNothing = 0, + EHspsTriggerRunRemovePluginCase, + EHspsTriggerRunAddPluginCase, + EHspsTriggerRunInstallationCase, + EHspsTriggerRunSetActivePluginCase, + EHspsTriggerRunReplacePluginCase, + EHspsTriggerRunUpdateInstallationCase, + EHspsTriggerRunUninstallationCase + }; + +// Active configuration ids +const TInt KHSPSMTAppUid( 0x20000FB1 ); +const TInt KHSPSMTInterfaceUid( 0x998 ); +const TInt KHSPSActiveConfMinimal( 0x2000B100 ); +const TInt KHSPSActiveConfTypical( 0x2000B110 ); +const TInt KHSPSActiveConfOperator( 0x2000B130 ); +const TInt KHSPSMinimalViewConf( 0x2000B101 ); +const TInt KHSPSMinimalWidgetConf( 0x2000B102 ); +const TInt KHSPSTypicalView1Conf( 0x2000B111 ); +const TInt KHSPSTypicalView2Conf( 0x2000B112 ); +const TInt KHSPSTypicalWidgetConf( 0x2000B120 ); +const TInt KHSPSOperatorViewConf( 0x2000B131 ); +const TInt KHSPSFinnishWidgetConf( 0x2000B132 ); +const TInt KHSPSInstalledWidgetConf( 0x2000B133 ); + +class MT_CHSPSResource + : public CBase + { + public: + MT_CHSPSResource( + const TDesC& aPath, + TInt aExpectedSize ); + + virtual ~MT_CHSPSResource(); + public: + TFileName iPath; + TInt iSize; + }; + +/** + * This class is an abstract class of HSPS SAPI tester classes +*/ +NONSHARABLE_CLASS( MT_CHSPS ) + : public CEUnitTestSuiteClass, public MhspsThemeManagementServiceObserver + { + protected: // Constructors and destructors + + MT_CHSPS(); + + virtual ~MT_CHSPS(); + + protected: // New methods + + void RunTestStepSyncL( + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aMeasureExecTime = EFalse ); + + void RunTestStepAsyncL( + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TInt aTriggerCase ); + + void SetActiveConfigurationL( + const TDesC8& aAppUid, + TInt aConfUid ); + + void ResetResources(); + + void AddResourceL( + const TDesC& aFileName, + const TInt aExpectedSize ); + + void CheckResourcesL(); + + // Request Notification testing purposes + void RunNotificationTriggerL( TInt aTriggerCase ); + + void RunRemovePluginCase(); + + void RunAddPluginCase(); + + void RunInstallationCase(); + + void RunUpdateInstallationCase(); + + void RunUninstallationCase(); + + void RunSetActivePluginCase(); + + void RunReplacePluginCase(); + + void RestoreTestDataL( TInt aTriggerCase ); + + void RestoreRemovedPluginCase(); + + void RestoreAddedPluginCase(); + + void StartTiming( + TDesC8& aMethod ); + + void StopTiming(); + + void SetCentralRepositoryKeyL( + TInt aKey, + TInt aValue ); + + void RemoveResourceFilesL( RFs& aFileSession ); + + public: // From base class MhspsThemeManagementServiceObserver + + /** + * Realisation of MhspsThemeManagementServiceObserver Interface + * @param aMessage contains a service completion message + */ + void HandlehspsClientMessage( ThspsServiceCompletedMessage aMessage ); + + public: + /** + * Attachs SAPI client to a service. + * @param aSapi SAPI designation. + * @param aInterface Interface name. + * @param aAppUid Application Identifier. + */ + void AttachServiceL( + const TDesC8& aSapi, + const TDesC8& aInterface, + const TDesC8& aAppUid, + const TBool aUseTiming = EFalse ); + + void DetachServiceL(); + + MLiwInterface* Interface(); + protected: // Data + + CLiwServiceHandler* iServiceHandler; + MLiwInterface* iInterface; + CLiwCriteriaItem* iService; + // This is only needed in request notification testing when restoring test data + TInt iAddedPluginId; + TTime iStartTime; + RPointerArray iResourceArray; + + }; + +#endif // C_MT_HSPS_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hspsinstallationservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hspsinstallationservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Theme handler class declaration +* +*/ + + +#ifndef C_MT_HSPSINSTALLATIONSERVICE_H +#define C_MT_HSPSINSTALLATIONSERVICE_H + + +// SYSTEM INCLUDES + +#include +#include + + +// USER INCLUDES + + +// FORWARD DECLARATIONS +class ChspsDomNode; +class ChspsResult; +class ChspsODT; +class ChspsClient; + +/** + * This class provides HSPS installation services + */ +class MT_CHspsInstallationService : public CBase, public MhspsThemeManagementServiceObserver + { + public: // Constructor and destructor + + /** + * Two-phased constructor. + * @return CHspsConfigurationService* + */ + static MT_CHspsInstallationService* NewL(); + + /** + * Destructor. + */ + virtual ~MT_CHspsInstallationService(); + + private: // Constructors + + /** + * Constructor + */ + MT_CHspsInstallationService(); + + /** + * Symbian Constructor + */ + void ConstructL(); + + + public: // From base class MhspsThemeManagementServiceObserver + + + /** + * Realisation of MhspsThemeManagementServiceObserver Interface + * @param aMessage contains a service completion message + */ + void HandlehspsClientMessage( ThspsServiceCompletedMessage aMessage ); + + public: // New methods + + void InstallConfigurationL( const TDesC& aManifestFileName ); + void UninstallConfigurationL( TInt aAppUid, TInt aConfUid ); + + + private: // Methods + void InstallThemeL(const TDesC& aManifestFileName); + + private: // Data + + // Pointer to HSPS Theme server client object + ChspsClient* iHspsClient; + TBuf8 iHeaderData; + TRequestStatus iStatus; + ChspsResult* iResult; + ChspsODT* iHeader; + CActiveSchedulerWait* iLoop; + }; + +#endif // C_MT_HSPSINSTALLATIONSERVICE_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hspsteststep.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/inc/mt_hspsteststep.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,201 @@ +/* +* 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: Defination of class MT_CHSPSTeststep +* +*/ + + +#ifndef C_MT_HSPSTESTSTEP_H +#define C_MT_HSPSTESTSTEP_H + +#include +#include +#include + +/** + * This class defines a HSPS test step used in HSPS testing +*/ +NONSHARABLE_CLASS( MT_CHSPSTeststep ) + : public CActive, public MLiwNotifyCallback + { + + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_CHSPSTeststep* NewL( + MLiwInterface& aInterface, + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aAsync, + TBool aMeasureExecTime = EFalse ); + + /** + * Destructor + */ + virtual ~MT_CHSPSTeststep(); + + private: // Constructors and destructors + + MT_CHSPSTeststep( + MLiwInterface& aInterface, + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aAsync, + TBool aMeasureExecTime ); + + public: // Functions from base classes + + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + */ + TInt RunError( TInt aError ); + + /** + * From CActive + */ + void DoCancel(); + + /** + * From MLiwNotifyCallback + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + + public: // New methods + + /** + * Calls service method + */ + void CallServiceL(); + + /** + * Checks output parameters of method call + * @return TRUE, if received output parameters + * match to expected output paramters + * FALSE, if received output paramters + * does not match to expected output parameters + */ + TInt CheckOutParams(); + + private: // New functions + + /** + * Creates input parameter list from a descriptor stream + * @param aInParams Input parameter stream + * @return Pointer to created input parameter list + */ + CLiwGenericParamList* CreateInParamListL( + TUint8* aInParams ); + + /** + * Creates output descriptor stream from output parameter list + * @param aOutParamList Output parameter list + * @return Pointer to created output parameter stream + */ + HBufC8* CreateOutParamsL( + CLiwGenericParamList& aOutParamList ); + + /** + * Starts timing of SAPI method execution + * @param aMethod Called SAPI method + * @return void + */ + void StartTiming( + TDesC8& aMethod ); + + /** + * Calculates SAPI method execution time + * @return void + */ + void StopTiming(); + +#ifdef HSPS_LOG_ACTIVE + /** + * Debug output to a text file + * @param aOutPtr An array of bytes from the SAPI call + */ + void DebugL( const TUint8* aOutPtr ); +#endif + + public: // Data + + // Output parameters + HBufC8* iOutParams; + // Test step timeout + CPeriodic* iTimeout; + + private: // Data + + /** + * Service interface + */ + MLiwInterface& iInterface; + + /** + * Test step method + * ( Not owned ) + */ + TUint8* iMethod; + + /** + * Test step input parameters as a binary stream + * ( Not owned ) + */ + TUint8* iInParams; + + /** + * Test step output parameters as a binary stream + * ( Not owned ) + */ + TUint8* iExpOutParams; + + /** + * Test step asynchronous status + */ + TBool iAsync; + + /** + * Execution time measurement status + */ + TBool iMeasureExecTime; + + /** + * Test step method start time + */ + TTime iStartTime; + + }; + +#endif // C_MT_HSPSTESTSTEP_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hsps.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,755 @@ +/* +* 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: Implementation of MT_CHSPS class +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mt_hsps.h" +#include "mt_hspsteststep.h" +#include "hspsserviceutilities.h" +#include "hspspersonalisationservice.h" +#include "mt_hspsinstallationservice.h" + +// ======== LOCAL CONSTANTS ==================================================== +// LIW variant names +_LIT8( KHspsAppUid, "appUid" ); + +// Heap size for test step thread +const TUint KDefaultHeapSize = 0x10000; + +// Test step data +typedef struct + { + TUint8* iMethod; + TUint8* iInParams; + TUint8* iExpOutParams; + TInt iTriggerCase; + TBool iAsync; + MT_CHSPS* iBaseObject; + }TTestStepDataStr; + +// ======== LOCAL FUNCTIONS ==================================================== + +// --------------------------------------------------------------------------- +// Calls asynchronous service method +// --------------------------------------------------------------------------- +// +void HSPSCallServiceL( TAny* aPointer ) + { + TTestStepDataStr* testStepData = (TTestStepDataStr*)aPointer; + + // Create test step + MT_CHSPSTeststep* ts = MT_CHSPSTeststep::NewL( + *(testStepData->iBaseObject->Interface()), + testStepData->iMethod, + testStepData->iInParams, + testStepData->iExpOutParams, + testStepData->iAsync ); + CleanupStack::PushL( ts ); + + // Call service method + ts->CallServiceL(); + + // Start wait loop for test step execution + CActiveScheduler::Start(); + + // Check test step result + User::LeaveIfError( ts->CheckOutParams() ); + + // Clean test step. + CleanupStack::PopAndDestroy( ts ); + } + +// --------------------------------------------------------------------------- +// Test step thread +// --------------------------------------------------------------------------- +// +TInt HSPSTestStepThread( TAny* aPointer ) + { + TTestStepDataStr* testStepData = (TTestStepDataStr*)aPointer; + + // Create cleanup stack for the test step thread + CTrapCleanup* theCleanupStack = CTrapCleanup::New(); + + // Create active scheduler. Do not start yet. + CActiveScheduler* scheduler = new( ELeave ) CActiveScheduler; + CActiveScheduler::Install( scheduler ); + + // Attach to service. + TInt err = KErrNone; + TRAP( err, + testStepData->iBaseObject->AttachServiceL( KHSPS, + KHSPSConfigurationIf, + KHSPSTestAppUid, + EFalse ); ); // No timing since it crashed + // (we are in separate thread than EUnit now) + + if( err == KErrNone ) + { + // Call asychronous service method + TRAP( err, HSPSCallServiceL( aPointer ) ); + + // Detach + TRAP_IGNORE( testStepData->iBaseObject->DetachServiceL() ); + } + + // Remove active scheduler. + CActiveScheduler::Install( NULL ); + delete scheduler; + scheduler = NULL; + + // Clean clean up stack. + delete theCleanupStack; + + // Signal EUnit thread that asynchronous service request is completed + RThread::Rendezvous( err ); + + // And finally exit. + return err; + } + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +MT_CHSPSResource::MT_CHSPSResource( + const TDesC& aPath, + TInt aExpectedSize ) + { + iPath.Copy( aPath ); + iSize = aExpectedSize; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPSResource::~MT_CHSPSResource() + { + } + + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +MT_CHSPS::MT_CHSPS() + { + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPS::~MT_CHSPS() + { + if ( iInterface ) + { + iInterface->Close(); + } + if ( iServiceHandler ) + { + delete iServiceHandler; + } + if ( iService ) + { + delete iService; + } + iResourceArray.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// Attach to defined service providers interface +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::AttachServiceL( + const TDesC8& aSapi, + const TDesC8& aInterface, + const TDesC8& aAppUid, + const TBool aUseTiming ) + { + iServiceHandler = CLiwServiceHandler::NewL(); + + iService = CLiwCriteriaItem::NewL( 1, aInterface, aSapi ); + iService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + RCriteriaArray interestList; + interestList.AppendL( iService ); + iServiceHandler->AttachL( interestList ); + interestList.Reset(); + + CLiwGenericParamList* inParamList = &( iServiceHandler->InParamListL() ); + CLiwGenericParamList* outParamList = &( iServiceHandler->OutParamListL() ); + + TLiwGenericParam appUid; + TLiwVariant uidVar; + uidVar.Set( aAppUid ); + appUid.SetNameAndValueL( KHspsAppUid, uidVar ); + inParamList->AppendL( appUid ); + appUid.Reset(); + + if( aUseTiming ) + { + TPtrC8 method; + method.Set( _L8( "Attach" ) ); + StartTiming( method ); + } + + iServiceHandler->ExecuteServiceCmdL( + *iService, + *inParamList, + *outParamList ); + + if( aUseTiming ) + { + StopTiming(); + } + + TInt pos = 0; + outParamList->FindFirst( pos, aInterface ); + if( pos != KErrNotFound ) + { + iInterface = ( *outParamList )[ pos ].Value().AsInterface(); + inParamList->Reset(); + outParamList->Reset(); + } + else + { + inParamList->Reset(); + outParamList->Reset(); + User::Leave( KErrNotFound ); + } +} + +// ----------------------------------------------------------------------------- +// Detach from attached interface +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::DetachServiceL( ) + { + if ( iInterface ) + { + iInterface->Close(); + iInterface = NULL; + } + if ( iService && iServiceHandler ) + { + RCriteriaArray interestList; + interestList.AppendL( iService ); + iServiceHandler->DetachL( interestList ); + interestList.Reset(); + } + if ( iServiceHandler ) + { + delete iServiceHandler; + iServiceHandler = NULL; + } + if ( iService ) + { + delete iService; + iService = NULL; + } + } + +// ----------------------------------------------------------------------------- +// Runs synchronous test step +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunTestStepSyncL( + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aMeasureExecTime ) + { + // AttachServiceL not done? + ASSERT ( iInterface ); + + // Create test step + MT_CHSPSTeststep* ts = MT_CHSPSTeststep::NewL( + *iInterface, + aMethod, + aInParams, + aExpOutParams, + EFalse, + aMeasureExecTime ); + CleanupStack::PushL( ts ); + + // Call synchronous service method + ts->CallServiceL(); + + User::LeaveIfError( ts->CheckOutParams() ); + + CleanupStack::PopAndDestroy( ts ); + } +// ----------------------------------------------------------------------------- +// Runs request notification triggerer +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunNotificationTriggerL( TInt aTriggerCase ) + { + switch( MT_THSPSTrigger(aTriggerCase) ) + { + case EHspsTriggerRunRemovePluginCase: + { + RunRemovePluginCase(); + } + break; + case EHspsTriggerRunAddPluginCase: + { + RunAddPluginCase(); + } + break; + case EHspsTriggerRunInstallationCase: + { + RunInstallationCase(); + } + break; + case EHspsTriggerRunSetActivePluginCase: + { + RunSetActivePluginCase(); + } + break; + case EHspsTriggerRunReplacePluginCase: + { + RunReplacePluginCase(); + } + break; + case EHspsTriggerRunUpdateInstallationCase: + { + RunUpdateInstallationCase(); + } + break; + case EHspsTriggerRunUninstallationCase: + { + RunUninstallationCase(); + } + break; + default: + break; + } + } +// ----------------------------------------------------------------------------- +// Runs Remove Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunRemovePluginCase() + { + _LIT8(KPluginId, "8"); + TBuf8<8> removedPluginId(KPluginId); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + hspsPersonalisationService->RemovePluginL(536874929, removedPluginId); + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + } +// ----------------------------------------------------------------------------- +// Runs Remove Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunAddPluginCase() + { + _LIT8(KViewConfId, "1"); + _LIT8(KPluginUid, "0x2000b120"); + _LIT8(KPluginposition, "-1"); + TBuf8<10> viewConfId(KViewConfId); + TBuf8<10> addedPluginUid(KPluginUid); + TBuf8<10> addedPluginposition(KPluginposition); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + + + TInt pluginId; + hspsPersonalisationService->AddPluginL(536874929, viewConfId, addedPluginUid, addedPluginposition, pluginId ); + iAddedPluginId = pluginId; + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + + } + +// ----------------------------------------------------------------------------- +// Installs a plugin +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunInstallationCase() + { + // Triggers a "PluginInstalled" notification to clients when finnished + MT_CHspsInstallationService* hspsInstallationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( hspsInstallationService ); + hspsInstallationService->InstallConfigurationL( KHSPSInstallInstalledWidgetConf ); + CleanupStack::PopAndDestroy( hspsInstallationService ); + } + +// ----------------------------------------------------------------------------- +// Installs an update for the plugin +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunUpdateInstallationCase() + { + // Triggers a "PluginUpdated" notification to clients when finnished + MT_CHspsInstallationService* hspsInstallationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( hspsInstallationService ); + hspsInstallationService->InstallConfigurationL( KHSPSInstallInstalledWidgetConfV2 ); + CleanupStack::PopAndDestroy( hspsInstallationService ); + } + +// ----------------------------------------------------------------------------- +// Uninstalls a plugin +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunUninstallationCase() + { + // Triggers a "PluginUninstalled" notification to clients when finnished + MT_CHspsInstallationService* hspsInstallationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( hspsInstallationService ); + hspsInstallationService->UninstallConfigurationL( + KHSPSMTInterfaceUid, + (TInt)KHSPSInstalledWidgetConf); + CleanupStack::PopAndDestroy( hspsInstallationService ); + } + +void MT_CHSPS::RestoreTestDataL( TInt aTriggerCase ) + { + switch(aTriggerCase) + { + case 1: + { + RestoreRemovedPluginCase(); + } + break; + case 2: + { + RestoreAddedPluginCase(); + } + break; + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// Runs Remove Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RestoreRemovedPluginCase() + { + _LIT8(KViewConfId, "6"); + _LIT8(KPluginUid, "0x2000b120"); + _LIT8(KPluginposition, "-1"); + TBuf8<10> viewConfId(KViewConfId); + TBuf8<10> addedPluginUid(KPluginUid); + TBuf8<10> addedPluginposition(KPluginposition); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + + TInt pluginId; + hspsPersonalisationService->AddPluginL(536874929, viewConfId, addedPluginUid, addedPluginposition, pluginId ); + + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + + } +// ----------------------------------------------------------------------------- +// Runs Remove Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RestoreAddedPluginCase() + { + //_LIT8(KPluginId, "9"); + //iAddedPluginId + TBuf8<10> removedPluginId; + removedPluginId.AppendNum(iAddedPluginId); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + hspsPersonalisationService->RemovePluginL(536874929, removedPluginId); + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + + } + +// ----------------------------------------------------------------------------- +// Runs Remove Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunSetActivePluginCase() + { + _LIT8(KPluginId, "5"); + TBuf8<10> pluginId( KPluginId ); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + + hspsPersonalisationService->SetActivePluginL( 536874929, pluginId ); + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + + } + +// ----------------------------------------------------------------------------- +// Runs Replace Plugin for request notification tests +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunReplacePluginCase() + { + _LIT8(KPluginId, "1"); + _LIT8(KPluginUid, "0x2000b102"); + TBuf8<10> replacePluginUid( KPluginUid ); + TBuf8<1> replacePluginId( KPluginId ); + CHspsPersonalisationService* hspsPersonalisationService = CHspsPersonalisationService::NewL(); + CleanupStack::PushL( hspsPersonalisationService ); + + hspsPersonalisationService->ReplacePluginL( 536874929, replacePluginId, replacePluginUid ); + + CleanupStack::PopAndDestroy( hspsPersonalisationService ); + + } + +// ----------------------------------------------------------------------------- +// Accessor to iInterface +// ----------------------------------------------------------------------------- +// +MLiwInterface* MT_CHSPS::Interface() + { + return iInterface; + } + +// ----------------------------------------------------------------------------- +// Runs synchronous test step +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RunTestStepAsyncL( + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TInt aTriggerCase) + { + + // Create test step data + TTestStepDataStr data; + data.iMethod = aMethod; + data.iInParams = aInParams; + data.iExpOutParams = aExpOutParams; + data.iTriggerCase = aTriggerCase; + data.iAsync = ETrue; + data.iBaseObject = this; + + // Create thread for the asynchronous test step + RThread testThread; + TInt err = testThread.Create( + _L( "TestStep" ), + HSPSTestStepThread, + 0x5000, // 20kB + KDefaultHeapSize, + KDefaultHeapSize, + ( TAny* )&data, + EOwnerProcess ); + + if ( err == KErrNone ) + { + // This must be done before resume is called to get correct error code. + TRequestStatus status; + + // Request signal from test step thread when test step is completed + testThread.Rendezvous( status ); + + // Start test step thread + testThread.Resume(); + + // Give test thread some time to initialize so that triggers are not ran before + // test thread is connected to server. + User::After( 2000000 ); + + // change application configuration + TRAP( err, RunNotificationTriggerL(aTriggerCase) ); + if( err != KErrNone ) + { + // Shutdown thread and close handle. Then leave and + // do not wait for event that is never triggered. + if( testThread.ExitReason() == EExitPending ) // Check that process is alive. + { + testThread.Kill( KErrUnknown ); + } + + testThread.Close(); + User::Leave( err ); + } + + // Wait test step to be completed + User::WaitForRequest( status ); + err = status.Int(); + + testThread.Close(); + + // Give test thread some time to close + User::After( 2000000 ); + + } + + User::LeaveIfError( err ); + + } + +// ----------------------------------------------------------------------------- +// Set active configuration +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::SetActiveConfigurationL( + const TDesC8& aAppUid, + TInt aConfId ) + { + + TInt appUid = HspsServiceUtilities::DecString2Int( aAppUid ); + + // Set application configuration active + SetCentralRepositoryKeyL( appUid, aConfId ); + + } + +void MT_CHSPS::AddResourceL( + const TDesC& aFileName, + const TInt aExpectedSize ) + { + iResourceArray.AppendL( new MT_CHSPSResource(aFileName, aExpectedSize) ); + } + +void MT_CHSPS::ResetResources() + { + iResourceArray.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// Check if all given files exist +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::CheckResourcesL() + { + RFs rFs; + rFs.Connect(); + CleanupClosePushL( rFs ); + + RFile file; + CleanupClosePushL( file ); + + TInt err = KErrNone; + TInt actualSize = 0; + for( TInt i = 0; i < iResourceArray.Count() && !err; i++ ) + { + MT_CHSPSResource* r = iResourceArray[ i ]; + + if ( !r || !r->iPath.Length() ) + { + err = KErrArgument; + } + if ( !err ) + { + err = file.Open( rFs, r->iPath, EFileRead ); + } + if ( !err ) + { + file.Size( actualSize ); + file.Close(); + if ( r->iSize >= 0 && actualSize != r->iSize ) + { + err = KErrCorrupt; + } + } + + if ( err ) + { + EUNIT_PRINT( r->iPath ); + User::Leave( err ); + } + } + + CleanupStack::PopAndDestroy(2, &rFs); // file, rFs + + ResetResources(); + } + +// ----------------------------------------------------------------------------- +// Starts timing of SAPI method execution +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::StartTiming( + TDesC8& aMethod ) + { + iStartTime.HomeTime(); + EUNIT_PRINT( aMethod ); + } + +// ----------------------------------------------------------------------------- +// Calculates SAPI method execution time +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::StopTiming() + { + TTime readyTime; + readyTime.HomeTime(); + TTimeIntervalMicroSeconds delay = readyTime.MicroSecondsFrom( iStartTime ); + TTime transferTime( delay.Int64() ); + TBuf<64> timeString; + transferTime.FormatL( timeString,_L( "Execution time: %S%C microseconds" ) ); + + EUNIT_PRINT( timeString ); + + } + +// ----------------------------------------------------------------------------- +// Sets Central Repository key value +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::SetCentralRepositoryKeyL( + TInt aKey, + TInt aValue ) + { + CRepository* cr = CRepository::NewL( KhspsThemeStatusRepositoryUid ); + CleanupStack::PushL( cr ); + User::LeaveIfError( cr->Set( aKey, aValue ) ); + + CleanupStack::PopAndDestroy( cr ); + } + +// ----------------------------------------------------------------------------- +// Removes test configuration resource files +// ----------------------------------------------------------------------------- +// +void MT_CHSPS::RemoveResourceFilesL( + RFs& aFileSession ) + { + + CFileMan* fileManager = CFileMan::NewL( aFileSession ); + CleanupStack::PushL( fileManager ); + fileManager->RmDir( _L( "c:\\private\\20000fb1\\2456\\" ) ); + fileManager->RmDir( _L( "c:\\private\\20000fb1\\536874929\\" ) ); + CleanupStack::PopAndDestroy( fileManager ); + + } + +// --------------------------------------------------------------------------- +// Hsps client service observer +// --------------------------------------------------------------------------- +// +void MT_CHSPS::HandlehspsClientMessage( ThspsServiceCompletedMessage /*aMessage*/ ) + { + // Asynchronous service handling + + } + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsinstallationservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsinstallationservice.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "mt_hspsinstallationservice.h" + +// ----------------------------------------------------------------------------- +// CThemeInstaller::NewL() +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C MT_CHspsInstallationService* MT_CHspsInstallationService::NewL() + { + MT_CHspsInstallationService* self = new ( ELeave ) MT_CHspsInstallationService; + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return( self ); + } + + +// ----------------------------------------------------------------------------- +// CThemeInstaller::ConstructL() +// +// +// ----------------------------------------------------------------------------- +// +void MT_CHspsInstallationService::ConstructL() + { + iResult = ChspsResult::NewL(); + iHspsClient = ChspsClient::NewL( *this ); + iHeader = NULL; + iLoop = new ( ELeave )CActiveSchedulerWait(); + } + +// ----------------------------------------------------------------------------- +// CThemeInstaller::~CThemeInstaller() +// +// +// ----------------------------------------------------------------------------- +// +MT_CHspsInstallationService:: ~MT_CHspsInstallationService() + { + delete iHspsClient; + delete iResult; + delete iHeader; + delete iLoop; + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +MT_CHspsInstallationService::MT_CHspsInstallationService() + { + } +// ----------------------------------------------------------------------------- +// Gets program arguments and starts the installer +// ----------------------------------------------------------------------------- +// + +void MT_CHspsInstallationService::InstallConfigurationL( + const TDesC& aManifestFileName ) + { + // Init + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + // Check if the file exists + BaflUtils baf; + if( baf.FileExists( fs, aManifestFileName ) ) + { + InstallThemeL( aManifestFileName ); + iLoop->Start(); + } + else + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( 1, &fs ); // directoryList, args, Fs + } + +// ----------------------------------------------------------------------------- +// Initiates installing of a confgiruation from the provided manifest file +// ----------------------------------------------------------------------------- +// +void MT_CHspsInstallationService::InstallThemeL( + const TDesC& aManifestFileName ) + { + + if ( iHeader ) + { + delete iHeader; + iHeader = NULL; + } + iHeader = ChspsODT::NewL(); + + TParse p; + p.Set( aManifestFileName, NULL, NULL ); + TPtrC ptr = p.NameAndExt(); + + ThspsServiceCompletedMessage ret = iHspsClient->hspsInstallTheme( aManifestFileName, *iHeader ); + + switch ( ret ) + { + case EhspsInstallThemeSuccess: + // Installation completed - Update status + iHspsClient->GethspsResult( *iResult ); + break; + case EhspsInstallPhaseSuccess: + // Continue installation + iHspsClient->hspsInstallNextPhaseL( *iHeader ); + break; + default: + // Installation failed + User::Leave( KErrGeneral ); + break; + } + } + +void MT_CHspsInstallationService::UninstallConfigurationL( + TInt aAppUid, + TInt aConfUid ) + { + ChspsODT* odt = ChspsODT::NewL(); + CleanupStack::PushL( odt ); + odt->SetRootUid( aAppUid ); + odt->SetThemeUid( aConfUid ); + odt->SetProviderUid( 270513751 ); + + ThspsServiceCompletedMessage ret = iHspsClient->hspsRemoveThemeL( *odt ); + + CleanupStack::PopAndDestroy( odt ); + } + +// ----------------------------------------------------------------------------- +// MT_CHspsInstallationService::HandlehspsClientMessage() +// +// Handles events received from themeserver via hspsClient +// ----------------------------------------------------------------------------- + +void MT_CHspsInstallationService::HandlehspsClientMessage( + ThspsServiceCompletedMessage aEvent ) + { + TInt errorCode = KErrNone; + + TBuf tmp; + iHspsClient->GethspsResult(*iResult); + + switch( aEvent ) + { + case EhspsInstallThemeFailed: + // Flow through + case EhspsInstallThemeSuccess: + // Installation completed + iLoop->AsyncStop(); + break; + default: + // No operation - Continue installation + break; + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/common/src/mt_hspsteststep.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,448 @@ +/* +* 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: Implementation of MT_CHSPSTeststep class +* +*/ + + +#include +#include +#include +#include +#include "mt_hspsteststep.h" + +#ifdef HSPS_LOG_ACTIVE +#include +#include +#endif + +// ======== LOCAL CONSTANTS ==================================================== + +// Test step timeout +const TInt KTestStepTimeout = 5000000; + +// Max input +const TInt KTestStepInputSizeMax = 1000; + +// Max output +const TInt KTestStepOutputSizeMax = 10000; + +// ======== LOCAL FUNCTIONS ==================================================== + +// --------------------------------------------------------- +// TimeoutCallback +// --------------------------------------------------------- +// +TInt TimeoutCallback( TAny* aPtr ) + { + TRequestStatus* status = &( ( ( MT_CHSPSTeststep* )aPtr )->iStatus ); + + if ( ( ( MT_CHSPSTeststep* )aPtr )->iOutParams ) + { + delete ( ( MT_CHSPSTeststep* )aPtr )->iOutParams; + ( ( MT_CHSPSTeststep* )aPtr )->iOutParams = NULL; + } + if ( ( ( MT_CHSPSTeststep* )aPtr )->iTimeout ) + { + delete ( ( MT_CHSPSTeststep* )aPtr )->iTimeout; + ( ( MT_CHSPSTeststep* )aPtr )->iTimeout = NULL; + } + + User::RequestComplete( status, KErrNone ); + + return KErrNone; + } + + +// ======== MEMBER FUNCTIONS =================================================== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPSTeststep* MT_CHSPSTeststep::NewL( + MLiwInterface& aInterface, + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aAsync, + TBool aMeasureExecTime ) + { + MT_CHSPSTeststep* self = new( ELeave ) MT_CHSPSTeststep( + aInterface, + aMethod, + aInParams, + aExpOutParams, + aAsync, + aMeasureExecTime ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +MT_CHSPSTeststep::MT_CHSPSTeststep( + MLiwInterface& aInterface, + TUint8* aMethod, + TUint8* aInParams, + TUint8* aExpOutParams, + TBool aAsync, + TBool aMeasureExecTime ) + :CActive( CActive::EPriorityStandard ) + ,iOutParams( NULL ) + ,iTimeout( NULL ) + ,iInterface( aInterface ) + ,iMethod( aMethod ) + ,iInParams( aInParams ) + ,iExpOutParams( aExpOutParams ) + ,iAsync( aAsync ) + ,iMeasureExecTime( aMeasureExecTime ) + { + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPSTeststep::~MT_CHSPSTeststep() + { + if ( iOutParams ) + { + delete iOutParams; + } + if ( iTimeout ) + { + delete iTimeout; + } + } + +// ----------------------------------------------------------------------------- +// From CActive +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::RunL() + { + // Stop test thread active scheduler + CActiveScheduler::Stop(); + } + +// ----------------------------------------------------------------------------- +// From CActive +// ----------------------------------------------------------------------------- +// +TInt MT_CHSPSTeststep::RunError( + TInt /*aError*/ ) + { + if ( iOutParams ) + { + delete iOutParams; + iOutParams = NULL; + } + if ( iTimeout ) + { + delete iTimeout; + iTimeout = NULL; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// From CActive +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::DoCancel() + { + if ( iOutParams ) + { + delete iOutParams; + iOutParams = NULL; + } + if ( iTimeout ) + { + delete iTimeout; + iTimeout = NULL; + } + } + +// ----------------------------------------------------------------------------- +// MLiwNotifyCallback::HandleNotifyL +// ----------------------------------------------------------------------------- +// +TInt MT_CHSPSTeststep::HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + aCmdId = aCmdId; + aEventId = aEventId; + + // Copy event parameters as a descriptor stream + if ( iOutParams ) + { + delete iOutParams; + iOutParams = NULL; + } + iOutParams = CreateOutParamsL( aEventParamList ); + + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Calls service method +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::CallServiceL() + { + + CLiwGenericParamList* inParamList; + CLiwGenericParamList* outParamList; + TInt err; + + // Create input parameter list + if ( iInParams ) + { + // Create input parameter list from binary stream + inParamList = CreateInParamListL( + iInParams ); + } + else + { + // Create empty input parameter list + inParamList = CLiwGenericParamList::NewL(); + } + + // Create empty output parameter list + outParamList = CLiwGenericParamList::NewL(); + + // Execute test step + if ( !iAsync ) + { + TPtrC8 method( iMethod ); + + if ( iMeasureExecTime ) + { + StartTiming( method ); + } + + TRAP( err, iInterface.ExecuteCmdL( + method, + *inParamList, + *outParamList ) ); + + if ( iMeasureExecTime ) + { + StopTiming(); + } + + if ( err == KErrNone ) + { + // Store outparams as descriptor stream + if ( iOutParams ) + { + delete iOutParams; + iOutParams = NULL; + } + iOutParams = CreateOutParamsL( *outParamList ); + } + } + else + { + TPtrC8 method( iMethod ); + + TRAP( err, iInterface.ExecuteCmdL( + method, + *inParamList, + *outParamList, + KLiwOptASyncronous, + this ) ); + + if ( err == KErrNone ) + { + // Set test step to wait asynchronous response + CActiveScheduler::Add( this ); + iStatus = KRequestPending; + SetActive(); + + // Start test step timeout + iTimeout = CPeriodic::NewL( CActive::EPriorityStandard ); + iTimeout->Start( + TTimeIntervalMicroSeconds32( KTestStepTimeout ), + TTimeIntervalMicroSeconds32( KTestStepTimeout ), + TCallBack( TimeoutCallback, this ) ); + } + } + + inParamList->Reset(); + delete inParamList; + outParamList->Reset(); + delete outParamList; + + } + +#ifdef HSPS_LOG_ACTIVE +// ----------------------------------------------------------------------------- +// Debugging +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::DebugL( + const TUint8* aOutPtr ) + { + ChspsLogBus* logBus = ChspsLogBusFile::NewL( _L("LIW_test_comparison.log") ); + CleanupStack::PushL( logBus ); + + logBus->LogText( _L( "index, expected(int, char), actual(int, char)" ) ); + + TBool exitNow = EFalse; + for ( TInt i = 0; + i < iOutParams->Length() && !exitNow; + i++ ) + { + logBus->LogText( _L("[%5d], %3d, '%c', %3d, '%c'"), + i, // index + ( TUint16 )iExpOutParams[i], + ( TUint16 )iExpOutParams[i], + ( TUint16 )aOutPtr[i], + ( TUint16 )aOutPtr[i] ); + + if ( iExpOutParams[i] != aOutPtr[i] ) + { + exitNow = ETrue; + } + } + + CleanupStack::PopAndDestroy( logBus ); + } +#endif + +// ----------------------------------------------------------------------------- +// Checks method call output parameters +// ----------------------------------------------------------------------------- +// +TInt MT_CHSPSTeststep::CheckOutParams() + { + TInt err( KErrArgument ); + + if ( iExpOutParams && iOutParams ) + { + err = KErrNone; + + const TUint8* outPtr = ( iOutParams->Des() ).Ptr(); + for ( TInt i = 0; + i < iOutParams->Length() && err == KErrNone; + i++ ) + { + if ( *( iExpOutParams + i ) != *( outPtr + i ) ) + { + EUNIT_PRINT( _L("TEST STEP FAILED: Output mismatch: output[%d] = %d, expected output[%d] = %d "), i, ( *( outPtr + i ) ), i, ( *( iExpOutParams + i ) ) ); + err = KErrArgument; + } + } + + // Dump comparison file. +#ifdef HSPS_LOG_ACTIVE + if( err != KErrNone ) + { + TRAP_IGNORE( DebugL( outPtr ) ); + } +#endif + } + + return err; + } + +// ----------------------------------------------------------------------------- +// Creates input parameter list from a descriptor stream +// ----------------------------------------------------------------------------- +// +CLiwGenericParamList* MT_CHSPSTeststep::CreateInParamListL( + TUint8* aInParams ) + { + HBufC8* inParamBuf = HBufC8::NewL( KTestStepInputSizeMax ); + CleanupStack::PushL( inParamBuf ); + + TPtr8 inParamBufPtr = inParamBuf->Des(); + inParamBufPtr.Set( + ( ( TUint8* )aInParams ), + KTestStepInputSizeMax, + KTestStepInputSizeMax ); + + RDesReadStream inParamStream; + inParamStream.Open( inParamBufPtr ); + CLiwGenericParamList* inParamList = + CLiwGenericParamList::NewL( inParamStream ); + inParamStream.Release(); + + CleanupStack::PopAndDestroy( inParamBuf ); + + return inParamList; + } + +// ----------------------------------------------------------------------------- +// Creates output descriptor stream from output parameter list +// ----------------------------------------------------------------------------- +// +HBufC8* MT_CHSPSTeststep::CreateOutParamsL( + CLiwGenericParamList& aOutParamList ) + { + HBufC8* outParams = HBufC8::NewL( KTestStepOutputSizeMax ); + CleanupStack::PushL( outParams ); + + TPtr8 outParamBufPtr = outParams->Des(); + RDesWriteStream outParamStream; + outParamStream.Open( outParamBufPtr ); + aOutParamList.ExternalizeL( outParamStream ); + outParamStream.CommitL(); + outParamStream.Close(); + + CleanupStack::Pop( outParams ); + + return outParams; + } + +// ----------------------------------------------------------------------------- +// Starts timing of SAPI method execution +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::StartTiming( + TDesC8& aMethod ) + { + iStartTime.HomeTime(); + EUNIT_PRINT( aMethod ); + } + +// ----------------------------------------------------------------------------- +// Calculates SAPI method execution time +// ----------------------------------------------------------------------------- +// +void MT_CHSPSTeststep::StopTiming() + { + TTime readyTime; + readyTime.HomeTime(); + TTimeIntervalMicroSeconds delay = readyTime.MicroSecondsFrom( iStartTime ); + TTime transferTime( delay.Int64() ); + TBuf<64> timeString; + transferTime.FormatL( timeString,_L( "Execution time: %S%C microseconds" ) ); + + EUNIT_PRINT( timeString ); + + } + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/Nokia_RnDCert_02.der Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/group/Nokia_RnDCert_02.der has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/Nokia_RnDCert_02.key --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/Nokia_RnDCert_02.key Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn +uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO +vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB +AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo +REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss +/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J +s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut +sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/ +pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp +VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ +P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK +1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT +1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x +-----END RSA PRIVATE KEY----- diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* 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: Build information file for HSPS SAPI module testing +* +*/ + + +#include "../hspsconfigurationif/group/bld.inf" +#include "../hspsprovider/group/bld.inf" + + +PRJ_PLATFORMS + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/checkunittestlog.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/checkunittestlog.pl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +# +# Copyright (c) 2009 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: +# +#!/usr/bin/perl +use XML::Twig; +my $twig= new XML::Twig(); + +$logpath = "\\epoc32\\winscw\\c\\shared\\EUnit\\Logs\\EUnit_log.xml"; +$twig->parsefile( $logpath); + +my $root= $twig->root; +my $elt = $twig->root; +my $failCount = 0; +my $okCount = 0; + +while ($elt = $elt->next_elt('result')){ + if( $elt->att('status') eq "FAIL") + { + $failCount++; + } + elsif( $elt->att('status') eq "OK") + { + $okCount++; + } +} + +my $allCount = $failCount + $okCount; +print "\nUnit testing results:\n\n"; +print $allCount; +print " unit tests run.\n"; +print $okCount; +print " unit tests passed.\n"; +print $failCount; +print " unit tests failed.\n"; +print "\n"; + +if( $failCount > 0) + { + #system("explorer $logpath"); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/createsis_armv5.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/createsis_armv5.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +makesis mt_sapi_homescreenplugin_armv5.pkg +signsis mt_sapi_homescreenplugin_armv5.sis mt_sapi_homescreenplugin_armv5.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/createsis_winscw.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/createsis_winscw.bat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +makesis mt_sapi_homescreenplugin_winscw.pkg +signsis mt_sapi_homescreenplugin_winscw.sis mt_sapi_homescreenplugin_winscw.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_armv5.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,142 @@ +; +; Copyright (c) 2009 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: +; +; mt_sapi_homescreenplugin_winscw.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"mt_sapi_homescreenplugin"},(0xEf111202),1,0,0 + +; Supports Series 60 v5.0 +[0x1028315F], 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +; Files to copy + +; Module test dll +"\epoc32\release\armv5\urel\mt_hspsconfigurationif.dll"-"c:\sys\bin\mt_hspsconfigurationif.dll" +"\epoc32\release\armv5\urel\mt_hspsprovider.dll"-"c:\sys\bin\mt_hspsprovider.dll" + +; Test configurations + +; MinimalConfiguration - Widget +"../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" +"../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" +"../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" + +; MinimalConfiguration - View +"../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" +"../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" +"../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" +"../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" +"../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" +"../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" +"../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" + +; MinimalConfiguration - Root +"../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" +"../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" +"../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" + +; TypicalConfiguration - Widget +"../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" +"../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" +"../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" +"../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" +"../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" +"../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" +"../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" + +; TypicalConfiguration - View1 +"../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" +"../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" +"../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" +"../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" +"../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" +"../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" +"../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" +"../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" +"../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" + +; TypicalConfiguration - View2 +"../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" +"../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" +"../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" +"../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" +"../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" +"../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" + +; TypicalConfiguration - Root +"../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" +"../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" +"../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" +"../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" +"../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" +"../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" + +; OperatorConfiguration - View +"../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" +"../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" +"../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" +"../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" + +; OperatorConfiguration - Root +"../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" +"../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" +"../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" + +; FinnishWidget - Widget +"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" +"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" +"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" +"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" +"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" +"../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" + +; InstalledWidget +"../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" +"../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" +"../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" +"../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" +"../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" +"../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" +"../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" +"../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" +"../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" +"../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" +"../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" + +; InstalledWidget_v2 +"../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" +"../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" +"../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" +"../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" +"../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" +"../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" +"../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" +"../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" +"../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" +"../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" +"../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" +"../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/mt_sapi_homescreenplugin_winscw.pkg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,142 @@ +; +; Copyright (c) 2009 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: +; +; mt_sapi_homescreenplugin_winscw.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"mt_sapi_homescreenplugin"},(0xEf111202),1,0,0 + +; Supports Series 60 v5.0 +[0x1028315F], 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"Nokia"} + +;Unique Vendor name +:"Nokia" + +; Files to copy + +; Module test dll +"\epoc32\release\winscw\udeb\mt_hspsconfigurationif.dll"-"c:\sys\bin\mt_hspsconfigurationif.dll" +"\epoc32\release\winscw\udeb\mt_hspsprovider.dll"-"c:\sys\bin\mt_hspsprovider.dll" + +; Test configurations + +; MinimalConfiguration - Widget +"../testthemes/minimalconf/widget/manifest.dat"-"c:/data/mt_hsps/minimalconf/widget/manifest.dat" +"../testthemes/minimalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/minimalconf/widget/widgetconfiguration.xml" +"../testthemes/minimalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/widget/0/locale.dtd" + +; MinimalConfiguration - View +"../testthemes/minimalconf/view/manifest.dat"-"c:/data/mt_hsps/minimalconf/view/manifest.dat" +"../testthemes/minimalconf/view/viewconfiguration.xml"-"c:/data/mt_hsps/minimalconf/view/viewconfiguration.xml" +"../testthemes/minimalconf/view/main.xml"-"c:/data/mt_hsps/minimalconf/view/main.xml" +"../testthemes/minimalconf/view/picture.jpeg"-"c:/data/mt_hsps/minimalconf/view/picture.jpeg" +"../testthemes/minimalconf/view/resource.file"-"c:/data/mt_hsps/minimalconf/view/resource.file" +"../testthemes/minimalconf/view/viewnavigationrules.xml"-"c:/data/mt_hsps/minimalconf/view/viewnavigationrules.xml" +"../testthemes/minimalconf/view/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/view/0/locale.dtd" + +; MinimalConfiguration - Root +"../testthemes/minimalconf/root/manifest.dat"-"c:/data/mt_hsps/minimalconf/root/manifest.dat" +"../testthemes/minimalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/minimalconf/root/rootconfiguration.xml" +"../testthemes/minimalconf/root/0/locale.dtd"-"c:/data/mt_hsps/minimalconf/root/0/locale.dtd" + +; TypicalConfiguration - Widget +"../testthemes/typicalconf/widget/manifest.dat"-"c:/data/mt_hsps/typicalconf/widget/manifest.dat" +"../testthemes/typicalconf/widget/widgetconfiguration.xml"-"c:/data/mt_hsps/typicalconf/widget/widgetconfiguration.xml" +"../testthemes/typicalconf/widget/hs_logo.jpg"-"c:/data/mt_hsps/typicalconf/widget/hs_logo.jpg" +"../testthemes/typicalconf/widget/widget.bmp"-"c:/data/mt_hsps/typicalconf/widget/widget.bmp" +"../testthemes/typicalconf/widget/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/0/locale.dtd" +"../testthemes/typicalconf/widget/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/1/locale.dtd" +"../testthemes/typicalconf/widget/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/widget/9/locale.dtd" + +; TypicalConfiguration - View1 +"../testthemes/typicalconf/view1/manifest.dat"-"c:/data/mt_hsps/typicalconf/view1/manifest.dat" +"../testthemes/typicalconf/view1/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view1/viewconfiguration.xml" +"../testthemes/typicalconf/view1/view1.bmp"-"c:/data/mt_hsps/typicalconf/view1/view1.bmp" +"../testthemes/typicalconf/view1/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/0/locale.dtd" +"../testthemes/typicalconf/view1/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/1/locale.dtd" +"../testthemes/typicalconf/view1/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view1/9/locale.dtd" +"../testthemes/typicalconf/view1/0/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/0/hs_logoz.jpg" +"../testthemes/typicalconf/view1/1/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/1/hs_logoz.jpg" +"../testthemes/typicalconf/view1/9/hs_logoz.jpg"-"c:/data/mt_hsps/typicalconf/view1/9/hs_logoz.jpg" + +; TypicalConfiguration - View2 +"../testthemes/typicalconf/view2/manifest.dat"-"c:/data/mt_hsps/typicalconf/view2/manifest.dat" +"../testthemes/typicalconf/view2/viewconfiguration.xml"-"c:/data/mt_hsps/typicalconf/view2/viewconfiguration.xml" +"../testthemes/typicalconf/view2/view2.bmp"-"c:/data/mt_hsps/typicalconf/view2/view2.bmp" +"../testthemes/typicalconf/view2/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/0/locale.dtd" +"../testthemes/typicalconf/view2/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/1/locale.dtd" +"../testthemes/typicalconf/view2/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/view2/9/locale.dtd" + +; TypicalConfiguration - Root +"../testthemes/typicalconf/root/manifest.dat"-"c:/data/mt_hsps/typicalconf/root/manifest.dat" +"../testthemes/typicalconf/root/rootconfiguration.xml"-"c:/data/mt_hsps/typicalconf/root/rootconfiguration.xml" +"../testthemes/typicalconf/root/root.bmp"-"c:/data/mt_hsps/typicalconf/root/root.bmp" +"../testthemes/typicalconf/root/0/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/0/locale.dtd" +"../testthemes/typicalconf/root/1/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/1/locale.dtd" +"../testthemes/typicalconf/root/9/locale.dtd"-"c:/data/mt_hsps/typicalconf/root/9/locale.dtd" + +; OperatorConfiguration - View +"../testthemes/operatorconf/view/manifest.dat"-"c:/data/mt_hsps/operatorconf/view/manifest.dat" +"../testthemes/operatorconf/view/configuration.xml"-"c:/data/mt_hsps/operatorconf/view/configuration.xml" +"../testthemes/operatorconf/view/dummy.mif"-"c:/data/mt_hsps/operatorconf/view/dummy.mif" +"../testthemes/operatorconf/view/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/view/0/locale.dtd" + +; OperatorConfiguration - Root +"../testthemes/operatorconf/root/manifest.dat"-"c:/data/mt_hsps/operatorconf/root/manifest.dat" +"../testthemes/operatorconf/root/configuration.xml"-"c:/data/mt_hsps/operatorconf/root/configuration.xml" +"../testthemes/operatorconf/root/0/locale.dtd"-"c:/data/mt_hsps/operatorconf/root/0/locale.dtd" + +; FinnishWidget - Widget +"../testthemes/finnish_widget/manifest.dat"-"c:/data/mt_hsps/finnish_widget/manifest.dat" +"../testthemes/finnish_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/finnish_widget/widgetconfiguration.xml" +"../testthemes/finnish_widget/common.jpg"-"c:/data/mt_hsps/finnish_widget/common.jpg" +"../testthemes/finnish_widget/0/locale.dtd"-"c:/data/mt_hsps/finnish_widget/0/locale.dtd" +"../testthemes/finnish_widget/9/locale.dtd"-"c:/data/mt_hsps/finnish_widget/9/locale.dtd" +"../testthemes/finnish_widget/0/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/0/localizedbg.jpg" +"../testthemes/finnish_widget/9/localizedbg.jpg"-"c:/data/mt_hsps/finnish_widget/9/localizedbg.jpg" + +; InstalledWidget +"../testthemes/installed_widget/manifest.dat"-"c:/data/mt_hsps/installed_widget/manifest.dat" +"../testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat"-"c:/data/mt_hsps/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat" +"../testthemes/installed_widget/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget/widgetconfiguration.xml" +"../testthemes/installed_widget/0/locale.dtd"-"c:/data/mt_hsps/installed_widget/0/locale.dtd" +"../testthemes/installed_widget/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/0/hs_logo.jpg" +"../testthemes/installed_widget/0/widget.bmp"-"c:/data/mt_hsps/installed_widget/0/widget.bmp" +"../testthemes/installed_widget/1/locale.dtd"-"c:/data/mt_hsps/installed_widget/1/locale.dtd" +"../testthemes/installed_widget/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/1/hs_logo.jpg" +"../testthemes/installed_widget/1/widget.bmp"-"c:/data/mt_hsps/installed_widget/1/widget.bmp" +"../testthemes/installed_widget/9/locale.dtd"-"c:/data/mt_hsps/installed_widget/9/locale.dtd" +"../testthemes/installed_widget/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget/9/hs_logo.jpg" +"../testthemes/installed_widget/9/widget.bmp"-"c:/data/mt_hsps/installed_widget/9/widget.bmp" + +; InstalledWidget_v2 +"../testthemes/installed_widget_v2/manifest.dat"-"c:/data/mt_hsps/installed_widget_v2/manifest.dat" +"../testthemes/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat"-"c:/data/mt_hsps/installed_widget_v2/plugin_0998_101FB657_2000B133_2.0.dat" +"../testthemes/installed_widget_v2/widgetconfiguration.xml"-"c:/data/mt_hsps/installed_widget_v2/widgetconfiguration.xml" +"../testthemes/installed_widget_v2/0/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/0/locale.dtd" +"../testthemes/installed_widget_v2/0/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/0/hs_logo.jpg" +"../testthemes/installed_widget_v2/0/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/0/widget.bmp" +"../testthemes/installed_widget_v2/1/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/1/locale.dtd" +"../testthemes/installed_widget_v2/1/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/1/hs_logo.jpg" +"../testthemes/installed_widget_v2/1/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/1/widget.bmp" +"../testthemes/installed_widget_v2/9/locale.dtd"-"c:/data/mt_hsps/installed_widget_v2/9/locale.dtd" +"../testthemes/installed_widget_v2/9/hs_logo.jpg"-"c:/data/mt_hsps/installed_widget_v2/9/hs_logo.jpg" +"../testthemes/installed_widget_v2/9/widget.bmp"-"c:/data/mt_hsps/installed_widget_v2/9/widget.bmp" diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/group/updatetests.cmd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,23 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off +rem +rem For testing/debugging in emulator after the SISX package has been installed +rem + +if exist \epoc32\winscw\c\sys\bin\mt_*.dll del \epoc32\winscw\c\sys\bin\mt_*.dll +if exist \epoc32\winscw\c\sys\hash\mt_*.dll del \epoc32\winscw\c\sys\hash\mt_*.dll +copy \epoc32\release\winscw\udeb\mt_*.dll \epoc32\release\winscw\udeb\z\sys\bin \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/bwins/mt_hspsconfigurationifu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/bwins/mt_hspsconfigurationifu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?NewL@MT_CHspsInstallationService@@SAPAV1@XZ @ 2 NONAME ; class MT_CHspsInstallationService * MT_CHspsInstallationService::NewL(void) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/eabi/mt_hspsconfigurationifu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/eabi/mt_hspsconfigurationifu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _ZN27MT_CHspsInstallationService4NewLEv @ 2 NONAME + _ZTI16MT_CHSPSResource @ 3 NONAME ; ## + _ZTI27MT_CHspsInstallationService @ 4 NONAME ; ## + _ZTV16MT_CHSPSResource @ 5 NONAME ; ## + _ZTV27MT_CHspsInstallationService @ 6 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* 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: Build information file for HSPS SAPI configuration interface +* module testing +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES + +PRJ_TESTMMPFILES +mt_hspsconfigurationif.mmp + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/group/mt_hspsconfigurationif.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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: Project definition file for HSPS SAPI configuration interface +* module testing +* +*/ + + +#include +#include "../../../inc/hsps_log_cfg.hrh" + +TARGET mt_hspsconfigurationif.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB -DRM +VENDORID 0x00000000 + +SOURCEPATH ../src +SOURCE mt_hspsconfigurationif.cpp +SOURCE mt_hspsconfigurationif_dllmain.cpp +SOURCE mt_hspsliwlistprinter.cpp +SOURCEPATH ../../common/src +SOURCE mt_hsps.cpp +SOURCE mt_hspsteststep.cpp +SOURCE mt_hspsinstallationservice.cpp + +SOURCEPATH ../../../hspsservice/src +SOURCE hspsserviceutilities.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../common/inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../hspsservice/inc + +// System include folders required by the tested code +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/platform/digia/eunit + +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY EUnit.lib +LIBRARY EUnitUtil.lib +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY liwServiceHandler.lib +LIBRARY flogger.lib +LIBRARY centralrepository.lib +LIBRARY hspsservice.lib +LIBRARY hspsclient.lib +LIBRARY hspsodt.lib +LIBRARY hspsresult.lib + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2751 @@ +/* +* 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: Test case AddPlugin(1) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_1_H +#define C_MT_HSPS_ADDPLUGIN_1_H + +/* +Add/RemovePlugin(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that a plugin configuration is +successfully added to the application configuration to the defined position and +that a plugin is successfully removed from the application configuration. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + AddPlugin(“Typical configuration”“ View Conf #1”, “0”) +• Expected output: + Plugin id of added View Conf #1. + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration including View Conf #1 view configuration + as first plugin in the plugin list + +Test step 3: +• Input: + GetPluginConf(“pluginId”) +• Expected output: + View Conf #1 configuration + +Test step 4: +• Input: + RemovePlugin(“pluginId”) +• Expected output: + ErrorCode element with KErrNone + +Test step 5: +• Input: + GetActiveAppConf() +• Expected output: + Original Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 addplugin_1_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_1_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','1', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 1 output: + +const TUint8 addplugin_1_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0' +}; + +// Test step 2 method: + +const TUint8 addplugin_1_ts_2_method[] = "GetActiveAppConf"; + + +// Test step 2 input: + +const TUint8 addplugin_1_ts_2_input = 0; + + +// Test step 2 expected output: + + +const TUint8 addplugin_1_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 addplugin_1_ts_3_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 addplugin_1_ts_3_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0' +}; + +// Test step 3 output: + +const TUint8 addplugin_1_ts_3_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 4 method: + +const TUint8 addplugin_1_ts_4_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 addplugin_1_ts_4_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0' +}; + +// Test step 4 output: + +const TUint8 addplugin_1_ts_4_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 5 method: + +const TUint8 addplugin_1_ts_5_method[] = "GetActiveAppConf"; + + +// Test step 5 input: + +const TUint8 addplugin_1_ts_5_input = 0; + + +// Test step 5 expected output: + + +const TUint8 addplugin_1_ts_5_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_10.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_10.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,839 @@ +/* +* 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: Test case AddPlugin(10) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_10_H +#define C_MT_HSPS_ADDPLUGIN_10_H + +/* +AddPlugin(10) +---------------- + +Test purpose + +Verify that the service fails when invalid inputs are provided. +Service inputs: configuration id(int), plug-in uid(hex), position(int). + +Pre-conditions +• None + +Test steps + +Test step 1: + +• Input: + AddPlugin( “NULL“ ) +• Expected output: + Failure due to the missing mandatory arguments + +Test step 2: + +• Input: + AddPlugin( "1" ) +• Expected output: + Failure due to the missing mandatory arguments + +Test step 3: + +• Input: + AddPlugin(".Ö*", ".Ö*") +• Expected output: + Failure due to the invalid inputs + +Test step 4: + +• Input: + AddPlugin("ÖÖÖ", "ÖÖÖ","ÖÖÖ") +• Expected output: + Failure due to the invalid input + + +Test step 5: + +• Input: + AddPlugin("0xXX", "0xXX","0xXX") +• Expected output: + Failure due to the invalid input + +Test step 6: + +• Input: + AddPlugin("0xXX9", "0xABC" ) +• Expected output: + Failure due to the invalid input + +Test step 7: + +• Input: + AddPlugin(0, 0, 0) +• Expected output: + Failure due to the invalid input + +Test step 8: + +• Input: + AddPlugin(999999, 999999, 999999) +• Expected output: + Failure due to the invalid input + +*/ + +// Test step 1 method: + +const TUint8 addplugin_10_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_10_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +}; + +// Test step 1 output: + +const TUint8 addplugin_10_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 2 method: + +const TUint8 addplugin_10_ts_2_method[] = "AddPlugin"; + +// Test step 2 input: + +const TUint8 addplugin_10_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 2 output: + +const TUint8 addplugin_10_ts_2_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + +// Test step 3 method: + +const TUint8 addplugin_10_ts_3_method[] = "AddPlugin"; + +// Test step 3 input: + +const TUint8 addplugin_10_ts_3_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'.','Ö','*', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'.','Ö','*' +}; + +// Test step 3 output: + +const TUint8 addplugin_10_ts_3_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 4 method: + +const TUint8 addplugin_10_ts_4_method[] = "AddPlugin"; + +// Test step 4 input: + +const TUint8 addplugin_10_ts_4_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'Ö','Ö','Ö', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'Ö','Ö','Ö' +}; + +// Test step 4 output: + +const TUint8 addplugin_10_ts_4_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + + + +// Test step 5 method: + +const TUint8 addplugin_10_ts_5_method[] = "AddPlugin"; + +// Test step 5 input: + +const TUint8 addplugin_10_ts_5_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'0','x','X','X', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +16, +'0','x','X','X' +}; + +// Test step 5 output: + +const TUint8 addplugin_10_ts_5_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + + + +// Test step 6 method: + +const TUint8 addplugin_10_ts_6_method[] = "AddPlugin"; + +// Test step 6 input: + +const TUint8 addplugin_10_ts_6_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','X','X','9', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','A','B','C' +}; + +// Test step 6 output: + +const TUint8 addplugin_10_ts_6_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 7 method: + +const TUint8 addplugin_10_ts_7_method[] = "AddPlugin"; + +// Test step 7 input: + +const TUint8 addplugin_10_ts_7_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 7 output: + +const TUint8 addplugin_10_ts_7_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + + + +// Test step 8 method: + +const TUint8 addplugin_10_ts_8_method[] = "AddPlugin"; + +// Test step 7 input: + +const TUint8 addplugin_10_ts_8_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'9','9','9','9','9','9','9', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'9','9','9','9','9','9','9', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'9','9','9','9','9','9','9' +}; + +// Test step 8 output: + +const TUint8 addplugin_10_ts_8_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + + + + +#endif // C_MT_HSPS_ADDPLUGIN_10_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_11.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_11.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,527 @@ +/* +* 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: Test case AddPlugin(11) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_11_H +#define C_MT_HSPS_ADDPLUGIN_11_H + +/* +Add/RemovePlugin(11) +---------------- + +Test purpose + +The purpose of this test case is to verify that a plugin (e.g. a view) which +contains a reference to a non-installed plugin (e.g. a widget) can be +successfully added. Non-installed plugin reference should be replaced with +an error plugin reference. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active +• Uninstall Widget Conf #1 (View Conf #1 contains a reference to Widget Conf #1) + +Test steps + +Test step 1: +• Input: + AddPlugin(“Typical configuration”“ View Conf #1”, “0”) +• Expected output: + Plugin id of added View Conf #1. + +Test step 2: +• Input: + GetPluginConf(“Error plugin id”) +• Expected output: + Error plugin configuration + +*/ + +// Test step 1 method: + +const TUint8 addplugin_11_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_11_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','1', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 1 output: + +const TUint8 addplugin_11_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0' +}; + +// Test step 2 method: + +const TUint8 addplugin_11_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_11_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 2 output: + +const TUint8 addplugin_11_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','1', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'u','n','k','n','o','w','n', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'u','n','k','n','o','w','n', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'E','r','r','o','r', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3167 @@ +/* +* 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: Test case AddPlugin(2) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_2_H +#define C_MT_HSPS_ADDPLUGIN_2_H + +/* +AddPlugin(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that a plugin configuration is +successfully added to the plugin configuration + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active +• Test step AddPlugin(1) must be executed + +Test steps + +Test step 1: +• Input: + AddPlugin(“Typical view conf 2”,” Widget Conf #1”, “4”) +• Expected output: + Plugin id of added Widget Conf #1. + +Test step 2: +• Input: + GetPluginConf(“Typical view conf 2”) +• Expected output: + Typical view conf 2 configuration including Widget Conf #1 configuration + +Test step 3: +• Input: + GetPluginConf(“pluginId”) +• Expected output: + Widget Conf #1 configuration + +Test step 4: +• Input: + RemovePlugin(“pluginId”) +• Expected output: + ErrorCode element with KErrNone + +Test step 5: +• Input: + GetPluginConf(“Typical view conf 2”) +• Expected output: + Original Typical view conf 2 configuration + +*/ + +// Test step 1 method: + +const TUint8 addplugin_2_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_2_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','2' +}; + +// Test step 1 output: + +const TUint8 addplugin_2_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 2 method: + +const TUint8 addplugin_2_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_2_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 2 output: + +const TUint8 addplugin_2_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10,0,0,0,0, +// - pluginConf::plugins[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[3]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[3]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9', +// - plugins[3]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[3]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[3]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[3]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[3]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[3]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 addplugin_2_ts_3_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 addplugin_2_ts_3_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 3 output: + +const TUint8 addplugin_2_ts_3_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'S','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','h','t', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 addplugin_2_ts_4_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 addplugin_2_ts_4_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 4 output: + +const TUint8 addplugin_2_ts_4_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 5 method: + +const TUint8 addplugin_2_ts_5_method[] = "GetPluginConf"; + +// Test step 5 input: + +const TUint8 addplugin_2_ts_5_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 5 output: + +const TUint8 addplugin_2_ts_5_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_ADDPLUGIN_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,799 @@ +/* +* 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: Test case AddPlugin(3) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_3_H +#define C_MT_HSPS_ADDPLUGIN_3_H + +/* +AddPlugin(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that adding of a plugin configuration +fails, when a plugin configuration is added to the plugin configuration where +the adding of plugins is not allowed (plugins list is not defined in the plugins configuration) + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + AddPlugin(“Widget conf# 1”,”Typical Widget conf”, “0”) +• Expected output: + Adding fails + +Test step 2: +• Input: + GetPluginConf() +• Expected output: + Original Widget conf#1 configuration + +*/ + +// Test step 1 method: + +const TUint8 addplugin_3_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_3_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 1 output: + +const TUint8 addplugin_3_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + +// Test step 2 method: + +const TUint8 addplugin_3_ts_2_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 addplugin_3_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 3 output: + +const TUint8 addplugin_3_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'S','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','h','t', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,164 @@ +/* +* 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: Test case AddPlugin(4) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_4_H +#define C_MT_HSPS_ADDPLUGIN_4_H + +/* +AddPlugin(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that adding of a plugin configuration +fails, when a plugin configuration is request to be added to the non existing +plugin configuration. + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + AddPlugin(“Non existing configuration”,”Typical Widget conf”, “1”) +• Expected output: + Adding fails + +*/ + +// Test step 1 method: + +const TUint8 addplugin_4_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_4_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'9','9','9','9', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 1 output: + +const TUint8 addplugin_4_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* 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: Test case AddPlugin(5) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_5_H +#define C_MT_HSPS_ADDPLUGIN_5_H + +/* +AddPlugin(5) +---------------- + +Test purpose + +The purpose of this test case is to verify that adding of a plugin configuration +fails, when a non existing plugin configuration is request to be added to the +plugin configuration. + +Pre-conditions + +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + AddPlugin(“Minimal configuration”,“Non existing plugin”, “1”) +• Expected output: + Adding fails + +*/ + +// Test step 1 method: + +const TUint8 addplugin_5_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_5_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','f','f','f','f','f','f','f', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 1 output: + +const TUint8 addplugin_5_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - AddPlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2205 @@ +/* +* 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: Test case AddPlugin(6) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_6_H +#define C_MT_HSPS_ADDPLUGIN_6_H + +/* +AddPlugin(6) +---------------- + +Test purpose + +The purpose of this test case is to verify that a plugin configuration is +successfully added to the plugin configuration installed to ROM. + +Pre-conditions +• There must be installed test themes for Active Idle application and Operator + configuration must be set as active + +Test steps + +Test step 1: +• Input: + AddPlugin(“Operator view conf”,” Widget Conf #1”) +• Expected output: + Plugin id of added Widget Conf #1. + +Test step 2: +• Input: + GetPluginConf(“Operator view conf”) +• Expected output: + Operator view conf configuration including Widget Conf #1 configuration + +Test step 3: +• Input: + GetPluginConf(“pluginId”) +• Expected output: + Widget Conf #1 configuration + +Test step 4: +• Input: + RemovePlugin(“pluginId”) +• Expected output: + ErrorCode element with KErrNone + +Test step 5: +• Input: + GetPluginConf(“Operator view conf”) +• Expected output: + Original Operator view conf configuration + +*/ + +// Test step 1 method: + +const TUint8 addplugin_6_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_6_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2' +}; + +// Test step 1 output: + +const TUint8 addplugin_6_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 2 method: + +const TUint8 addplugin_6_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_6_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 2 output: + +const TUint8 addplugin_6_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','V','i','e','w', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'S','t','r','i','n','g', +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'d','u','m','m','y','.','m','i','f', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'l','o','g','o' +}; + +// Test step 3 method: + +const TUint8 addplugin_6_ts_3_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 addplugin_6_ts_3_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 3 output: + +const TUint8 addplugin_6_ts_3_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'S','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','h','t', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 addplugin_6_ts_4_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 addplugin_6_ts_4_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 4 output: + +const TUint8 addplugin_6_ts_4_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 5 method: + +const TUint8 addplugin_6_ts_5_method[] = "GetPluginConf"; + +// Test step 5 input: + +const TUint8 addplugin_6_ts_5_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 5 output: + +const TUint8 addplugin_6_ts_5_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','V','i','e','w', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'S','t','r','i','n','g', +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'d','u','m','m','y','.','m','i','f', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'l','o','g','o' +}; + +#endif // C_MT_HSPS_ADDPLUGIN_6_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_7.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_7.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2559 @@ +/* +* 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: Test case AddPlugin(7) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_7_H +#define C_MT_HSPS_ADDPLUGIN_7_H + +/* +AddPlugin(7) +---------------- + +Test purpose + +The purpose of this test case is to verify that a plugin can be successfully +added to a configuration to the middle of the plugin list and while the +configuration already contains an instance of that plugin and to verify that +a multiple instantiated plugin can be successfully removed. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: + +• Input: + AddPlugin(“Typical view 2”, “Typical Widget”,”2”) +• Expected output: + Plugin id of successfully added plugin + +Test step 2: +• Input: + GetPluginConf(“Typical view 2”) +• Expected output: + Active Idle Typical view 1 configuration with added plugin is returned + +Test step 3: +• Input: + RemovePlugin(“New plugin id”) +• Expected output: + Removing of plugin succeed. + +Test step 4: +• Input: + GetPluginConf(“Typical view 2”) +• Expected output: + Original Active Idle Typical view 2 configuration is returned + +*/ + +// Test step 1 method: + +const TUint8 addplugin_7_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_7_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: + +const TUint8 addplugin_7_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 2 method: + +const TUint8 addplugin_7_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_7_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 2 output: + +const TUint8 addplugin_7_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[3]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[3]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[3]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[3]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[3]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[3]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[3]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 addplugin_7_ts_3_method[] = "RemovePlugin"; + +// Test step 3 input: + +const TUint8 addplugin_7_ts_3_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 3 output: + +const TUint8 addplugin_7_ts_3_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 addplugin_7_ts_4_method[] = "GetPluginConf"; + +// Test step 5 input: + +const TUint8 addplugin_7_ts_4_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 4 output: + +const TUint8 addplugin_7_ts_4_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_ADDPLUGIN_7_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_8.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1312 @@ +/* +* 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: Test case AddPlugin(8) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_8_H +#define C_MT_HSPS_ADDPLUGIN_8_H + +/* +AddPlugin(8) +---------------- + +Test purpose + +Verify that localized plugins can be added into unlocalized configurations. +In addition, make sure that all resources (locale specific and unlocalized) +are copied into the client's private folder when the application configuration is +fetched. + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: + +• Input: + AddPlugin(“Minimal view”, “Typical View1”,”2”) +• Expected output: + Plugin id of successfully added plugin + +Test step 2: + +• Input: + GetPluginConf(“Typical View1”) +• Expected output: + Resource list was found + +Test step 3: + +• Input: + RemovePlugin(“Typical View1”) +• Expected output: + Minimal configuration has succesfully been restored + +*/ + + +// Test step 1 method: + +const TUint8 addplugin_8_ts_1_method[] = "AddPlugin"; + +// Test step 1 input: + +const TUint8 addplugin_8_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','1', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: + +const TUint8 addplugin_8_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6' +}; + + + +// Test step 2 method: + +const TUint8 addplugin_8_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_8_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6' +}; + +// Test step 2 output: + +const TUint8 addplugin_8_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','1','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'h','s','_','l','o','g','o','z','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 addplugin_8_ts_3_method[] = "RemovePlugin"; + +// Test step 3 input: + +const TUint8 addplugin_8_ts_3_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6' +}; + +// Test step 3 output: + +const TUint8 addplugin_8_ts_3_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +#endif // C_MT_HSPS_ADDPLUGIN_8_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_addplugin_9.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,806 @@ +/* +* 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: Test case AddPlugin(9) test data +* +*/ + + +#ifndef C_MT_HSPS_ADDPLUGIN_9_H +#define C_MT_HSPS_ADDPLUGIN_9_H + +/* +AddPlugin(9) +---------------- + +Test purpose + +Verify that default locale is used when plugin configuration doesn't have a locale +for the active device language. In this case, device language should be other than +finnish and the test plugin should have only finnish localization. +In addition, make sure that all resources (locale specific and unlocalized) +are copied into the client's private folder when the application configuration is +fetched. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: + +• Input: + AddPlugin(“Typical view”, “FinnishWidget”,”2”) +• Expected output: + Plugin id of successfully added plugin + +Test step 2: + +• Input: + GetPluginConf(“FinnishWidget”) +• Expected output: + Resource list was found + +Test step 3: + +• Input: + RemovePlugin(“FinnishWidget”) +• Expected output: + Typical configuration was succesfully restored + +*/ + +// Test step 1 method: + +const TUint8 addplugin_9_ts_1_method[] = "AddPlugin"; + +// Test step 4 input: + +const TUint8 addplugin_9_ts_1_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','2', +}; + +// Test step 1 output: + +const TUint8 addplugin_9_ts_1_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + + + +// Test step 2 method: + +const TUint8 addplugin_9_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 addplugin_9_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 2 output: + +const TUint8 addplugin_9_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'F','i','n','n','i','s','h',' ','-',' ','W','i','d','g','e','t', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'c','o','m','m','o','n','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'l','o','c','a','l','i','z','e','d','b','g','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','4','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 addplugin_9_ts_3_method[] = "RemovePlugin"; + +// Test step 3 input: + +const TUint8 addplugin_9_ts_3_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +// Test step 3 output: + +const TUint8 addplugin_9_ts_3_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + +#endif // C_MT_HSPS_ADDPLUGIN_9_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1055 @@ +/* +* 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: Test case GetActiveAppConf(1) test data +* +*/ + + +#ifndef C_MT_HSPS_GETACTIVEAPPCONF_1_H +#define C_MT_HSPS_GETACTIVEAPPCONF_1_H + +/* +GetActiveAppConf(1) +------------------- + +Test purpose: + +The purpose of this test case is to verify that Active Idle Minimal +configuration is returned when GetActiveAppConf method is called. + +Pre-conditions: + +• There must be installed test themes for ActiveIdle application and Minimal + configuration must be set as active. + +Test steps: + +Test step 1: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Minimal configuration with configuration state + “NotConfirmed” + +Test step 2: +• Input: + SetConfState(“Confirmed”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Minimal configuration with configuration state “Confirmed” + +Test step 4: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 5: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Minimal configuration with configuration state “Confirmed” + +*/ + +// Test step 1 method: + +const TUint8 getactiveappconf_1_ts_1_method[] = "GetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 getactiveappconf_1_ts_1_input = 0; + + +// Test step 1 expected output: + + +const TUint8 getactiveappconf_1_ts_1_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 getactiveappconf_1_ts_2_method[] = "SetConfState"; + +// Test step 1 input: + +const TUint8 getactiveappconf_1_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'C','o','n','f','i','r','m','e','d' +}; + +// Test step 2 output: + +const TUint8 getactiveappconf_1_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 3 method: + +const TUint8 getactiveappconf_1_ts_3_method[] = "GetActiveAppConf"; + + +// Test step 3 input: + +const TUint8 getactiveappconf_1_ts_3_input = 0; + + +// Test step 3 expected output: + + +const TUint8 getactiveappconf_1_ts_3_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +// Test step 5 method: + +#define getactiveappconf_1_ts_5_method getactiveappconf_1_ts_3_method + + +// Test step 1 input: + +#define getactiveappconf_1_ts_5_input getactiveappconf_1_ts_3_input + + +// Test step 1 expected output: + +#define getactiveappconf_1_ts_5_output getactiveappconf_1_ts_3_output + +#endif // C_MT_HSPS_GETACTIVEAPPCONF_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1035 @@ +/* +* 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: Test case GetActiveAppConf(2) test data +* +*/ + + +#ifndef C_MT_HSPS_GETACTIVEAPPCONF_2_H +#define C_MT_HSPS_GETACTIVEAPPCONF_2_H + +/* +GetActiveAppConf(2) +------------------- + +Test purpose + +The purpose of this test case is to verify that licensee restorable configuration +(Operator configuration) is set as active, if the active licensee default +configuration (Minimal configuration) is not confirmed with SetConfState. + +Pre-conditions +There must be installed test themes for Active Idle application and Minimal +configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Minimal configuration with configuration state + “WaitForConfirmation” + +Test step 2: +• Input: + SetConfState(“WaitForConfirmation”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 4: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Operator configuration with configuration state “NotConfirmed” + +*/ + +// Test step 1 method: + +const TUint8 getactiveappconf_2_ts_1_method[] = "GetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 getactiveappconf_2_ts_1_input = 0; + + +// Test step 1 expected output: + + +const TUint8 getactiveappconf_2_ts_1_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 getactiveappconf_2_ts_2_method[] = "SetConfState"; + +// Test step 1 input: + +const TUint8 getactiveappconf_2_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +19,0,0,0, +78, +'W','a','i','t','F','o','r','C','o','n','f','i','r','m','a','t','i','o','n' +}; + +// Test step 2 output: + +const TUint8 getactiveappconf_2_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 4 method + +const TUint8 getactiveappconf_2_ts_4_method[] = "GetActiveAppConf"; + + +// Test step 4 input: + +const TUint8 getactiveappconf_2_ts_4_input = 0; + + +// Test step 4 expected output: + + +const TUint8 getactiveappconf_2_ts_4_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','r','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETACTIVEAPPCONF_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getactiveappconf_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1257 @@ +/* +* 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: Test case GetActiveAppConf(3) test data +* +*/ + + +#ifndef C_MT_HSPS_GETACTIVEAPPCONF_3_H +#define C_MT_HSPS_GETACTIVEAPPCONF_3_H + +/* +GetActiveAppConf(3) +------------------- + +Test purpose + +The purpose of this test case is to verify that licensee restorable configuration +is activated if Active Idle configuration with default status +(Typical configuration) is not confirmed with SetConfState method + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetActiveAppConf +• Expected output: + Typical configuration with configuration state “NotConfirmed” + +Test step 2: +• Input: + SetConfState(“WaitForConfirmation”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 4: +• Input: + GetActiveAppConf +• Expected output: + Active Idle Operator configuration with configuration state “NotConfirmed” + +*/ + +// Test step 1 method: + +const TUint8 getactiveappconf_3_ts_1_method[] = "GetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 getactiveappconf_3_ts_1_input = 0; + + +// Test step 1 expected output: + + +const TUint8 getactiveappconf_3_ts_1_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 2 method: + +const TUint8 getactiveappconf_3_ts_2_method[] = "SetConfState"; + +// Test step 1 input: + +const TUint8 getactiveappconf_3_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +19,0,0,0, +78, +'W','a','i','t','F','o','r','C','o','n','f','i','r','m','a','t','i','o','n' +}; + +// Test step 2 output: + +const TUint8 getactiveappconf_3_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 getactiveappconf_3_ts_4_method[] = "GetActiveAppConf"; + + +// Test step 3 input: + +const TUint8 getactiveappconf_3_ts_4_input = 0; + + +// Test step 3 expected output: + + +const TUint8 getactiveappconf_3_ts_4_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','r','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + + +#endif // C_MT_HSPS_GETACTIVEAPPCONF_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getappconfs_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getappconfs_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,279 @@ +/* +* 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: Test case GetAppConfs(1) test data +* +*/ + + +#ifndef C_MT_HSPS_GETAPPCONFS_1_H +#define C_MT_HSPS_GETAPPCONFS_1_H + +/* +GetAppConfs(1) +------------------- + +Test purpose + +The purpose of this test case is to verify that the list of application +configurations is successfully returned + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetAppConfs() +• Expected output: + List of application configurations containing Minimal and Typical + configurations. + +*/ + +// Test step 1 method: + +const TUint8 getappconfs_1_ts_1_method[] = "GetAppConfs"; + + +// Test step 1 input: + +const TUint8 getappconfs_1_ts_1_input = 0; + + +// Test step 1 expected output: + + +const TUint8 getappconfs_1_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'a','p','p','C','o','n','f','s', +// GetPlugins(Output)::appConfs +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::appConfs +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// GetPlugins(Output)::appConfs +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConfs[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConfs[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConfs[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConfs[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','0', +// - appConfs[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConfs[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','r','o','o','t', +// GetPlugins(Output)::appConfs +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConfs[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConfs[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConfs[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConfs[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', +// - appConfs[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConfs[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// GetPlugins(Output)::appConfs +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConfs[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConfs[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConfs[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConfs[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','0', +// - appConfs[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConfs[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1' +}; + +#endif // C_MT_HSPS_GETAPPCONFS_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2286 @@ +/* +* 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: Test case GetPluginConf(1) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINCONF_1_H +#define C_MT_HSPS_GETPLUGINCONF_1_H + +/* +GetPluginConf(1) +---------------- + +Test purpose: + +The purpose of this test case is to verify that correct s60_view_plugin_1 +configuration is returned when GetPluginConf method is called. + +Pre-conditions: + +There must be installed test themes for Active Idle application and Minimal +configuration must be set as active. + +Test steps: + +Test step 1: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “NotConfirmed” + +Test step 2: +• Input: + SetConfState(“Confirmed”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “Confirmed” + +Test step 4: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 5: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “Confirmed” + +*/ + +// Test step 1 method: + +const TUint8 getpluginconf_1_ts_1_method[] = "GetPluginConf"; + +// Test step 1 input: + +const TUint8 getpluginconf_1_ts_1_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 getpluginconf_1_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 2 method: + +const TUint8 getpluginconf_1_ts_2_method[] = "SetConfState"; + +// Test step 2 input: + +const TUint8 getpluginconf_1_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'C','o','n','f','i','r','m','e','d' +}; + +// Test step 2 output: + +const TUint8 getpluginconf_1_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 3 method: + +const TUint8 getpluginconf_1_ts_3_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 getpluginconf_1_ts_3_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 3 output: + +const TUint8 getpluginconf_1_ts_3_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 5 method: + +#define getpluginconf_1_ts_5_method getpluginconf_1_ts_3_method + +// Test step 5 input: + +#define getpluginconf_1_ts_5_input getpluginconf_1_ts_3_input + +// Test step 5 output: + +#define getpluginconf_1_ts_5_output getpluginconf_1_ts_3_output + +#endif // C_MT_HSPS_GETPLUGINCONF_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Test case GetPluginConf(2) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINCONF_2_H +#define C_MT_HSPS_GETPLUGINCONF_2_H + +/* +GetPluginConf(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that GetPluginConf method fails when +plugin is not found (invalid plugin id). + +Pre-Conditions +There must be installed test themes for Active Idle application and Minimal +configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetPluginConf(“invalid plugin id”) +• Expected output: + Status not found + +*/ + +// Test step 1 method: + +const TUint8 getpluginconf_2_ts_1_method[] = "GetPluginConf"; + +// Test step 1 input: +const TUint8 getpluginconf_2_ts_1_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'99' +}; + +// Test step 2 output: + +const TUint8 getpluginconf_2_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out KErrNotFound (-1) +}; + +#endif // C_MT_HSPS_GETPLUGINCONF_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Test case GetPluginConf(3) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINCONF_3_H +#define C_MT_HSPS_GETPLUGINCONF_3_H + +/* +GetPluginConf(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that GetPluginConf method fails when +mandatory plugin id field is missing. + +Pre-Conditions +There must be installed test themes for Active Idle application and Minimal +configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetPluginConf(“plugin id is missing”) +• Expected output: + Status err argument + +*/ + +// Test step 1 method: +const TUint8 getpluginconf_3_ts_1_method[] = "GetPluginConf"; + +// Test step 2 input: +const TUint8 getpluginconf_3_ts_1_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34 +}; + +// Test step 2 output: + +const TUint8 getpluginconf_3_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 // expected error +}; + +#endif // C_MT_HSPS_GETPLUGINCONF_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2266 @@ +/* +* 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: Test case GetPluginConf(4) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINCONF_4_H +#define C_MT_HSPS_GETPLUGINCONF_4_H + +/* +GetPluginConf(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that s60_view_plugin_1 configuration state is changed to “Error” if the configuration is not confirmed with SetConfState. + +Pre-Conditions + +There must be installed test themes for Active Idle application and Minimal configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “NotConfirmed” + +Test step 2: +• Input: + SetConfState(“WaitForConfirmation”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 4: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “Error” + +*/ + +// Test step 1 method: + +const TUint8 getpluginconf_4_ts_1_method[] = "GetPluginConf"; + +// Test step 1 input: + +const TUint8 getpluginconf_4_ts_1_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 getpluginconf_4_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 2 method: + +const TUint8 getpluginconf_4_ts_2_method[] = "SetConfState"; + +// Test step 2 input: + +const TUint8 getpluginconf_4_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +19,0,0,0, +78, +'W','a','i','t','F','o','r','C','o','n','f','i','r','m','a','t','i','o','n' +}; + +// Test step 2 output: + +const TUint8 getpluginconf_4_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 getpluginconf_4_ts_4_method[] = "GetPluginConf"; + +// Test step 4 input: + +const TUint8 getpluginconf_4_ts_4_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 4 output: + +const TUint8 getpluginconf_4_ts_4_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'E','r','r','o','r', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_GETPLUGINCONF_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginconf_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2282 @@ +/* +* 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: Test case GetPluginConf(5) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINCONF_5_H +#define C_MT_HSPS_GETPLUGINCONF_5_H + +/* +GetPluginConf(5) +---------------- + +Test purpose +The purpose of this test case is to verify that s60_view_plugin_1 configuration state is changed to “Error” and that configuration state is “Error” after SAPI re-attach. + +Pre-Conditions +There must be installed test themes for Active Idle application and Minimal configuration must be set as active. + +Test steps + +Test step 1: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “NotConfirmed” + +Test step 2: +• Input: + SetConfState(“Error”) +• Expected output: + Configuration state successfully updated + +Test step 3: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “Error” + +Test step 4: +• Input: + Re-attach HSPS service +• Expected output: + HSPS service interface is successfully closed and opened + +Test step 5: +• Input: + GetPluginConf(“s60_view_plugin_1”) +• Expected output: + s60_view_plugin_1 configuration with configuration state “Error” + +*/ + +// Test step 1 method: + +const TUint8 getpluginconf_5_ts_1_method[] = "GetPluginConf"; + +// Test step 1 input: + +const TUint8 getpluginconf_5_ts_1_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 getpluginconf_5_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 2 method: + +const TUint8 getpluginconf_5_ts_2_method[] = "SetConfState"; + +// Test step 2 input: + +const TUint8 getpluginconf_5_ts_2_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetConfState(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - SetConfState(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - SetConfState(Input)::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - SetConfState(Input)::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'E','r','r','o','r' +}; + +// Test step 2 output: + +const TUint8 getpluginconf_5_ts_2_output[] = { +// SetConfState(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetConfState(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetConfState(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 3 method: + +const TUint8 getpluginconf_5_ts_3_method[] = "GetPluginConf"; + +// Test step 3 input: + +const TUint8 getpluginconf_5_ts_3_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 3 output: + +const TUint8 getpluginconf_5_ts_3_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'E','r','r','o','r', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'m','a','i','n','.','x','m','l', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +23,0,0,0, +94, +'v','i','e','w','n','a','v','i','g','a','t','i','o','n','r','u','l','e','s','.','x','m','l', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +20,0,0,0, +82, +'t','e','x','t','/','a','p','p','l','i','c','a','t','i','o','n','+','x','m','l', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'r','e','s','o','u','r','c','e','.','f','i','l','e', +// - object[2]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[2]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[2]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[2]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[2]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[2]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[3] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'p','i','c','t','u','r','e','.','j','p','e','g', +// - object[3]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[3]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','2','5','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[3]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[3]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[3]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[3]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +// Test step 5 method: + +#define getpluginconf_5_ts_5_method getpluginconf_5_ts_3_method + +// Test step 5 input: + +#define getpluginconf_5_ts_5_input getpluginconf_5_ts_3_input + +// Test step 5 output: + +#define getpluginconf_5_ts_5_output getpluginconf_5_ts_3_output + +#endif // C_MT_HSPS_GETPLUGINCONF_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1360 @@ +/* +* 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: Test case GetPluginList(1) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_1_H +#define C_MT_HSPS_GETPLUGINLIST_1_H + +/* +GetPluginList(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that correct list of plugins included +in Typical configuration is returned + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList() +• Expected output + List of all Typical configuration plugins: + o Typical view conf 1 + o Typical view conf 2 + o Typical widget conf (Typical view conf 1 plugin 1) + o Typical widget conf (Typical view conf 1 plugin 2) + o Typical widget conf (Typical view conf 1 plugin 3) + o Typical widget conf (Typical view conf 2 plugin 1) + o Typical widget conf (Typical view conf 2 plugin 2) + o Typical widget conf (Typical view conf 2 plugin 3) +• Execution time measured + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_1_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_1_ts_1_input = 0; + +// Test step 1 output: + +const TUint8 getpluginlist_1_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +8,0,0,0, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[3] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[3]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[3]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[3]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[3]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[3]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[3]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[3]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[3]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[3]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[3]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[4] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[4] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[4]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[4]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[4]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[4]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[4]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[4]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[4]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[4]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[4]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[4]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[4]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[4]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[5] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[5] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[5]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[5]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[5]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[5]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[5]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[5]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[5]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[5]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[5]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[5]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[5]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[5]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[6] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[6] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[6]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[6]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[6]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[6]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[6]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[6]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[6]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[6]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[6]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[6]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[6]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[6]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[7] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[7] map +// - Version 1.0 +// - +10, +6,0,0,0, +// - plugins[7]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[7]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[7]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[7]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[7]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[7]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[7]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[7]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[7]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[7]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[7]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[7]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e' +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,592 @@ +/* +* 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: Test case GetPluginList(2) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_2_H +#define C_MT_HSPS_GETPLUGINLIST_2_H + +/* +GetPluginList(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that plugin list included in Typical view conf 1 is returned when GetPluginList method is called with Typical view conf 1 plugin’s id. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“Typical view conf 1”) +• Expected output + List of Typical aconfiguration plugins: + o Typical widget conf (Typical view conf 1 plugin 1) + o Typical widget conf (Typical view conf 1 plugin 2) + o Typical widget conf (Typical view conf 1 plugin 3) + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_2_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_2_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginList(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_2_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,436 @@ +/* +* 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: Test case GetPluginList(3) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_3_H +#define C_MT_HSPS_GETPLUGINLIST_3_H + +/* +GetPluginList(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that plugin list including Typical +view conf 1 and Typical view conf 2 is returned when GetPluginList is called with +plugin type view. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“view”) +• Expected output + List of Typical aconfiguration plugins: + o Typical view conf 1 + o Typical view conf 2 + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_3_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_3_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPluginList(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_3_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e' +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,619 @@ +/* +* 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: Test case GetPluginList(4) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_4_H +#define C_MT_HSPS_GETPLUGINLIST_4_H + +/* +GetPluginList(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that list of widgets included in +Typical view conf 1 is returned when GetPlugin List is called with Typical view +conf 1 plugin’s id and widget type. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“Typical view conf 1”,“widget”) +• Expected output + List of Typical aconfiguration plugins: + o Typical widget conf (Typical view conf 1 plugin 1) + o Typical widget conf (Typical view conf 1 plugin 2) + o Typical widget conf (Typical view conf 1 plugin 3) + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_4_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_4_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPluginList(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginList(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - GetPluginList(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPluginList(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_4_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// GetPluginList(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,118 @@ +/* +* 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: Test case GetPluginList(5) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_5_H +#define C_MT_HSPS_GETPLUGINLIST_5_H + +/* +GetPluginList(5) +---------------- + +Test purpose + +The purpose of this test case is to verify that empty plugin list is returned +when GetPluginList is called with plugin’s id which does not contain any +plugins + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“Typical widget conf”) +• Expected output + Empty plugin list + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_5_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_5_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginList(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_5_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Test case GetPluginList(6) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_6_H +#define C_MT_HSPS_GETPLUGINLIST_6_H + +/* +GetPluginList(6) +---------------- + +Test purpose + +The purpose of this test case is to verify that error is returned when +GetPluginList is called with plugin id which is not found from configuration + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“99”) +• Expected output + Status element with error code KErrNotFound + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_6_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_6_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginList(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'9','9' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_6_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - GetPluginList(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_6_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_7.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_7.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* 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: Test case GetPluginList(7) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_7_H +#define C_MT_HSPS_GETPLUGINLIST_7_H + +/* +GetPluginList(7) +---------------- + +Test purpose + +The purpose of this test case is to verify that empty plugin list is returned +when GetPluginList is called with plugin type not found from configuration + +Pre-conditions + +There must be installed test themes for Active Idle application and Operator +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“widget”) +• Expected output + Empty plugin list + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_7_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_7_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPluginList(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_7_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPluginList(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPluginList(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_7_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_8.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginlist_8.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Test case GetPluginList(8) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINLIST_8_H +#define C_MT_HSPS_GETPLUGINLIST_8_H + +/* +GetPluginList(8) +---------------- + +Test purpose + +The purpose of this test case is to verify that error is returned when +GetPluginList is called with invalid plugin type + +Pre-conditions + +There must be installed test themes for Active Idle application and Operator +configuration must be set as active + +Test steps + +Test step 1: +• Input: + GetPluginList(“invalid type”) +• Expected output + Status element with error code KErrArgument + +*/ + +// Test step 1 method: + +const TUint8 getpluginlist_8_ts_1_method[] = "GetPluginList"; + +// Test step 1 input: + +const TUint8 getpluginlist_8_ts_1_input[] = { +// GetPluginList(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginList(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPluginList(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'i','n','v','a','l','i','d',' ','t','y','p','e' +}; + +// Test step 1 output: + +const TUint8 getpluginlist_8_ts_1_output[] = { +// GetPluginList(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginList(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - GetPluginList(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + +#endif // C_MT_HSPS_GETPLUGINLIST_6_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1251 @@ +/* +* 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: Test case GetPlugins(1) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_1_H +#define C_MT_HSPS_GETPLUGINS_1_H + +/* +GetPlugins(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that correct list of plugins installed for interface 2456 is returned when GetPlugins method is called. +Pre-conditions +• There must be installed test themes for Active Idle application + +Test steps + +Test step 1: +• Input: + GetPlugins(“0x998”) +• Expected output + List of installed plugins: + o Widget Conf #1 + o View Conf #1 + o Typical widget conf + o Typical view conf 1 + o Typical view conf 2 + o Operator - view + +*/ + +// Test step 1 method: + +const TUint8 getplugins_1_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_1_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8' +}; + +// Test step 1 output: + +const TUint8 getplugins_1_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +7,0,0,0, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','2', +// - plugins[0]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[0]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'F','i','n','n','i','s','h',' ','-',' ','W','i','d','g','e','t', +// - plugins[0]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[0]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +7,0,0,0, +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','1', +// - plugins[1]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[1]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','V','i','e','w', +// - plugins[1]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[1]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'S','t','r','i','n','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'l','o','g','o', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +75,0,0,0, +93, +2, +'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - plugins[2]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[2]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[2]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[2]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[3] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[3]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[3]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','2', +// - plugins[3]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[3]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[3]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[3]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - plugins[3]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[3]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[3]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[3]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[4] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[4] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[4]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[4]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','1', +// - plugins[4]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[4]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[4]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[4]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[4]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[4]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - plugins[4]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[4]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[4]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[4]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[5] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[5] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[5]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[5]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','2', +// - plugins[5]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[5]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[5]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[5]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[5]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[5]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - plugins[5]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[5]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[5]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[5]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[6] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[6] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[6]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[6]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','1', +// - plugins[6]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[6]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[6]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[6]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[6]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[6]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - plugins[6]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[6]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[6]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[6]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_GETPLUGINS_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Test case GetPlugins(2) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_2_H +#define C_MT_HSPS_GETPLUGINS_2_H + +/* +GetPlugins(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that an empty plugin list is returned. + +Pre-conditions + +- There must be installed test themes for Active Idle application + +Test steps + +Test step 1: +- Input: + GetPlugins(“0xFFFF”) +- Expected output + Empty plugin list +*/ + +// Test step 1 method: + +const TUint8 getplugins_2_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_2_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'0','x','f','f','f','f' +}; + +// Test step 1 output: + +const TUint8 getplugins_2_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETPLUGINS_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,804 @@ +/* +* 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: Test case GetPlugins(3) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_3_H +#define C_MT_HSPS_GETPLUGINS_3_H + +/* +GetPlugins(3) +---------------- + +Test purpose +The purpose of this test case is to verify that correct list of view plugins +installed for interface 0x998 is returned when GetPlugins method is called. + +Pre-conditions +• There must be installed test themes for Active Idle application + +Test steps + +Test step 1: +• Input: + GetPlugins(“0x998”, “viewplugin”) +• Expected output + List of installed plugins: + o View Conf #1 + o Typical view conf 1 + o Typical view conf 2 + o Operator - view + +Post-condition +In typical configuration check manually that all defined +resource files can be found under +\epoc32\winscw\c\private\102750f0\2456\270513751\536916241\1.0\sources +*/ + +// Test step 1 method: + +const TUint8 getplugins_3_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_3_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w' +}; + +// Test step 1 output: + +const TUint8 getplugins_3_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +7,0,0,0, +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','1', +// - plugins[0]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[0]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'O','p','e','r','a','t','o','r',' ','-',' ','V','i','e','w', +// - plugins[0]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[0]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'S','t','r','i','n','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'l','o','g','o', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +75,0,0,0, +93, +2, +'m','i','f','(','c',':','\\','p','r','i','v','a','t','e','\\','2','0','0','0','0','F','B','1','\\','2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','3','\\','1','.','0','\\','s','o','u','r','c','e','s','\\','d','u','m','m','y','.','m','i','f',' ','1',' ','2',')', +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','2', +// - plugins[1]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[1]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - plugins[1]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[1]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','1', +// - plugins[2]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[2]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - plugins[2]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[2]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[3] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[3] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[3]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[3]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','1', +// - plugins[3]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[3]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[3]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[3]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - plugins[3]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[3]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'V','i','e','w',' ','C','o','n','f',' ','#','1', +// - plugins[3]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[3]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[3]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[3]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_GETPLUGINS_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,615 @@ +/* +* 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: Test case GetPlugins(4) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_4_H +#define C_MT_HSPS_GETPLUGINS_4_H + +/* +GetPlugins(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that correct list of widget plugins +installed for interface 0x998 is returned when GetPlugins method is called. + +Pre-conditions +• There must be installed test themes for Active Idle application + +Test steps +Test step 1: +• Input: + GetPlugins(“0x998”, “widgetplugin”) +• Expected output + List of installed plugins: + o Finnish widget + o Typical widget conf + o Widget Conf #1 + +*/ + +// Test step 1 method: + +const TUint8 getplugins_4_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_4_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t' +}; + +// Test step 1 output: + +const TUint8 getplugins_4_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','2', +// - plugins[0]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[0]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[0]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[0]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'F','i','n','n','i','s','h',' ','-',' ','W','i','d','g','e','t', +// - plugins[0]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[0]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[0]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - plugins[1]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[1]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[1]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[1]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - plugins[1]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[1]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[1]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','2', +// - plugins[2]::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - plugins[2]::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - plugins[2]::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - plugins[2]::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - plugins[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - plugins[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - plugins[2]::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - plugins[2]::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - plugins[2]::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_GETPLUGINS_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Test case GetPlugins(5) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_5_H +#define C_MT_HSPS_GETPLUGINS_5_H + +/* +GetPlugins(5) +---------------- + +Test purpose +The purpose of this test case is to verify that GetPlugins works properly if +widget type is invalid. + +Pre-conditions +• There must be installed test themes for Active Idle application + +Test steps +Test step 1: +• Input: + GetPlugins(“0x998”, “clock”) +• Expected output + Error err argument +*/ + +// Test step 1 method: + +const TUint8 getplugins_5_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_5_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'c','l','o','c','k' +}; + +// Test step 1 output: + +const TUint8 getplugins_5_ts_1_output[] = { +// GetPlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 // expected error +}; + +#endif // C_MT_HSPS_GETPLUGINS_5_H + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Test case GetPlugins(6) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_6_H +#define C_MT_HSPS_GETPLUGINS_6_H + +/* +GetPlugins(6) +---------------- + +Test purpose + +The purpose of this test case is to verify that an empty +template plugin list is returned + +Pre-conditions +There must be installed test themes for Active Idle application. +There are no template plugins installed. + +Test steps +Test step 1: +• Input: + GetPlugins(“0x998”, “template”) +• Expected output + Error + +*/ + +// Test step 1 method: + +const TUint8 getplugins_6_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_6_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'t','e','m','p','l','a','t','e' +}; + +// Test step 1 output: + +const TUint8 getplugins_6_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETPLUGINS_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_7.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getplugins_7.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Test case GetPlugins(7) test data +* +*/ + + +#ifndef C_MT_HSPS_GETPLUGINS_7_H +#define C_MT_HSPS_GETPLUGINS_7_H + +/* +GetPlugins(7) +---------------- + +Test purpose +The purpose of this test case is to verify that GetPlugins fails +correctly if interface is wrongly defined as a string. + +Pre-conditions +There must be installed test themes for Active Idle application + +Test steps +Test step 1: +• Input: + GetPlugins(“flash”, “widget”) +• Expected output + Error not found +*/ + +// Test step 1 method: + +const TUint8 getplugins_7_ts_1_method[] = "GetPlugins"; + +// Test step 1 input: + +const TUint8 getplugins_7_ts_1_input[] = { +// GetPlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPlugins(Input)::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - GetPlugins(Input)::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'f','l','a','s','h', +// - GetPlugins(Input)::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - GetPlugins(Input)::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t' +}; + +// Test step 1 output: + +const TUint8 getplugins_7_ts_1_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPlugins(Output)::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// GetPlugins(Output)::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// GetPlugins(Output)::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_GETPLUGINS_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,269 @@ +/* +* 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: Test case GetPluginSettings(1) test data +* +*/ + + +#ifndef MT_HSPS_GETPLUGINSETTINGS_1_H_ +#define MT_HSPS_GETPLUGINSETTINGS_1_H_ + +/* +GetPluginSettings(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that get plugin setting +works properly when settings for plugin uid can be found. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active. View with 0x2000B111 must be + available. + +Test steps + +Test step 1: +• Input: + GetPluginSettings(“plugin uid”) +• Expected output: + Get Settings succeed + +*/ + +// Test step 1 method: + +const TUint8 getpluginsettings_1_ts_1_method[] = "GetPluginSettings"; + +// Test step 1 input: + +const TUint8 getpluginsettings_1_ts_1_input[] = { +// GetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - GetPluginSettings(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1' +}; + +// Test step 1 output: + +const TUint8 getpluginsettings_1_ts_1_output[] = { +// GetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - GetPluginSettings::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - GetPluginSettings::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0' +}; + + + +#endif /*MT_HSPS_GETPLUGINSETTINGS_1_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,118 @@ +/* +* 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: Test case GetPluginSettings(2) test data +* +*/ + + +#ifndef MT_HSPS_GETPLUGINSETTINGS_2_H_ +#define MT_HSPS_GETPLUGINSETTINGS_2_H_ + +/* +GetPluginSettings(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that get plugin setting +works properly when no plugin found (invalid pluginuid). + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active. Plugin with 0x00001111 + should not be available. + +Test steps + +Test step 1: +• Input: + GetPluginSettings(“plugin uid”) +• Expected output: + Status: not found + +*/ + +// Test step 1 method: + +const TUint8 getpluginsettings_2_ts_1_method[] = "GetPluginSettings"; + +// Test step 1 input: + +const TUint8 getpluginsettings_2_ts_1_input[] = { +// GetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - GetPluginSettings(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','0','0','0','0','1','1','1','1' +}; + +// Test step 1 output: + +const TUint8 getpluginsettings_2_ts_1_output[] = { +// GetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - GetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out KErrNotFound (-1) +}; + + + +#endif /*MT_HSPS_GETPLUGINSETTINGS_2_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_getpluginsettings_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,416 @@ +/* +* 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: Test case GetPluginSettings(3) test data +* +*/ + + +#ifndef MT_HSPS_GETPLUGINSETTINGS_3_H_ +#define MT_HSPS_GETPLUGINSETTINGS_3_H_ + +/* +GetPluginSettings(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that get plugin setting +works properly when two settings for plugin uid can be found. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active. View with 0x2000B112 must be + available. + +Test steps + +Test step 1: +• Input: + GetPluginSettings(“plugin uid”) +• Expected output: + Get Settings succeed + +*/ + +// Test step 1 method: + +const TUint8 getpluginsettings_3_ts_1_method[] = "GetPluginSettings"; + +// Test step 1 input: + +const TUint8 getpluginsettings_3_ts_1_input[] = { +// GetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - GetPluginSettings(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2' +}; + +// Test step 1 output: + +const TUint8 getpluginsettings_3_ts_1_output[] = { +// GetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginSettings::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - GetPluginSettings::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - GetPluginSettings::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - GetPluginSettings::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g' +}; + +#endif /*MT_HSPS_GETPLUGINSETTINGS_1_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2458 @@ +/* +* 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: Test case MovePlugins(1) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_1_H_ +#define MT_HSPS_MOVEPLUGINS_1_H_ + +/* +MovePlugins(1) +---------------- + +Test purpose +The purpose of this test case is to verify that the plugins order in a +configuration can be successfully changed. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + MovePlugins(“Typical view conf 1”,”3,2,1”) +• Expected output: + Plugins order is successfully changed + +Test step 2: +• Input: + GetPluginConf(“Typical view conf 1”) +• Expected output: + Configuration of Typical view conf1 plugin with changed plugins order + +Test step 3: +• Input: + MovePlugins(“Typical view conf 1”,”1,2,3”) +• Expected output: + Plugins order is successfully changed + +Test step 4: +• Input: + GetPluginConf(“Typical view conf 1”) +• Expected output: + Original Typical view conf1 plugin configuration + +*/ + +// Test step 1 method: + +const TUint8 moveplugins_1_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_1_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: +const TUint8 moveplugins_1_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNone +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 moveplugins_1_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 moveplugins_1_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 2 output: + +const TUint8 moveplugins_1_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','1','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'h','s','_','l','o','g','o','z','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +// Test step 3 method: + +const TUint8 moveplugins_1_ts_3_method[] = "MovePlugins"; + +// Test step 3 input: + +const TUint8 moveplugins_1_ts_3_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4' +}; + +// Test step 3 output: +const TUint8 moveplugins_1_ts_3_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNone +10, +1, +0,0,0,0 +}; + +// Test step 4 method: + +const TUint8 moveplugins_1_ts_4_method[] = "GetPluginConf"; + +// Test step 4 input: + +const TUint8 moveplugins_1_ts_4_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 4 output: + +const TUint8 moveplugins_1_ts_4_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','1','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'h','s','_','l','o','g','o','z','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','1','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif /*MT_HSPS_MOVEPLUGINS_1_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,187 @@ +/* +* 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: Test case MovePlugins(2) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_2_H_ +#define MT_HSPS_MOVEPLUGINS_2_H_ + +/* +MovePlugins(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that the plugins order change fails +if the configuration id is invalid + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + MovePlugins(“Invalid configuration”,”4,3,2”) +• Expected output: + Plugins order change fails + +*/ + +// Test step 1 method: + +const TUint8 moveplugins_2_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_2_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'9','9', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: +const TUint8 moveplugins_2_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + +#endif /*MT_HSPS_MOVEPLUGINS_2_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,187 @@ +/* +* 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: Test case MovePlugins(3) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_3_H_ +#define MT_HSPS_MOVEPLUGINS_3_H_ + +/* +MovePlugins(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that the plugins order change fails +if the plugin id list contains an id which cannot be found + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + MovePlugins(“Typical view conf 1”,”99,3,2”) +• Expected output: + Plugins order change fails + +*/ + +// Test step 1 method: + +const TUint8 moveplugins_3_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_3_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'9','9', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: +const TUint8 moveplugins_3_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + +#endif /*MT_HSPS_MOVEPLUGINS_3_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -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: Test case MovePlugins(4) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_4_H_ +#define MT_HSPS_MOVEPLUGINS_4_H_ + +/* +MovePlugins(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that the plugins order change fails +if the plugin id list contains an id which cannot be found (plugin count mismatch) + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + MovePlugins(“Typical view conf 1”,”4,3,2,1”) +• Expected output: + Plugins order change fails + +*/ + +// Test step 1 method: + +const TUint8 moveplugins_4_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_4_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[3] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: +const TUint8 moveplugins_4_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + +#endif /*MT_HSPS_MOVEPLUGINS_4_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,187 @@ +/* +* 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: Test case MovePlugins(5) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_5_H_ +#define MT_HSPS_MOVEPLUGINS_5_H_ + +/* +MovePlugins(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that the plugins order change fails +if the plugin id list is invalid (not unique plugin ids) + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: +• Input: + MovePlugins(“Typical view conf 1”,”4,4,2”) +• Expected output: + Plugins order change fails + +*/ + +// Test step 1 method: + +const TUint8 moveplugins_5_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_5_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 1 output: +const TUint8 moveplugins_5_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + +#endif /*MT_HSPS_MOVEPLUGINS_5_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_moveplugins_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,584 @@ +/* +* 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: Test case MovePlugins(6) test data +* +*/ + + +#ifndef MT_HSPS_MOVEPLUGINS_6_H_ +#define MT_HSPS_MOVEPLUGINS_6_H_ + +/* +MovePlugins(6) +---------------- + +Test purpose +Verify that the service fails when invalid inputs are provided. +Service inputs: configuration id(int), comma seperated plug-in ids(int). + +Pre-conditions +• N/A + +Test steps + +Test step 1: +• Input: + MovePlugins(“NULL”) +• Expected output: + Failure due to the missing/mandatory arguments + +Test step 2: +• Input: + MovePlugins( "0xFF" ) +• Expected output: + Failure due to the missing/mandatory arguments + +Test step 3: +• Input: + MovePlugins( "0", "0" ) +• Expected output: + Failure due to the invalid arguments + +Test step 4: +• Input: + MovePlugins( "1", "0,1,2" ) +• Expected output: + Failure due to the invalid arguments + +Test step 5: +• Input: + MovePlugins( "1", "abc,0xff,2" ) +• Expected output: + Failure due to the invalid arguments + + +*/ + + + +// Test step 1 method: + +const TUint8 moveplugins_6_ts_1_method[] = "MovePlugins"; + +// Test step 1 input: + +const TUint8 moveplugins_6_ts_1_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +// Test step 1 output: +const TUint8 moveplugins_6_ts_1_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 2 method: + +const TUint8 moveplugins_6_ts_2_method[] = "MovePlugins"; + +// Test step 2 input: + +const TUint8 moveplugins_6_ts_2_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0xFF' +}; + +// Test step 2 output: +const TUint8 moveplugins_6_ts_2_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 3 method: + +const TUint8 moveplugins_6_ts_3_method[] = "MovePlugins"; + +// Test step 3 input: + +const TUint8 moveplugins_6_ts_3_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0 +}; + +// Test step 3 output: +const TUint8 moveplugins_6_ts_3_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 4 method: + +const TUint8 moveplugins_6_ts_4_method[] = "MovePlugins"; + +// Test step 4 input: + +const TUint8 moveplugins_6_ts_4_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 4 output: +const TUint8 moveplugins_6_ts_4_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 5 method: + +const TUint8 moveplugins_6_ts_5_method[] = "MovePlugins"; + +// Test step 5 input: + +const TUint8 moveplugins_6_ts_5_input[] = { +// MovePlugins(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - MovePlugins::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - MovePlugins::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - MovePlugins::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - MovePlugins::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - MovePlugins(Input)::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'a','b','c', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[1] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'0','x','F','F', +// - MovePlugins::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - plugins[2] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 5 output: +const TUint8 moveplugins_6_ts_5_output[] = { +// MovePlugins(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - MovePlugins(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - MovePlugins(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +254,255,255,255 +}; + + + +#endif /*MT_HSPS_MOVEPLUGINS_6_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,777 @@ +/* +* 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: Test case RemovePlugin(1) test data +* +*/ + + +#ifndef C_MT_HSPS_REMOVEPLUGIN_1_H +#define C_MT_HSPS_REMOVEPLUGIN_1_H + +/* +RemovePlugin(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that removing of a plugin fails, +when a plugin request to be removed cannot be found. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + RemovePlugin(“Non existing plugin id”) +• Expected output: + Removing fails + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 removeplugin_1_ts_1_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 removeplugin_1_ts_1_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'9','9' +}; + +// Test step 1 output: + +const TUint8 removeplugin_1_ts_1_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 +}; + +// Test step 2 method: + +const TUint8 removeplugin_1_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 removeplugin_1_ts_2_input = 0; + +// Test step 2 output: + +const TUint8 removeplugin_1_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_REMOVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,405 @@ +/* +* 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: Test case RemovePlugin(2) test data +* +*/ + + +#ifndef C_MT_HSPS_REMOVEPLUGIN_2_H +#define C_MT_HSPS_REMOVEPLUGIN_2_H + +/* +RemovePlugin(2) +---------------- + +Test purpose + +Verify that the service fails when invalid inputs are provided. +Service inputs: plug-in id(int). + +Pre-conditions +• N/A + +Test steps + +Test step 1: +• Input: + RemovePlugin( “NULL”) +• Expected output: + Failure due to the missing mandatory argument + +Test step 2: +• Input: + RemovePlugin( 0 ) +• Expected output: + Failure due to the missing mandatory argument + +Test step 3: +• Input: + RemovePlugin( 0xFF ) +• Expected output: + Failure due to the invalid input + +Test step 4: +• Input: + RemovePlugin( -1 ) +• Expected output: + Failure due to plugin not found error + +Test step 5: +• Input: + RemovePlugin( "ÖP8" ) +• Expected output: + Failure due to plugin not found error + +*/ + + + +// Test step 1 method: + +const TUint8 removeplugin_2_ts_1_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 removeplugin_2_ts_1_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +// Test step 1 output: + +const TUint8 removeplugin_2_ts_1_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 2 method: + +const TUint8 removeplugin_2_ts_2_method[] = "RemovePlugin"; + +// Test step 2 input: + +const TUint8 removeplugin_2_ts_2_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 2 output: + +const TUint8 removeplugin_2_ts_2_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 3 method: + +const TUint8 removeplugin_2_ts_3_method[] = "RemovePlugin"; + +// Test step 3 input: + +const TUint8 removeplugin_2_ts_3_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'0','x','F','F' +}; + +// Test step 3 output: + +const TUint8 removeplugin_2_ts_3_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + +// Test step 4 method: + +const TUint8 removeplugin_2_ts_4_method[] = "RemovePlugin"; + +// Test step 4 input: + +const TUint8 removeplugin_2_ts_4_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'-','1' +}; + +// Test step 4 output: + +const TUint8 removeplugin_2_ts_4_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + + + + +// Test step 5 method: + +const TUint8 removeplugin_2_ts_5_method[] = "RemovePlugin"; + +// Test step 5 input: + +const TUint8 removeplugin_2_ts_5_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'Ö','P','8' +}; + +// Test step 5 output: + +const TUint8 removeplugin_2_ts_5_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + +#endif // C_MT_HSPS_REMOVEPLUGIN_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,668 @@ +/* +* 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: Test case RemovePlugin(3) test data +* +*/ + + +#ifndef C_MT_HSPS_REMOVEPLUGIN_3_H +#define C_MT_HSPS_REMOVEPLUGIN_3_H + +/* +RemovePlugin(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that plugin list’s active state is +correctly updated when currently active view is removed from plugin list. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + RemovePlugin(“Typical view 1”) +• Expected output: + Removing succeeded + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration with Typical view 2 as active view in + plugin list + +*/ + +// Test step 1 method: + +const TUint8 removeplugin_3_ts_1_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 removeplugin_3_ts_1_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 removeplugin_3_ts_1_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 removeplugin_3_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 removeplugin_3_ts_2_input = 0; + +// Test step 2 output: + +const TUint8 removeplugin_3_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_REMOVEPLUGIN_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_removeplugin_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1108 @@ +/* +* 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: Test case RemovePlugin(4) test data +* +*/ + + +#ifndef C_MT_HSPS_REMOVEPLUGIN_4_H +#define C_MT_HSPS_REMOVEPLUGIN_4_H + +/* +RemovePlugin(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that plugin list’s active state is +correctly updated when currently active widget is removed from plugin list. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + RemovePlugin(“1. Typical widget”) +• Expected output: + Removing succeeded + +Test step 2: +• Input: + GetPluginConf() +• Expected output: + Typical view conf 2 configuration, with 2. Typical widget set as active + widget in plugin list + +*/ + +// Test step 1 method: + +const TUint8 removeplugin_4_ts_1_method[] = "RemovePlugin"; + +// Test step 1 input: + +const TUint8 removeplugin_4_ts_1_input[] = { +// RemovePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - RemovePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6' +}; + +// Test step 1 output: + +const TUint8 removeplugin_4_ts_1_output[] = { +// RemovePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RemovePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 removeplugin_4_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 removeplugin_4_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 2 output: + +const TUint8 removeplugin_4_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_REMOVEPLUGIN_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_replaceplugin_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_replaceplugin_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2374 @@ +/* +* 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: Test case ReplacePlugin(1) test data +* +*/ + + +#ifndef MT_HSPS_REPLACEPLUGIN_1_H_ +#define MT_HSPS_REPLACEPLUGIN_1_H_ + +/* +ReplacePlugin(1) +---------------- + +Test purpose +Verify that the plugins can be replaced successfully in an application configuration. + +Pre-conditions +• There must be installed test themes for Active Idle application and Typical + configuration must be set as active + +Test steps + +Test step 1: replace plugin 2 with Widget Conf#1 +• Input: + ReplacePlugin(2,0x2000B102) +• Expected output: + KErrNone + +Test step 2: Get replaced plugin conf +• Input: + GetPluginConf(“2”) +• Expected output: + Correct widget configuration was returned + +Test step 3: ConfUi argument was not provided +• Input: + ReplacePlugin(1,null) +• Expected output: + Argument error + +Test step 4: Plugin id argument was not provided +• Input: + ReplacePlugin(null,0x2000B102) +• Expected output: + Argument error + +Test step 5: Test invalid plugin id +• Input: + ReplacePlugin(testid,0x2000B102) +• Expected output: + Argument error + +Test step 6: Test missing plugin id +• Input: + ReplacePlugin(100,0x2000B102) +• Expected output: + Not found error + +Test step 7: Test invalid configuration uid +• Input: + ReplacePlugin(2,testuid) +• Expected output: + Argument error + +Test step 8: Test missing configuration uid +• Input: + ReplacePlugin(2,0x00000001) +• Expected output: + Not found error + +Test step 9: Test replacing with an application configuration +• Input: + ReplacePlugin(2,2000B110) +• Expected output: + Not found error + +Test step 10: replace plugin 2 with Typical-Widget +• Input: + ReplacePlugin(2,0x2000B120) +• Expected output: + KErrNone + +Test step 11: Get replaced plugin conf +• Input: + GetPluginConf(“2”) +• Expected output: + Correct widget configuration was returned + +*/ + +// Test step 1 method: + +const TUint8 replaceplugin_1_ts_1_method[] = "ReplacePlugin"; + +// Test step 1 input: + +const TUint8 replaceplugin_1_ts_1_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +}; + +// Test step 1 output: +const TUint8 replaceplugin_1_ts_1_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNone +10, +1, +0,0,0,0 +}; + + + +// Test step 2 method: + +const TUint8 replaceplugin_1_ts_2_method[] = "GetPluginConf"; + + +// Test step 2 input: + +const TUint8 replaceplugin_1_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 2 output: + +const TUint8 replaceplugin_1_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'W','i','d','g','e','t',' ','C','o','n','f',' ','#','1', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'S','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','h','t', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + + + +// Test step 3 method: + +const TUint8 replaceplugin_1_ts_3_method[] = "ReplacePlugin"; + +// Test step 3 input: + +const TUint8 replaceplugin_1_ts_3_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 3 output: +const TUint8 replaceplugin_1_ts_3_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 4 method: + +const TUint8 replaceplugin_1_ts_4_method[] = "ReplacePlugin"; + +// Test step 4 input: + +const TUint8 replaceplugin_1_ts_4_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2' +}; + +// Test step 4 output: +const TUint8 replaceplugin_1_ts_4_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + + +// Test step 5 method: + +const TUint8 replaceplugin_1_ts_5_method[] = "ReplacePlugin"; + +// Test step 5 input: + +const TUint8 replaceplugin_1_ts_5_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'t','e','s','t','i','d', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +}; + +// Test step 5 output: +const TUint8 replaceplugin_1_ts_5_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +250,255,255,255 +}; + + +// Test step 6 method: + +const TUint8 replaceplugin_1_ts_6_method[] = "ReplacePlugin"; + +// Test step 6 input: + +const TUint8 replaceplugin_1_ts_6_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'1','0','0', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','2', +}; + +// Test step 6 output: +const TUint8 replaceplugin_1_ts_6_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNotFound +10, +1, +255,255,255,255 +}; + + + +// Test step 7 method: + +const TUint8 replaceplugin_1_ts_7_method[] = "ReplacePlugin"; + +// Test step 7 input: + +const TUint8 replaceplugin_1_ts_7_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'t','e','s','t','u','i','d' +}; + +// Test step 7 output: +const TUint8 replaceplugin_1_ts_7_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +254,255,255,255 +}; + + + +// Test step 8 method: + +const TUint8 replaceplugin_1_ts_8_method[] = "ReplacePlugin"; + +// Test step 8 input: + +const TUint8 replaceplugin_1_ts_8_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','0','0','0','0','0','0','0','1', +}; + +// Test step 8 output: +const TUint8 replaceplugin_1_ts_8_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNotFound +10, +1, +255,255,255,255 +}; + + + +// Test step 9 method: + +const TUint8 replaceplugin_1_ts_9_method[] = "ReplacePlugin"; + +// Test step 9 input: + +const TUint8 replaceplugin_1_ts_9_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +}; + +// Test step 9 output: +const TUint8 replaceplugin_1_ts_9_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrArgument +10, +1, +255,255,255,255 +}; + + +// Test step 10 method: + +const TUint8 replaceplugin_1_ts_10_method[] = "ReplacePlugin"; + +// Test step 10 input: + +const TUint8 replaceplugin_1_ts_10_input[] = { +// ReplacePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - ReplacePlugin::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - ReplacePlugin::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - ReplacePlugin::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +}; + +// Test step 10 output: +const TUint8 replaceplugin_1_ts_10_output[] = { +// ReplacePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - ReplacePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - ReplacePlugin(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value, KErrNone +10, +1, +0,0,0,0 +}; + + + +// Test step 11 method: + +const TUint8 replaceplugin_1_ts_11_method[] = "GetPluginConf"; + + +// Test step 11 input: + +const TUint8 replaceplugin_1_ts_11_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2' +}; + +// Test step 11 output: + +const TUint8 replaceplugin_1_ts_11_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'S','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'h','s','_','l','o','g','o','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','5','6','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'w','i','d','g','e','t','.','b','m','p', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','5','6','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + + +#endif /* MT_HSPS_REPLACEPLUGIN_1_H_ */ + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,251 @@ +/* +* 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: Test case RequestNotify(1) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_1_H +#define C_MT_HSPS_REQUESTNOTIFY_1_H + +/* +RequestNotify(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that change notify request works + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotify(“”) +• Expected output: + Notified added plugin + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 requestnotify_1_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: + +const TUint8 requestnotify_1_ts_1_input = 0; +// Test step 1 output: + +const TUint8 requestnotify_1_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0, +50, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - RequestNotification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'P','l','u','g','i','n','R','e','m','o','v','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - RequestNotification(Output)::AppConfUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','f','b','1', +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::pluginName +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - RequestNotification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - RequestNotification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8' +}; + +const TInt requestnotify_1_ts_1_trigger = 1; + +#endif // C_MT_HSPS_REMOVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,251 @@ +/* +* 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: Test case RequestNotify(1) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_2_H +#define C_MT_HSPS_REQUESTNOTIFY_2_H + +/* +RequestNotify(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that change notify request works + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotify(“”) +• Expected output: + Notified added plugin + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 requestnotify_2_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: + +const TUint8 requestnotify_2_ts_1_input = 0; +// Test step 1 output: + +const TUint8 requestnotify_2_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0, +50, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - RequestNotification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'P','l','u','g','i','n','A','d','d','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - RequestNotification(Output)::AppConfUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','f','b','1', +// - RequestNotification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - RequestNotification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +16,0,0,0, +66, +'T','y','p','i','c','a','l',' ','-',' ','W','i','d','g','e','t', +// - RequestNotification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - RequestNotification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','2','0', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + +const TInt requestnotify_2_ts_1_trigger = 2; + +#endif // C_MT_HSPS_REMOVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,249 @@ +/* +* 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: Test case RequestNotify(1) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_3_H +#define C_MT_HSPS_REQUESTNOTIFY_3_H + +/* +RequestNotify(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that change notify request works + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotify(“”) +• Expected output: + Notified added plugin + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 requestnotify_3_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: + +const TUint8 requestnotify_3_ts_1_input = 0; +// Test step 1 output: + +const TUint8 requestnotify_3_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0,//6,0,0,0, +50,//26, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'P','l','u','g','i','n','I','n','s','t','a','l','l','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +18,0,0,0, +74, +'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t', +// - Notification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +const TInt requestnotify_3_ts_1_trigger = 3; + +#endif // C_MT_HSPS_REMOVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,283 @@ +/* +* 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: Test case RequestNotify(4) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_4_H +#define C_MT_HSPS_REQUESTNOTIFY_4_H + +/* +RequestNotify(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that asynchronous client notification +is sent after the plugin is activated and reactivated + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotification() +• Trigger: + Existing plugin is activated +• Expected output: + Notification including: + o Event “PluginActivated” + o Active application configuration UID + o Activated plugin UID + o Activated plugin id + +Test step 2: +• Input: + RequestNotification() +• Trigger: + Existing plugin is activated +• Expected output: + Notification including: + o Event “PluginActivated” + o Active application configuration UID + o Activated plugin UID + o Activated plugin id + +*/ + +// Test step 1 method: + +const TUint8 requestnotify_4_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: + +const TUint8 requestnotify_4_ts_1_input = 0; + +// Test step 1 output: + +const TUint8 requestnotify_4_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0, +50, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'P','l','u','g','i','n','A','c','t','i','v','a','t','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','2', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 1 trigger: + +const TInt requestnotify_4_ts_1_trigger = 4; + +// Test step 1 method: + +#define requestnotify_4_ts_2_method requestnotify_4_ts_1_method + +// Test step 1 input: + +#define requestnotify_4_ts_2_input requestnotify_4_ts_1_input + +// Test step 1 output: + +#define requestnotify_4_ts_2_output requestnotify_4_ts_1_output + +// Test step 2 trigger: + +#define requestnotify_4_ts_2_trigger requestnotify_4_ts_1_trigger + + +#endif // C_MT_HSPS_REMOVEPLUGIN_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: Test case RequestNotify(5) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_5_H +#define C_MT_HSPS_REQUESTNOTIFY_5_H + +/* +RequestNotify(5) +---------------- + +Test purpose + +The purpose of this test case is to verify that change notify request works +when a plugin is replaced in active configuration + +Pre-conditions +• There must be installed test themes for Active Idle application and + Typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotify(“”) +• Trigger: + Replace plugin +• Expected output: + Notified replaced plugin + +*/ + +// Test step 1 method: + +const TUint8 requestnotify_5_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: + +const TUint8 requestnotify_5_ts_1_input = 0; +// Test step 1 output: + +const TUint8 requestnotify_5_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0, +50, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - RequestNotification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'P','l','u','g','i','n','R','e','p','l','a','c','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - RequestNotification(Output)::AppConfUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','1','0', +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','f','b','1', +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::pluginName +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - RequestNotification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - RequestNotification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','0','2', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +const TInt requestnotify_5_ts_1_trigger = 5; + +#endif // C_MT_HSPS_REMOVEPLUGIN_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_requestnotify_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1768 @@ +/* +* 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: Test case RequestNotify(6) test data +* +*/ + + +#ifndef C_MT_HSPS_REQUESTNOTIFY_6_H +#define C_MT_HSPS_REQUESTNOTIFY_6_H + + +/* +RequestNotify(6) +---------------- + +Test purpose + +Verify that asynchronous client notifications are sent after the plugin has been +installed or uninstalled. In addition, inactive application configuration +should have uninstalled plugin instances in an error state and related resources +removed. Changes in active application configuration should be handled by the +client wich should utilize ReplacePlugin API for updating the plugin instances. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Minimal configuration must be set as active + +Test steps + +Test step 1: +• Input: + RequestNotify(“”) +• Trigger: + installed_widget plugin installed +• Expected output: + PluginInstalled notification + +Test step 2: +• Input: + RequestNotify(“”) +• Trigger: + installed_widget_v2 plugin installed +• Expected output: + Plugin updated notification + +Test step 3: +• Input: + AddPlugin(“”) +• Expected output: + Plugin added to 1st view in the Minimal root configuration + +Test step 4: +• Input: + AddPlugin(“”) +• Expected output: + Plugin added to 1st view in the Typical root configuration while + Typical root configuration is active + +Test step 5: +• Input: + RequestNotification(“”) +• Trigger: + installed_widget_v2 plugin uninstalled +• Expected output: + PluginUninstalled notification is sent to the client + +Test step 6: +• Input: + GetPluginConf(“”) +• Expected output: + Uninstalled plugin instance is in error state in the inactive + Miminal root configuration + +*/ + + +// Test step 1 method: +const TUint8 requestnotify_6_ts_1_method[] = "RequestNotification"; + +// Test step 1 input: +const TUint8 requestnotify_6_ts_1_input = 0; + +// Test step 1 output: +const TUint8 requestnotify_6_ts_1_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0,//6,0,0,0, +50,//26, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'P','l','u','g','i','n','I','n','s','t','a','l','l','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +18,0,0,0, +74, +'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t', +// - Notification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +const TInt requestnotify_6_ts_1_trigger = EHspsTriggerRunInstallationCase; + + +// Test step 2 method: +const TUint8 requestnotify_6_ts_2_method[] = "RequestNotification"; + +// Test step 2 input: +const TUint8 requestnotify_6_ts_2_input = 0; + +// Test step 2 output: +const TUint8 requestnotify_6_ts_2_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0,//6,0,0,0, +50,//26, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +13,0,0,0, +54, +'P','l','u','g','i','n','U','p','d','a','t','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +21,0,0,0, +86, +'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t',' ','V','2', +// - Notification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +const TInt requestnotify_6_ts_2_trigger = EHspsTriggerRunUpdateInstallationCase; + + + +// Test step 3 method: +const TUint8 requestnotify_6_ts_3_method[] = "AddPlugin"; + +// Test step 3 input: +const TUint8 requestnotify_6_ts_3_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 3 output: +const TUint8 requestnotify_6_ts_3_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3' +}; + + + +// Test step 4 method: +const TUint8 requestnotify_6_ts_4_method[] = "AddPlugin"; + +// Test step 4 input: +const TUint8 requestnotify_6_ts_4_input[] = { +// AddPlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - AddPlugin(Input)::confId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'c','o','n','f','I','d', +// - AddPlugin(Input)::confId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'2', +// - AddPlugin(Input)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - AddPlugin(Input)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - AddPlugin(Input)::position +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','o','s','i','t','i','o','n', +// - AddPlugin(Input)::position +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +// Test step 4 output: +const TUint8 requestnotify_6_ts_4_output[] = { +// AddPlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - AddPlugin(Output)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - AddPlugin(Output)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'9' +}; + + + +// Test step 5 method: +const TUint8 requestnotify_6_ts_5_method[] = "RequestNotification"; + +// Test step 5 input: +const TUint8 requestnotify_6_ts_5_input = 0; + +// Test step 5 output: +const TUint8 requestnotify_6_ts_5_output[] = { +// RequestNotification (Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - RequestNotification (Output)::notification (map) +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +12,0,0,0,//6,0,0,0, +50,//26, +'n','o','t','i','f','i','c','a','t','i','o','n', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Notification +// - Version 1.0 +// - Item count (LE) +10, +6,0,0,0, +// - Notification(Output)::event +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'e','v','e','n','t', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +17,0,0,0, +70, +'P','l','u','g','i','n','U','n','i','n','s','t','a','l','l','e','d', +// - Notification(Output)::appConfUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'a','p','p','C','o','n','f','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::origUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'o','r','i','g','U','i','d', +// - RequestNotification(Output)::origUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Notification(Output)::pluginName +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Notification(Output)::event +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +21,0,0,0, +86, +'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t',' ','V','2', +// - Notification(Output)::pluginUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','U','i','d', +// - Notification(Output)::pluginUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','b','1','3','3', +// - Notification(Output)::pluginIds +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'p','l','u','g','i','n','I','d','s', +// - Notification::pluginIds +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - Notification::pluginIds +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// Notification::pluginIds +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Notification::pluginIds[0] +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0' +}; + +const TInt requestnotify_6_ts_5_trigger = EHspsTriggerRunUninstallationCase; + + + + +// Test step 6 method: +const TUint8 requestnotify_6_ts_6_method[] = "GetPluginConf"; + +// Test step 6 input: +const TUint8 requestnotify_6_ts_6_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'3' +}; + +// Test step 8 output: +const TUint8 requestnotify_6_ts_6_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'4', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','3','3', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'w','i','d','g','e','t', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +21,0,0,0, +86, +'I','n','s','t','a','l','l','e','d',' ','-',' ','W','i','d','g','e','t',' ','V','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'E','r','r','o','r', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +0,0,0,0, +2, +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'h','s','_','l','o','g','o','.','j','p','g', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','5','\\','2','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'w','i','d','g','e','t','.','b','m','p', +// - object[1]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[1]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','7','5','\\','2','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[1]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[1]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - Object[1]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[1]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + + +#endif // C_MT_HSPS_REMOVEPLUGIN_6_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,783 @@ +/* +* 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: Test case SetActiveAppConf(1) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEAPPCONF_1_H +#define C_MT_HSPS_SETACTIVEAPPCONF_1_H + +/* +SetActiveAppConf(1) +------------------- + +Test purpose + +The purpose of this test case is to verify that application configuration is +successfully changed + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetActiveAppConf(“Typical configuration”) +• Expected output: + Active Idle configuration is successfully changed + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration + +*/ + +// Test step 1 method: + +const TUint8 setactiveappconf_1_ts_1_method[] = "SetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 setactiveappconf_1_ts_1_input[] = { +// SetActiveAppConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Input)::confUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - SetActiveAppConf(Input)::confUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0' +}; + + +// Test step 1 expected output: + + +const TUint8 setactiveappconf_1_ts_1_output[] = { +// SetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetActiveAppConf(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setactiveappconf_1_ts_2_method[] = "GetActiveAppConf"; + + +// Test step 2 input: + +const TUint8 setactiveappconf_1_ts_2_input = 0; + + +// Test step 2 expected output: + + +const TUint8 setactiveappconf_1_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_SETACTIVEAPPCONF_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,561 @@ +/* +* 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: Test case SetActiveAppConf(2) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEAPPCONF_2_H +#define C_MT_HSPS_SETACTIVEAPPCONF_2_H + +/* +SetActiveAppConf(2) +------------------- + +Test purpose +The purpose of this test case is to verify that application configuration change +fails if the defined configuration cannot be found. + +Pre-conditions +There must be installed test themes for Active Idle application and Minimal +configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetActiveAppConf(“Unknown condiguration”) +• Expected output: + Active configuration change fails + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Minimal configuration is returned + +*/ + +// Test step 1 method: + +const TUint8 setactiveappconf_2_ts_1_method[] = "SetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 setactiveappconf_2_ts_1_input[] = { +// SetActiveAppConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Input)::confUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - SetActiveAppConf(Input)::confUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','F','F','F','F' +}; + + +// Test step 1 expected output: + + +const TUint8 setactiveappconf_2_ts_1_output[] = { +// SetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetActiveAppConf(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out "KErrNotFound" +}; + +// Test step 2 method: + +const TUint8 setactiveappconf_2_ts_2_method[] = "GetActiveAppConf"; + + +// Test step 2 input: + +const TUint8 setactiveappconf_2_ts_2_input = 0; + + +// Test step 2 expected output: + + +const TUint8 setactiveappconf_2_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + +#endif // C_MT_HSPS_SETACTIVEAPPCONF_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,560 @@ +/* +* 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: Test case SetActiveAppConf(3) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEAPPCONF_3_H +#define C_MT_HSPS_SETACTIVEAPPCONF_3_H + +/* +SetActiveAppConf(3) +------------------- + +Test purpose + +The purpose of this test case is to verify that a default application +configuration is returned if the defined configuration id is view’s +uid instead of appuid. + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetActiveAppConf(“view's uid”) +• Expected output: + Active Idle configuration is successfully changed + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Minimal configuration is returned + +*/ + +// Test step 1 method: + +const TUint8 setactiveappconf_3_ts_1_method[] = "SetActiveAppConf"; + +// Test step 1 input: + +const TUint8 setactiveappconf_3_ts_1_input[] = { +// SetActiveAppConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Input)::confUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d', +// - SetActiveAppConf(Input)::confUid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1' +}; + + +// Test step 1 expected output: + + +const TUint8 setactiveappconf_3_ts_1_output[] = { +// SetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetActiveAppConf(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out "KErrNotFound" +}; + +// Test step 2 method: + +const TUint8 setactiveappconf_3_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 setactiveappconf_3_ts_2_input = 0; + +// Test step 2 expected output: + +const TUint8 setactiveappconf_3_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + + +#endif // C_MT_HSPS_SETACTIVEAPPCONF_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveappconf_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,548 @@ +/* +* 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: Test case SetActiveAppConf(4) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEAPPCONF_4_H +#define C_MT_HSPS_SETACTIVEAPPCONF_4_H + +/* +SetActiveAppConf(4) +------------------- + +Test purpose + +The purpose of this test case is to verify that a default +application configuration is returned if the defined +configuration is missing. + +Pre-conditions +• There must be installed test themes for Active Idle application and Minimal + configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetActiveAppConf(“NULL”) +• Expected output: + Active Idle configuration is successfully changed + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle minimal configuration is returned + +*/ + +// Test step 1 method: +const TUint8 setactiveappconf_4_ts_1_method[] = "SetActiveAppConf"; + + +// Test step 1 input: + +const TUint8 setactiveappconf_4_ts_1_input[] = { +// SetActiveAppConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Input)::confUid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'c','o','n','f','U','i','d' +}; + + +// Test step 1 expected output: + + +const TUint8 setactiveappconf_4_ts_1_output[] = { +// SetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActiveAppConf(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetActiveAppConf(Output)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +254,255,255,255 // expected out "KErrNotFound" +}; + +// Test step 2 method: + +const TUint8 setactiveappconf_4_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 setactiveappconf_4_ts_2_input = 0; + +// Test step 2 expected output: + +const TUint8 setactiveappconf_4_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'R','o','o','t',' ','c','o','n','f',' ','#','1', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','0','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +0,0,0,0 +}; + + +#endif // C_MT_HSPS_SETACTIVEAPPCONF_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,779 @@ +/* +* 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: Test case SetActivePlugin(1) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_1_H +#define C_MT_HSPS_SETACTIVEPLUGIN_1_H + +/* +SetActivePlugin(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that active plugin is successfully +changed + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetActivePlugin(“Typical view 2”) +• Expected output: + Active Idle configuration is successfully changed +• Execution time measured + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration with plugin list where Typical view 2 is set as active. + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_1_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_1_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetActivePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_1_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setactiveplugin_1_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 setactiveplugin_1_ts_2_input = 0; + +// Test step 2 output: + +const TUint8 setactiveplugin_1_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,779 @@ +/* +* 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: Test case SetActivePlugin(2) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_2_H +#define C_MT_HSPS_SETACTIVEPLUGIN_2_H + +/* +SetActivePlugin(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that currently active view is +successfully reactivated + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active (Typical view 1 is set as active). + +Test steps + +Test step 1: +• Input: + SetActivePlugin(“Typical view 1”) +• Expected output: + Typical view 1 is successfully reactivated + +Test step 2: +• Input: + GetActiveAppConf() +• Expected output: + Active Idle Typical configuration with plugin list where Typical view 1 is + set as active. + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_2_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_2_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetActivePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1' +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_2_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setactiveplugin_2_ts_2_method[] = "GetActiveAppConf"; + +// Test step 2 input: + +const TUint8 setactiveplugin_2_ts_2_input = 0; + +// Test step 2 output: + +const TUint8 setactiveplugin_2_ts_2_output[] = { +// GetActiveAppConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetActiveAppConf(Output)::appConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'a','p','p','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - appConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - appConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - appConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - appConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','0', +// - appConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - appConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'a','p','p','l','i','c','a','t','i','o','n', +// - appConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - appConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','0','F','B','1', +// - appConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - appConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +14,0,0,0, +58, +'T','y','p','i','c','a','l',' ','-',' ','R','o','o','t', +// - appConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - appConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - appConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - appConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - appConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - appConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - appConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - appConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - appConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - appConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','1', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - appConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - appConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - appConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::settings +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0, +// - appConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - appConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - appConf::resources +// - Version 1.0 +// - List item count +10, +1,0,0,0, +// - resources[0]::object +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - Object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - Object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - Object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - Object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +8,0,0,0, +34, +'r','o','o','t','.','b','m','p', +// - Object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - Object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +42,0,0,0, +170, +'5','3','6','8','7','4','9','2','9','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','0','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - Object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - Object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2 +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1219 @@ +/* +* 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: Test case SetActivePlugin(3) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_3_H +#define C_MT_HSPS_SETACTIVEPLUGIN_3_H + +/* +SetActivePlugin(3) +------------------ + +Test purpose + +The purpose of this test case is to verify that active widget is successfully +changed + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active (Typical view 1 is set as active). + +Test steps + +Test step 1: +• Input: + SetActivePlugin(“2. Typical widget”) +• Expected output: + 2. Typical widget is successfully activated + +Test step 2: +• Input: + GetPluginConf() +• Expected output: + Active Idle Typical view 2 configuration with plugin list where 2. Typical + widget is set as active + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_3_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_3_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetActivePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7' +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_3_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setactiveplugin_3_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 setactiveplugin_3_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 2 output: + +const TUint8 setactiveplugin_3_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1219 @@ +/* +* 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: Test case SetActivePlugin(4) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_4_H +#define C_MT_HSPS_SETACTIVEPLUGIN_4_H + +/* +SetActivePlugin(4) +------------------ + +Test purpose + +The purpose of this test case is to verify that currently active widget is +successfully reactivated + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active (Typical view 1 is set as active). + +Test steps + +Test step 1: +• Input: + SetActivePlugin(“1. Typical widget”) +• Expected output: + 1. Typical widget is successfully reactivated + +Test step 2: +• Input: + GetPluginConf() +• Expected output: + Active Idle Typical view 2 configuration with plugin list where 1. Typical + widget is set as active. + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_4_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_4_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetActivePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6' +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_4_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setactiveplugin_4_ts_2_method[] = "GetPluginConf"; + +// Test step 2 input: + +const TUint8 setactiveplugin_4_ts_2_input[] = { +// GetPluginConf(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - GetPluginConf(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - GetPluginConf(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'5' +}; + +// Test step 2 output: + +const TUint8 setactiveplugin_4_ts_2_output[] = { +// GetPluginConf(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// GetPluginConf(Output)::pluginConf +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','l','u','g','i','n','C','o','n','f', +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - pluginConf map +// - Version 1.0 +// - Item count (LE) +10, +12,0,0,0, +// - pluginConf::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - pluginConf::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - pluginConf::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','1','2', +// - pluginConf::type +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'t','y','p','e', +// - pluginConf::type +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'v','i','e','w', +// - pluginConf::interface +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'i','n','t','e','r','f','a','c','e', +// - pluginConf::interface +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'0','x','9','9','8', +// - pluginConf::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - pluginConf::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +15,0,0,0, +62, +'T','y','p','i','c','a','l',' ','-',' ','V','i','e','w','2', +// - pluginConf::multiinstance +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +13,0,0,0, +54, +'m','u','l','t','i','i','n','s','t','a','n','c','e', +// - pluginConf::multiinstance +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::description +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'d','e','s','c', +// - pluginConf::description +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +// - pluginConf::state +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'s','t','a','t','e', +// - pluginConf::state +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +12,0,0,0, +50, +'N','o','t','C','o','n','f','i','r','m','e','d', +// - pluginConf::max_child +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','a','x','_','c','h','i','l','d', +// - pluginConf::max_child +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - pluginConf::plugins +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +7,0,0,0, +30, +'p','l','u','g','i','n','s', +// - pluginConf::plugins +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::plugins +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[0]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[0]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'6', +// - plugins[0]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[0]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[0]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[0]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - plugins[0]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[0]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[1] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[1]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[1]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'7', +// - plugins[1]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[1]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[1]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[1]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[1]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[1]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::plugins +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::plugins[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - plugins[2] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - plugins[2]::id +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +2,0,0,0, +10, +'i','d', +// - plugins[2]::id +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - plugins[2]::uid +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'u','i','d', +// - plugins[2]::uid +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +10,0,0,0, +42, +'0','x','2','0','0','0','B','1','2','0', +// - plugins[2]::activationstate +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +15,0,0,0, +62, +'a','c','t','i','v','a','t','i','o','n','s','t','a','t','e', +// - plugins[2]::activationstate +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'0', +// - plugins[2]::locking_status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +14,0,0,0, +58, +'l','o','c','k','i','n','g','_','s','t','a','t','u','s', +// - plugins[2]::locking_status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +4,0,0,0, +18, +'n','o','n','e', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','2','2',',','1','1','1',',','0', +// - GetPluginSettings::settings +// - Version 1.0 +// - List item +10, +0,0,0,0, +// - items[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[1] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[1]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[1]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','i','m','a','g','e', +// - items[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +16,0,0,0, +66, +'B','a','c','k','g','r','o','u','n','d',' ','I','m','a','g','e', +// - items[1]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[1]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[1]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[1]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +11,0,0,0, +46, +'v','i','e','w','2','b','g','.','j','p','g', +// - pluginConf::resources +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'r','e','s','o','u','r','c','e','s', +// - pluginConf::resources +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::resources +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::resources +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - object[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - object[0] map +// - Version 1.0 +// - Item count (LE) +10, +4,0,0,0, +// - object[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - object[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'v','i','e','w','2','.','b','m','p', +// - object[0]::path +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'p','a','t','h', +// - object[0]::path +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +37,0,0,0, +150, +'2','4','5','6','\\','2','7','0','5','1','3','7','5','1','\\','5','3','6','9','1','6','2','4','2','\\','1','.','0','\\','s','o','u','r','c','e','s','\\', +// - object[0]::mediatype +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +9,0,0,0, +38, +'m','e','d','i','a','t','y','p','e', +// - object[0]::mediatype +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'m','i','m','e','_','t','y','p','e', +// - Object[0]::tag +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +3,0,0,0, +14, +'t','a','g', +// - Object[0]::tag +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +0,0,0,0, +2, +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* 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: Test case SetActivePlugin(5) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_5_H +#define C_MT_HSPS_SETACTIVEPLUGIN_5_H + +/* +SetActivePlugin(5) +------------------ + +Test purpose + +The purpose of this test case is to verify that status element with KErrNotFound +error code is returned when defined plugin id is not found from active +configuration. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active (Typical view 1 is set as active). + +Test steps + +Test step 1: +• Input: + SetActivePlugin(“Not found plugin”) +• Expected output: + Status element with KErrNotFound error code + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_5_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_5_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetActivePlugin(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'9','9' +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_5_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setactiveplugin_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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: Test case SetActivePlugin(6) test data +* +*/ + + +#ifndef C_MT_HSPS_SETACTIVEPLUGIN_6_H +#define C_MT_HSPS_SETACTIVEPLUGIN_6_H + +/* +SetActivePlugin(6) +------------------ + +Test purpose + +The purpose of this test case is to verify that status element with KErrArgument +error code is returned when plugin id parameter is not defined. + +Pre-conditions + +There must be installed test themes for Active Idle application and Typical +configuration must be set as active (Typical view 1 is set as active). + +Test steps + +Test step 1: +• Input: + SetActivePlugin() +• Expected output: + Status element with KErrArgument error code + +*/ + +// Test step 1 method: + +const TUint8 setactiveplugin_6_ts_1_method[] = "SetActivePlugin"; + +// Test step 1 input: + +const TUint8 setactiveplugin_6_ts_1_input[] = { +// SetActivePlugin(Input) +// - Version 1.0 +// - Item count (LE) +10, +0,0,0,0 +}; + +// Test step 1 output: + +const TUint8 setactiveplugin_6_ts_1_output[] = { +// SetActivePlugin(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetActivePlugin(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 +}; + +#endif // C_MT_HSPS_SETACTIVEPLUGIN_6_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_1.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,776 @@ +/* +* 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: Test case SetPluginSettings(1) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_1_H +#define C_MT_HSPS_SETPLUGINSETTINGS_1_H + +/* +SetPluginSettings(1) +---------------- + +Test purpose + +The purpose of this test case is to verify that removing of a plugin fails, +when a plugin request to be removed cannot be found. + +Pre-conditions +• There must be installed test themes for Active Idle application and + Minimal configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(“plugin id-Settings list”) +• Expected output: + Set Settings succeed + +Test step 2: +• Input: + SetPluginSettings(“plugin id-Settings list”) same as installed +• Expected output: + Set Settings succeed + +*/ + +// Test step 1 method: + +const TUint8 setpluginsettings_1_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_1_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +12,0,0,0, +50, +'&','q','t','n','_','b','g','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'1','2','3',',','1','2','3',',','0' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_1_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +const TUint8 setpluginsettings_1_ts_2_method[] = "SetPluginSettings"; + +// Test step 2 input: + +const TUint8 setpluginsettings_1_ts_2_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +12,0,0,0, +50, +'&','q','t','n','_','b','g','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'1','2','3',',','1','2','3',',','0' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_1_ts_2_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + + + +// Test step 1 method: + +const TUint8 setpluginsettings_1_ts_3_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_1_ts_3_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'1', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, + +// - items[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - items[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - items[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - items[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +7,0,0,0, +30, +'b','g','c','o','l','o','r', +// - items[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - items[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +12,0,0,0, +50, +'&','q','t','n','_','b','g','c','o','l','o','r', +// - items[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - items[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - items[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - items[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'v','a','l','u','e', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +9,0,0,0, +38, +'2','0','0',',','1','0','0',',','0' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_1_ts_3_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; +#endif // C_MT_HSPS_REMOVEPLUGIN_1_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_2.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1155 @@ +/* +* 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: Test case SetPluginSettings(2) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_2_H +#define C_MT_HSPS_SETPLUGINSETTINGS_2_H + +/* +SetPluginSettings(2) +---------------- + +Test purpose + +The purpose of this test case is to verify that settings settings of a plugin success +for widget plugin. + +Pre-conditions +• There must be installed test themes for Active Idle application and + typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(“plugin id-Settings list”) +• Expected output: + Set Settings succeed + +Test step 2: +• Input: + SetPluginSettings(“plugin id-Settings list”) +• Expected output: + Set Settings succeed + +*/ + + + +// Test step 1 method: + +const TUint8 setpluginsettings_2_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_2_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +21,0,0,0, +86, +'&','q','t','n','_','s','6','0','s','h','o','r','t','c','u','t','_','s','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'5','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'3','2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'n','o' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_2_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 2 method: + +const TUint8 setpluginsettings_2_ts_2_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_2_ts_2_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +21,0,0,0, +86, +'&','q','t','n','_','s','6','0','s','h','o','r','t','c','u','t','_','s','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s' +}; + +// Test step 1 output: +const TUint8 setpluginsettings_2_ts_2_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +0,0,0,0 +}; + +// Test step 3 method: + +const TUint8 setpluginsettings_2_ts_3_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_2_ts_3_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'t','y','p','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +21,0,0,0, +86, +'&','q','t','n','_','s','6','0','s','h','o','r','t','c','u','t','_','s','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','4','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'y','e','s' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_2_ts_3_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - RemovePlugin(Input)::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 +}; + + +#endif // C_MT_HSPS_SETPLUGINSETTINGS_2_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_3.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,411 @@ +/* +* 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: Test case SetPluginSettings(3) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_3_H +#define C_MT_HSPS_SETPLUGINSETTINGS_3_H + +/* +SetPluginSettings(3) +---------------- + +Test purpose + +The purpose of this test case is to verify that setting of plugin settings fails +when settings item cannot be found from the configuration. + +Pre-conditions +• There must be installed test themes for Active Idle application and + typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(“plugin id-Settings list") +• Expected output: + Status +*/ + + +// Test step 1 method: + +const TUint8 setpluginsettings_3_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: +const TUint8 setpluginsettings_3_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +6,0,0,0, +26, +'h','e','i','g','h','t', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +14,0,0,0, +58, +'&','q','t','n','_','s','6','0','h','e','i','g','h','t', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'m','a','x', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'2','0','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'m','i','n', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'1','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +7,0,0,0, +30, +'d','e','f','a','u','l','t', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'1','0','0' +}; + +// Test step 1 output: +const TUint8 setpluginsettings_3_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out KErrNotFound (-1) +}; + +#endif // C_MT_HSPS_SETPLUGINSETTINGS_3_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_4.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_4.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,412 @@ +/* +* 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: Test case SetPluginSettings(4) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_4_H +#define C_MT_HSPS_SETPLUGINSETTINGS_4_H + +/* +SetPluginSettings(4) +---------------- + +Test purpose + +The purpose of this test case is to verify that setting of settings fails +when id of the plug-in is invalid (not found). + +Pre-conditions +• There must be installed test themes for Active Idle application and + typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(“invalid plugin id”) +• Expected output: + Status +*/ + + +// Test step 1 method: + +const TUint8 setpluginsettings_4_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_4_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'X', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +21,0,0,0, +86, +'&','q','t','n','_','s','6','0','s','h','o','r','t','c','u','t','_','s','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'5','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'3','2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'n','o' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_4_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out KErrNotFound (-1) +}; + +#endif // C_MT_HSPS_SETPLUGINSETTINGS_4_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_5.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,411 @@ +/* +* 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: Test case SetPluginSettings(5) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_5_H +#define C_MT_HSPS_SETPLUGINSETTINGS_5_H + +/* +SetPluginSettings(5) +---------------- + +Test purpose + +The purpose of this test case is to verify that setting of plugin settings fails +when plug-in id is missing from input params. + +Pre-conditions +• There must be installed test themes for Active Idle application and + typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(NULL) +• Expected output: + Status not found +*/ + + +// Test step 1 method: + +const TUint8 setpluginsettings_5_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: +const TUint8 setpluginsettings_5_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +' ', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'s','e','t','t','i','n','g','s', +// - pluginConf::settings +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - pluginConf::settings +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - pluginConf::settings +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - pluginConf::settings[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - settings[0] map +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::itemId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'i','t','e','m','I','d', +// - settings[0]::itemId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +4,0,0,0, +18, +'s','i','z','e', +// - settings[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - settings[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value (empty) +10, +5, +21,0,0,0, +86, +'&','q','t','n','_','s','6','0','s','h','o','r','t','c','u','t','_','s','i','z','e', +// - settings[0]::properties +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +10,0,0,0, +42, +'p','r','o','p','e','r','t','i','e','s', +// - settings[0]::properties +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeList +10, +7, +// - settings[0]::properties +// - Version 1.0 +// - Item count (LE) +10, +3,0,0,0, +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[0] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[0] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[0]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[0]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'h','e','i','g','t','h', +// - prperties[0]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[0]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'5','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[1] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[1] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - prperties[1]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[1]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +5,0,0,0, +22, +'w','i','d','t','h', +// - prperties[1]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[1]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +3,0,0,0, +14, +'3','2','0', +// - settings[0]::properties +// - Version 1.0 +// - List item starts +10, +0,0,0,0, +// - properties[2] +// - Version 1.0 +// - Variant value type, EVariantTypeMap +10, +8, +// - properties[2] map +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - properties[2]::name +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'n','a','m','e', +// - properties[2]::name +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +6,0,0,0, +26, +'l','o','c','k','e','d', +// - properties[2]::value +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +5,0,0,0, +22, +'v','a','l','u','e', +// - properties[2]::value +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +2,0,0,0, +10, +'n','o' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_5_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +255,255,255,255 // expected out KErrNotFound (-1) +}; + +#endif // C_MT_HSPS_SETPLUGINSETTINGS_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_6.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hsps_setpluginsettings_6.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* 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: Test case SetPluginSettings(6) test data +* +*/ + + +#ifndef C_MT_HSPS_SETPLUGINSETTINGS_6_H +#define C_MT_HSPS_SETPLUGINSETTINGS_6_H + +/* +SetPluginSettings(6) +---------------- + +Test purpose + +The purpose of this test case is to verify that setting of plugin settings fails +when settings are missing from input params. + +Pre-conditions +• There must be installed test themes for Active Idle application and + typical configuration must be set as active + +Test steps + +Test step 1: +• Input: + SetPluginSettings(NULL) +• Expected output: + Status not found +*/ + + +// Test step 1 method: + +const TUint8 setpluginsettings_6_ts_1_method[] = "SetPluginSettings"; + +// Test step 1 input: + +const TUint8 setpluginsettings_6_ts_1_input[] = { +// SetPluginSettings(Input) +// - Version 1.0 +// - Item count (LE) +10, +2,0,0,0, +// - SetPluginSettings(Input)::pluginId +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +8,0,0,0, +34, +'p','l','u','g','i','n','I','d', +// - SetPluginSettings(Input)::pluginId +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeDesC +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +5, +1,0,0,0, +6, +'8', +// - pluginConf::settings +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +4,0,0,0, +18, +'s','e','t','t' +}; +// Test step 1 output: + +const TUint8 setpluginsettings_6_ts_1_output[] = { +// SetPluginSettings(Output) +// - Version 1.0 +// - Item count (LE) +10, +1,0,0,0, +// - SetPluginSettings(Output)::status +// - Variant name +// - Version 1.0 +// - Semantic ID (LE) +// - Variant name length (LE) +// - Variant name descriptor maximum length ( ( variant name length * 4 ) + 2 ) +// - Variant name +10, +12,0,0,0, +6,0,0,0, +26, +'s','t','a','t','u','s', +// - SetPluginSettings::status +// - Variant value +// - Version 1.0 +// - Variant value type, EVariantTypeTInt32 +// - Variant value length (LE) +// - Variant value descriptor maximum length ( ( variant value length * 4 ) + 2 ) +// - Variant value +10, +1, +250,255,255,255 // expected out KErrArgument (-6) +}; + +#endif // C_MT_HSPS_SETPLUGINSETTINGS_5_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,457 @@ +/* +* 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: Defination of class MT_CHSPSConfigurationIf +* +*/ + + +#ifndef C_MT_HSPSCONFIGURATIONIF_H +#define C_MT_HSPSCONFIGURATIONIF_H + +#include +#include +#include "mt_hsps.h" + +/** + * This class is a tester class for HSPS SAPI configuration interface +*/ +NONSHARABLE_CLASS( MT_CHSPSConfigurationIf ) : public MT_CHSPS + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_CHSPSConfigurationIf* NewL(); + + /** + * Destructor + */ + virtual ~MT_CHSPSConfigurationIf(); + + private: // Constructors and destructors + + /** + * Default constructor. + */ + MT_CHSPSConfigurationIf(); + + /** + * 2nd tier constructor. + */ + void ConstructL(); + + private: // Common test case methods + + /** + * Remove resources from client's private folder + */ + void ResetClientFolderL(); + + /** + * Setup for the unit test. + */ + void SetupL(); + + /** + * Unit test teardown. + */ + void Teardown(); + + /** + * Prints return value to a file. + * @param aOutParamList Parameter list to be printed. + */ + void PrintReturnValuesL( + CLiwGenericParamList& aOutParamList ); + + private: // Test cases + + /** + * Test case function for test case GetActiveAppConf(1) + * See HSPS module test specification + */ + void GetActiveAppConf_1_L(); + /** + * Test case function for test case GetActiveAppConf(2) + * See HSPS module test specification + */ + void GetActiveAppConf_2_L(); + /** + * Test case function for test case GetActiveAppConf(3) + * See HSPS module test specification + */ + void GetActiveAppConf_3_L(); + /** + * Test case function for test case GetPluginConf(1) + * See HSPS module test specification + */ + void GetPluginConf_1_L(); + /** + * Test case function for test case GetPluginConf(2) + * See HSPS module test specification + */ + void GetPluginConf_2_L(); + /** + * Test case function for test case GetPluginConf(3) + * See HSPS module test specification + */ + void GetPluginConf_3_L(); + /** + * Test case function for test case GetPluginConf(4) + * See HSPS module test specification + */ + void GetPluginConf_4_L(); + /** + * Test case function for test case GetPluginConf(5) + * See HSPS module test specification + */ + void GetPluginConf_5_L(); + /** + * Test case function for test case GetPlugins(1) + * See HSPS module test specification + */ + void GetPlugins_1_L(); + /** + * Test case function for test case GetPlugins(2) + * See HSPS module test specification + */ + void GetPlugins_2_L(); + /** + * Test case function for test case GetPlugins(3) + * See HSPS module test specification + */ + void GetPlugins_3_L(); + /** + * Test case function for test case GetPlugins(4) + * See HSPS module test specification + */ + void GetPlugins_4_L(); + /** + * Test case function for test case GetPlugins(5) + * See HSPS module test specification + */ + void GetPlugins_5_L(); + /** + * Test case function for test case GetPlugins(6) + * See HSPS module test specification + */ + void GetPlugins_6_L(); + /** + * Test case function for test case GetPlugins(7) + * See HSPS module test specification + */ + void GetPlugins_7_L(); + /** + * Test case function for test case GetPluginList(1) + * See HSPS module test specification + */ + void GetPluginList_1_L(); + /** + * Test case function for test case GetPluginList(2) + * See HSPS module test specification + */ + void GetPluginList_2_L(); + /** + * Test case function for test case GetPluginList(3) + * See HSPS module test specification + */ + void GetPluginList_3_L(); + /** + * Test case function for test case GetPluginList(4) + * See HSPS module test specification + */ + void GetPluginList_4_L(); + /** + * Test case function for test case GetPluginList(5) + * See HSPS module test specification + */ + void GetPluginList_5_L(); + /** + * Test case function for test case GetPluginList(6) + * See HSPS module test specification + */ + void GetPluginList_6_L(); + /** + * Test case function for test case GetPluginList(7) + * See HSPS module test specification + */ + void GetPluginList_7_L(); + /** + * Test case function for test case GetPluginList(8) + * See HSPS module test specification + */ + void GetPluginList_8_L(); + /** + * Test case function for test case AddPlugin(1) + * See HSPS module test specification + */ + void AddPlugin_1_L(); + /** + * Test case function for test case AddPlugin(2) + * See HSPS module test specification + */ + void AddPlugin_2_L(); + /** + * Test case function for test case AddPlugin(3) + * See HSPS module test specification + */ + void AddPlugin_3_L(); + /** + * Test case function for test case AddPlugin(4) + * See HSPS module test specification + */ + void AddPlugin_4_L(); + /** + * Test case function for test case AddPlugin(5) + * See HSPS module test specification + */ + void AddPlugin_5_L(); + /** + * Test case function for test case AddPlugin(6) + * See HSPS module test specification + */ + void AddPlugin_6_L(); + /** + * Test case function for test case AddPlugin(7) + * See HSPS module test specification + */ + void AddPlugin_7_L(); + /** + * Test case function for test case AddPlugin(8) + * See HSPS module test specification + */ + void AddPlugin_8_L(); + /** + * Test case function for test case AddPlugin(9) + * See HSPS module test specification + */ + void AddPlugin_9_L(); + /** + * Test case function for test case AddPlugin(10) + * See HSPS module test specification + */ + void AddPlugin_10_L(); + /** + * Test case function for test case AddPlugin(11) + * See HSPS module test specification + */ + void AddPlugin_11_L(); + /** + * Test case function for test case RemovePlugin(1) + * See HSPS module test specification + */ + void RemovePlugin_1_L(); + /** + * Test case function for test case RemovePlugin(2) + * See HSPS module test specification + */ + void RemovePlugin_2_L(); + /** + * Test case function for test case RemovePlugin(3) + * See HSPS module test specification + */ + void RemovePlugin_3_L(); + /** + * Test case function for test case RemovePlugin(4) + * See HSPS module test specification + */ + void RemovePlugin_4_L(); + /** + * Test case function for test case SetPluginSettings(1) + * See HSPS module test specification + */ + void SetPluginSettings_1_L(); + /** + * Test case function for test case SetPluginSettings(2) + * See HSPS module test specification + */ + void SetPluginSettings_2_L(); + /** + * Test case function for test case SetPluginSettings(3) + * See HSPS module test specification + */ + void SetPluginSettings_3_L(); + /** + * Test case function for test case SetPluginSettings(4) + * See HSPS module test specification + */ + void SetPluginSettings_4_L(); + /** + * Test case function for test case SetPluginSettings(5) + * See HSPS module test specification + */ + void SetPluginSettings_5_L(); + /** + * Test case function for test case SetPluginSettings(6) + * See HSPS module test specification + */ + void SetPluginSettings_6_L(); + /** + * Test case function for test case GetPluginSettings(1) + * See HSPS module test specification + */ + void GetPluginSettings_1_L(); + /** + * Test case function for test case GetPluginSettings(2) + * See HSPS module test specification + */ + void GetPluginSettings_2_L(); + /** + * Test case function for test case GetPluginSettings(3) + * See HSPS module test specification + */ + void GetPluginSettings_3_L(); + /** + * Test case function for test case MovePlugins(1) + * See HSPS module test specification + */ + void MovePlugins_1_L(); + /** + * Test case function for test case MovePlugins(2) + * See HSPS module test specification + */ + void MovePlugins_2_L(); + /** + * Test case function for test case MovePlugins(3) + * See HSPS module test specification + */ + void MovePlugins_3_L(); + /** + * Test case function for test case MovePlugins(4) + * See HSPS module test specification + */ + void MovePlugins_4_L(); + /** + * Test case function for test case MovePlugins(5) + * See HSPS module test specification + */ + void MovePlugins_5_L(); + /** + * Test case function for test case MovePlugins(6) + * See HSPS module test specification + */ + void MovePlugins_6_L(); + /** + * Test case function for test case ReplacePlugin(1) + * See HSPS module test specification + */ + void ReplacePlugin_1_L(); + /** + * Test case function for test case GetAppConfs(1) + * See HSPS module test specification + */ + void GetAppConfs_1_L(); + /** + * Test case function for test case SetActiveAppConf(1) + * See HSPS module test specification + */ + void SetActiveAppConf_1_L(); + /** + * Test case function for test case SetActiveAppConf(2) + * See HSPS module test specification + */ + void SetActiveAppConf_2_L(); + /** + * Test case function for test case SetActiveAppConf(3) + * See HSPS module test specification + */ + void SetActiveAppConf_3_L(); + /** + * Test case function for test case SetActiveAppConf(4) + * See HSPS module test specification + */ + void SetActiveAppConf_4_L(); + /** + * Test case function for test case RequestNotify(1) + * See HSPS module test specification + */ + void RequestNotify_1_L(); + /** + * Test case function for test case RequestNotify(2) + * See HSPS module test specification + */ + void RequestNotify_2_L(); + /** + * Test case function for test case RequestNotify(3) + * See HSPS module test specification + */ + void RequestNotify_3_L(); + /** + * Test case function for test case RequestNotify(4) + * See HSPS module test specification + */ + void RequestNotify_4_L(); + /** + * Test case function for test case RequestNotify(5) + * See HSPS module test specification + */ + void RequestNotify_5_L(); + /** + * Test case function for test case RequestNotify(6) + * See HSPS module test specification + */ + void RequestNotify_6_L(); + /** + * Test case function for test case SisxInstallation(1) + * See HSPS module test specification + */ + void SisxInstallation_1_L(); + /** + * Test case function for test case NativeInstallation(1) + * See HSPS module test specification + */ + void NativeInstallation_1_L(); + /** + * Test case function for test case SetActivePlugin(1) + * See HSPS module test specification + */ + void SetActivePlugin_1_L(); + /** + * Test case function for test case SetActivePlugin(2) + * See HSPS module test specification + */ + void SetActivePlugin_2_L(); + /** + * Test case function for test case SetActivePlugin(3) + * See HSPS module test specification + */ + void SetActivePlugin_3_L(); + /** + * Test case function for test case SetActivePlugin(4) + * See HSPS module test specification + */ + void SetActivePlugin_4_L(); + /** + * Test case function for test case SetActivePlugin(5) + * See HSPS module test specification + */ + void SetActivePlugin_5_L(); + /** + * Test case function for test case SetActivePlugin(6) + * See HSPS module test specification + */ + void SetActivePlugin_6_L(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + RFs iFileserver; + + }; + +#endif // C_MT_HSPSCONFIGURATIONIF_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsliwlistprinter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsliwlistprinter.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,152 @@ +/* +* 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: Prints liw list to a file. +* +*/ + + +#ifndef _MT_HSPSLIWLISTPRINTER_H_ +#define _MT_HSPSLIWLISTPRINTER_H_ + +// INCLUDES +#include +#include +#include + +// CLASS DECLARATION + +/** + * CHspsLiwListPrinter + */ +NONSHARABLE_CLASS( CHspsLiwListPrinter ) : public CBase + { + +// +// Construction +// + +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CHspsLiwListPrinter(); + + /** + * Two-phased constructor. + */ + static CHspsLiwListPrinter* NewL(); + + /** + * Two-phased constructor. + */ + static CHspsLiwListPrinter* NewLC(); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CHspsLiwListPrinter(); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + +// +// New methods +// +public: + + /** + * Prints LiwGenericParamList to a file. + * The defaultpath is c:\logs\ + additional folder defined by + * KLogFolder. + * + * @param aLiwList A list to be printed. + */ + void PrintLiwListL( CLiwGenericParamList& aLiwList ); + +private: + /** + * Parses the variant type. + * + * @param value Variant to be printed. + */ + void PrintVariantL( TLiwVariant value ); + + /** + * Prints liw map. + * + * @param value Map variant to be printed. + */ + void PrintMapL( TLiwVariant value ); + + /** + * Prints liw string variant. + * + * @param value String variant to be printed. + */ + void PrintStringL( TLiwVariant value ); + + /** + * Prints liw string variant. 8 bit variant. + * + * @param value String variant to be printed. + */ + void PrintString8L( TLiwVariant value ); + + /** + * Prints liw list variant. + * + * @param value List variant to be printed. + */ + void PrintListL( TLiwVariant value ); + + /** + * Appends indentation (delimiters) to the line of text. 8 bit variant. + * + * @param aText text to be printed. + * @param aDepth intendation depth. + * @param aDelim delimiter character or string. + */ + HBufC8* GetFixedText8LC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim ); + + /** + * Appends indentation (delimiters) to the line of text. + * + * @param aText text to be printed. + * @param aDepth intendation depth. + * @param aDelim delimiter character or string. + */ + HBufC* GetFixedTextLC( const TDesC& aText, + const TInt aDepth, + const TDesC& aDelim ); + +// +// Attributes +// + +private: + /** + * Depth level of indentation. + */ + TInt iDepth; + }; + +#endif // _MT_HSPSLIWLISTPRINTER_H_ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3405 @@ +/* +* 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: Implementation of MT_CHSPSConfigurationIf class +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mt_hspsconfigurationif.h" +#include "mt_hspsliwlistprinter.h" +#include "mt_hspsinstallationservice.h" + +#include "liwgenericparam.hrh" + +// get active app conf +#include "mt_hsps_getactiveappconf_1.h" +#include "mt_hsps_getactiveappconf_2.h" +#include "mt_hsps_getactiveappconf_3.h" +// get plugin conf +#include "mt_hsps_getpluginconf_1.h" +#include "mt_hsps_getpluginconf_2.h" +#include "mt_hsps_getpluginconf_3.h" +#include "mt_hsps_getpluginconf_4.h" +#include "mt_hsps_getpluginconf_5.h" +// get plugins +#include "mt_hsps_getplugins_1.h" +#include "mt_hsps_getplugins_2.h" +#include "mt_hsps_getplugins_3.h" +#include "mt_hsps_getplugins_4.h" +#include "mt_hsps_getplugins_5.h" +#include "mt_hsps_getplugins_6.h" +#include "mt_hsps_getplugins_7.h" +// get plugin list +#include "mt_hsps_getpluginlist_1.h" +#include "mt_hsps_getpluginlist_2.h" +#include "mt_hsps_getpluginlist_3.h" +#include "mt_hsps_getpluginlist_4.h" +#include "mt_hsps_getpluginlist_5.h" +#include "mt_hsps_getpluginlist_6.h" +#include "mt_hsps_getpluginlist_7.h" +#include "mt_hsps_getpluginlist_8.h" +// add plugin +#include "mt_hsps_addplugin_1.h" +#include "mt_hsps_addplugin_2.h" +#include "mt_hsps_addplugin_3.h" +#include "mt_hsps_addplugin_4.h" +#include "mt_hsps_addplugin_5.h" +#include "mt_hsps_addplugin_6.h" +#include "mt_hsps_addplugin_7.h" +#include "mt_hsps_addplugin_8.h" +#include "mt_hsps_addplugin_9.h" +#include "mt_hsps_addplugin_10.h" +#include "mt_hsps_addplugin_11.h" +// remove plugin +#include "mt_hsps_removeplugin_1.h" +#include "mt_hsps_removeplugin_2.h" +#include "mt_hsps_removeplugin_3.h" +#include "mt_hsps_removeplugin_4.h" +// set plugin settings +#include "mt_hsps_setpluginsettings_1.h" +#include "mt_hsps_setpluginsettings_2.h" +#include "mt_hsps_setpluginsettings_3.h" +#include "mt_hsps_setpluginsettings_4.h" +#include "mt_hsps_setpluginsettings_5.h" +#include "mt_hsps_setpluginsettings_6.h" +// get plugin setting +#include "mt_hsps_getpluginsettings_1.h" +#include "mt_hsps_getpluginsettings_2.h" +#include "mt_hsps_getpluginsettings_3.h" +// mvoe plugins +#include "mt_hsps_moveplugins_1.h" +#include "mt_hsps_moveplugins_2.h" +#include "mt_hsps_moveplugins_3.h" +#include "mt_hsps_moveplugins_4.h" +#include "mt_hsps_moveplugins_5.h" +#include "mt_hsps_moveplugins_6.h" +// replace plugin +#include "mt_hsps_replaceplugin_1.h" +// get app confs +#include "mt_hsps_getappconfs_1.h" +// set app confs +#include "mt_hsps_setactiveappconf_1.h" +#include "mt_hsps_setactiveappconf_2.h" +#include "mt_hsps_setactiveappconf_3.h" +#include "mt_hsps_setactiveappconf_4.h" +// request notification +#include "mt_hsps_requestnotify_1.h" +#include "mt_hsps_requestnotify_2.h" +#include "mt_hsps_requestnotify_3.h" +#include "mt_hsps_requestnotify_4.h" +#include "mt_hsps_requestnotify_5.h" +#include "mt_hsps_requestnotify_6.h" +// set active plugin +#include "mt_hsps_setactiveplugin_1.h" +#include "mt_hsps_setactiveplugin_2.h" +#include "mt_hsps_setactiveplugin_3.h" +#include "mt_hsps_setactiveplugin_4.h" +#include "mt_hsps_setactiveplugin_5.h" +#include "mt_hsps_setactiveplugin_6.h" + +// ======== LOCAL CONSTANTS ==================================================== + +// Resource files copied by minimal configuration. +_LIT( KMinimalResourceFile1, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\main.xml" ); +_LIT( KMinimalResourceFile2, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml" ); +_LIT( KMinimalResourceFile3, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file" ); +_LIT( KMinimalResourceFile4, "c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg" ); + +// ======== LOCAL FUNCTIONS ==================================================== + +// ======== MEMBER FUNCTIONS =================================================== + +//------------------------------------------------------------------------------ +// Two-phased constructor. +//------------------------------------------------------------------------------ +MT_CHSPSConfigurationIf* MT_CHSPSConfigurationIf::NewL() + { + MT_CHSPSConfigurationIf* self = new( ELeave ) MT_CHSPSConfigurationIf(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +//------------------------------------------------------------------------------ +// Destructor. +//------------------------------------------------------------------------------ +MT_CHSPSConfigurationIf::~MT_CHSPSConfigurationIf() + { + iFileserver.Close(); + } + +//------------------------------------------------------------------------------ +// Constructor +//------------------------------------------------------------------------------ +MT_CHSPSConfigurationIf::MT_CHSPSConfigurationIf() + { + } + +//------------------------------------------------------------------------------ +// Symbian Constructor +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + + User::LeaveIfError( iFileserver.Connect() ); + } + +//------------------------------------------------------------------------------ +// Remove resources from client's private folder +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::ResetClientFolderL() + { + // Remove all resource files from the test client's private folder (files are + // copied back when an application configuration is fecthed) + _LIT( KClientFolder, "c:\\private\\102750f0\\"); + TFileName folderPath; + folderPath.Copy( KClientFolder ); + if( BaflUtils::FolderExists( iFileserver, folderPath ) ) + { + CFileMan* fileMan = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileMan ); + + folderPath.Append( _L("2456\\") ); + if( BaflUtils::FolderExists( iFileserver, folderPath ) ) + { + User::LeaveIfError( fileMan->RmDir( folderPath ) ); + } + + folderPath.Copy( KClientFolder ); + folderPath.Append( _L("271012080\\") ); + if( BaflUtils::FolderExists( iFileserver, folderPath ) ) + { + User::LeaveIfError( fileMan->RmDir( folderPath ) ); + } + + CleanupStack::PopAndDestroy( fileMan ); + } + } + +//------------------------------------------------------------------------------ +// Initialize test case +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetupL() + { + MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( installationService ); + + // Uninstall possible test configurations + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfMinimal ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSMinimalViewConf ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSMinimalWidgetConf ); + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfTypical ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSTypicalView1Conf ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSTypicalView2Conf ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSTypicalWidgetConf ); + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfOperator ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSOperatorViewConf ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSFinnishWidgetConf ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSInstalledWidgetConf ); + + // Remove test configurations from import folder + CFileMan* fileManager = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileManager ); + fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ) ); + fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ); + CleanupStack::PopAndDestroy( fileManager ); + + // Install test configurations + installationService->InstallConfigurationL( KHSPSInstallMinimalRootConf ); + installationService->InstallConfigurationL( KHSPSInstallMinimalViewConf ); + installationService->InstallConfigurationL( KHSPSInstallMinimalWidgetConf ); + installationService->InstallConfigurationL( KHSPSInstallTypicalRootConf ); + installationService->InstallConfigurationL( KHSPSInstallTypicalView1Conf ); + installationService->InstallConfigurationL( KHSPSInstallTypicalView2Conf ); + installationService->InstallConfigurationL( KHSPSInstallTypicalWidgetConf ); + installationService->InstallConfigurationL( KHSPSInstallOperatorRootConf ); + installationService->InstallConfigurationL( KHSPSInstallOperatorViewConf ); + installationService->InstallConfigurationL( KHSPSInstallFinnishWidgetConf ); + + CleanupStack::PopAndDestroy( installationService ); + ResetResources(); + } + +//------------------------------------------------------------------------------ +// Deinitialize test case +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::Teardown() + { + // Detach from HSPS + TRAPD( err, DetachServiceL() ); + // Remove test configuration resource files + TRAP( err, RemoveResourceFilesL( iFileserver ) ); + if ( err != KErrNone ) + { + EUNIT_FAIL_TEST( "Teardown failed." ); + } + } + +//------------------------------------------------------------------------------ +// Prints liw list to a file. +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::PrintReturnValuesL( + CLiwGenericParamList& aOutParamList ) + { + CHspsLiwListPrinter* printer = CHspsLiwListPrinter::NewLC(); + printer->PrintLiwListL( aOutParamList ); + CleanupStack::PopAndDestroy( printer ); + } + +//------------------------------------------------------------------------------ +// Test case: GetActiveAppConf(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetActiveAppConf_1_L() + { + // Pre conditions + //---------------------------------------------------------------- + + // Remove old resources + ResetClientFolderL(); + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_1_ts_1_method, + ( TUint8* )getactiveappconf_1_ts_1_input, + ( TUint8* )getactiveappconf_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_1_ts_2_method, + ( TUint8* )getactiveappconf_1_ts_2_input, + ( TUint8* )getactiveappconf_1_ts_2_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_1_ts_3_method, + ( TUint8* )getactiveappconf_1_ts_3_input, + ( TUint8* )getactiveappconf_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_1_ts_5_method, + ( TUint8* )getactiveappconf_1_ts_5_input, + ( TUint8* )getactiveappconf_1_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // post condition check. + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + ResetResources(); + AddResourceL( KMinimalResourceFile1, 136 ); + AddResourceL( KMinimalResourceFile2, 17 ); + AddResourceL( KMinimalResourceFile3, 17 ); + AddResourceL( KMinimalResourceFile4, 18 ); + CheckResourcesL(); + EUNIT_PRINT( _L8( "post condition check for resource file copy passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetActiveAppConf(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetActiveAppConf_2_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_2_ts_1_method, + ( TUint8* )getactiveappconf_2_ts_1_input, + ( TUint8* )getactiveappconf_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_2_ts_2_method, + ( TUint8* )getactiveappconf_2_ts_2_input, + ( TUint8* )getactiveappconf_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_2_ts_4_method, + ( TUint8* )getactiveappconf_2_ts_4_input, + ( TUint8* )getactiveappconf_2_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetActiveAppConf(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetActiveAppConf_3_L() + { + + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_3_ts_1_method, + ( TUint8* )getactiveappconf_3_ts_1_input, + ( TUint8* )getactiveappconf_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_3_ts_2_method, + ( TUint8* )getactiveappconf_3_ts_2_input, + ( TUint8* )getactiveappconf_3_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )getactiveappconf_3_ts_4_method, + ( TUint8* )getactiveappconf_3_ts_4_input, + ( TUint8* )getactiveappconf_3_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginConf(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginConf_1_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_1_ts_1_method, + ( TUint8* )getpluginconf_1_ts_1_input, + ( TUint8* )getpluginconf_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_1_ts_2_method, + ( TUint8* )getpluginconf_1_ts_2_input, + ( TUint8* )getpluginconf_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_1_ts_3_method, + ( TUint8* )getpluginconf_1_ts_3_input, + ( TUint8* )getpluginconf_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_1_ts_5_method, + ( TUint8* )getpluginconf_1_ts_5_input, + ( TUint8* )getpluginconf_1_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginConf(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginConf_2_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_2_ts_1_method, + ( TUint8* )getpluginconf_2_ts_1_input, + ( TUint8* )getpluginconf_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginConf(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginConf_3_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_3_ts_1_method, + ( TUint8* )getpluginconf_3_ts_1_input, + ( TUint8* )getpluginconf_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginConf(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginConf_4_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_4_ts_1_method, + ( TUint8* )getpluginconf_4_ts_1_input, + ( TUint8* )getpluginconf_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_4_ts_2_method, + ( TUint8* )getpluginconf_4_ts_2_input, + ( TUint8* )getpluginconf_4_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_4_ts_4_method, + ( TUint8* )getpluginconf_4_ts_4_input, + ( TUint8* )getpluginconf_4_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginConf(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginConf_5_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_5_ts_1_method, + ( TUint8* )getpluginconf_5_ts_1_input, + ( TUint8* )getpluginconf_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_5_ts_2_method, + ( TUint8* )getpluginconf_5_ts_2_input, + ( TUint8* )getpluginconf_5_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_5_ts_3_method, + ( TUint8* )getpluginconf_5_ts_3_input, + ( TUint8* )getpluginconf_5_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + EUNIT_PRINT( _L8( "DetachServiceL" ) ); + DetachServiceL(); + EUNIT_PRINT( _L8( "Set KCenrepKeyCheckConf key" ) ); + SetCentralRepositoryKeyL( 100000003, 1 ); + EUNIT_PRINT( _L8( "AttachServiceL" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginconf_5_ts_5_method, + ( TUint8* )getpluginconf_5_ts_5_input, + ( TUint8* )getpluginconf_5_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_1_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_1_ts_1_method, + ( TUint8* )getplugins_1_ts_1_input, + ( TUint8* )getplugins_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_2_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_2_ts_1_method, + ( TUint8* )getplugins_2_ts_1_input, + ( TUint8* )getplugins_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_3_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_3_ts_1_method, + ( TUint8* )getplugins_3_ts_1_input, + ( TUint8* )getplugins_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_4_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_4_ts_1_method, + ( TUint8* )getplugins_4_ts_1_input, + ( TUint8* )getplugins_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_5_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_5_ts_1_method, + ( TUint8* )getplugins_5_ts_1_input, + ( TUint8* )getplugins_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_6_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_6_ts_1_method, + ( TUint8* )getplugins_6_ts_1_input, + ( TUint8* )getplugins_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPlugins(7) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPlugins_7_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getplugins_7_ts_1_method, + ( TUint8* )getplugins_7_ts_1_input, + ( TUint8* )getplugins_7_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_1_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_1_ts_1_method, + ( TUint8* )getpluginlist_1_ts_1_input, + ( TUint8* )getpluginlist_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_2_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_2_ts_1_method, + ( TUint8* )getpluginlist_2_ts_1_input, + ( TUint8* )getpluginlist_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_3_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_3_ts_1_method, + ( TUint8* )getpluginlist_3_ts_1_input, + ( TUint8* )getpluginlist_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_4_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_4_ts_1_method, + ( TUint8* )getpluginlist_4_ts_1_input, + ( TUint8* )getpluginlist_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_5_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_5_ts_1_method, + ( TUint8* )getpluginlist_5_ts_1_input, + ( TUint8* )getpluginlist_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_6_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_6_ts_1_method, + ( TUint8* )getpluginlist_6_ts_1_input, + ( TUint8* )getpluginlist_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(7) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_7_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_7_ts_1_method, + ( TUint8* )getpluginlist_7_ts_1_input, + ( TUint8* )getpluginlist_7_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginList(8) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginList_8_L() + { + + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginlist_8_ts_1_method, + ( TUint8* )getpluginlist_8_ts_1_input, + ( TUint8* )getpluginlist_8_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_1_ts_1_method, + ( TUint8* )addplugin_1_ts_1_input, + ( TUint8* )addplugin_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_1_ts_2_method, + ( TUint8* )addplugin_1_ts_2_input, + ( TUint8* )addplugin_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_1_ts_3_method, + ( TUint8* )addplugin_1_ts_3_input, + ( TUint8* )addplugin_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_1_ts_4_method, + ( TUint8* )addplugin_1_ts_4_input, + ( TUint8* )addplugin_1_ts_4_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_1_ts_5_method, + ( TUint8* )addplugin_1_ts_5_input, + ( TUint8* )addplugin_1_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_2_L() + { + // Pre conditions + //---------------------------------------------------------------- + ResetClientFolderL(); // affects performance testing + + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_2_ts_1_method, + ( TUint8* )addplugin_2_ts_1_input, + ( TUint8* )addplugin_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // post condition check: verify that resources of the application configuration have been copied + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + ResetResources(); + // Typical - Root + AddResourceL( _L("c:\\private\\20000fb1\\536874929\\270513751\\536916240\\1.0\\sources\\root.bmp"), 165450 ); + // Typical - View1 + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\view1.bmp"), 9354 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\hs_logoz.jpg"), 19519 ); + // Typical - View2 + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916242\\1.0\\sources\\view2.bmp"), 183654 ); + // Typical - Widget + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg"), 18179 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp"), 6446 ); + CheckResourcesL( ); + // Minimal - Widget + EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) ); + + // Test step 2 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_2_ts_2_method, + ( TUint8* )addplugin_2_ts_2_input, + ( TUint8* )addplugin_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_2_ts_3_method, + ( TUint8* )addplugin_2_ts_3_input, + ( TUint8* )addplugin_2_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_2_ts_4_method, + ( TUint8* )addplugin_2_ts_4_input, + ( TUint8* )addplugin_2_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_2_ts_5_method, + ( TUint8* )addplugin_2_ts_5_input, + ( TUint8* )addplugin_2_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_3_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_3_ts_1_method, + ( TUint8* )addplugin_3_ts_1_input, + ( TUint8* )addplugin_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_3_ts_2_method, + ( TUint8* )addplugin_3_ts_2_input, + ( TUint8* )addplugin_3_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_4_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_4_ts_1_method, + ( TUint8* )addplugin_4_ts_1_input, + ( TUint8* )addplugin_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_5_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_5_ts_1_method, + ( TUint8* )addplugin_5_ts_1_input, + ( TUint8* )addplugin_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_6_L() + { + // Pre conditions + // Set active configuration to Operator configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Operator" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfOperator ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_6_ts_1_method, + ( TUint8* )addplugin_6_ts_1_input, + ( TUint8* )addplugin_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_6_ts_2_method, + ( TUint8* )addplugin_6_ts_2_input, + ( TUint8* )addplugin_6_ts_2_output ); + ResetResources(); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916273\\1.0\\sources\\dummy.mif"), 4608 ); + CheckResourcesL( ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_6_ts_3_method, + ( TUint8* )addplugin_6_ts_3_input, + ( TUint8* )addplugin_6_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_6_ts_4_method, + ( TUint8* )addplugin_6_ts_4_input, + ( TUint8* )addplugin_6_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_6_ts_5_method, + ( TUint8* )addplugin_6_ts_5_input, + ( TUint8* )addplugin_6_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(7) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_7_L() + { + // Pre conditions + // Set active configuration to Operator configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_7_ts_1_method, + ( TUint8* )addplugin_7_ts_1_input, + ( TUint8* )addplugin_7_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_7_ts_2_method, + ( TUint8* )addplugin_7_ts_2_input, + ( TUint8* )addplugin_7_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_7_ts_3_method, + ( TUint8* )addplugin_7_ts_3_input, + ( TUint8* )addplugin_7_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_7_ts_4_method, + ( TUint8* )addplugin_7_ts_4_input, + ( TUint8* )addplugin_7_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(8) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_8_L() + { + // Pre conditions + //---------------------------------------------------------------- + ResetClientFolderL(); // affects performance testing + + // Active device language is ELangEnglish(=1) + // in \epoc32\RELEASE\WINSCW\udeb\Z\resource\BootData\Languages.txt + + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: add widget with english locale to unlocalized configuration + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_8_ts_1_method, + ( TUint8* )addplugin_8_ts_1_input, + ( TUint8* )addplugin_8_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: get added plugin configuration + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_8_ts_2_method, + ( TUint8* )addplugin_8_ts_2_input, + ( TUint8* )addplugin_8_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // post condition check: verify that resources of the application configuration have been copied + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + // Minimal - Root + // Minimal - View + ResetResources(); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\main.xml"), 136 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\picture.jpeg"), 18 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\resource.file"), 17 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916225\\1.0\\sources\\viewnavigationrules.xml"), 17 ); + // Minimal - Widget + // Typical - View1 + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\view1.bmp"), 9354 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\hs_logoz.jpg"), 19519 ); + // Typical - Widget + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg"), 18179 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp"), 6446 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp"), 6446 ); + CheckResourcesL(); + EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) ); + + // Test step 3: restore configuration by removing the plugin + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_8_ts_3_method, + ( TUint8* )addplugin_8_ts_3_input, + ( TUint8* )addplugin_8_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(9) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_9_L() + { + // Pre conditions + //---------------------------------------------------------------- + ResetClientFolderL(); // affects performance testing + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: add widget with a finnish locale only + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_9_ts_1_method, + ( TUint8* )addplugin_9_ts_1_input, + ( TUint8* )addplugin_9_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: get added plugin configuration + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_9_ts_2_method, + ( TUint8* )addplugin_9_ts_2_input, + ( TUint8* )addplugin_9_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // post condition check: verify that resources of the application configuration have been copied + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + ResetResources(); + // Typical - Root + // Typical - View1 + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\view1.bmp"), 9354 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916241\\1.0\\sources\\hs_logoz.jpg"), 19519 ); + // Typical - View2 + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916242\\1.0\\sources\\view2.bmp"), 183654 ); + // Typical - Widget + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg"), 18179 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp"), 6446 ); + // Typical - Widget + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg"), 18179 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp"), 6446 ); + // Typical - FinnishWidget + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\common.jpg"), 19465 ); + AddResourceL( _L("c:\\private\\20000fb1\\2456\\270513751\\536916274\\1.0\\sources\\localizedbg.jpg"), 1214 ); + CheckResourcesL(); + EUNIT_PRINT( _L8( "post condition check for resource copy passed" ) ); + + // Test step 3: restore configuration by removing the plugin + //---------------------------------------------------------------- + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_9_ts_3_method, + ( TUint8* )addplugin_9_ts_3_input, + ( TUint8* )addplugin_9_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(10) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_10_L() + { + // Pre conditions + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_1_method, + ( TUint8* )addplugin_10_ts_1_input, + ( TUint8* )addplugin_10_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_2_method, + ( TUint8* )addplugin_10_ts_2_input, + ( TUint8* )addplugin_10_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_3_method, + ( TUint8* )addplugin_10_ts_3_input, + ( TUint8* )addplugin_10_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_4_method, + ( TUint8* )addplugin_10_ts_4_input, + ( TUint8* )addplugin_10_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_5_method, + ( TUint8* )addplugin_10_ts_5_input, + ( TUint8* )addplugin_10_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 6" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_6_method, + ( TUint8* )addplugin_10_ts_6_input, + ( TUint8* )addplugin_10_ts_6_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 7" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_7_method, + ( TUint8* )addplugin_10_ts_7_input, + ( TUint8* )addplugin_10_ts_7_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Test step 8" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_10_ts_8_method, + ( TUint8* )addplugin_10_ts_8_input, + ( TUint8* )addplugin_10_ts_8_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: AddPlugin(11) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::AddPlugin_11_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Uninstall Widget Conf #1 + MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( installationService ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSMinimalWidgetConf ); + CleanupStack::PopAndDestroy( installationService ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_11_ts_1_method, + ( TUint8* )addplugin_11_ts_1_input, + ( TUint8* )addplugin_11_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )addplugin_11_ts_2_method, + ( TUint8* )addplugin_11_ts_2_input, + ( TUint8* )addplugin_11_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RemovePlugin(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RemovePlugin_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_1_ts_1_method, + ( TUint8* )removeplugin_1_ts_1_input, + ( TUint8* )removeplugin_1_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_1_ts_2_method, + ( TUint8* )removeplugin_1_ts_2_input, + ( TUint8* )removeplugin_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RemovePlugin(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RemovePlugin_2_L() + { + // Pre conditions + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_2_ts_1_method, + ( TUint8* )removeplugin_2_ts_1_input, + ( TUint8* )removeplugin_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_2_ts_2_method, + ( TUint8* )removeplugin_2_ts_2_input, + ( TUint8* )removeplugin_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_2_ts_3_method, + ( TUint8* )removeplugin_2_ts_3_input, + ( TUint8* )removeplugin_2_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_2_ts_4_method, + ( TUint8* )removeplugin_2_ts_4_input, + ( TUint8* )removeplugin_2_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_2_ts_5_method, + ( TUint8* )removeplugin_2_ts_5_input, + ( TUint8* )removeplugin_2_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RemovePlugin(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RemovePlugin_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_3_ts_1_method, + ( TUint8* )removeplugin_3_ts_1_input, + ( TUint8* )removeplugin_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_3_ts_2_method, + ( TUint8* )removeplugin_3_ts_2_input, + ( TUint8* )removeplugin_3_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RemovePlugin(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RemovePlugin_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_4_ts_1_method, + ( TUint8* )removeplugin_4_ts_1_input, + ( TUint8* )removeplugin_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )removeplugin_4_ts_2_method, + ( TUint8* )removeplugin_4_ts_2_input, + ( TUint8* )removeplugin_4_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_1_ts_1_method, + ( TUint8* )setpluginsettings_1_ts_1_input, + ( TUint8* )setpluginsettings_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_1_ts_2_method, + ( TUint8* )setpluginsettings_1_ts_2_input, + ( TUint8* )setpluginsettings_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_1_ts_3_method, + ( TUint8* )setpluginsettings_1_ts_3_input, + ( TUint8* )setpluginsettings_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_2_ts_1_method, + ( TUint8* )setpluginsettings_2_ts_1_input, + ( TUint8* )setpluginsettings_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_2_ts_2_method, + ( TUint8* )setpluginsettings_2_ts_2_input, + ( TUint8* )setpluginsettings_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_2_ts_3_method, + ( TUint8* )setpluginsettings_2_ts_3_input, + ( TUint8* )setpluginsettings_2_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_3_ts_1_method, + ( TUint8* )setpluginsettings_3_ts_1_input, + ( TUint8* )setpluginsettings_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_4_ts_1_method, + ( TUint8* )setpluginsettings_4_ts_1_input, + ( TUint8* )setpluginsettings_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_5_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_5_ts_1_method, + ( TUint8* )setpluginsettings_5_ts_1_input, + ( TUint8* )setpluginsettings_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetPluginSettings(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetPluginSettings_6_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setpluginsettings_6_ts_1_method, + ( TUint8* )setpluginsettings_6_ts_1_input, + ( TUint8* )setpluginsettings_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginSettings(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginSettings_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginsettings_1_ts_1_method, + ( TUint8* )getpluginsettings_1_ts_1_input, + ( TUint8* )getpluginsettings_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginSettings(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginSettings_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginsettings_2_ts_1_method, + ( TUint8* )getpluginsettings_2_ts_1_input, + ( TUint8* )getpluginsettings_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetPluginSettings(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetPluginSettings_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getpluginsettings_3_ts_1_method, + ( TUint8* )getpluginsettings_3_ts_1_input, + ( TUint8* )getpluginsettings_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_1_ts_1_method, + ( TUint8* )moveplugins_1_ts_1_input, + ( TUint8* )moveplugins_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_1_ts_2_method, + ( TUint8* )moveplugins_1_ts_2_input, + ( TUint8* )moveplugins_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_1_ts_3_method, + ( TUint8* )moveplugins_1_ts_3_input, + ( TUint8* )moveplugins_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_1_ts_4_method, + ( TUint8* )moveplugins_1_ts_4_input, + ( TUint8* )moveplugins_1_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_2_ts_1_method, + ( TUint8* )moveplugins_2_ts_1_input, + ( TUint8* )moveplugins_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_3_ts_1_method, + ( TUint8* )moveplugins_3_ts_1_input, + ( TUint8* )moveplugins_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_4_ts_1_method, + ( TUint8* )moveplugins_4_ts_1_input, + ( TUint8* )moveplugins_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_5_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_5_ts_1_method, + ( TUint8* )moveplugins_5_ts_1_input, + ( TUint8* )moveplugins_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: MovePlugins(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::MovePlugins_6_L() + { + // Pre conditions + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_6_ts_1_method, + ( TUint8* )moveplugins_6_ts_1_input, + ( TUint8* )moveplugins_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_6_ts_2_method, + ( TUint8* )moveplugins_6_ts_2_input, + ( TUint8* )moveplugins_6_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_6_ts_3_method, + ( TUint8* )moveplugins_6_ts_3_input, + ( TUint8* )moveplugins_6_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_6_ts_4_method, + ( TUint8* )moveplugins_6_ts_4_input, + ( TUint8* )moveplugins_6_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )moveplugins_6_ts_5_method, + ( TUint8* )moveplugins_6_ts_5_input, + ( TUint8* )moveplugins_6_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: ReplacePlugin_1_L(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::ReplacePlugin_1_L() + { + // Pre conditions + + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: active configuration is Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_1_method, + ( TUint8* )replaceplugin_1_ts_1_input, + ( TUint8* )replaceplugin_1_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_2_method, + ( TUint8* )replaceplugin_1_ts_2_input, + ( TUint8* )replaceplugin_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 3 + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_3_method, + ( TUint8* )replaceplugin_1_ts_3_input, + ( TUint8* )replaceplugin_1_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 4 + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_4_method, + ( TUint8* )replaceplugin_1_ts_4_input, + ( TUint8* )replaceplugin_1_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 5 + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_5_method, + ( TUint8* )replaceplugin_1_ts_5_input, + ( TUint8* )replaceplugin_1_ts_5_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 6 + EUNIT_PRINT( _L8( "Test step 6" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_6_method, + ( TUint8* )replaceplugin_1_ts_6_input, + ( TUint8* )replaceplugin_1_ts_6_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 7 + EUNIT_PRINT( _L8( "Test step 7" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_7_method, + ( TUint8* )replaceplugin_1_ts_7_input, + ( TUint8* )replaceplugin_1_ts_7_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 8 + EUNIT_PRINT( _L8( "Test step 8" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_8_method, + ( TUint8* )replaceplugin_1_ts_8_input, + ( TUint8* )replaceplugin_1_ts_8_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 9 + EUNIT_PRINT( _L8( "Test step 9" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_9_method, + ( TUint8* )replaceplugin_1_ts_9_input, + ( TUint8* )replaceplugin_1_ts_9_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Make sure resources of the typical-widget are removed + // from client's private folder, should be restored in next step + if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg" ) ) + || BaflUtils::FileExists( iFileserver, _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp" ) ) ) + { + CFileMan* fileManager = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileManager ); + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg" ) ) ); + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp" ) ) ); + CleanupStack::PopAndDestroy( fileManager ); + if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg" )) + || BaflUtils::FileExists( iFileserver, _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp" ) ) ) + { + User::Leave( KErrGeneral ); + } + } + + // Test step 10 + EUNIT_PRINT( _L8( "Test step 10" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_10_method, + ( TUint8* )replaceplugin_1_ts_10_input, + ( TUint8* )replaceplugin_1_ts_10_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 11 + EUNIT_PRINT( _L8( "Test step 11" ) ); + RunTestStepSyncL( + ( TUint8* )replaceplugin_1_ts_11_method, + ( TUint8* )replaceplugin_1_ts_11_input, + ( TUint8* )replaceplugin_1_ts_11_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "post condition check for resource file copy" ) ); + ResetResources(); + AddResourceL( _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\hs_logo.jpg" ), 18179 ); + AddResourceL( _L( "c:\\private\\20000fb1\\2456\\270513751\\536916256\\1.0\\sources\\widget.bmp" ), 6446 ); + CheckResourcesL(); + EUNIT_PRINT( _L8( "post condition check for resource file copy passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: GetAppConfs(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::GetAppConfs_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )getappconfs_1_ts_1_method, + ( TUint8* )getappconfs_1_ts_1_input, + ( TUint8* )getappconfs_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActiveAppConf(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActiveAppConf_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveappconf_1_ts_1_method, + ( TUint8* )setactiveappconf_1_ts_1_input, + ( TUint8* )setactiveappconf_1_ts_1_output, + ETrue ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveappconf_1_ts_2_method, + ( TUint8* )setactiveappconf_1_ts_2_input, + ( TUint8* )setactiveappconf_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActiveAppConf(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActiveAppConf_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveappconf_2_ts_1_method, + ( TUint8* )setactiveappconf_2_ts_1_input, + ( TUint8* )setactiveappconf_2_ts_1_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + + RunTestStepSyncL( + ( TUint8* )setactiveappconf_2_ts_2_method, + ( TUint8* )setactiveappconf_2_ts_2_input, + ( TUint8* )setactiveappconf_2_ts_2_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActiveAppConf(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActiveAppConf_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveappconf_3_ts_1_method, + ( TUint8* )setactiveappconf_3_ts_1_input, + ( TUint8* )setactiveappconf_3_ts_1_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + + RunTestStepSyncL( + ( TUint8* )setactiveappconf_3_ts_2_method, + ( TUint8* )setactiveappconf_3_ts_2_input, + ( TUint8* )setactiveappconf_3_ts_2_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActiveAppConf(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActiveAppConf_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveappconf_4_ts_1_method, + ( TUint8* )setactiveappconf_4_ts_1_input, + ( TUint8* )setactiveappconf_4_ts_1_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + + RunTestStepSyncL( + ( TUint8* )setactiveappconf_4_ts_2_method, + ( TUint8* )setactiveappconf_4_ts_2_input, + ( TUint8* )setactiveappconf_4_ts_2_output ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_1_ts_1_method, + ( TUint8* )requestnotify_1_ts_1_input, + ( TUint8* )requestnotify_1_ts_1_output, + ( TInt ) requestnotify_1_ts_1_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_2_ts_1_method, + ( TUint8* )requestnotify_2_ts_1_input, + ( TUint8* )requestnotify_2_ts_1_output, + ( TInt ) requestnotify_2_ts_1_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_3_ts_1_method, + ( TUint8* )requestnotify_3_ts_1_input, + ( TUint8* )requestnotify_3_ts_1_output, + ( TInt ) requestnotify_3_ts_1_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_4_ts_1_method, + ( TUint8* )requestnotify_4_ts_1_input, + ( TUint8* )requestnotify_4_ts_1_output, + ( TInt ) requestnotify_4_ts_1_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_4_ts_2_method, + ( TUint8* )requestnotify_4_ts_2_input, + ( TUint8* )requestnotify_4_ts_2_output, + ( TInt ) requestnotify_4_ts_2_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_5_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_5_ts_1_method, + ( TUint8* )requestnotify_5_ts_1_input, + ( TUint8* )requestnotify_5_ts_1_output, + ( TInt ) requestnotify_5_ts_1_trigger ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: RequestNotify(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::RequestNotify_6_L() + { + // Pre conditions + // Set active configuration to Minimal configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Test step 1: install a SISX package and check output from received notifiction + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_6_ts_1_method, + ( TUint8* )requestnotify_6_ts_1_input, + ( TUint8* )requestnotify_6_ts_1_output, + ( TInt ) requestnotify_6_ts_1_trigger ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: update the SISX package and check output from received notifiction + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_6_ts_2_method, + ( TUint8* )requestnotify_6_ts_2_input, + ( TUint8* )requestnotify_6_ts_2_output, + ( TInt ) requestnotify_6_ts_2_trigger ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Attach to HSPS, get active app configuration which generates full application configuration with IDs + EUNIT_PRINT( _L8( "Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 3: add the installed v2 plugin to 1st view in the Minimal root configuration + EUNIT_PRINT( _L8( "Test step 3" ) ); + RunTestStepSyncL( + ( TUint8* )requestnotify_6_ts_3_method, + ( TUint8* )requestnotify_6_ts_3_input, + ( TUint8* )requestnotify_6_ts_3_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Detach so that the next Typical app configuration gets read + TRAP_IGNORE( DetachServiceL() ); + + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + + // Attach to HSPS, get active app configuration which generates full application configuration with IDs + EUNIT_PRINT( _L8( "Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 4: add the installed v2 plugin to 1st view in the Typical root configuration + EUNIT_PRINT( _L8( "Test step 4" ) ); + RunTestStepSyncL( + ( TUint8* )requestnotify_6_ts_4_method, + ( TUint8* )requestnotify_6_ts_4_input, + ( TUint8* )requestnotify_6_ts_4_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + TRAP_IGNORE( DetachServiceL() ); + + // Test step 5: uninstall the SISX package and check output from received notification + EUNIT_PRINT( _L8( "Test step 5" ) ); + RunTestStepAsyncL( + ( TUint8* )requestnotify_6_ts_5_method, + ( TUint8* )requestnotify_6_ts_5_input, + ( TUint8* )requestnotify_6_ts_5_output, + ( TInt ) requestnotify_6_ts_5_trigger ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + EUNIT_PRINT( _L8( "Set Active configuration Minimal" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfMinimal ); + + // Attach to HSPS, get active app configuration which generates full application configuration with IDs + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 6: get plugin conf from the plugin instance in the Minimal root configuration + EUNIT_PRINT( _L8( "Test step 6" ) ); + RunTestStepSyncL( + ( TUint8* )requestnotify_6_ts_6_method, + ( TUint8* )requestnotify_6_ts_6_input, + ( TUint8* )requestnotify_6_ts_6_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SisxInstallation(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SisxInstallation_1_L() + { + // Pre conditions + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: + EUNIT_PRINT( _L8( "Test step 1: simulate installation of a SISX package" ) ); + + CFileMan* fileManager = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileManager ); + + // Copy installation files to c\private\200159c0\import + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\0\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\0\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\1\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\1\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\9\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\9\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\manifest.dat" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\plugin_0998_101FB657_2000B133_1.0.dat" ), + _L( "c:\\private\\200159c0\\import\\" ), + CFileMan::EOverWrite ) ); + + // Wait until configuration is installed + User::After( 5000000 ); + + // Make sure "InstalledWidget" is installed + if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + User::Leave( KErrGeneral ); + } + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: + EUNIT_PRINT( _L8( "Test step 2: simulate un-installation of the SISX package" ) ); + + // Remove installation files from c\private\200159c0\import + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ), + 0, + KEntryAttReadOnly, + TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + // Removing of *.dat file causes configuration uninstallation + // Wait until configuration is uninstalled + User::After( 5000000 ); + + // Make sure "InstalledWidget" is uninstalled + if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + User::Leave( KErrGeneral ); + } + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + + CleanupStack::PopAndDestroy( fileManager ); + } + +//------------------------------------------------------------------------------ +// Test case: NativeInstallation(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::NativeInstallation_1_L() + { + // Pre conditions + _LIT(KFileThemes, "c:\\private\\200159C0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000"); + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( installationService ); + + // Test step 1: + EUNIT_PRINT( _L8( "Test step 1" ) ); + installationService->InstallConfigurationL( KHSPSInstallInstalledWidgetConf ); + if ( !BaflUtils::FileExists( iFileserver, KFileThemes) ) + { + User::Leave( KErrGeneral ); + } + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: + EUNIT_PRINT( _L8( "Test step 2" ) ); + installationService->UninstallConfigurationL( KHSPSMTInterfaceUid, KHSPSInstalledWidgetConf ); + if ( BaflUtils::FileExists( iFileserver, KFileThemes) ) + { + User::Leave( KErrGeneral ); + } + EUNIT_PRINT( _L8( "Test step passed" ) ); + + CleanupStack::PopAndDestroy( installationService ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_1_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_1_ts_1_method, + ( TUint8* )setactiveplugin_1_ts_1_input, + ( TUint8* )setactiveplugin_1_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_1_ts_2_method, + ( TUint8* )setactiveplugin_1_ts_2_input, + ( TUint8* )setactiveplugin_1_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(2) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_2_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_2_ts_1_method, + ( TUint8* )setactiveplugin_2_ts_1_input, + ( TUint8* )setactiveplugin_2_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_2_ts_2_method, + ( TUint8* )setactiveplugin_2_ts_2_input, + ( TUint8* )setactiveplugin_2_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(3) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_3_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_3_ts_1_method, + ( TUint8* )setactiveplugin_3_ts_1_input, + ( TUint8* )setactiveplugin_3_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_3_ts_2_method, + ( TUint8* )setactiveplugin_3_ts_2_input, + ( TUint8* )setactiveplugin_3_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(4) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_4_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_4_ts_1_method, + ( TUint8* )setactiveplugin_4_ts_1_input, + ( TUint8* )setactiveplugin_4_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2 + EUNIT_PRINT( _L8( "Test step 2" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_4_ts_2_method, + ( TUint8* )setactiveplugin_4_ts_2_input, + ( TUint8* )setactiveplugin_4_ts_2_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(5) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_5_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_5_ts_1_method, + ( TUint8* )setactiveplugin_5_ts_1_input, + ( TUint8* )setactiveplugin_5_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case: SetActivePlugin(6) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SetActivePlugin_6_L() + { + // Pre conditions + // Set active configuration to Typical configuration + EUNIT_PRINT( _L8( "Pre conditions: Set Active configuration Typical" ) ); + SetActiveConfigurationL( KHSPSTestAppUid, KHSPSActiveConfTypical ); + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1 + EUNIT_PRINT( _L8( "Test step 1" ) ); + RunTestStepSyncL( + ( TUint8* )setactiveplugin_6_ts_1_method, + ( TUint8* )setactiveplugin_6_ts_1_input, + ( TUint8* )setactiveplugin_6_ts_1_output ); + EUNIT_PRINT( _L8( "Test step passed" ) ); + } + +//------------------------------------------------------------------------------ +// Test case table +//------------------------------------------------------------------------------ +EUNIT_BEGIN_TEST_TABLE( + MT_CHSPSConfigurationIf, + "This is a test suite for HSPS configuration interface.", + "UNIT" ) + + // Get configuration test group + EUNIT_TEST( + "GetActiveAppConf(1)", + "IConfiguration", + "GetActiveAppConf", + "FUNCTIONALITY", + SetupL, GetActiveAppConf_1_L, Teardown ) + + EUNIT_TEST( + "GetActiveAppConf(2)", + "IConfiguration", + "GetActiveAppConf", + "FUNCTIONALITY", + SetupL, GetActiveAppConf_2_L, Teardown ) + + EUNIT_TEST( + "GetActiveAppConf(3)", + "IConfiguration", + "GetActiveAppConf", + "FUNCTIONALITY", + SetupL, GetActiveAppConf_3_L, Teardown ) + + EUNIT_TEST( + "GetPluginConf(1)", + "IConfiguration", + "GetPluginConf", + "FUNCTIONALITY", + SetupL, GetPluginConf_1_L, Teardown ) + + EUNIT_TEST( + "GetPluginConf(2)", + "IConfiguration", + "GetPluginConf", + "FUNCTIONALITY", + SetupL, GetPluginConf_2_L, Teardown ) + + EUNIT_TEST( + "GetPluginConf(3)", + "IConfiguration", + "GetPluginConf", + "FUNCTIONALITY", + SetupL, GetPluginConf_3_L, Teardown ) + + EUNIT_TEST( + "GetPluginConf(4)", + "IConfiguration", + "GetPluginConf", + "FUNCTIONALITY", + SetupL, GetPluginConf_4_L, Teardown ) + + EUNIT_TEST( + "GetPluginConf(5)", + "IConfiguration", + "GetPluginConf", + "FUNCTIONALITY", + SetupL, GetPluginConf_5_L, Teardown ) + + // Modify Configuration test group + EUNIT_TEST( + "GetPlugins(1)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_1_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(2)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_2_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(3)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_3_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(4)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_4_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(5)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_5_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(6)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_6_L, Teardown ) + + EUNIT_TEST( + "GetPlugins(7)", + "IConfiguration", + "GetPlugins", + "FUNCTIONALITY", + SetupL, GetPlugins_7_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(1)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_1_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(2)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_2_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(3)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_3_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(4)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_4_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(5)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_5_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(6)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_6_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(7)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_7_L, Teardown ) + + EUNIT_TEST( + "GetPluginList(8)", + "IConfiguration", + "GetPluginList", + "FUNCTIONALITY", + SetupL, GetPluginList_8_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(1)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_1_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(2)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_2_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(3)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_3_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(4)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_4_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(5)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_5_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(6)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_6_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(7)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_7_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(8)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_8_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(9)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_9_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(10)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_10_L, Teardown ) + + EUNIT_TEST( + "AddPlugin(11)", + "IConfiguration", + "AddPlugin", + "FUNCTIONALITY", + SetupL, AddPlugin_11_L, Teardown ) + + EUNIT_TEST( + "RemovePlugin(1)", + "IConfiguration", + "RemovePlugin", + "FUNCTIONALITY", + SetupL, RemovePlugin_1_L, Teardown ) + + EUNIT_TEST( + "RemovePlugin(2)", + "IConfiguration", + "RemovePlugin", + "FUNCTIONALITY", + SetupL, RemovePlugin_2_L, Teardown ) + + EUNIT_TEST( + "RemovePlugin(3)", + "IConfiguration", + "RemovePlugin", + "FUNCTIONALITY", + SetupL, RemovePlugin_3_L, Teardown ) + + EUNIT_TEST( + "RemovePlugin(4)", + "IConfiguration", + "RemovePlugin", + "FUNCTIONALITY", + SetupL, RemovePlugin_4_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(1)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_1_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(2)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_2_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(3)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_3_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(4)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_4_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(5)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_5_L, Teardown ) + + EUNIT_TEST( + "SetPluginSettings(6)", + "IConfiguration", + "SetPluginSettings", + "FUNCTIONALITY", + SetupL, SetPluginSettings_6_L, Teardown ) + + EUNIT_TEST( + "GetPluginSettings(1)", + "IConfiguration", + "GetPluginSettings", + "FUNCTIONALITY", + SetupL, GetPluginSettings_1_L, Teardown ) + + EUNIT_TEST( + "GetPluginSettings(2)", + "IConfiguration", + "GetPluginSettings", + "FUNCTIONALITY", + SetupL, GetPluginSettings_2_L, Teardown ) + + EUNIT_TEST( + "GetPluginSettings(3)", + "IConfiguration", + "GetPluginSettings", + "FUNCTIONALITY", + SetupL, GetPluginSettings_3_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(1)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_1_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(2)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_2_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(3)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_3_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(4)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_4_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(5)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_5_L, Teardown ) + + EUNIT_TEST( + "MovePlugins(6)", + "IConfiguration", + "MovePlugins", + "FUNCTIONALITY", + SetupL, MovePlugins_6_L, Teardown ) + + EUNIT_TEST( + "ReplacePlugin(1)", + "IConfiguration", + "ReplacePlugin", + "FUNCTIONALITY", + SetupL, ReplacePlugin_1_L, Teardown ) + + EUNIT_TEST( + "GetAppConfs(1)", + "IConfiguration", + "GetAppConfs", + "FUNCTIONALITY", + SetupL, GetAppConfs_1_L, Teardown ) + + EUNIT_TEST( + "SetActiveAppConf(1)", + "IConfiguration", + "SetActiveAppConf", + "FUNCTIONALITY", + SetupL, SetActiveAppConf_1_L, Teardown ) + + EUNIT_TEST( + "SetActiveAppConf(2)", + "IConfiguration", + "SetActiveAppConf", + "FUNCTIONALITY", + SetupL, SetActiveAppConf_2_L, Teardown ) + + EUNIT_TEST( + "SetActiveAppConf(3)", + "IConfiguration", + "SetActiveAppConf", + "FUNCTIONALITY", + SetupL, SetActiveAppConf_3_L, Teardown ) + + EUNIT_TEST( + "SetActiveAppConf(4)", + "IConfiguration", + "SetActiveAppConf", + "FUNCTIONALITY", + SetupL, SetActiveAppConf_4_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(1)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_1_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(2)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_2_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(3)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_3_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(4)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_4_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(5)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_5_L, Teardown ) + + EUNIT_TEST( + "RequestNotify(6)", + "IConfiguration", + "RequestNotify", + "FUNCTIONALITY", + SetupL, RequestNotify_6_L, Teardown ) + + EUNIT_TEST( + "SisxInstallation(1)", + "IConfiguration", + "SisxInstallation", + "FUNCTIONALITY", + SetupL, SisxInstallation_1_L, Teardown ) + + EUNIT_TEST( + "NativeInstallation(1)", + "IConfiguration", + "NativeInstallation", + "FUNCTIONALITY", + SetupL, NativeInstallation_1_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(1)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_1_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(2)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_2_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(3)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_3_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(4)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_4_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(5)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_5_L, Teardown ) + + EUNIT_TEST( + "SetActivePlugin(6)", + "IConfiguration", + "SetActivePlugin", + "FUNCTIONALITY", + SetupL, SetActivePlugin_6_L, Teardown ) + + EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif_dllmain.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* 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: Test suite creation +* +*/ + + +#include + +#include "mt_hspsconfigurationif.h" + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return MT_CHSPSConfigurationIf::NewL(); + } + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsliwlistprinter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsliwlistprinter.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,249 @@ +/* +* 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: Prints liw list to a file. +* +*/ + + +#include +#include + +#include "mt_hspsliwlistprinter.h" + + +// File logging macros +// filename +_LIT(KLog,"printliw.log"); +// additional path +_LIT(KLogFolder,"hspsprintdom"); +#define _LOGT(aDescription) RFileLogger::Write( KLogFolder, KLog, EFileLoggingModeOverwrite, aDescription ); +#define _LOGTFRM1(a,b) RFileLogger::WriteFormat( KLogFolder, KLog, EFileLoggingModeOverwrite, (a), (b) ) +#define _LOGTFRM2(a,b,c) RFileLogger::WriteFormat( KLogFolder, KLog, EFileLoggingModeOverwrite, (a),(b),(c) ); +#define _LOGTFRM3(a,b,c,d) RFileLogger::WriteFormat( KLogFolder, KLog, EFileLoggingModeOverwrite, (a),(b),(c),(d) ); +// indentation delimiter +_LIT8(KDelim8, "\t" ); +_LIT(KDelim, "\t" ); + +//------------------------------------------------------------------------------ +// Constuctor +//------------------------------------------------------------------------------ +CHspsLiwListPrinter::CHspsLiwListPrinter() + { + iDepth = 0; + } + +//------------------------------------------------------------------------------ +// Destructor +//------------------------------------------------------------------------------ +CHspsLiwListPrinter::~CHspsLiwListPrinter() + { + } + +//------------------------------------------------------------------------------ +// Symbian constructor +//------------------------------------------------------------------------------ +CHspsLiwListPrinter* CHspsLiwListPrinter::NewLC() + { + CHspsLiwListPrinter* self = new (ELeave)CHspsLiwListPrinter(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +//------------------------------------------------------------------------------ +// Symbian constructor +//------------------------------------------------------------------------------ +CHspsLiwListPrinter* CHspsLiwListPrinter::NewL() + { + CHspsLiwListPrinter* self=CHspsLiwListPrinter::NewLC(); + CleanupStack::Pop( self ); // self; + return self; + } + +//------------------------------------------------------------------------------ +// 2nd tier constructor +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::ConstructL() + { + } + +//------------------------------------------------------------------------------ +// Prints liw list to a file. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintLiwListL( CLiwGenericParamList& aLiwList ) + { + // implementation for GetActiveAppConf and GetPluginConf that has map + // as base root. + iDepth = 0; + TInt count = aLiwList.Count(); + for( TInt i = 0; i < count; i++ ) + { + //get Generic param and check for param id and name. + TLiwGenericParam param = aLiwList[i]; + //Check for the param identifier: + LIW::TGenericParamId identifier = param.SemanticId(); + //print semanticId: + _LOGTFRM1(_L8(" SemanticId: %d"), identifier ); + if( identifier == LIW::EGenericParamError ) + { + _LOGT(_L8(" ERROR: EGenericParamError") ); + } + //get generic param name. + //print name. + _LOGT( param.Name() ); + //get Variant + TLiwVariant value = param.Value(); + //get variant type. + PrintVariantL( value ); + } + } + +//------------------------------------------------------------------------------ +// Parses variant type for printing. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintVariantL( TLiwVariant value ) + { + LIW::TVariantTypeId variantId = value.TypeId(); + if( variantId == LIW::EVariantTypeDesC8 ) + { + PrintString8L( value ); + } + else if( variantId == LIW::EVariantTypeDesC ) + { + PrintStringL( value ); + } + else if ( variantId == LIW::EVariantTypeMap ) + { + HBufC* text = GetFixedTextLC( _L(""), iDepth, KDelim ); + _LOGT( *text ); + CleanupStack::PopAndDestroy( text ); + PrintMapL( value ); + } + else if ( variantId == LIW::EVariantTypeList ) + { + HBufC* text = GetFixedTextLC( _L(""), iDepth, KDelim ); + _LOGT( *text ); + CleanupStack::PopAndDestroy( text ); + PrintListL( value ); + } + else + { + _LOGT(_L8("--- TODO: Unknown --- ")); + } + } + +//------------------------------------------------------------------------------ +// Prints map type variant. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintMapL( TLiwVariant value ) + { + //get map from the variant. + //get map values. + const CLiwMap* map = value.AsMap(); + TInt count = map->Count(); + for( TInt i = 0; i < count; i++ ) + { + HBufC* index = GetFixedTextLC( _L("---"), iDepth, KDelim ); + _LOGT( *index ); + CleanupStack::PopAndDestroy( index ); + TBuf8<100> buf; //TODO: bad solution... + map->AtL( i, buf); + HBufC8* text = GetFixedText8LC( buf, iDepth, KDelim8 ); + _LOGT( *text ); + CleanupStack::PopAndDestroy( text ); + TLiwVariant value; + map->FindL( buf, value ); + PrintVariantL( value ); + value.Reset(); + } + } + +//------------------------------------------------------------------------------ +// Prints string type variant. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintStringL( TLiwVariant value ) + { + TPtrC textValue = value.AsDes(); + HBufC* text = GetFixedTextLC( textValue, iDepth, KDelim ); + _LOGT( *text ); + CleanupStack::PopAndDestroy( text ); + } + +//------------------------------------------------------------------------------ +// Prints string type variant. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintString8L( TLiwVariant value ) + { + TPtrC8 textValue = value.AsData(); + HBufC8* text = GetFixedText8LC( textValue, iDepth, KDelim8 ); + _LOGT( *text ); + CleanupStack::PopAndDestroy( text ); + } + +//------------------------------------------------------------------------------ +// Prints list type variant. +//------------------------------------------------------------------------------ +void CHspsLiwListPrinter::PrintListL( TLiwVariant value ) + { + iDepth++; + const CLiwList* list = value.AsList(); + TInt count = list->Count(); + for( TInt i = 0; i < count; i++ ) + { + HBufC* index = GetFixedTextLC( _L("---"), iDepth, KDelim ); + _LOGT( *index ); + CleanupStack::PopAndDestroy( index ); + TLiwVariant value; + list->AtL( i, value ); + PrintVariantL( value ); + value.Reset(); + } + iDepth--; + } + +//------------------------------------------------------------------------------ +// Utility method for generating a custom text descriptor. +// Adds indentation to a text string. 8 bit variant. +//------------------------------------------------------------------------------ +HBufC8* CHspsLiwListPrinter::GetFixedText8LC( const TDesC8& aText, + const TInt aDepth, + const TDesC8& aDelim ) + { + HBufC8 *buf = HBufC8::NewLC( aDepth * aDelim.Length() + aText.Length() + 1 ); + TInt i = 0; + for( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + buf->Des().Append( aText ); + return buf; + } + +//------------------------------------------------------------------------------ +// Debug utility for generating a custom text descriptor. +// Adds indentation to a text string. 8 bit variant. +//------------------------------------------------------------------------------ +HBufC* CHspsLiwListPrinter::GetFixedTextLC( const TDesC& aText, + const TInt aDepth, + const TDesC& aDelim ) + { + HBufC *buf = HBufC::NewLC( aDepth * aDelim.Length() + aText.Length() + 1 ); + TInt i = 0; + for( ; i < aDepth; i++ ) + { + buf->Des().Append( aDelim ); + } + buf->Des().Append( aText ); + return buf; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/bwins/mt_hspsprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/bwins/mt_hspsprovideru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?NewL@MT_CHspsInstallationService@@SAPAV1@XZ @ 2 NONAME ; class MT_CHspsInstallationService * MT_CHspsInstallationService::NewL(void) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/eabi/mt_hspsprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/eabi/mt_hspsprovideru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,8 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _ZN27MT_CHspsInstallationService4NewLEv @ 2 NONAME + _ZTI16MT_CHSPSResource @ 3 NONAME ; ## + _ZTI27MT_CHspsInstallationService @ 4 NONAME ; ## + _ZTV16MT_CHSPSResource @ 5 NONAME ; ## + _ZTV27MT_CHspsInstallationService @ 6 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ +/* +* 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: Build information file for HSPS SAPI provider module testing +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +mt_hspsprovider.mmp + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/group/mt_hspsprovider.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: Project definition file for HSPS SAPI provider module testing +* +*/ + + +#include +#include "../../../inc/hsps_log_cfg.hrh" + +TARGET mt_hspsprovider.dll +TARGETTYPE dll +UID 0x1000af5a 0x01700000 + +CAPABILITY ALL -TCB -DRM + +VENDORID 0x00000000 + +SOURCEPATH ../src +SOURCE mt_hspsprovider.cpp +SOURCE mt_hspsprovider_dllmain.cpp + +SOURCEPATH ../../common/src +SOURCE mt_hsps.cpp +SOURCE mt_hspsteststep.cpp +SOURCE mt_hspsinstallationservice.cpp + +SOURCEPATH ../../../hspsservice/src +SOURCE hspsserviceutilities.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../common/inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../hspsservice/inc + +// System include folders required by the tested code +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/platform/digia/eunit + +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY eunit.lib +LIBRARY eunitutil.lib +LIBRARY euser.lib +LIBRARY estor.lib +LIBRARY liwservicehandler.lib +LIBRARY centralrepository.lib +LIBRARY hspsservice.lib +LIBRARY hspsclient.lib +LIBRARY hspsodt.lib +LIBRARY hspsresult.lib + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/inc/mt_hspsprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/inc/mt_hspsprovider.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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: Defination of class MT_CHSPSProvider +* +*/ + + +#ifndef C_MT_HSPSPROVIDER_H +#define C_MT_HSPSPROVIDER_H + +#include +#include +#include "mt_hsps.h" + +/** + * This class is a tester class for HSPS SAPI provider +*/ +NONSHARABLE_CLASS( MT_CHSPSProvider ) : public MT_CHSPS + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static MT_CHSPSProvider* NewL(); + /** + * Destructor + */ + virtual ~MT_CHSPSProvider(); + + private: // Constructors and destructors + + MT_CHSPSProvider(); + void ConstructL(); + + private: // New methods + + void SetupL(); + + void TestCase_AttachL(); + + void TestCase_AttachInvalidProviderL(); + + void TestCase_AttachInvalidInterfaceL(); + + void Teardown(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // C_MT_HSPSPROVIDER_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,194 @@ +/* +* 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: Implementation of MT_CHSPSProvider +* +*/ + + +#include +#include + +#include "mt_hspsprovider.h" +#include "mt_hspsinstallationservice.h" + +_LIT8( KInvalidProvider, "Service.Invalid" ); +_LIT8( KHSPSConfigurationService, "IConfiguration" ); +_LIT8( KHSPSInvalidInterface, "IInvalid" ); + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPSProvider* MT_CHSPSProvider::NewL() + { + MT_CHSPSProvider* self = new( ELeave ) MT_CHSPSProvider(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +MT_CHSPSProvider::~MT_CHSPSProvider() + { + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +// +MT_CHSPSProvider::MT_CHSPSProvider() + { + } + +// ----------------------------------------------------------------------------- +// Symbian Constructor +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// Initialize test case +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::SetupL() + { + MT_CHspsInstallationService* installationService = MT_CHspsInstallationService::NewL(); + CleanupStack::PushL( installationService ); + + // Uninstall possible test configurations + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfMinimal ); + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfTypical ); + installationService->UninstallConfigurationL( KHSPSMTAppUid, KHSPSActiveConfOperator ); + + // Install test configurations + installationService->InstallConfigurationL( KHSPSInstallMinimalRootConf ); + installationService->InstallConfigurationL( KHSPSInstallTypicalRootConf ); + installationService->InstallConfigurationL( KHSPSInstallOperatorRootConf ); + + CleanupStack::PopAndDestroy( installationService ); + ResetResources(); + } + +// ----------------------------------------------------------------------------- +// Deinitialize test case +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::Teardown( ) + { + if ( iInterface ) + { + iInterface->Close(); + iInterface = NULL; + } + if ( iServiceHandler && iService ) + { + RCriteriaArray interestList; + interestList.AppendL( iService ); + iServiceHandler->DetachL( interestList ); + interestList.Reset(); + } + if ( iServiceHandler ) + { + delete iServiceHandler; + iServiceHandler = NULL; + } + if ( iService ) + { + delete iService; + iService = NULL; + } + } + +// ----------------------------------------------------------------------------- +// Test case 1: Attach +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::TestCase_AttachL( ) + { + /* Attach to HSPS Configuration interface */ + AttachServiceL( KHSPS, KHSPSConfigurationService, KHSPSTestAppUid, ETrue ); + /* Detach from HSPS */ + DetachServiceL(); + } + +// ----------------------------------------------------------------------------- +// Test case 2: Attach - Invalid provider +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::TestCase_AttachInvalidProviderL( ) + { + /* Attach to Invalid provider */ + TRAPD( err, AttachServiceL( KInvalidProvider, KHSPSConfigurationService, KHSPSTestAppUid ) ); + EUNIT_ASSERT_DESC( err == KErrNotFound, "Attach invalid provider"); + } + +// ----------------------------------------------------------------------------- +// Test case 3: Attach - Invalid interface +// ----------------------------------------------------------------------------- +// +void MT_CHSPSProvider::TestCase_AttachInvalidInterfaceL( ) + { + /* Attach to HSPS */ + TRAPD( err, AttachServiceL( KHSPS, KHSPSInvalidInterface, KHSPSTestAppUid ) ); + EUNIT_ASSERT_DESC( err == KErrNotFound, "Attach invalid interface"); + } + +// ----------------------------------------------------------------------------- +// Test case table +// ----------------------------------------------------------------------------- +// +EUNIT_BEGIN_TEST_TABLE( + MT_CHSPSProvider, + "This is a test suite for HSPS provider.", + "UNIT" ) + +EUNIT_TEST( + "Attach", + "HSPS provider", + "TestCase_AttachL", + "FUNCTIONALITY", + SetupL, TestCase_AttachL, Teardown ) + +EUNIT_TEST( + "Attach - Invalid provider", + "HSPS provider", + "TestCase_AttachInvalidProviderL", + "FUNCTIONALITY", + SetupL, TestCase_AttachInvalidProviderL, Teardown ) + +EUNIT_TEST( + "Attach - Invalid interface", + "HSPS provider", + "TestCase_AttachInvalidInterfaceL", + "FUNCTIONALITY", + SetupL, TestCase_AttachInvalidInterfaceL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider_dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsprovider/src/mt_hspsprovider_dllmain.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* 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: Test suite creation +* +*/ + + +#include + +#include "mt_hspsprovider.h" + +// ======== LOCAL FUNCTIONS ==================================================== + + +// ======== MEMBER FUNCTIONS =================================================== + + +// ----------------------------------------------------------------------------- +// Creates test suite instance +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + return MT_CHSPSProvider::NewL(); + } + +// END OF FILE diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/0/localizedbg.JPG Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/0/localizedbg.JPG has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/9/localizedbg.JPG Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/9/localizedbg.JPG has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/common.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/common.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ + + + + + widget + + + 0998 + + + 101FB657 + + + 2000B132 + + + + + &qtn_2000B132_configuration_name; + FinnishWidget + 1.0 + + + widgetconfiguration.xml + + + locale.dtd + + + common.jpg + + + + localizedbg.jpg + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/finnish_widget/widgetconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/hsps_definition.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/hsps_definition.xsd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/hsps_manifest.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/hsps_manifest.xsd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/hs_logo.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/0/widget.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/hs_logo.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/1/widget.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/hs_logo.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/9/widget.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ + + + + + widget + + + 0998 + + + 101FB657 + + + 2000B133 + + + + + &qtn_2000B133_configuration_name; + InstallWidgetConf + 1.0 + + + widgetconfiguration.xml + + + locale.dtd + + + + hs_logo.jpg + widget.bmp + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/plugin_0998_101FB657_2000B133_1.0.dat diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/installed_widget/widgetconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ + + + + + application + + + 20000FB1 + + + 101FB657 + + + 2000B100 + + + statusmakeactive + + + &qtn_2000B100_configuration_name; + Rootconf1 + 1.0 + + + rootconfiguration.xml + + + locale.dtd + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/rootconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/root/rootconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/main.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/main.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ + + + + view + + + 0998 + + + 101FB657 + + + 2000B101 + + + + + &qtn_2000B101_configuration_name; + ViewConf1 + 1.0 + + + viewconfiguration.xml + + + locale.dtd + + + main.xml + viewnavigationrules.xml + resource.file + picture.jpeg + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/picture.jpeg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/picture.jpeg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1 @@ +background picture \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/resource.file --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/resource.file Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1 @@ +any resource file \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/viewconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/viewnavigationrules.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/view/viewnavigationrules.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2 @@ + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + widget + + + 0998 + + + 101FB657 + + + 2000B102 + + + + + &qtn_2000B102_configuration_name; + WidgetConf1 + 1.0 + + + widgetconfiguration.xml + + + locale.dtd + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/minimalconf/widget/widgetconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/configuration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/configuration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/root/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ + + + + + application + + + 20000FB1 + + + 101FB657 + + + 2000B130 + + + statuslicenceerestorable + statusmakeactive + + + &qtn_2000B130_configuration_name; + operatorroot + 1.0 + + + configuration.xml + + + locale.dtd + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/configuration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/configuration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/dummy.mif Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/dummy.mif has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/operatorconf/view/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + view + + + 0998 + + + 101FB657 + + + 2000B131 + + + + + &qtn_2000B131_configuration_name; + operatorview + 1.0 + &qtn_2000B131_configuration_desc; + mif(dummy.mif 1 2) + + + configuration.xml + + + locale.dtd + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/1/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ + + + + + application + + + 20000FB1 + + + 101FB657 + + + 2000B110 + + + statusmakeactive + + + &qtn_2000B110_configuration_name; + TypicalAppConf + 1.0 + + + rootconfiguration.xml + + + locale.dtd + + + root.bmp + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/root.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/root.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/rootconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/root/rootconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/0/hs_logoz.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/0/hs_logoz.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/1/hs_logoz.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/1/hs_logoz.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/1/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/9/hs_logoz.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/9/hs_logoz.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ + + + + + view + + + 0998 + + + 101FB657 + + + 2000B111 + + + + + &qtn_2000B111_configuration_name; + TypicalViewConf1 + 1.0 + + + viewconfiguration.xml + + + locale.dtd + + + view1.bmp + + + + hs_logoz.jpg + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/view1.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/view1.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view1/viewconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/1/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,29 @@ + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ + + + + + view + + + 0998 + + + 101FB657 + + + 2000B112 + + + + + &qtn_2000B112_configuration_name; + TypicalViewConf2 + 1.0 + + + viewconfiguration.xml + + + locale.dtd + + + view2.bmp + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/view2.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/view2.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/viewconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/view2/viewconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/0/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/0/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/1/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/1/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/9/locale.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/9/locale.dtd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/hs_logo.jpg Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/hs_logo.jpg has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/manifest.dat Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ + + + + + widget + + + 0998 + + + 101FB657 + + + 2000B120 + + + + + &qtn_2000B120_configuration_name; + TypicalWidgetConf + 1.0 + + + widgetconfiguration.xml + + + locale.dtd + + + hs_logo.jpg + widget.bmp + + + + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/widget.bmp Binary file homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/widget.bmp has changed diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/typicalconf/widget/widgetconfiguration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/validate.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/testthemes/validate.cmd Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@ECHO OFF +SETLOCAL + +SET PATH_LINT=C:\Apps\libxml2-2.6.23.win32\bin\xmllint.exe +SET PATH_MANIFEST_XSD=.\common\hsps_manifest.xsd +SET PATH_DEFINITION_XSD=.\common\hsps_definition.xsd + +IF NOT EXIST %PATH_LINT% GOTO ERR_LINT +IF NOT EXIST %PATH_MANIFEST_XSD% GOTO ERR_XSD +IF NOT EXIST %PATH_DEFINITION_XSD% GOTO ERR_XSD + +SET ARGS_MANIFEST=--schema %PATH_MANIFEST_XSD% --noout +SET ARGS_DEFINITION=--schema %PATH_DEFINITION_XSD% --noout +CLS + +SET FOLDER=MinimalConfiguration +echo. +echo Validating %FOLDER% against HSPS schema files... +echo. +%PATH_LINT% .\%FOLDER%\root\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\root\rootconfiguration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\view\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\view\viewconfiguration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\widget\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\widget\widgetconfiguration.xml %ARGS_DEFINITION% + + +SET FOLDER=TypicalConfiguration +echo. +echo. +echo Validating %FOLDER% against HSPS schema files... +echo. +%PATH_LINT% .\%FOLDER%\root\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\root\rootconfiguration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\view1\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\view1\viewconfiguration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\view2\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\view2\viewconfiguration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\widget\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\widget\widgetconfiguration.xml %ARGS_DEFINITION% + + +SET FOLDER=OperatorConfiguration +echo. +echo. +echo Validating %FOLDER% against HSPS schema files... +echo. +%PATH_LINT% .\%FOLDER%\root\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\root\configuration.xml %ARGS_DEFINITION% + +%PATH_LINT% .\%FOLDER%\view\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\view\configuration.xml %ARGS_DEFINITION% + + +SET FOLDER=FinnishWidget +echo. +echo. +echo Validating %FOLDER% against HSPS schema files... +echo. +%PATH_LINT% .\%FOLDER%\widget\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\widget\widgetconfiguration.xml %ARGS_DEFINITION% + + +SET FOLDER=InstalledWidget +echo. +echo. +echo Validating %FOLDER% against HSPS schema files... +echo. +%PATH_LINT% .\%FOLDER%\manifest.dat %ARGS_MANIFEST% +%PATH_LINT% .\%FOLDER%\widgetconfiguration.xml %ARGS_DEFINITION% + + +GOTO END + +:ERR_LINT +ECHO XMLLint was not found! Personlize the PATH_LINT variable in %0 +GOTO END + +:ERR_XSD +ECHO Schemas were not found at %PATH_MANIFEST_XSD% and %PATH_DEFINITION_XSD%! +GOTO END + +:END + +ENDLOCAL \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/data/2001242C.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/data/2001242C.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2001 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: Resource file +* +*/ + + +#include +#include +#include + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x2001242C; + interfaces = + { + INTERFACE_INFO + { + // Base service class + interface_uid = KLiwClassBase; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2001242D; + version_no = 1; + display_name = "MCS Service Provider"; + default_data = "Service.MenuContent"; + opaque_data = "IDataSource" "::" "RUDWUD"; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x2001242E; + version_no = 1; + display_name = "MCS Service Provider"; + default_data = "Service.MenuContent"; + opaque_data = "IMenuContent" "::" "RUDWUD"; + } + }; + } + }; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* 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: This is a top level bld file that drives all sub-components +* that make MCS SAPI library +* +*/ + +// MW_LAYER_PLATFORM_EXPORT_PATH macro definitions +#include + +#include "../mcsservice/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/mcssapi.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mcssapi.iby) + +PRJ_MMPFILES +mcsprovider.mmp + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/group/mcsprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/group/mcsprovider.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET mcsprovider.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2001242C + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +LANG SC + +USERINCLUDE ../mcsservice/inc +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE mcsdsinterface.cpp +SOURCE mcsservicehandler.cpp +SOURCE mcscallback.cpp +SOURCE mcsmcinterface.cpp + +SOURCEPATH ../data +START RESOURCE 2001242C.rss + TARGET mcsprovider.rsc +END + + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY bafl.lib +LIBRARY mcsservice.lib +LIBRARY liwservicehandler.lib +LIBRARY mcsmenu.lib estor.lib +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/debug.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 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 DEBUG_H +#define DEBUG_H + +#include + +#ifdef _DEBUG + +#define FLOG(aText) RDebug::Print(_L(aText)); +#define FLOGF(aText,aParam) RDebug::Print(_L(aText),aParam); + + +#else // _DEBUG not defined, no logging code will be included at all! + +#define FLOG(a) +#define FLOGF(a,p) + + +#endif // _DEBUG + +#endif // DEBUG_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/mcscallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/mcscallback.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Defination of class CMCSInterface +* +*/ + + +#ifndef __MCSCALLBACK_H +#define __MCSCALLBACK_H + +#include +#include +#include + +#include "mcsservice.h" + +/** +* +* +*/ +class CMCSCallback : public CBase, public MMCSCallback + { + public: + + enum TCmds + { + EGetList = 0, + EExecuteAction, + ERequestNotification, + EAddORChange, + EDelete, + EOrganize, + EGetRunningApps + }; + + public: + + /** + * Two-phase Constructor + * @return CMsgCallbackBase* + */ + static CMCSCallback* NewL( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList &aPtrInParamList, TInt32 aTransactionId, + CMCSService& aMcsService,TCmds aCmd); + + /** + * Gives the result of asynchronous SAPI + * @param aErrCode errcode + * @param aResult Result + * @return void + */ + void NotifyResultL(TInt aErrCode, TAny* aResult = NULL); + + private: + + /** + * Constructor + */ + CMCSCallback( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList &aPtrInParamList, TInt32 aTransactionId, + CMCSService& aMcsService,TCmds aCmd ); + /** + */ + void HandleComandL( TInt &aErrCode, TAny* aResult, + CLiwGenericParamList& aParamList ); + + private: + + MLiwNotifyCallback* iPtrNotifyCallback; + const CLiwGenericParamList* iPtrInParamList; + TInt iTransactionId; + CMCSService* iMcsService; + TCmds iCmd; + }; + + +#endif __MCSCALLBACK_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/mcsconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/mcsconstants.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: Constants definitions used across SAPI +* +*/ + + +#ifndef _MCSCONSTANTS_H_ +#define _MCSCONSTANTS_H_ + +const TInt KArrayGran = 4; +const TInt KArrayZeroIndex = 0; +const TInt KMaxActionLen = 16; + +_LIT8(KGenericParamID, "cmd"); +_LIT8(KMCSDataSourceInterface, "IDataSource"); +_LIT8(KMCSMenuContentInterface, "IMenuContent"); +_LIT8(KMCSService, "Service.MenuContent"); + +_LIT8(KErrorCode, "ErrorCode"); +//_LIT8(KReturnValue, "ReturnValue"); +_LIT8(KTransactionID, "TransactionID"); + +// Command Names +_LIT8(KCmdAdd, "Add"); +_LIT8(KCmdDelete, "Delete"); +_LIT8(KCmdGetList, "GetList"); +_LIT8(KCmdReqNotification, "RequestNotification"); +_LIT8(KCmdExecuteAction, "ExecuteAction"); +_LIT8(KcmdRunningApps, "GetRunningApplication"); +_LIT8(KCmdOrganize, "Organize"); + +// Execute actions +_LIT8(KAction, "action"); +_LIT8(KActionOpen, "open"); +_LIT8(KActionRemove, "remove"); +_LIT8(KContentName, "ContentName"); + +// GetList Parameters +//_LIT8(KInData, "InData"); +//_LIT8(KFilter, "Filter"); +//_LIT8(KType, "type"); +//_LIT8(KAddRemove, "add_remove"); +//_LIT8(KReorder, "reorder"); +//_LIT8(KAttributeChange, "attribute_change"); +//_LIT8(KParentId, "parent_id"); +//_LIT8(KBeforeId, "before_item"); + +// Organize Parameters +_LIT8(KItemIds, "item_ids"); +_LIT8(KFolderId, "folder_id"); +_LIT8(KBeforeItemId, "before_item_id"); + +// Flags +//_LIT8(KNameLocked, "name_locked"); +//_LIT8(KIconLocked, "icon_locked"); +//_LIT8(KDeleteLocked, "delete_locked"); +//_LIT8(KMoveLocked, "move_locked"); +//_LIT8(KAddingLocked, "adding_locked"); +//_LIT8(KHidden, "hidden"); +//_LIT8(KRunning, "running"); +//_LIT8(KMissing, "missing"); + +// Search and Result Types +//_LIT8(KRecursiveSearch, "recursive_search"); +//_LIT8(KChildren, "children"); +//_LIT8(KFlatResult, "flat_result"); +//_LIT8(KParentOnly, "parent_only"); +// +//_LIT8(KIgnoreAttributes, "ignore_attributes"); +//_LIT8(KRequiredAttributes, "required_attributes"); + +// Prefix hex format +//_LIT(KHexFormat, "0x%X"); +//_LIT(KHexPrefix, "0x"); + +// Built-in types and attributes. +//_LIT8( KBitmapBuffer, "bitmap_buffer"); +//_LIT8( KMaskBuffer, "mask_buffer"); +//_LIT8( KChildrenCount, "children_count"); + +#endif _MCSCONSTANTS_H_ + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/mcsdsinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/mcsdsinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,153 @@ +/* +* 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: Defination of class CMCSInterface +* +*/ + + +#ifndef __MCSDSINTERFACE_H +#define __MCSDSINTERFACE_H + +#include +#include +#include + +class CMCSService; +class CMenuFilter; +class TMenuItem; +/** + * This class provides the MCS SAPI interface to LIW Framework +*/ +class CMCSDSInterface : public CBase, public MLiwInterface + { + + public: + + /** + * Two-phased constructor. + * @return CMCSDSInterface* + */ + static CMCSDSInterface* NewL(const TDesC& aContent); + + /** + * Destructor. + */ + virtual ~CMCSDSInterface(); + + private: + + /** + * Constructor + */ + CMCSDSInterface(); + + /** + * Symbian Constructor + */ + void ConstructL(const TDesC& aContent); + + // MLiwInterface member functions + public: + + /** + * Executes the SAPI as per params + * @param aCmdName Command name defining which operation is to be performed + * @param aInParamList Input param list + * @param aOutParamList Output list + * @param aCmdOptions Command option + * @param aCallback Callback object pointer + */ + virtual void ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + MLiwNotifyCallback* aCallback = 0 ); + + /** + * Closes the interface + */ + virtual void Close(); + + /** + * Static Functions + * + * Same functionality required outside the CMCSDSInterface class in case of async + * operation. Those set of functions can be given as static. + */ + public: + + /** + * Converts symbian errcode to equivalent SAPI error code + * @param aErrorCode Symbian error code + * + * @return mapped SAPI error code + */ + static TInt32 ErrCodeConversion(TInt aErrorCode); + + private: + + /** + * Issues GetList + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void AddItemL(const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + /** + * Issues GetList + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void GetListL(const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + + /** + * + */ + void CheckGetListInputListL( const CLiwGenericParamList& + aInParamList ); + + /** + * Issues Change Notification + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void RequestNotificationL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + /** + * Issues Delete an item + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void DeleteL(const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + + + private: + + /** + * CMCSService class pointer + */ + CMCSService* iMCSService; + + }; + + +#endif // __MCSDSINTERFACE_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/mcsmcinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/mcsmcinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* +* 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: Defination of class CMCSInterface +* +*/ + + +#ifndef __MCSMCINTERFACE_H +#define __MCSMCINTERFACE_H + +#include +#include +#include + +class CMCSService; +class TMenuItem; +/** + * This class provides the MCS SAPI interface to LIW Framework +*/ +class CMCSMCInterface : public CBase, public MLiwInterface + { + + public: + + /** + * Two-phased constructor. + * @return CMCSMCInterface* + */ + static CMCSMCInterface* NewL(const TDesC& aContent); + + /** + * Destructor. + */ + virtual ~CMCSMCInterface(); + + private: + + /** + * Constructor + */ + CMCSMCInterface(); + + /** + * Symbian Constructor + */ + void ConstructL(const TDesC& aContent); + + // MLiwInterface member functions + public: + + /** + * Executes the SAPI as per params + * @param aCmdName Command name defining which operation is to be performed + * @param aInParamList Input param list + * @param aOutParamList Output list + * @param aCmdOptions Command option + * @param aCallback Callback object pointer + */ + virtual void ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + MLiwNotifyCallback* aCallback = 0 ); + + /** + * Closes the interface + */ + virtual void Close(); + + /** + * Static Functions + * + * Same functionality required outside the CMCSMCInterface class in case of async + * operation. Those set of functions can be given as static. + */ + public: + + /** + * Converts symbian errcode to equivalent SAPI error code + * @param aErrorCode Symbian error code + * + * @return mapped SAPI error code + */ + static TInt32 ErrCodeConversion(TInt aErrorCode); + + private: + + /** + * Issues GetRunningApplications + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void GetRunningAppsL (const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + + /** + * Issues ExecuteAction + * @param aInParamList Input param list + * @param aCallback Callback object pointer + * @return void + */ + void ExecuteActionL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ); + + /** + * Issues Organize + * @param aInParamList Input param list + * @param aOutParamList Output param list + * @param aCallback Callback object pointer + * @return void + */ + void OrganizeL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + MLiwNotifyCallback* aCallback ); + + /** + * Issues GetGenericParam + * @param aInputMap input map + * @param aParamName name of parameter + * @param aOutputList output parameter + * @return TBool return true if exist at least one element in list + */ + TBool GetParamFromMapL( const CLiwMap* aInputMap, + const TDesC8& aParamName, RArray& aOutputList); + + /** + * Issues GetGenericParam + * @param aInputMap Input map + * @param aParamName name of parameter + * @param aOutputValue output parameter + * @return TBool return true if exist expcected param + */ + TBool GetParamFromMapL( const CLiwMap* aInputMap, + const TDesC8& aParamName, TInt& aOutputValue); + + private: + + /** + * CMCSService class pointer + */ + CMCSService* iMCSService; + + }; + + +#endif // __MCSMCINTERFACE_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/mcsservicehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/mcsservicehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSSERVICEHANDLER_H +#define __MCSSERVICEHANDLER_H + +#include +#include + +/** +* Provides implementation to CLiwServiceIfBase interface. +* +**/ +class CMCSServiceHandler : public CLiwServiceIfBase + { + public: + static CMCSServiceHandler* NewL(); + + // CLiwServiceIfBase member functions + /** + * Called by the LIW framework to initialise necessary information + * from the Service Handler. This method is called when the consumer makes + * the attach operation. + * + * @param aFrameworkCallback Framework provided callback for provider to send + * events to framework. + * @param aInterest List of criteria items which invoked the provider. + */ + virtual void InitialiseL( + MLiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest); + + /** + * Executes generic service commands included in criteria. + * + * @param aCmdId Command to be executed. + * @param aInParamList Input parameters, can be an empty list. + * @param aOutParamList Output parameters, can be an empty list. + * @param aCmdOptions Options for the command, see KLiwOpt* in LiwCommon.hrh. + * @param aCallback Callback for asynchronous command handling, parameter checking, etc. + * @leave KErrArgument Callback is missing when required. + * @leave KErrNotSupported No provider supports service. + */ + virtual void HandleServiceCmdL( + const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + const MLiwNotifyCallback* aCallback = NULL); + + private: + /** + * Constructor. + */ + CMCSServiceHandler(); + + }; + +#endif __MCSSERVICEHANDLER_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/inc/serviceerrno.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/inc/serviceerrno.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef SERVICEERRNO_H +#define SERVICEERRNO_H + +#define SERRBASE 1000 + +enum SapiErrors + { + SErrNone , + SErrInvalidServiceArgument = SERRBASE, + SErrUnknownArgumentName , + SErrBadArgumentType , + SErrMissingArgument , + SErrServiceNotSupported , + SErrServiceInUse , + SErrServiceNotReady , + SErrNoMemory , + SErrHardwareNotAvailable , + SErrServerBusy , + SErrEntryExists , + SErrAccessDenied , + SErrNotFound , + SErrUnknownFormat , + SErrGeneralError , + SErrCancelSuccess, + SErrServiceTimedOut + }; + +#endif diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/bwins/mcsserviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/bwins/mcsserviceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,16 @@ +EXPORTS + ?DeleteL@CMCSService@@QAEXPAVMMCSCallback@@H@Z @ 1 NONAME ; void CMCSService::DeleteL(class MMCSCallback *, int) + ?ExecuteActionL@CMCSService@@QAEXPAVMMCSCallback@@HAAVTDesC8@@@Z @ 2 NONAME ; void CMCSService::ExecuteActionL(class MMCSCallback *, int, class TDesC8 &) + ?GetListL@CMCSService@@QAEXPAVMMCSCallback@@HAAVCMenuFilter@@HHHPAVCLiwGenericParamList@@@Z @ 3 NONAME ABSENT ; void CMCSService::GetListL(class MMCSCallback *, int, class CMenuFilter &, int, int, int, class CLiwGenericParamList *) + ?GetRunningAppsL@CMCSService@@QAEXPAVMMCSCallback@@@Z @ 4 NONAME ; void CMCSService::GetRunningAppsL(class MMCSCallback *) + ?NewL@CMCSService@@SAPAV1@ABVTDesC16@@@Z @ 5 NONAME ; class CMCSService * CMCSService::NewL(class TDesC16 const &) + ?OrganizeL@CMCSService@@QAEXPAVMMCSCallback@@ABV?$RArray@H@@HH@Z @ 6 NONAME ; void CMCSService::OrganizeL(class MMCSCallback *, class RArray const &, int, int) + ?OrganizeL@CMCSService@@QAEXPAVMMCSCallback@@HH@Z @ 7 NONAME ; void CMCSService::OrganizeL(class MMCSCallback *, int, int) + ?RegisterObserverL@CMCSService@@QAEXHHPAVMMCSCallback@@@Z @ 8 NONAME ; void CMCSService::RegisterObserverL(int, int, class MMCSCallback *) + ?SetGetListOutputL@CMCSService@@QAEXAAV?$RArray@VTMenuItem@@@@AAVCLiwGenericParamList@@@Z @ 9 NONAME ABSENT ; void CMCSService::SetGetListOutputL(class RArray &, class CLiwGenericParamList &) + ?SetReqNotificationOutputL@CMCSService@@QAEXHHAAVCLiwGenericParamList@@@Z @ 10 NONAME ; void CMCSService::SetReqNotificationOutputL(int, int, class CLiwGenericParamList &) + ?SetRunningAppsOutputL@CMCSService@@QAEXAAV?$RArray@VTUid@@@@AAVCLiwGenericParamList@@@Z @ 11 NONAME ; void CMCSService::SetRunningAppsOutputL(class RArray &, class CLiwGenericParamList &) + ?UnRegisterObserverL@CMCSService@@QAEXXZ @ 12 NONAME ; void CMCSService::UnRegisterObserverL(void) + ?UpdateItemL@CMCSService@@QAEXPAVMMCSCallback@@AAVTDesC16@@HHHAAVCLiwMap@@@Z @ 13 NONAME ; void CMCSService::UpdateItemL(class MMCSCallback *, class TDesC16 &, int, int, int, class CLiwMap &) + ?GetListL@CMCSService@@QAEXABVCLiwGenericParamList@@PAVMMCSCallback@@@Z @ 14 NONAME ; void CMCSService::GetListL(class CLiwGenericParamList const &, class MMCSCallback *) + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/eabi/mcsserviceu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/eabi/mcsserviceu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +EXPORTS + _ZN11CMCSService11UpdateItemLEP12MMCSCallbackR7TDesC16iiiR7CLiwMap @ 1 NONAME + _ZN11CMCSService14ExecuteActionLEP12MMCSCallbackiR6TDesC8 @ 2 NONAME + _ZN11CMCSService15GetRunningAppsLEP12MMCSCallback @ 3 NONAME + _ZN11CMCSService17RegisterObserverLEiiP12MMCSCallback @ 4 NONAME + _ZN11CMCSService19UnRegisterObserverLEv @ 5 NONAME + _ZN11CMCSService21SetRunningAppsOutputLER6RArrayI4TUidER20CLiwGenericParamList @ 6 NONAME + _ZN11CMCSService25SetReqNotificationOutputLEiiR20CLiwGenericParamList @ 7 NONAME + _ZN11CMCSService4NewLERK7TDesC16 @ 8 NONAME + _ZN11CMCSService7DeleteLEP12MMCSCallbacki @ 9 NONAME + _ZN11CMCSService8GetListLERK20CLiwGenericParamListP12MMCSCallback @ 10 NONAME + _ZN11CMCSService9OrganizeLEP12MMCSCallbackRK6RArrayIiEii @ 11 NONAME + _ZN11CMCSService9OrganizeLEP12MMCSCallbackii @ 12 NONAME + _ZTI11CMCSService @ 13 NONAME ; ## + _ZTI14CMCSDeleteItem @ 14 NONAME ; ## + _ZTI14CMCSUpdateItem @ 15 NONAME ; ## + _ZTI15CMCSGetListImpl @ 16 NONAME ; ## + _ZTI15CMCSRunningApps @ 17 NONAME ; ## + _ZTI16CMCSOrganizeImpl @ 18 NONAME ; ## + _ZTI16CMcsBitmapBuffer @ 19 NONAME ; ## + _ZTI17CMCSExecuteAction @ 20 NONAME ; ## + _ZTI17CMCSMenuOpWatcher @ 21 NONAME ; ## + _ZTI19CMCSReqNotification @ 22 NONAME ; ## + _ZTI20RMcsOperationManager @ 23 NONAME ; ## + _ZTV11CMCSService @ 24 NONAME ; ## + _ZTV14CMCSDeleteItem @ 25 NONAME ; ## + _ZTV14CMCSUpdateItem @ 26 NONAME ; ## + _ZTV15CMCSGetListImpl @ 27 NONAME ; ## + _ZTV15CMCSRunningApps @ 28 NONAME ; ## + _ZTV16CMCSOrganizeImpl @ 29 NONAME ; ## + _ZTV16CMcsBitmapBuffer @ 30 NONAME ; ## + _ZTV17CMCSExecuteAction @ 31 NONAME ; ## + _ZTV17CMCSMenuOpWatcher @ 32 NONAME ; ## + _ZTV19CMCSReqNotification @ 33 NONAME ; ## + _ZTV20RMcsOperationManager @ 34 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* 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: This is a top level bld file that drives all sub-components +* that make calendar SAPI library +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +mcsservice.mmp + +PRJ_EXPORTS + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/group/mcsservice.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/group/mcsservice.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET mcsservice.dll +TARGETTYPE DLL +UID 0x1000008D 0x2001242B + +CAPABILITY All -Tcb +VENDORID VID_DEFAULT + +LANG SC + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE mcsservice.cpp +SOURCE mcsgetlistimpl.cpp +SOURCE mcsexecuteaction.cpp +SOURCE mcsmenuopwatcher.cpp +SOURCE mcsrunningapps.cpp +SOURCE mcsrequestnotification.cpp +SOURCE mcsupdateitem.cpp +SOURCE mcsdeleteitem.cpp +SOURCE mcsbitmapbuffer.cpp +SOURCE mcsorganizeimpl.cpp +SOURCE mcsoperationmanager.cpp +SOURCE mcsiconutility.cpp +//SOURCE fbscli.lib + + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY mcsmenu.lib // MCS +LIBRARY liwservicehandler.lib +LIBRARY aknicon.lib +LIBRARY mcsextendedmenu.lib + +LIBRARY apgrfx.lib +LIBRARY mcsmenuutils.lib +LIBRARY fbscli.lib +LIBRARY aknskins.lib +LIBRARY mcssathandler.lib + +// End of File + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsbitmapbuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsbitmapbuffer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,103 @@ +/* +* 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: +* +*/ + + +#ifndef MCSBITMAPBUFFER_H_ +#define MCSBITMAPBUFFER_H_ + +#include +#include +#include + + +/** + * + */ +class CMcsBitmapBuffer : public CLiwBitmapBuffer + { + public: + + /** + * Two-phased constructor. + * + * @return CMcsBitmapBuffer* Pointer. + */ + static CMcsBitmapBuffer* NewL( CFbsBitmap* aBitmapPtr ); + + /** + * Destructor + */ + virtual ~CMcsBitmapBuffer(); + + private: + + /** + * Default Constructor. + */ + CMcsBitmapBuffer( CFbsBitmap* aBitmapPtr); + + public: + + /** + * Returns the pointer to the underlying buffer. + * + * @return the pointer to the underlying buffer + */ + virtual TUint8* Buf() const; + + /** + * Returns the length of the buffer data. + * + * @return the length of the buffer data + */ + virtual TInt Len(); + + /** + * Releases the buffer. The service provider implementing concrete + * buffer type should provide appropriate implementation. + */ + virtual void Release(); + + /** + * Returns the appropriate type of buffer. + */ + virtual TInt TypeID(); + + /** + * This returns the pointer of the type CFbsBitmap. + * @return platform specific bitmap representation. By default, + * this method returns NULL + */ + virtual CFbsBitmap* AsBitmap(); + + public: + + CFbsBitmap* iBitmapPtr; + + private: + /** + * Dummy implementation for == operator not applicable in this case. + */ + TBool operator==( CLiwBuffer& /*aBuffer*/ ) + { + return ETrue; + } + }; + +#endif /*MCSBITMAPBUFFER_H_*/ + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsdeleteitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsdeleteitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSDELETEITEM_H_ +#define __MCSDELETEITEM_H_ + +#include +#include "mcsmenuopobserver.h" + +class MMCSCallback; +class RMenu; +class RMcsOperationManager; +/** + * This class implements MCS SAPI core logic for delete an item async requests. + * + */ +class CMCSDeleteItem : public CActive, public MMCSMenuOpObserver + { + public: + + /** + * Two-phased constructor. + * @param aMenu MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSUpdateItem reference. + */ + static CMCSDeleteItem* NewL( RMenu& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * Delete item and its attributes + * @param aItemId item id to delete. + */ + void DeleteItemL(TInt aItemId); + + /** + * Destructor. + */ + virtual ~CMCSDeleteItem(); + + public: // from MMCSMenuOpObserver + + /** + * MenuOpCompletedL menu operation complete call back. + * @param aStatus status of the operation + */ + void MenuOpCompletedL(TInt aStatus ); + + private: + + /** + * Default constructor. + * @param aMenu MenuContentService object. + * @param aCallback It is a callback notification. + */ + CMCSDeleteItem( RMenu& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResult(TInt aReason); + + private: + + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** iMCS reference. Not owned. */ + RMenu iMCS; + /** Item id to delete. */ + TInt iItemId; + /*not own*/ + RMcsOperationManager& iOperationManager; + }; + +#endif /*__MCSDELETEITEM_H_*/ +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsexecuteaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsexecuteaction.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSEXECUTEATCION_H +#define __MCSEXECUTEATCION_H + +#include +#include "mcsmenuopobserver.h" + +class MMCSCallback; +class RMenu; +class TMenuItem; +class RMcsOperationManager; + +/** + * This class implements MCS SAPI core logic for ExecuteAction async requests. + * + */ +class CMCSExecuteAction : public CActive, public MMCSMenuOpObserver + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSExecuteAction reference. + */ + static CMCSExecuteAction* NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ExecuteActionL for asynchronous calls. + * @param aItemId item id. + * @param aAction action open/remove. + */ + void ExecuteActionL( TInt aItemId, TDesC8& aAction); + + /** + * ExecuteL for synchronous calls. + * @param aItemId item id. + * @param aAction action open/remove. + */ + void ExecuteL(TInt aItemId, TDesC8& aAction); + + /** + * Destructor. + */ + virtual ~CMCSExecuteAction(); + + public: // from MMCSMenuOpObserver + + /** + * MenuOpCompletedL menu operation complete call back. + * @param aStatus status of the operation + */ + void MenuOpCompletedL(TInt aStatus ); + + private: + + /** + * Default constructor. + * @param aMCS MenuContentService object. + * @param aCallback It is a callback notification. + */ + CMCSExecuteAction( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResult(TInt aReason); + + private: + + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** iMCS reference. Not owned. */ + RMenu iMCS; + + /** item id **/ + TInt iItemId; + /** Action to Execute **/ + TPtrC8 iAction; + /*not own*/ + RMcsOperationManager& iOperationManager; + }; + +#endif //__MCSEXECUTEATCION_H diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsgetlistimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsgetlistimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSGETLISTIMPL_H +#define __MCSGETLISTIMPL_H + +#include + +class MMCSCallback; +class RMenuSapi; +class TMenuItem; +class RMcsOperationManager; +class CLiwGenericParamList; +class CLiwDefaultMap; +class CLiwList; +class CLiwDefaultList; +class CAknIcon; + +/** + * This class implements MCS SAPI core logic for GetList async requests. + * + */ +class CMCSGetListImpl : public CActive + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSGetListImpl reference. + */ + static CMCSGetListImpl* NewL( RMenuSapi& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * GetListL for asynchronous calls. + * @param aInParamList list containing input parameters for getlist + */ + void GetListL( const CLiwGenericParamList& aInParamList ); + + /** + * GetListL for synchronous calls. + */ + void GetListL( ); + + /** + * Destructor. + */ + virtual ~CMCSGetListImpl(); + + private: + + /** + * Default constructor. + * @param aMCS MenuContentService object. + * @param aCallback It is a callback notification. + * @param aOperationManager for safe cleanup + */ + CMCSGetListImpl( RMenuSapi& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResultL(TInt aReason); + + /* + * Handle append icons + */ + void HandleAppendIconsL( CLiwGenericParamList* aParamList ); + + /** + * Appends icons to generic param list. + */ + void AppendIconsL( const CLiwList* aList, + CLiwDefaultList* aDefaultList ); + + /** + * Appends icon to specific map. + */ + void AppendIconL( CLiwDefaultMap* aMap ); + void GetMaskAndBitmapL( CLiwDefaultMap& aMap, CAknIcon* aIcon ); + + private: + /*own*/ + RBuf8 iSerializedInputList; + /*own*/ + RBuf8 iSerializedOutputList; + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** iMCS reference. Not owned. */ + RMenuSapi iMCS; + /*not own*/ + RMcsOperationManager& iOperationManager; + }; + + + +#endif //__MCSGETLISTIMPL_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsiconutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsiconutility.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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 requesting raw bitmaps +* +*/ + + +#ifndef __MCSICONUTILITY_H__ +#define __MCSICONUTILITY_H__ + +#include +class CMenuItem; +class CLiwDefaultMap; + +/** + * Icon utility. + * This is a utilitiy class providing method(s) for querying raw bitmap data + * belonging to menu items + * @lib mcsextendedmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( McsIconUtility ) + { +public: + + /** + * Creates the icon that belongs to a menu item. + * @since S60 v5.0. + * @param aItem The menu item the icon is querried for + * @return the icon of the specified menu item. The ownership of the icon + * object is transferred to the caller. + */ + + static CAknIcon* GetItemIconL( const CLiwDefaultMap* aMap ); + }; + +#endif // __MCSICONUTILITY_H__ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsmenuopobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsmenuopobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MMCSMENUOPOBSERVER_H_ +#define __MMCSMENUOPOBSERVER_H_ + +#include + +// Observe menu operations. TRequestStatus -> callback +class MMCSMenuOpObserver + { +public: + virtual void MenuOpCompletedL( TInt /*aStatus*/ ) = 0; + }; + +#endif /*__MMCSMENUOPOBSERVER_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsmenuopwatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsmenuopwatcher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSMENUOPWATCHER_H +#define __MCSMENUOPWATCHER_H + +#include + +class MMCSMenuOpObserver; +class CMenuOperation; +class RMcsOperationManager; + +/** + * This class implements MCS SAPI menu action watcher for async calls. + * + */ +class CMCSMenuOpWatcher: public CActive + { + public: + + /** + * Two-phased constructor. + * @param iObserver Menu operation observer object. + * @return CMCSMenuOpWatcher reference. + */ + static CMCSMenuOpWatcher* NewL( MMCSMenuOpObserver& iObserver, + RMcsOperationManager& aOperationManager ); + + /** + * Destructor. + */ + virtual ~CMCSMenuOpWatcher(); + + /** + * Watch menu operation watcher. + * @param iObserver Menu operation observer object. + * @return CMCSMenuOpWatcher reference. + */ + void Watch( CMenuOperation& aOperation); + + private: + + /** + * Default constructor. + * @param iObserver Menu operation observer object. + */ + CMCSMenuOpWatcher( MMCSMenuOpObserver& iObserver, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError( TInt aError ); + + /** + * Inherited from CActive class + */ + void RunL(); + + /** + * Inherited from CActive class + */ + void DoCancel(); + + private: + + /** Menu operation observer */ + MMCSMenuOpObserver& iObserver; + /** Menu operation */ + CMenuOperation* iOperation; + /*not own*/ + RMcsOperationManager& iOperationManager; + + }; + +#endif /*__MCSMENUOPWATCHER_H*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsoperationmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsoperationmanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSOPERATIONMANAGER_H_ +#define __MCSOPERATIONMANAGER_H_ + +#include + +class RMcsOperationManager + { +public: + + /** + * Default constructor. + */ + RMcsOperationManager( ); + + /** + * Destructor. + */ + virtual ~RMcsOperationManager(); + + + /** + * @param aOperation pointer to active object to be added to + * iOperations array. AddL transfers AO ownership to + * RMcsOperationManager object + */ + void AddL( CActive* aOperation ); + + /** + * @param aOperation pointer to active object to be removed + * from the iOperations array + * + */ + void Remove( CActive* aOperation ); + + /** + */ + void Close(); + + +private: + RPointerArray< CActive > iOperations; + }; + +#endif /*__MCSOPERATIONMANAGER_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsorganizeimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsorganizeimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,142 @@ +/* +* 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: CMCSOrganize declaration +* +*/ + + +#ifndef __MCSORGANIZEIMPL_H +#define __MCSORGANIZEIMPL_H + +#include +#include "mcsmenuopobserver.h" + +class MMCSCallback; +class RMenu; +class TMenuItem; +class CLiwList; +class RMcsOperationManager; +/** + * This class implements MCS SAPI core logic for GetList async requests. + * + */ +class CMCSOrganizeImpl : public CActive, public MMCSMenuOpObserver + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSOrganizeImpl reference. + */ + static CMCSOrganizeImpl* NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * OrganizeL for asynchronous calls. + * @param aItemId item id to move. + * @param aBeforeItemId Before item id. + */ + void OrganizeL( TInt aItemId, TInt aBeforeItemId ); + + /** + * OrganizeL for asynchronous calls. + * @param aList list item ids to move. + * @param aFolderId Folder id. + * @param aBeforeItemId Before item id. + */ + void OrganizeL( const RArray& aList, + TInt aFolderId, TInt aBeforeItemId ); + + /** + * OrganizeL for synchronous calls. + */ + void OrganizeL(); + + /** + * Destructor. + */ + virtual ~CMCSOrganizeImpl(); + + public: // from MMCSMenuOpObserver + + /** + * MenuOpCompletedL menu operation complete call back. + * @param aStatus status of the operation + */ + void MenuOpCompletedL(TInt aStatus ); + + private: + + /** + * Default constructor. + * @param aMCS MenuContentService object. + * @param aCallback It is a callback notification. + */ + CMCSOrganizeImpl( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResult(TInt aReason); + + private: + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** iMCS reference. Not owned. */ + RMenu iMCS; + /** list item ids. **/ + RArray iList; + /** item id. Not owned **/ + TInt iItemId; + /** folder id **/ + TInt iFolderId; + /** Before item id **/ + TInt iBeforeItemId; + /** single or list **/ + TBool iIsSingle; + /*not own*/ + RMcsOperationManager& iOperationManager; + }; + +#endif //__MCSORGANIZEIMPL_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsrequestnotification.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsrequestnotification.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSREQUESTNOTIFICATION_H_ +#define __MCSREQUESTNOTIFICATION_H_ + +#include +#include "mcsmenunotifier.h" + +class MMCSCallback; + +/** + * This class implements MCS SAPI core logic for Request Notification async requests. + * + */ +class CMCSReqNotification: public CActive + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSRunningApps reference. + */ + static CMCSReqNotification* NewL(RMenu& aMCS); + + /** + * Destructor. + */ + virtual ~CMCSReqNotification(); + + private: + + /** + * Default constructor. + */ + CMCSReqNotification(); + + /** + * ConstructL + * @param aMCS MenuContentService object. + */ + void ConstructL(RMenu& aMCS); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + public : + + /** + * Starts the notification of events. + * @param aFolderId folder id to observe the events. + * @param aEvent events to notificy. + */ + void StartNotificationL(TInt aFolderId, TInt aEvent, MMCSCallback* aCallback ); + + /** + * Stops the registered notifcation. + */ + void StopNotificationL(); + + private: + + RMenuNotifier iNotifier; + /** Folder it to watch owned. */ + TInt iFolderId; + /** Events to Notifiy. owned */ + TInt iEvents; + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** notification watch owned */ + TBool iIsNotification; + /** iMCS reference. Not owned. */ + RMenu iMCS; + + }; + +#endif /*__MCSREQUESTNOTIFICATION_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsrunningapps.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsrunningapps.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MCSRUNNINGAPPS_H_ +#define MCSRUNNINGAPPS_H_ + +#include +#include "mcsmenunotifier.h" + +class MMCSCallback; +class RMenu; +class TMenuItem; +class RMcsOperationManager; + +/** + * This class implements MCS SAPI core logic for Getrunningapplications async requests. + * + */ +class CMCSRunningApps: public CActive + { + public: + + /** + * Two-phased constructor. + * @param aCallback Callback Object for Change notification. + * @return CMCSRunningApps reference. + */ + static CMCSRunningApps* NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * Destructor. + */ + virtual ~CMCSRunningApps(); + + private: + + /** + * Default constructor. + * @param aCallback It is a callback notification. + */ + CMCSRunningApps( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResult(TInt aReason); + + public : + + /** + * GetRunningApplicationL for asynchronous calls. + */ + void GetRunningApplicationL(); + + public: // from MMCSMenuOpObserver + + /** + * RunningAppsChangedL operation complete call back. + */ + void RunningAppsChangedL(); + + private: + + /** iMCS reference. Not owned. */ + RMenu iMCS; + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** UID Array. Owned */ + RArray iUidArray; + /** item id **/ + TInt iItemId; + /** Action to Execute **/ + TPtrC8 iAction; + /*not own*/ + RMcsOperationManager& iOperationManager; + + + }; + +#endif /*MCSRUNNINGAPPS_H_*/ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsservice.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSSERVICE_H +#define __MCSSERVICE_H + +#include +#include +#include +#include +#include "mcsmenusapi.h" +#include "mcsmenuitem.h" +#include "mcsoperationmanager.h" + +class CMCSReqNotification; +/** + * MCS callback interface, its pure interface class, application need to + * Write there own callback derriving from this class. + */ + + class MMCSCallback + { + /** + * Handles notifications caused by an asynchronous calls. + * + * @return Success/Error code for the callback. + */ + public: + + virtual void NotifyResultL(TInt aErrCode, TAny* aResult = NULL ) = 0; + }; + +/** + * MCS Service class. +*/ +class CMCSService : public CBase + { + public: + + /** + * Two Phase Constructor + */ + IMPORT_C static CMCSService* NewL(const TDesC& aContent); + + /** + * Destructor + */ + virtual ~CMCSService(); + + private: + + /** + * Constructor + */ + CMCSService(); + + /** + * Constructor + */ + void ConstructL(const TDesC& aContent); + + /** + * @param aInputMap map containing attributes to add or modify + * @param aMenuitem menuitem object + * @param aFlag flag enum + * @return void + */ + void SetFlagInMenuitemL( CLiwMap& aInputMap, + CMenuItem& aMenuitem, TMenuItem::TFlags aFlag); + + + + public: + + /** + * Add / Changes an item and its attribute. + * @param aCallBack CallBack for asynchronous requests + * @param aType type of item + * @param aParentId parent id of the item + * @param aBeforeId item id after which the new item will be added + * @param aInputMap attributes to add or modify + * @return void + */ + IMPORT_C void UpdateItemL( MMCSCallback* aCallBack, TDesC& aType, + TInt aId, TInt aParentId, TInt aBeforeId, CLiwMap& aInputMap ); + + /** + * Gets the list of items from xml + * @param aInParamList list containing input parameters for getlist + * @param aCallBack CallBack for asynchronous requests + * @return void + */ + IMPORT_C void GetListL( const CLiwGenericParamList& aInParamList, + MMCSCallback* aCallBack ); + + + /** + * Gets the Uid of running applications + * @param aCallback CallBack for asynchronous requests + * @return void + */ + IMPORT_C void GetRunningAppsL( MMCSCallback* aCallback ); + + /** + * Execute a action (open/remove) + * @param aCallback CallBack for asynchronous requests + * @param aItemId item id + * @param aAction action to execute + * @return void + */ + IMPORT_C void ExecuteActionL( MMCSCallback* aCallback, + TInt aItemId, TDesC8& aAction ); + + /** + * Start notifying the changes + * @param aCallback CallBack for asynchronous requests, Ownership is passed + * @param aFolderId folder id to observe the events notification. + * @param aEvents events to observe + * @return void + */ + IMPORT_C void RegisterObserverL( TInt aFolderId,TInt aEvents,MMCSCallback* aCallBack ); + + /** + * Stop notifying the changes + */ + IMPORT_C void UnRegisterObserverL(); + + /** + * Delete an Item + * @param aCallback CallBack for asynchronous requests, Ownership is passed + * @param aItemId item id to delete + * @return void + */ + IMPORT_C void DeleteL( MMCSCallback* aCallBack, TInt aItemId); + + /** + * Set Get running applications output to output parameter + * @param aOutputArray GetList array + * @param aOutParamList Output parammeter + * @return void + */ + IMPORT_C void SetRunningAppsOutputL( RArray& aOutputArray, + CLiwGenericParamList& aOutParamList ); + + /** + * Organize + * @param aCallback CallBack for asynchronous requests, Ownership is passed + * @return void + */ + IMPORT_C void OrganizeL(MMCSCallback* aCallBack, + TInt aItemId, TInt aBeforeItemId); + + /** + * Organize + * @param aCallback CallBack for asynchronous requests, Ownership is passed + * @return void + */ + IMPORT_C void OrganizeL(MMCSCallback* aCallBack, + const RArray& aList, TInt aFolderId, TInt aBeforeItemId); + + /** + * Set the events and folder to notify + * @param aFolderId folder id which modified + * @param aEvent events occured + * @param aOutParamList Output parammeter + * @return void + */ + IMPORT_C void SetReqNotificationOutputL( TInt aFolderId, + TInt aEvent, CLiwGenericParamList& aOutParamList ); + + private: + + /** Menu */ + RMenuSapi iMCS; + /** Result Type*/ + TBool iFlatResult; + /** Notification events registered status */ + TBool iIsRegistered; + /** Event notifier */ + CMCSReqNotification *iReqNotifier; + /* own */ + RMcsOperationManager iOperationManager; + /** + * CLiwGenericParamList class pointer + * Not Own. + */ + CLiwGenericParamList* iAttributes; + + /** + * CDesC16ArrayFlat class pointer + * Own. + */ + CDesC16Array* iIgnoredAttributes; + + /** + * CDesC16ArrayFlat class pointer + * Own. + */ + CDesC16Array* iRequiredAttributes; + + }; + + +#endif /* __MCSSERVICE_H */ diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsupdateitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/inc/mcsupdateitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSUPDATEITEM_H +#define __MCSUPDATEITEM_H + +#include +#include "mcsmenuopobserver.h" + +class MMCSCallback; +class CMenuOperation; +class CMCSMenuOpWatcher; +class RMcsOperationManager; + +/** + * This class implements MCS SAPI core logic for Add / Change async requests. + * + */ +class CMCSUpdateItem : public CActive, public MMCSMenuOpObserver + { + public: + + /** + * Two-phased constructor. + * @param aMCS MenuContentService object. + * @param aCallback Callback Object for Change notification. + * @return CMCSUpdateItem reference. + */ + static CMCSUpdateItem* NewL( CMenuItem& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * Add/Change item and its attributes + */ + void UpdateItemL(); + + /** + * Destructor. + */ + virtual ~CMCSUpdateItem(); + + public: // from MMCSMenuOpObserver + + /** + * MenuOpCompletedL menu operation complete call back. + * @param aStatus status of the operation + */ + void MenuOpCompletedL(TInt aStatus ); + + private: + + /** + * Default constructor. + * @param aMCS MenuContentService object. + * @param aCallback It is a callback notification. + */ + CMCSUpdateItem( CMenuItem& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + virtual void DoCancel(); + + /** + * Inherited from CActive class + */ + virtual void RunL(); + + /** + * Notify callback in case RunL leaved; + */ + TInt RunError(TInt aError); + + /** + * Activates the request and call SetActive() function + */ + void ActivateRequest(TInt aReason); + + /** + * Gives the result for notification request. + */ + void NotifyRequestResult(TInt aReason); + + private: + + /** Callback Object. Not owned. */ + MMCSCallback* iCallback; + /** iMCS reference. Owned. */ + CMenuItem *iMenu; + /*not own*/ + RMcsOperationManager& iOperationManager; + }; + + + +#endif //__MCSUPDATEITEM_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsbitmapbuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsbitmapbuffer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "mcsbitmapbuffer.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsBitmapBuffer::CMcsBitmapBuffer( CFbsBitmap* aBitmapPtr ) + : iBitmapPtr( aBitmapPtr ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsBitmapBuffer* CMcsBitmapBuffer::NewL( CFbsBitmap* aBitmapPtr ) + { + return new( ELeave ) CMcsBitmapBuffer( aBitmapPtr ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CMcsBitmapBuffer::~CMcsBitmapBuffer() + { + Release(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint8* CMcsBitmapBuffer::Buf() const + { + return NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMcsBitmapBuffer::Len() + { + return 0; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMcsBitmapBuffer::Release() + { + delete iBitmapPtr; + iBitmapPtr = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMcsBitmapBuffer::TypeID() + { + return KLiwBufferBitmap; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CFbsBitmap* CMcsBitmapBuffer::AsBitmap() + { + return iBitmapPtr; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsdeleteitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsdeleteitem.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsmenu.h" +#include "mcsmenuitem.h" + +#include "mcsdeleteitem.h" +#include "mcscallback.h" +#include "mcsservice.h" +#include "mcsmenuopwatcher.h" +#include "mcsoperationmanager.h" + + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSDeleteItem* CMCSDeleteItem::NewL( RMenu& aMenu, + MMCSCallback* aCallback, RMcsOperationManager& aOperationManager ) + { + CMCSDeleteItem* self = new (ELeave) CMCSDeleteItem( aMenu, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSDeleteItem::~CMCSDeleteItem() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSDeleteItem::CMCSDeleteItem( RMenu& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) : + CActive( EPriorityStandard ), + iCallback( aCallback ), + iMCS( aMenu ), + iOperationManager(aOperationManager) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSDeleteItem::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Async delete item +// --------------------------------------------------------------------------- +void CMCSDeleteItem::DeleteItemL(TInt aItemId) + { + iItemId = aItemId; + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSDeleteItem::DoCancel() + { + //TRequestStatus* temp = &iStatus; + //User::RequestComplete( temp, KErrCancel ); + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); + //NotifyRequestResult( err ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSDeleteItem::RunL() + { + TInt err = iStatus.Int(); + if ( err == KErrNone ) + { + CMCSMenuOpWatcher* watcherAO = CMCSMenuOpWatcher::NewL( *this, + iOperationManager ); + CleanupStack::PushL( watcherAO ); + iOperationManager.AddL( watcherAO ); + CleanupStack::Pop( watcherAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + + CMenuOperation* operation = iMCS.RemoveL( iItemId , watcherAO->iStatus ); + + watcherAO->Watch( *operation ); + } + else + { + NotifyRequestResult( err ); + } + } + +// --------------------------------------------------------------------------- +// CMCSDeleteItem::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSDeleteItem::RunError(TInt aError) + { + NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSDeleteItem::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSDeleteItem::NotifyRequestResult( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + + if ( iCallback ) + { + TRAP_IGNORE(iCallback->NotifyResultL( aReason ));//, NULL); + } + + delete this; + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSDeleteItem::MenuOpCompletedL(TInt aStatus ) + { + NotifyRequestResult( aStatus ); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsexecuteaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsexecuteaction.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsdef.h" +#include "mcsmenu.h" +#include "mcsmenufilter.h" +#include "mcsexecuteaction.h" +#include "mcsservice.h" +#include "mcsconstants.h" +#include "mcsmenuopwatcher.h" +#include "mcsoperationmanager.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSExecuteAction* CMCSExecuteAction::NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) + { + CMCSExecuteAction* self = new (ELeave) CMCSExecuteAction( aMCS, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSExecuteAction::~CMCSExecuteAction() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSExecuteAction::CMCSExecuteAction( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) : + CActive( EPriorityStandard ), + iCallback( aCallback ), + iMCS( aMCS ), + iOperationManager(aOperationManager) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSExecuteAction::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// ExecuteActionL - Async +// --------------------------------------------------------------------------- +void CMCSExecuteAction::ExecuteActionL( TInt aItemId, TDesC8& aAction) + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + iItemId = aItemId; + iAction.Set(aAction); + + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// ExecuteL - Sync +// --------------------------------------------------------------------------- +void CMCSExecuteAction::ExecuteL(TInt aItemId, TDesC8& aAction ) + { + CMenuItem* item = CMenuItem::OpenL( iMCS, aItemId ); + CleanupStack::PushL( item ); + + CMCSMenuOpWatcher* watcherAO = CMCSMenuOpWatcher::NewL( *this, + iOperationManager ); + CleanupStack::PushL( watcherAO ); + iOperationManager.AddL( watcherAO ); + CleanupStack::Pop( watcherAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + + CMenuOperation* operation = item->HandleCommandL( aAction, + KNullDesC8, watcherAO->iStatus); + watcherAO->Watch( *operation ); + + CleanupStack::PopAndDestroy( item ); + } + + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSExecuteAction::DoCancel() + { +// TRequestStatus* temp = &iStatus; +// User::RequestComplete( temp, KErrCancel ); + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); +// NotifyRequestResult( err ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSExecuteAction::RunL() + { + TInt err = iStatus.Int(); + + if ( err == KErrNone ) + { + TRAP( err, ExecuteL( iItemId, iAction ) ); + } + if(err != KErrNone) + { + NotifyRequestResult( err ); + } + } + +// --------------------------------------------------------------------------- +// CMCSExecuteAction::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSExecuteAction::RunError(TInt aError) + { + NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSExecuteAction::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSExecuteAction::NotifyRequestResult( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + if ( iCallback ) + { + TRAP_IGNORE( iCallback->NotifyResultL( aReason) ); + // iCallback deletes itself. + } + delete this; + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSExecuteAction::MenuOpCompletedL(TInt aStatus ) + { + NotifyRequestResult( aStatus ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsgetlistimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsgetlistimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,297 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + +#include "mcsmenu.h" +#include "mcsmenusapi.h" +#include "mcsmenuitem.h" +#include "mcsgetlistimpl.h" +#include "mcsservice.h" +#include "mcsoperationmanager.h" +#include "mcsiconutility.h" +#include "mcsbitmapbuffer.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSGetListImpl* CMCSGetListImpl::NewL( RMenuSapi& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) + { + CMCSGetListImpl* self = new (ELeave) CMCSGetListImpl( aMCS, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSGetListImpl::~CMCSGetListImpl() + { + Cancel(); + iSerializedInputList.Close(); + iSerializedOutputList.Close(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSGetListImpl::CMCSGetListImpl( RMenuSapi& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) : + CActive( EPriorityStandard ), + iCallback( aCallback ), + iMCS( aMCS ), + iOperationManager( aOperationManager ) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSGetListImpl::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Async +// --------------------------------------------------------------------------- +void CMCSGetListImpl::GetListL( const CLiwGenericParamList& aInParamList ) + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + + if (!IsActive()) + { + iSerializedInputList.Close( ); + iSerializedInputList.CreateL( aInParamList.Size() ); + + RDesWriteStream datastrm( iSerializedInputList ); + CleanupClosePushL(datastrm); + aInParamList.ExternalizeL(datastrm); + datastrm.CommitL(); + CleanupStack::PopAndDestroy(&datastrm); + + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + } + +// --------------------------------------------------------------------------- +// Sync +// --------------------------------------------------------------------------- +void CMCSGetListImpl::GetListL( ) + { + iSerializedOutputList.Close(); + iMCS.GetListL( iSerializedInputList, iSerializedOutputList ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSGetListImpl::DoCancel() + { +// TRequestStatus* temp = &iStatus; +// User::RequestComplete( temp, KErrCancel ); + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); +// NotifyRequestResult( KErrCancel ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSGetListImpl::RunL() + { + TInt err = iStatus.Int(); + + if ( err == KErrNone ) + { + TRAP( err, GetListL( )); + } + NotifyRequestResultL( err ); + } + +// --------------------------------------------------------------------------- +// CMCSGetListImpl::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSGetListImpl::RunError(TInt aError) + { + TRAP( aError,NotifyRequestResultL( aError ) ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSGetListImpl::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSGetListImpl::NotifyRequestResultL( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + + if ( iCallback ) + { + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewLC(); + + if ( aReason == KErrNone ) + { + TRAP(aReason, HandleAppendIconsL( outParamList )); + } + + TRAP_IGNORE(iCallback->NotifyResultL( aReason, (TAny*)(outParamList))); + + CleanupStack::PopAndDestroy( outParamList ); + + // iCallback deletes itself. + } + delete this; + } + +// -------------------------------------------------------------------------------------------------------- +// Appends icons to generic param list +// -------------------------------------------------------------------------------------------------------- +// +void CMCSGetListImpl::HandleAppendIconsL( CLiwGenericParamList* aParamList ) + { + RDesReadStream stream( iSerializedOutputList ); + CleanupClosePushL( stream ); + aParamList->InternalizeL( stream ) ; + TInt pos ( 0 ); + const TLiwGenericParam* returnVal = + aParamList->FindFirst( pos, KReturnValue ); + if ( returnVal ) + { + CLiwDefaultList* resultList = CLiwDefaultList::NewLC(); + const CLiwList* resultTemp = returnVal->Value().AsList(); + AppendIconsL( resultTemp , resultList ); + aParamList->Remove( KReturnValue ); + aParamList->AppendL( TLiwGenericParam(KReturnValue, + TLiwVariant( resultList ) ) ); + CleanupStack::PopAndDestroy( resultList ); + } + CleanupStack::PopAndDestroy( &stream ); + } + +// -------------------------------------------------------------------------------------------------------- +// Appends icons to generic param list +// -------------------------------------------------------------------------------------------------------- +// +void CMCSGetListImpl::AppendIconsL( const CLiwList* aList, + CLiwDefaultList* aDefaultList ) + { + for ( TInt index = 0; index < aList->Count(); index++ ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + TLiwVariant variant; + variant.PushL(); + aList->AtL( index, variant ); + variant.Get( *map ); + AppendIconL( map ); + aDefaultList->AppendL( TLiwVariant( map ) ); + CleanupStack::PopAndDestroy( &variant ); + CleanupStack::PopAndDestroy( map ); + } + + } + +// -------------------------------------------------------------------------------------------------------- +// Appends icons to specific map +// -------------------------------------------------------------------------------------------------------- +// +void CMCSGetListImpl::AppendIconL( CLiwDefaultMap* aMap ) + { + //check if there are any children and call AppendIconsL recursively if so + TLiwVariant variant; + variant.PushL(); + if( aMap->FindL( KChildren, variant ) ) + { + const CLiwList* tempList = variant.AsList(); + CLiwDefaultList* resultList = CLiwDefaultList::NewLC(); + AppendIconsL( tempList, resultList ); + aMap->Remove( KChildren ); + aMap->InsertL( KChildren, TLiwVariant( resultList ) ) ; + CleanupStack::PopAndDestroy( resultList ); + } + + if( aMap->FindL( KIconAttributes, variant ) ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + CAknIcon* icon = NULL; + TRAP_IGNORE( icon = McsIconUtility::GetItemIconL( map ) ); + aMap->Remove( KIconAttributes ); + if ( icon ) + { + CleanupStack::PushL( icon ); + GetMaskAndBitmapL( *aMap, icon ); + CleanupStack::PopAndDestroy( icon ); + } + CleanupStack::PopAndDestroy( map ); + } + + CleanupStack::PopAndDestroy( &variant ); + } + +// --------------------------------------------------------------------------- +// CMCSGetListImpl::GetMaskAndBitmapL. +// --------------------------------------------------------------------------- +// +void CMCSGetListImpl::GetMaskAndBitmapL( CLiwDefaultMap& aMap, CAknIcon* aIcon ) + { + CLiwBitmapBuffer* bitmapBuffer = CMcsBitmapBuffer::NewL( aIcon->Bitmap() ); + aIcon->SetBitmap( NULL ); + bitmapBuffer->PushL(); + TLiwVariant lvBitmap( bitmapBuffer ); + lvBitmap.PushL(); + aMap.InsertL( KBitmapBuffer, lvBitmap ); + CleanupStack::PopAndDestroy( &lvBitmap ); + CleanupStack::PopAndDestroy( bitmapBuffer ); + + + CLiwBitmapBuffer* maskBuffer = CMcsBitmapBuffer::NewL( aIcon->Mask() ); + aIcon->SetMask( NULL ); + maskBuffer->PushL(); + TLiwVariant lvMask( maskBuffer ); + lvMask.PushL(); + aMap.InsertL( KMaskBuffer, lvMask ); + CleanupStack::PopAndDestroy( &lvMask ); + CleanupStack::PopAndDestroy( maskBuffer ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsiconutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsiconutility.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,478 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + + + +//#include "mcsextendedmenuitem.h" +#include "mcsiconutility.h" +#include "mcssathandler.h" +#include + +// Constants +_LIT( KMifIconPath, "\\resource\\apps\\" ); +const TUint32 KMifIconPathLenght = 18; +const TInt KJavaIconWidth = 88; // Java icon default width +const TInt KJavaIconHeight = 88; // Java icon default height + + + +// ================= LOCAL FUNCTIONS ======================== + + +// ----------------------------------------------------------------------------- +// CreateMbmIconLC2 - Creates bitmap +// ----------------------------------------------------------------------------- +// +LOCAL_C TBool CreateMbmIconLC2(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask, const TDesC& aAppUid ) + { + TBool ret = EFalse; + TSize size( KJavaIconWidth, KJavaIconHeight ); + + aBitmap = NULL; + aMask = NULL; + + RApaLsSession lsSession; + User::LeaveIfError( lsSession.Connect() ); + CleanupClosePushL( lsSession ); // lsSession (1) + + TUint appUidUint; + + // Gets app TUid from aAppUid descryptor + User::LeaveIfError( MenuUtils::GetTUint( aAppUid, appUidUint ) ); + TUid appUid( TUid::Uid( appUidUint) ); + + // Tries to find icon with default size. + CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC(); + TInt apaErr = lsSession.GetAppIcon( appUid, size, *apaBmp ); + if ( apaErr == KErrNotFound ) + { + // Icon not found. + // AppArc tries to find equal to or smaller than the specified size. + // Get all icon sizes and search for next bigger icon size. + CArrayFixFlat* sizes = new(ELeave) CArrayFixFlat( 5 ); + apaErr = lsSession.GetAppIconSizes(appUid, *sizes); + if ( !apaErr ) + { + if ( sizes->Count() ) + { + // There are other icon sizes + TInt idx = -1; + TInt square( size.iWidth * size.iHeight ); + for ( TInt i = 0; i < sizes->Count(); i++ ) + { + if ( ( sizes->At( i ).iWidth * sizes->At( i ).iHeight ) > square ) + { + idx = i; + break; + } + } + + if ( idx >= 0 ) + { + // Next bigger icon. + size = sizes->At( idx ); + } + else + { + // Just get the first available. + size = sizes->At( 0 ); + } + } + + // Gets icon with new size. + apaErr = lsSession.GetAppIcon( appUid, size, *apaBmp ); + } + + // Reset and destroy. + sizes->Reset(); + delete sizes; + sizes = NULL; + } + + // Some builds requires brackets + // logical correction was also made + if ( ( apaErr != KErrNone ) && + ( apaErr != KErrNotFound ) && + ( apaErr != KErrNotSupported ) ) + { + // System wide error. + User::LeaveIfError( apaErr ); + } + + if( !apaErr && + apaBmp && + apaBmp->Mask() && + apaBmp->Handle() && + apaBmp->Mask()->Handle()) + { + // AIF-based icon + CFbsBitmap* iconOwnedBitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( iconOwnedBitmap ); // iob (3) + CFbsBitmap* iconOwnedMask = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( iconOwnedMask ); // iom (4) + User::LeaveIfError( + iconOwnedBitmap->Duplicate( apaBmp->Handle() ) ); + User::LeaveIfError( + iconOwnedMask->Duplicate( apaBmp->Mask()->Handle() ) ); + + CAknIcon* tmpIcon = CAknIcon::NewL(); + + // Ownership is transferred + tmpIcon->SetBitmap( iconOwnedBitmap ); + tmpIcon->SetMask( iconOwnedMask ); + // Ownership of tmpIcon is transferred + CAknIcon* appIcon = AknIconUtils::CreateIconL( tmpIcon ); + CleanupStack::Pop( 2 ); // iom, iob (2) + + aBitmap = appIcon->Bitmap(); + aMask = appIcon->Mask(); + AknInternalIconUtils::SetAppIcon(aBitmap); + + // Detach and delete + appIcon->SetBitmap( NULL ); + appIcon->SetMask( NULL ); + delete appIcon; + + ret = ETrue; + } + + CleanupStack::PopAndDestroy( 2 ); // lsSession, apaBmp (0) + + // These are both safe + if ( aBitmap ) + { + CleanupStack::PushL( aBitmap ); // (1) + CleanupStack::PushL( aMask ); // (2) + } + + return ret; + } + + +// --------------------------------------------------------- +// ParseIconFilePathL +// --------------------------------------------------------- +// + +LOCAL_C void ParseIconFilePathL( const TDesC& aIconFilePath, RBuf& aIconFilePathBuf ) + { + TParsePtrC fileParsePtrC(aIconFilePath); + if( !fileParsePtrC.PathPresent()) + { + aIconFilePathBuf.CreateL(KMifIconPathLenght + aIconFilePath.Length()); + aIconFilePathBuf.Append(KMifIconPath); + } + else + { + aIconFilePathBuf.CreateL(aIconFilePath.Length()); + } + aIconFilePathBuf.Append(aIconFilePath); + } + +// --------------------------------------------------------- +// LoadSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* LoadSkinL( TUint majorId, TUint minorId ) + { + CAknIcon* icon = NULL; + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + TAknsItemID skinId; + skinId.Set( majorId, minorId ); + + AknsUtils::CreateIconLC( + AknsUtils::SkinInstance(), + skinId, + bitmap, + mask, + KNullDesC, + KErrNotFound, + KErrNotFound ); + + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + + // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order + CleanupStack::Pop( 2 ); + + return icon; + } + +// --------------------------------------------------------- +// LoadSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* LoadAppSkinL( TUid& aAppUid ) + { + CAknIcon* icon = NULL; + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TRAPD( err, + { + AknsUtils::CreateAppIconLC( skin, aAppUid, EAknsAppIconTypeList, bitmap, mask ); + CleanupStack::Pop(2); //for trap + } + ); + if( err == KErrNone ) + { + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + } + return icon; + } + +// --------------------------------------------------------- +// GetSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetSkinL( const CLiwDefaultMap* aMap ) + { + CAknIcon* icon = NULL; + TUint majorId( 0 ); + TUint minorId( 0 ); + TPtrC idString( KNullDesC ); + + TLiwVariant variant; + variant.PushL(); + TBuf8 attrName; + attrName.Copy( KMenuAttrIconSkinMajorId ); + + if( aMap->FindL( attrName, variant)) + { + variant.Get( idString ); + User::LeaveIfError( MenuUtils::GetTUint( idString, majorId ) ); + attrName.Copy( KMenuAttrIconSkinMinorId ); + if( aMap->FindL( attrName, variant)) + { + variant.Get( idString ); + User::LeaveIfError( MenuUtils::GetTUint( idString, minorId ) ); + icon = LoadSkinL( majorId, minorId ); + } + } + CleanupStack::PopAndDestroy( &variant ); + return icon; + } + +// --------------------------------------------------------- +// GetIconL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetIconL( const CLiwDefaultMap* aMap ) + { + CAknIcon* icon = NULL; + TUint iconId( 0 ); + TUint maskId( 0 ); + TPtrC attrStr( KNullDesC ); + TPtrC iconFilePath; + + TLiwVariant variantIconFile; + TLiwVariant variantIconId; + TLiwVariant variantMaskId; + variantIconFile.PushL(); + variantIconId.PushL(); + variantMaskId.PushL(); + TBuf8 attrName; + attrName.Copy( KMenuAttrIconFile ); + + if( aMap->FindL( attrName, variantIconFile)) + { + variantIconFile.Get( iconFilePath ); + attrName.Copy( KMenuAttrIconId ); + if( aMap->FindL( attrName, variantIconId) ) + { + variantIconId.Get( attrStr ); + User::LeaveIfError( MenuUtils::GetTUint( attrStr, iconId ) ); + attrName.Copy( KMenuAttrMaskId ); + if( aMap->FindL( attrName, variantMaskId) ) + { + variantMaskId.Get( attrStr ); + User::LeaveIfError( MenuUtils::GetTUint( attrStr, maskId ) ); + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + RBuf pathBuf; + pathBuf.CleanupClosePushL(); + ParseIconFilePathL(iconFilePath, pathBuf); + AknIconUtils::CreateIconLC( bitmap, mask, + pathBuf, iconId, maskId ); + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + CleanupStack::Pop( 2 ); + CleanupStack::PopAndDestroy( &pathBuf ); + } + } + } + CleanupStack::PopAndDestroy( &variantMaskId ); + CleanupStack::PopAndDestroy( &variantIconId ); + CleanupStack::PopAndDestroy( &variantIconFile ); + return icon; + } + + + + +// --------------------------------------------------------- +// GetDefaultSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetDefaultSkinL( const CLiwDefaultMap* aMap ) + { + CAknIcon* icon = NULL; + TPtrC attrValueUid(KNullDesC); + TPtrC attrValueNative(KNullDesC); + TPtrC attrValueChildren(KNullDesC); + + TLiwVariant variantUid; + variantUid.PushL(); + TLiwVariant variantNative; + variantNative.PushL(); + TLiwVariant variantChildren; + variantChildren.PushL(); + TBuf8 attrName; + + //APPLICATION + attrName.Copy( KMenuAttrUid ); + if( aMap->FindL( attrName, variantUid)) + { + variantUid.Get( attrValueUid ); + + if( attrValueUid == KMenuSatUiUid ) + { + CMcsSatHandler* satHandler = CMcsSatHandler::NewL(); + CleanupStack::PushL( satHandler ); + icon = satHandler->LoadIconL(); + CleanupStack::PopAndDestroy( satHandler ); + } + if( !icon ) + { + attrName.Copy( KMenuAttrNative ); + if( aMap->FindL( attrName, variantNative) ) + { + variantNative.Get( attrValueNative ); + if( attrValueNative == KMenuFalse ) + { + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + //for native + if( CreateMbmIconLC2( bitmap, mask, attrValueUid ) ) + { + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + CleanupStack::Pop( 2 ); + } + } + } + if( !icon ) + { + TUint appUid; + TUid uid; + TInt err = MenuUtils::GetTUint( attrValueUid, appUid ); + if ( !err ) + { + uid = TUid::Uid( appUid ); + icon = LoadAppSkinL( uid ); + } + } + if( !icon ) + { + icon = LoadSkinL( + KAknsIIDQgnMenuUnknownLst.iMajor, + KAknsIIDQgnMenuUnknownLst.iMinor ); + } + } + } + + //FOLDER + TUint childrenCount; + + attrName.Copy( KChildrenCount ); + if( aMap->FindL( attrName, variantChildren)) + { + variantChildren.Get( attrValueChildren ); + TInt err = MenuUtils::GetTUint( attrValueChildren, childrenCount ); + if( childrenCount > 0 ) + { + icon = LoadSkinL( + KAknsIIDQgnPropFolderAppsMedium.iMajor, + KAknsIIDQgnPropFolderAppsMedium.iMinor ); + } + else + { + icon = LoadSkinL( + KAknsIIDQgnMenuFolderEmpty.iMajor, + KAknsIIDQgnMenuFolderEmpty.iMinor ); + } + } + CleanupStack::PopAndDestroy( &variantChildren ); + CleanupStack::PopAndDestroy( &variantNative ); + CleanupStack::PopAndDestroy( &variantUid ); + return icon; + } + +// ================= MEMBER FUNCTIONS ======================= + + +// --------------------------------------------------------- +// MenuIconUtility::GetItemIconL +// --------------------------------------------------------- +// +CAknIcon* McsIconUtility::GetItemIconL( const CLiwDefaultMap* aMap ) + { + CAknIcon* icon = NULL; + + // Try to get the skin of the item + TRAP_IGNORE(icon = GetSkinL( aMap )); + if ( icon ) + { + return icon; + } + + // Try to get the icon of the item (skin failed) + TRAP_IGNORE(icon = GetIconL( aMap )); + if ( icon ) + { + return icon; + } + + // Return a default (skin and icon failed) + icon = GetDefaultSkinL( aMap ); + return icon; + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsmenuopwatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsmenuopwatcher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsmenuoperation.h" +#include "mcsmenuopwatcher.h" +#include "mcsmenuopobserver.h" +#include "mcsoperationmanager.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher* CMCSMenuOpWatcher::NewL( MMCSMenuOpObserver& aObserver, + RMcsOperationManager& aOperationManager ) + { + CMCSMenuOpWatcher* self = new (ELeave) CMCSMenuOpWatcher( aObserver, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher::CMCSMenuOpWatcher( MMCSMenuOpObserver& aObserver, + RMcsOperationManager& aOperationManager ) + : CActive( CActive::EPriorityStandard ), iObserver( aObserver ), + iOperationManager(aOperationManager) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSMenuOpWatcher::~CMCSMenuOpWatcher() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// Watch Async +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::Watch( CMenuOperation& aOperation) + { + __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); + __ASSERT_DEBUG( !iOperation, User::Invariant() ); + iOperation = &aOperation; + SetActive(); + } + +// --------------------------------------------------------------------------- +// CMCSMenuOpWatcher::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSMenuOpWatcher::RunError( TInt aError ) + { + TRAP_IGNORE( iOperationManager.AddL( this ) ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::RunL() + { + delete iOperation; + iOperation = NULL; + iOperationManager.Remove( this );//delete this object and remove it + //from operation manager + TRAP_IGNORE( iObserver.MenuOpCompletedL(iStatus.Int() ) ); + User::LeaveIfError( iStatus.Int() ); + + delete this; + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSMenuOpWatcher::DoCancel() + { + delete iOperation; + iOperation = NULL; + iOperationManager.Remove( this );//delete this object and remove it + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsoperationmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsoperationmanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "mcsoperationmanager.h" + + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +RMcsOperationManager::~RMcsOperationManager() + { + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +void RMcsOperationManager::Close() + { + iOperations.ResetAndDestroy(); + } + + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +RMcsOperationManager::RMcsOperationManager( ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +void RMcsOperationManager::AddL( CActive* aOperation ) + { + User::LeaveIfError( iOperations.Append( aOperation ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +void RMcsOperationManager::Remove( CActive* aOperation ) + { + TInt ptrIndex( iOperations.Find( aOperation ) ); + if ( KErrNotFound != ptrIndex ) + { + iOperations.Remove( ptrIndex ); + } + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsorganizeimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsorganizeimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,223 @@ +/* +* 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: CMCSOrganize implementation +* +*/ + + +#include +#include "mcsmenu.h" +#include "mcsmenuitem.h" +#include "mcsorganizeimpl.h" +#include "mcsservice.h" +#include "mcsmenuopwatcher.h" +#include "mcsoperationmanager.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSOrganizeImpl* CMCSOrganizeImpl::NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) + { + CMCSOrganizeImpl* self = new (ELeave) CMCSOrganizeImpl( aMCS, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSOrganizeImpl::~CMCSOrganizeImpl() + { + Cancel(); + iList.Close(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSOrganizeImpl::CMCSOrganizeImpl( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) : + CActive( EPriorityStandard ), + iCallback( aCallback ), + iMCS( aMCS ), + iOperationManager(aOperationManager) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSOrganizeImpl::ConstructL() + { + iIsSingle = ETrue; + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +void CMCSOrganizeImpl::OrganizeL( + TInt aItemId, TInt aBeforeItemId ) + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + + iItemId = aItemId; + iBeforeItemId = aBeforeItemId; + iIsSingle = ETrue; + + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +void CMCSOrganizeImpl::OrganizeL( const RArray& aList, + TInt aFolderId, TInt aBeforeItemId ) + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + + iList.Reset(); + //iList = aList; + for( TInt idx = 0; idx < aList.Count(); idx++ ) + { + TInt value = aList[idx]; + iList.AppendL( value ); + } + iFolderId = aFolderId; + iBeforeItemId = aBeforeItemId; + iIsSingle = EFalse; + + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +void CMCSOrganizeImpl::OrganizeL() + { + CMCSMenuOpWatcher* watcherAO = CMCSMenuOpWatcher::NewL( *this, + iOperationManager ); + CMenuOperation* operation = NULL; + + CleanupStack::PushL( watcherAO ); + iOperationManager.AddL( watcherAO ); + CleanupStack::Pop( watcherAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + + if( iIsSingle ) + { + TInt id = ( TInt )iItemId; + operation = iMCS.ReorderL( id, iBeforeItemId, watcherAO->iStatus ); + } + else + { + TInt folder = ( iFolderId == 0 ) ? iMCS.RootFolderL() : iFolderId; + operation = iMCS.MoveToFolderL( iList, folder, iBeforeItemId, + watcherAO->iStatus ); + } + watcherAO->Watch( *operation); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSOrganizeImpl::DoCancel() + { +// TRequestStatus* temp = &iStatus; +// User::RequestComplete( temp, KErrCancel ); + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); +// NotifyRequestResult( err ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSOrganizeImpl::RunL() + { + TInt err = iStatus.Int(); + + if ( err == KErrNone ) + { + TRAP( err, OrganizeL() ); + } + if(err != KErrNone) + { + NotifyRequestResult( err ); + } + } + +// --------------------------------------------------------------------------- +// CMCSOrganizeImpl::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSOrganizeImpl::RunError(TInt aError) + { + NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSOrganizeImpl::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSOrganizeImpl::NotifyRequestResult( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + if ( iCallback ) + { + TRAP_IGNORE( iCallback->NotifyResultL( aReason, NULL ) ); + // iCallback deletes itself. + } + delete this; + + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSOrganizeImpl::MenuOpCompletedL(TInt aStatus ) + { + NotifyRequestResult( aStatus ); + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsrequestnotification.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsrequestnotification.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "mcsdef.h" +#include "mcsmenu.h" +#include "mcsmenufilter.h" + +#include "mcsrequestnotification.h" +#include "mcsservice.h" +#include "mcsconstants.h" + + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSReqNotification* CMCSReqNotification::NewL( RMenu& aMCS ) + { + CMCSReqNotification* self = new (ELeave) CMCSReqNotification(); + CleanupStack::PushL( self ); + self->ConstructL(aMCS); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSReqNotification::~CMCSReqNotification() + { + Cancel(); + + // delete iRunningApps; + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSReqNotification::CMCSReqNotification() : CActive( EPriorityStandard ) + { + + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSReqNotification::ConstructL( RMenu& aMCS) + { + TInt err = KErrNone; + err = iNotifier.Open(aMCS); + iMCS = aMCS; + iIsNotification = EFalse; + if(err != KErrNone) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::DoCancel() + { + iNotifier.Close(); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::RunL() + { + TInt event = iStatus.Int(); + if( event != KErrCancel ) + { + if(iIsNotification) + { + if(event) + { + iCallback->NotifyResultL( event, (TAny*) &iFolderId ); + iStatus = KRequestPending; + iNotifier.Notify(iFolderId, iEvents, iStatus ); + SetActive(); + } + else + { + if(event != KErrCancel)// error in notification + { + iCallback->NotifyResultL( event, (TAny*) &iFolderId ); + } + } + } + else + { + iIsNotification = ETrue; + iStatus = KRequestPending; + iNotifier.Notify(iFolderId, iEvents, iStatus ); + SetActive(); + } + } + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + + +// --------------------------------------------------------------------------- +// Start event's notifications +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::StartNotificationL(TInt aFolderId, + TInt aEvent, MMCSCallback* aCallback ) + { + if(IsActive() ) + { + User::Leave( KErrInUse ); + } + iCallback = aCallback; + iFolderId = aFolderId; + iEvents = aEvent; + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// Stop event's notifications +// --------------------------------------------------------------------------- +// +void CMCSReqNotification::StopNotificationL() + { + if ( !IsActive() ) + { + User::Leave(KErrNotFound); + } + else + { + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); + } + } + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsrunningapps.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsrunningapps.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsdef.h" +#include "mcsmenu.h" +#include "mcsmenufilter.h" + +#include "mcsrunningapps.h" +#include "mcsservice.h" +#include "mcsconstants.h" +#include "mcsmenuopwatcher.h" +#include "mcsoperationmanager.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSRunningApps* CMCSRunningApps::NewL( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) + { + CMCSRunningApps* self = new (ELeave) CMCSRunningApps( aMCS, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSRunningApps::~CMCSRunningApps() + { + Cancel(); + iUidArray.Close(); + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSRunningApps::CMCSRunningApps( RMenu& aMCS, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager ) : + CActive( EPriorityStandard ), + iMCS( aMCS ), + iCallback( aCallback ), + iOperationManager(aOperationManager) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSRunningApps::ConstructL( ) + { + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSRunningApps::DoCancel() + { + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSRunningApps::RunL() + { + TInt err = iStatus.Int(); + + if ( err == KErrNone ) + { + RunningAppsChangedL();//temporary + } + if(err != KErrNone) + { + NotifyRequestResult( err ); + } + } + +// --------------------------------------------------------------------------- +// CMCSRunningApps::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSRunningApps::RunError(TInt aError) + { + NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSRunningApps::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSRunningApps::NotifyRequestResult( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + if ( iCallback ) + { + TRAP_IGNORE( iCallback->NotifyResultL( aReason, (TAny*)(&iUidArray))); + // iCallback deletes itself. + } + delete this; + } + +// --------------------------------------------------------------------------- +// ExecuteActionL - Async +// --------------------------------------------------------------------------- +void CMCSRunningApps::GetRunningApplicationL() + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSRunningApps::RunningAppsChangedL() + { + TRAPD(err, + { + RArray uids; + CleanupClosePushL( uids ); + iMCS.GetRunningAppsL( uids ); + for(TInt i =0; iConstructL(aContent); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMCSService::~CMCSService() + { + if( iReqNotifier ) + { + TRAP_IGNORE(iReqNotifier->StopNotificationL()); + delete iReqNotifier; + iReqNotifier = NULL; + } + iOperationManager.Close(); + iMCS.Close(); + delete iIgnoredAttributes; + delete iRequiredAttributes; + } + +// --------------------------------------------------------------------------- +// Constructor. +// --------------------------------------------------------------------------- +// +CMCSService::CMCSService() + { + } + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +void CMCSService::ConstructL(const TDesC& aContent) + { + iMCS.OpenL(aContent); + iIsRegistered = EFalse; + + iIgnoredAttributes = new (ELeave) CDesC16ArrayFlat(1); + iRequiredAttributes = new (ELeave) CDesC16ArrayFlat(8); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSService::SetFlagInMenuitemL( CLiwMap& aInputMap, + CMenuItem& aMenuitem, TMenuItem::TFlags aFlag) + { + TLiwVariant param; + TPtrC8 key ( KNullDesC8 ); + switch ( aFlag ) + { + case TMenuItem::ELockDelete: + key.Set( KDeleteLocked ); + break; + case TMenuItem::ELockName: + key.Set( KNameLocked ); + break; + case TMenuItem::ELockIcon: + key.Set( KIconLocked ); + break; + case TMenuItem::ELockMoveInto: + key.Set( KMoveLocked ); + break; + case TMenuItem::ELockItem: + key.Set( KAddingLocked ); + break; + case TMenuItem::EHidden: + key.Set( KHidden ); + break; + case TMenuItem::EMissing: + key.Set( KMissing ); + break; + } + if( aInputMap.FindL( key, param)) + { + if (param.AsTBool()) + { + aMenuitem.SetFlags(aFlag, ETrue); + } + else + { + aMenuitem.SetFlags(aFlag, EFalse); + } + aInputMap.Remove( key ); + param.Reset(); + } + + } + +// --------------------------------------------------------------------------- +// Update item and its attributes. +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::UpdateItemL(MMCSCallback* aCallBack, TDesC& aType, + TInt aId, TInt aParentId, TInt aBeforeId, CLiwMap& aInputMap) + { + TBuf8 attrname; + TBuf16 attrname16; + TBuf16 paramValStr; + TPtrC paramvalue; + TLiwVariant param; + + if( !aCallBack ) + { + User::Leave( KErrArgument ); + } + CMenuItem* menuItem; + + // If if is zero then create new menu item + if (!aId) + { + menuItem = CMenuItem::CreateL( iMCS, aType, aParentId, aBeforeId ); + } + // Otherwise open existing menu item + else + { + menuItem = CMenuItem::OpenL(iMCS, aId); + } + CleanupStack::PushL( menuItem ); + + attrname.Copy(KMenuAttrRefId()); + if( aInputMap.FindL( attrname, param)) + { + paramValStr.Num( param.AsTInt32()); + aInputMap.Remove(attrname); + menuItem->SetAttributeL(KMenuAttrRefId(), paramValStr); + } + else + { + if( aType == KMenuTypeLink) + { + User::Leave( KErrArgument ); + } + } + param.Reset(); + + // Flags parsing + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::ELockName); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::ELockIcon); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::ELockDelete); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::ELockMoveInto); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::ELockItem); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::EHidden); + SetFlagInMenuitemL( aInputMap, *menuItem, TMenuItem::EMissing); + + for(TInt index = 0; index < aInputMap.Count(); index++) + { + aInputMap.AtL(index, attrname); + aInputMap.FindL( attrname, param); + paramvalue.Set(param.AsDes()); + attrname16.Copy(attrname); + menuItem->SetAttributeL( attrname16, paramvalue ); + param.Reset(); + } + + CMCSUpdateItem* updateAO = CMCSUpdateItem::NewL( *menuItem, aCallBack, + iOperationManager ); + CleanupStack::PushL( updateAO ); + iOperationManager.AddL( updateAO ); + CleanupStack::Pop(updateAO); + updateAO->UpdateItemL(); + + CleanupStack::Pop(menuItem); + } + +// --------------------------------------------------------------------------- +// GetListL +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::GetListL( const CLiwGenericParamList& aInParamList, MMCSCallback* aCallBack ) + { + if( !aCallBack ) + { + User::Leave( KErrArgument ); + } + CMCSGetListImpl* getListAO = CMCSGetListImpl::NewL( iMCS, aCallBack, + iOperationManager ); + CleanupStack::PushL(getListAO); + iOperationManager.AddL( getListAO ); + CleanupStack::Pop(getListAO); + getListAO->GetListL( aInParamList ); + } + +// --------------------------------------------------------------------------- +// GetRunningAppsL +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::GetRunningAppsL( MMCSCallback* aCallback ) + { + if( !aCallback ) + { + User::Leave( KErrArgument ); + } + + CMCSRunningApps* getRunningAppsAO = CMCSRunningApps::NewL( iMCS, aCallback, + iOperationManager ); + CleanupStack::PushL(getRunningAppsAO); + iOperationManager.AddL( getRunningAppsAO ); + CleanupStack::Pop(getRunningAppsAO); + getRunningAppsAO->GetRunningApplicationL(); + } + +// --------------------------------------------------------------------------- +// ExecuteActionL +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::ExecuteActionL( MMCSCallback* aCallback, + TInt aItemId, TDesC8& aAction ) + { + if( !aCallback ) + { + User::Leave( KErrArgument ); + } + CMCSExecuteAction* executeAO = CMCSExecuteAction::NewL( iMCS, aCallback, + iOperationManager ); + CleanupStack::PushL( executeAO ); + iOperationManager.AddL( executeAO ); + CleanupStack::Pop(executeAO); + executeAO->ExecuteActionL( aItemId, aAction); + } + +// --------------------------------------------------------------------------- +// DeleteL +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::DeleteL( MMCSCallback* aCallBack, TInt aItemId ) + { + if( !aCallBack ) + { + User::Leave( KErrArgument ); + } + CMCSDeleteItem* deleteAO = CMCSDeleteItem::NewL( iMCS, aCallBack, + iOperationManager ); + CleanupStack::PushL(deleteAO); + iOperationManager.AddL( deleteAO ); + CleanupStack::Pop(deleteAO); + deleteAO->DeleteItemL( aItemId ); + } + + +// --------------------------------------------------------------------------- +// Set GetRunningAppsL output to output parameter +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::SetRunningAppsOutputL( RArray& aOutputArray, + CLiwGenericParamList& aOutParamList ) + { + //List of Maps + TBuf8 attrname; + CLiwDefaultList *list = CLiwDefaultList::NewL(); + CleanupStack::PushL( list ); + + TInt arrCount = aOutputArray.Count(); + + for( TInt index = 0; index < arrCount; ++index ) + { + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + TUid auid = aOutputArray[index]; + attrname.Copy(KMenuAttrUid()); + + map->InsertL( attrname, TLiwVariant( (TInt32) aOutputArray[index].iUid )); + + list->AppendL( TLiwVariant( map ) ); + + CleanupStack::PopAndDestroy( map ); + } + + aOutParamList.AppendL( TLiwGenericParam( KReturnValue, TLiwVariant( list ) ) ); + + CleanupStack::Pop( list ); + list->DecRef(); + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::OrganizeL( MMCSCallback* aCallBack, + TInt aMoveItemId, TInt aBeforeItemId ) + { + if( !aCallBack ) + { + User::Leave( KErrArgument ); + } + + CMCSOrganizeImpl* organizeAO = CMCSOrganizeImpl::NewL( iMCS, aCallBack, + iOperationManager ); + CleanupStack::PushL( organizeAO ); + iOperationManager.AddL( organizeAO ); + CleanupStack::Pop( organizeAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + organizeAO->OrganizeL( aMoveItemId, aBeforeItemId ); + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::OrganizeL( MMCSCallback* aCallBack, + const RArray& aList, TInt aFolderId, TInt aBeforeItemId ) + { + if( !aCallBack ) + { + User::Leave( KErrArgument ); + } + + + CMCSOrganizeImpl* organizeAO = CMCSOrganizeImpl::NewL( iMCS, aCallBack, + iOperationManager ); + CleanupStack::PushL( organizeAO ); + iOperationManager.AddL( organizeAO ); + CleanupStack::Pop( organizeAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + organizeAO->OrganizeL( aList, aFolderId, aBeforeItemId ); + } + +// --------------------------------------------------------------------------- +// Set RequestNotification output to output parameter +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::SetReqNotificationOutputL( TInt aFolderId, + TInt aEvent, CLiwGenericParamList& aOutParamList ) + { + + TBuf8 attrname; + CLiwDefaultMap* map = CLiwDefaultMap::NewLC(); + + attrname.Copy(KMenuAttrId()); + map->InsertL( attrname, TLiwVariant( (TInt32)aFolderId)); + + if(aEvent & RMenuNotifier::EItemsAddedRemoved) + { + map->InsertL( KAddRemove, TLiwVariant( (TBool) ETrue) ); + + } + if( aEvent & RMenuNotifier::EItemsReordered) + { + map->InsertL( KReorder, TLiwVariant( (TBool) ETrue) ); + } + if( aEvent & RMenuNotifier::EItemAttributeChanged) + { + map->InsertL( KAttributeChange, TLiwVariant( (TBool) ETrue) ); + } + + aOutParamList.AppendL( TLiwGenericParam( KReturnValue, TLiwVariant( map ) ) ); + CleanupStack::PopAndDestroy( map ); + } + + +// --------------------------------------------------------------------------- +// Stop Notification for changes in mcs +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::UnRegisterObserverL() + { + if ( iReqNotifier == NULL ) + { + User::Leave( KErrNotFound ); + } + iReqNotifier->StopNotificationL(); + + delete iReqNotifier; + iReqNotifier = NULL; + iIsRegistered = EFalse; + } + +// --------------------------------------------------------------------------- +// Start Notification for changes in mcs +// --------------------------------------------------------------------------- +// +EXPORT_C void CMCSService::RegisterObserverL(TInt aFolderId,TInt aEvents,MMCSCallback* aCallBack ) + { + if( !aCallBack ) + User::Leave( KErrArgument ); + + if(!iIsRegistered) + { + iReqNotifier = CMCSReqNotification::NewL( iMCS ); + iIsRegistered = ETrue; + } + iReqNotifier->StartNotificationL(aFolderId, aEvents, aCallBack); + } + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsupdateitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsupdateitem.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsmenuitem.h" +#include "mcsmenuoperation.h" + +#include "mcsupdateitem.h" +#include "mcscallback.h" +#include "mcsservice.h" +#include "mcsmenuopwatcher.h" +#include "mcsoperationmanager.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSUpdateItem* CMCSUpdateItem::NewL( CMenuItem& aMenu, + MMCSCallback* aCallback, RMcsOperationManager& aOperationManager ) + { + CMCSUpdateItem* self = new (ELeave) CMCSUpdateItem( aMenu, aCallback, + aOperationManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSUpdateItem::~CMCSUpdateItem() + { + Cancel(); + delete iMenu; + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSUpdateItem::CMCSUpdateItem( CMenuItem& aMenu, MMCSCallback* aCallback, + RMcsOperationManager& aOperationManager) : + CActive( EPriorityStandard ), + iCallback( aCallback ), + iMenu( &aMenu ), + iOperationManager(aOperationManager) + { + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSUpdateItem::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Async update (add/change) item +// --------------------------------------------------------------------------- +void CMCSUpdateItem::UpdateItemL() + { + if( !iCallback ) + { + User::Leave( KErrArgument ); + } + CActiveScheduler::Add ( this ); + ActivateRequest( KErrNone ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSUpdateItem::DoCancel() + { + //TRequestStatus* temp = &iStatus; + //User::RequestComplete( temp, KErrCancel ); + TRAP_IGNORE( iCallback->NotifyResultL( KErrCancel, NULL )); + //NotifyRequestResult( err ); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +// +void CMCSUpdateItem::RunL() + { + TInt err = iStatus.Int(); + if ( err == KErrNone ) + { + CMCSMenuOpWatcher* watcherAO = CMCSMenuOpWatcher::NewL( *this, + iOperationManager ); + CleanupStack::PushL( watcherAO ); + iOperationManager.AddL( watcherAO ); + CleanupStack::Pop( watcherAO );// we pop item from cleanupstack because + //ownership was transfered to operation manager + + CMenuOperation* operation = iMenu->SaveL( watcherAO->iStatus ); + + watcherAO->Watch( *operation ); + } + else + { + NotifyRequestResult( err ); + } + } + +// --------------------------------------------------------------------------- +// CMCSUpdateItem::RunError +// --------------------------------------------------------------------------- +// +TInt CMCSUpdateItem::RunError(TInt aError) + { + NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } + return aError; + } + +// --------------------------------------------------------------------------- +// Activates the asynchronous request +// --------------------------------------------------------------------------- +// +void CMCSUpdateItem::ActivateRequest( TInt aReason ) + { + iStatus = KRequestPending; + SetActive(); + TRequestStatus* temp = &iStatus; + User::RequestComplete( temp, aReason ); + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSUpdateItem::NotifyRequestResult( TInt aReason ) + { + iOperationManager.Remove( this );//remove it + //from operation manager + if ( iCallback ) + { + TInt id = iMenu->Id(); + TRAP_IGNORE(iCallback->NotifyResultL( aReason, (TAny*)&id)); + } + delete this; + } + +// -------------------------------------------------------------------------------------------------------- +// Notifies callback the result for asynchronous request. +// -------------------------------------------------------------------------------------------------------- +// +void CMCSUpdateItem::MenuOpCompletedL(TInt aStatus ) + { + NotifyRequestResult( aStatus ); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/rom/mcssapi.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/rom/mcssapi.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 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 MCSSAPI_IBY +#define MCSSAPI_IBY + +#include + +file=ABI_DIR\BUILD_DIR\mcsservice.dll SHARED_LIB_DIR\mcsservice.dll +ECOM_PLUGIN( mcsprovider.dll, 2001242C.rsc ) + + +#endif + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/sapi_menucontent.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/sapi_menucontent.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,13 @@ + + +sapi_menucontent +Menu Content Service Service API +c++ +menucontentsrv + + + +no +no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/src/mcscallback.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/src/mcscallback.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcscallback.h" +#include "mcsdsinterface.h" +#include "mcsconstants.h" + +// --------------------------------------------------------------------------- +// Two-phase Constructor +// --------------------------------------------------------------------------- +// +CMCSCallback* CMCSCallback::NewL( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList& aPtrInParamList, + TInt32 aTransactionId, CMCSService& aMcsService,TCmds aCmd ) + { + return new (ELeave) CMCSCallback( aPtrNotifyCallback, aPtrInParamList, aTransactionId, + aMcsService, aCmd); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CMCSCallback::CMCSCallback( MLiwNotifyCallback *aPtrNotifyCallback, + const CLiwGenericParamList& aPtrInParamList, + TInt32 aTransactionId, CMCSService& aMcsService, + TCmds aCmd ) + { + iPtrNotifyCallback = aPtrNotifyCallback; + iPtrInParamList = &aPtrInParamList; + iTransactionId = aTransactionId; + iMcsService = &aMcsService; + iCmd = aCmd; + } + +// --------------------------------------------------------------------------- +// Gives the result of asynchronous SAPI calls +// --------------------------------------------------------------------------- +// +void CMCSCallback::NotifyResultL( TInt aErrCode, TAny* aResult ) + { + CLiwGenericParamList* outParams= NULL; + + if(iCmd != ERequestNotification || + (iCmd == ERequestNotification && aErrCode == KErrCancel)) + { + CleanupStack::PushL( this); + outParams = CLiwGenericParamList::NewLC(); + outParams->AppendL(TLiwGenericParam(KErrorCode, + TLiwVariant(CMCSDSInterface::ErrCodeConversion(aErrCode)))); + } + else + { + outParams = CLiwGenericParamList::NewLC(); + } + + HandleComandL( aErrCode, aResult, *outParams ); + + + TInt event = KLiwEventInProgress; + if (aErrCode == KErrCancel) + { + event = KLiwEventCanceled; + } + else + if (aErrCode != KErrNone) + { + event = KLiwEventStopped; + } + + ((MLiwNotifyCallback*)iPtrNotifyCallback)->HandleNotifyL( + iTransactionId, event, *outParams, + *((CLiwGenericParamList*)iPtrInParamList)); + + CleanupStack::PopAndDestroy(outParams); + if (iCmd != ERequestNotification || (iCmd == ERequestNotification + && aErrCode == KErrCancel)) + { + CleanupStack::PopAndDestroy(this); + } + } + + +// --------------------------------------------------------------------------- +// CMCSCallback::HandleComandL +// --------------------------------------------------------------------------- +// +void CMCSCallback::HandleComandL( TInt &aErrCode, TAny* aResult, + CLiwGenericParamList& aParamList) + { + + switch (iCmd) + { + case EGetList: + { + if (aResult && aErrCode == KErrNone) + { + aParamList.AppendL(*static_cast(aResult)); + } + } + break; + case EExecuteAction: + { + // Do Nothing. + } + break; + case ERequestNotification: + { + if (aResult) + { + TInt &folderId = *((TInt*)aResult); + TInt event = aErrCode; + if (event) + { + aErrCode = KErrNone; + } + aParamList.AppendL(TLiwGenericParam( KErrorCode, + TLiwVariant(CMCSDSInterface::ErrCodeConversion(aErrCode)))); + iMcsService->SetReqNotificationOutputL(folderId, event, aParamList ); + + } + } + break; + case EAddORChange: + { + if (aErrCode== KErrNone) + { + TBuf8 attrname; + TInt &itemId = *((TInt*)aResult); + attrname.Copy(KMenuAttrId()); + aParamList.AppendL(TLiwGenericParam(attrname, TLiwVariant( (TInt32) itemId ) ) ); + } + // Do Nothing. + } + break; + case EDelete: + { + // Do Nothing + } + break; + case EOrganize: + { + // Do Nothing + } + break; + case EGetRunningApps: + { + if (aResult) + { + RArray& outputArray = *((RArray*)aResult); + iMcsService->SetRunningAppsOutputL(outputArray, aParamList); + } + } + break; + default: + { + // Do Nothing + } + break; + } + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/src/mcsdsinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/src/mcsdsinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,424 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include +#include "mcsdef.h" +#include "mcsmenufilter.h" +#include "mcsmenuitem.h" +#include "mcsmenunotifier.h" + +#include "serviceerrno.h" +#include "mcsservice.h" +#include "mcsdsinterface.h" +#include "mcscallback.h" +#include "mcsconstants.h" + + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CMCSDSInterface* CMCSDSInterface::NewL(const TDesC& aContent) + { + CMCSDSInterface* self = new (ELeave) CMCSDSInterface(); + CleanupStack::PushL( self ); + self->ConstructL(aContent); + CleanupStack::Pop( self ); + return self; + } +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMCSDSInterface::~CMCSDSInterface() + { + delete iMCSService; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CMCSDSInterface::CMCSDSInterface() + { + } + +// --------------------------------------------------------------------------- +// Symbian Constructor +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::ConstructL(const TDesC& aContent) + { + iMCSService = CMCSService::NewL(aContent); + } + +// --------------------------------------------------------------------------- +// Executes the SAPI as per params +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::ExecuteCmdL( const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint aCmdOptions, + MLiwNotifyCallback* aCallback ) + { + TInt errcode = KErrNotSupported; + TInt32 transactionId = -1; + + aOutParamList.AppendL(TLiwGenericParam( KErrorCode, + TLiwVariant( ErrCodeConversion( KErrNone )))); + + if ( !aCallback ) + { + // Callback is a null pointer + errcode = KErrArgument; + } + else + { + + if ( aCmdName.CompareF( KCmdAdd ) == 0 ) + { + TRAP(errcode, AddItemL( aInParamList, aCallback )); + } + else if ( aCmdName.CompareF( KCmdDelete ) == 0 ) + { + TRAP(errcode, DeleteL( aInParamList, aCallback )); + } + else if ( aCmdName.CompareF( KCmdGetList ) == 0 ) + { + TRAP(errcode, GetListL( aInParamList, aCallback )); + } + else if ( aCmdName.CompareF( KCmdReqNotification ) == 0 ) + { + if( aCallback && !(aCmdOptions & KLiwOptCancel) ) + { + TRAP(errcode, RequestNotificationL(aInParamList, aCallback)); + } + if ( aCmdOptions & KLiwOptCancel ) + { + TRAP(errcode, iMCSService->UnRegisterObserverL()); + } + + } + + // Append transaction id in case of asynchronous requests + if( ( KLiwOptASyncronous & aCmdOptions ) && + ( errcode == KErrNone ) && ( transactionId != -1 ) ) + { + aOutParamList.AppendL(TLiwGenericParam( KTransactionID, + TLiwVariant( TInt32( transactionId )))); + } + } + + if( errcode != KErrNone ) + { + aOutParamList.Reset(); + aOutParamList.AppendL(TLiwGenericParam( KErrorCode, + TLiwVariant(ErrCodeConversion(errcode)))); + } + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::Close() + { + delete this; + } + +// --------------------------------------------------------------------------- +// Issues Add a new Item request to MCSService +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::AddItemL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ) + { + TInt32 itemId = 0; + TInt32 parentId = 0; + TInt32 beforeId = 0; + TInt pos = 0; + TPtrC paramvalue; + + TBuf16 paramValStr; + TBuf16 attrname16; + TBuf8 attrname; + TBuf16 paramType; + TLiwVariant param; + + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KInData ); + if (inParam) + { + CLiwMap* inputMap = (CLiwMap*)inParam->Value().AsMap(); + if ( inputMap ) + { + attrname.Copy(KMenuAttrId()); + if( inputMap->FindL( attrname, param)) + { + param.Get(itemId); + inputMap->Remove( attrname ); + } + param.Reset(); + if( inputMap->FindL( KParentId, param)) + { + param.Get(parentId); + inputMap->Remove( KParentId ); + } + param.Reset(); + + if( inputMap->FindL( KBeforeId, param)) + { + param.Get(beforeId); + inputMap->Remove(KBeforeId); + } + param.Reset(); + if( inputMap->FindL( KType, param)) + { + paramType.Copy(param.AsDes()); + inputMap->Remove( KType ); + } + param.Reset(); + + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService,CMCSCallback::EAddORChange ); + CleanupStack::PushL(cb); + iMCSService->UpdateItemL(cb, paramType, itemId, parentId, beforeId, *inputMap); + CleanupStack::Pop(cb); + } + else + { + User::Leave(KErrArgument); + } + } + else + { + User::Leave(KErrArgument); + } + } + +// --------------------------------------------------------------------------- +// Issues GetList request to MCSService +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::GetListL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ) + { + CheckGetListInputListL( aInParamList ); + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService,CMCSCallback::EGetList ); + CleanupStack::PushL(cb); + iMCSService->GetListL( aInParamList, cb ); + CleanupStack::Pop(cb); + } +// --------------------------------------------------------------------------- +// Check if inputlist for getlist is proper +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::CheckGetListInputListL( const CLiwGenericParamList& + aInParamList ) + { + TInt pos( 0 ); + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KInData ); + if (inParam) + { + const CLiwMap* inputMap = inParam->Value().AsMap(); + if ( inputMap ) + { + TLiwVariant param; + // Folder Id + if( !inputMap->FindL( KMenuAttrId8, param ) ) + { + User::Leave( KErrArgument ); + } + } + else + { + User::Leave( KErrArgument ); + } + } + else + { + User::Leave( KErrArgument ); + } + } + +// --------------------------------------------------------------------------- +// Issues Change Notification request to MCSService +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::RequestNotificationL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback) + + { + TInt pos = 0; + TInt events = 0; + TBuf8 attrname; + TInt paramFolderId = 0; + TLiwVariant param; + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KInData ); + if (inParam) + { + const CLiwMap* inputMap = inParam->Value().AsMap(); + if ( inputMap ) + { + // Folder Id + attrname.Copy(KMenuAttrId()); + if( inputMap->FindL( attrname, param)) + { + paramFolderId = param.AsTInt32(); + } + param.Reset(); + if( inputMap->FindL( KAddRemove, param)) + { + if (param.AsTBool()) + { + events = events | RMenuNotifier::EItemsAddedRemoved; + } + } + param.Reset(); + if( inputMap->FindL( KReorder, param)) + { + if (param.AsTBool()) + { + events = events | RMenuNotifier::EItemsReordered; + } + } + param.Reset(); + if( inputMap->FindL( KAttributeChange, param)) + { + if (param.AsTBool()) + { + events = events | RMenuNotifier::EItemAttributeChanged; + } + } + param.Reset(); + } + } + + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService, CMCSCallback::ERequestNotification ); + CleanupStack::PushL( cb ); + + // Issue request + if(events) + { + iMCSService->RegisterObserverL(paramFolderId, events, cb ); + } + else + { + User::Leave(KErrArgument); + } + CleanupStack::Pop( cb ); + } + +// --------------------------------------------------------------------------- +// Issues Delete an item request to MCSService +// --------------------------------------------------------------------------- +// +void CMCSDSInterface::DeleteL( const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback ) + { + TInt pos = 0; + TBuf8 attrname; + TInt itemId = -1; + TLiwVariant param; + const TLiwGenericParam* inParam = aInParamList.FindFirst( pos, KInData ); + if (inParam) + { + const CLiwMap* inputMap = inParam->Value().AsMap(); + if ( inputMap ) + { + // Item Id + attrname.Copy(KMenuAttrId()); + if( inputMap->FindL( attrname, param)) + { + itemId = param.AsTInt32(); + } + param.Reset(); + } + } + + if (itemId == -1) + { + User::Leave(KErrArgument); + } + else + { + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService,CMCSCallback::EDelete ); + CleanupStack::PushL(cb); + + iMCSService->DeleteL( cb, itemId ); + CleanupStack::Pop(cb); + } + } + + +// --------------------------------------------------------------------------- +// ErrCode Conversion +// --------------------------------------------------------------------------- +// +TInt32 CMCSDSInterface::ErrCodeConversion(TInt code) + { + TInt32 err; + switch (code) + { + case KErrCancel: + // Returning KErrNone incase of KErrCancel + case KErrNone: + err= SErrNone; + break; + + case KErrNotFound: + err= SErrNotFound; + break; + + case KErrNoMemory: + err = SErrNoMemory; + break; + + case KErrInUse: + err = SErrServiceInUse; + break; + + case KErrNotSupported: + err = SErrServiceNotSupported; + break; + + case KErrBadName: + err = SErrBadArgumentType; + break; + + case KErrArgument: + err = SErrInvalidServiceArgument; + break; + + case KErrAccessDenied: + err = SErrAccessDenied; + break; + + default: + err = SErrGeneralError; + break; + } + + return err; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/src/mcsmcinterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/src/mcsmcinterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + + +#include +#include +#include "mcsdef.h" +#include "mcsmenufilter.h" +#include "mcsmenuitem.h" + +#include "serviceerrno.h" +#include "mcsservice.h" +#include "mcsmcinterface.h" +#include "mcscallback.h" +#include "mcsconstants.h" + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CMCSMCInterface* CMCSMCInterface::NewL(const TDesC& aContent) + { + CMCSMCInterface* self = new (ELeave) CMCSMCInterface(); + CleanupStack::PushL(self); + self->ConstructL(aContent); + CleanupStack::Pop(self); + return self; + } +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMCSMCInterface::~CMCSMCInterface() + { + delete iMCSService; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CMCSMCInterface::CMCSMCInterface() + { + } + +// --------------------------------------------------------------------------- +// Symbian Constructor +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::ConstructL(const TDesC& aContent) + { + iMCSService = CMCSService::NewL(aContent); + } + +// --------------------------------------------------------------------------- +// Executes the SAPI as per params +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::ExecuteCmdL(const TDesC8& aCmdName, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, TUint aCmdOptions, + MLiwNotifyCallback* aCallback) + { + TInt errcode = KErrNotSupported; + TInt32 transactionId = -1; + + aOutParamList.AppendL(TLiwGenericParam(KErrorCode, + TLiwVariant(ErrCodeConversion(KErrNone)))); + + if ( !aCallback ) + { + // Callback is a null pointer + errcode = KErrArgument; + } + else + { + if (aCmdName.CompareF(KCmdExecuteAction) == 0) + { + TRAP(errcode, ExecuteActionL( aInParamList, aCallback )); + } + else if (aCmdName.CompareF(KcmdRunningApps) == 0) + { + TRAP(errcode, GetRunningAppsL( aInParamList, aCallback )); + } + else if (aCmdName.CompareF(KCmdOrganize) == 0) + { + aOutParamList.Reset(); + TRAP(errcode, OrganizeL( aInParamList, aOutParamList, aCallback )); + } + + // Append transaction id in case of asynchronous requests + if ( (KLiwOptASyncronous & aCmdOptions ) && (errcode + == KErrNone ) && (transactionId != -1 )) + { + aOutParamList.AppendL(TLiwGenericParam(KTransactionID, + TLiwVariant(TInt32(transactionId)))); + } + } + + if (errcode != KErrNone) + { + aOutParamList.Reset(); + aOutParamList.AppendL(TLiwGenericParam(KErrorCode, + TLiwVariant(ErrCodeConversion(errcode)))); + } + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::Close() + { + delete this; + } + +// --------------------------------------------------------------------------- +// Closes the interface +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::GetRunningAppsL(const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback) + { + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService, + CMCSCallback::EGetRunningApps); + CleanupStack::PushL(cb); + iMCSService->GetRunningAppsL(cb); + CleanupStack::Pop(cb); + + } +// --------------------------------------------------------------------------- +// Execute actions +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::ExecuteActionL(const CLiwGenericParamList& aInParamList, + MLiwNotifyCallback* aCallback) + { + TLiwVariant param; + TInt32 itemId = -1; + TInt pos = 0; + TPtrC8 action; + TBuf8 buf8; + + const TLiwGenericParam* inParam = aInParamList.FindFirst(pos, KInData); + + if (inParam) + { + const CLiwMap* inputMap = inParam->Value().AsMap(); + if (inputMap) + { + // Item Id + buf8.Copy(KMenuAttrId()); + if (inputMap->FindL(buf8, param)) + { + itemId = param.AsTInt32(); + } + param.Reset(); + // Action + if (inputMap->FindL(KAction, param)) + { + action.Set(param.AsData()); + if (param == KActionOpen() ) + { + action.Set(KMenuCmdOpen()); + } + else + if (param == KActionRemove() ) + { + action.Set(KMenuCmdRemove()); + } + else + { + itemId = -1; + } + } + else + { + itemId = -1; + } + param.Reset(); + } + } + + if (itemId == -1) + { + User::Leave(KErrArgument); + } + else + { + CMCSCallback* cb = CMCSCallback::NewL(aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService, + CMCSCallback::EExecuteAction); + CleanupStack::PushL(cb); + iMCSService->ExecuteActionL(cb, itemId, action); + CleanupStack::Pop(cb); + } + } + +// --------------------------------------------------------------------------- +// GetParamFromMap +// --------------------------------------------------------------------------- +// +TBool CMCSMCInterface::GetParamFromMapL( const CLiwMap* aInputMap, + const TDesC8& aParamName, RArray& aOutputList ) + { + TBool status = EFalse; + TLiwVariant param; + param.PushL(); + if ( aInputMap->FindL ( aParamName, param ) ) + { + const CLiwList* paramList = param.AsList(); + if(paramList) + { + for (TInt i = 0; i < paramList->Count(); i++) + { + TLiwVariant variant; + variant.PushL(); + if (paramList->AtL(i, variant) ) + { + TInt value = 0; + if (variant.Get(value) ) + { + aOutputList.AppendL( value ); + } + } + CleanupStack::PopAndDestroy( &variant ); + } + } + } + CleanupStack::PopAndDestroy( ¶m ); + + if( aOutputList.Count() > 0 ) + { + status = ETrue; + } + + return status; + } + +// --------------------------------------------------------------------------- +// GetParamFromMap +// --------------------------------------------------------------------------- +// +TBool CMCSMCInterface::GetParamFromMapL( const CLiwMap* aInputMap, + const TDesC8& aParamName, TInt& aOutputValue ) + { + TBool status = EFalse; + TLiwVariant param; + param.PushL(); + if ( aInputMap->FindL( aParamName, param ) ) + { + param.Get( aOutputValue ); + status = ETrue; + } + CleanupStack::PopAndDestroy( ¶m ); + return status; + } + +// --------------------------------------------------------------------------- +// Organize +// --------------------------------------------------------------------------- +// +void CMCSMCInterface::OrganizeL( const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + MLiwNotifyCallback* aCallback ) + { + TInt errcode = KErrArgument; + TBuf8 attrname; + TBuf16 paramType; + TInt pos = 0; + + const TLiwGenericParam* inParam = aInParamList.FindFirst(pos, KInData); + if (inParam) + { + const CLiwMap* inputMap = (CLiwMap*)inParam->Value().AsMap(); + if (inputMap) + { + RArray list; + TInt beforeItemId = 0; + TInt folderId = 0; + CleanupClosePushL( list ); + if( GetParamFromMapL( inputMap, KItemIds, list ) ) + { + GetParamFromMapL( inputMap, KBeforeItemId, beforeItemId ); + + CMCSCallback* cb = CMCSCallback::NewL( aCallback, aInParamList, + aCallback->GetTransactionID(), *iMCSService, + CMCSCallback::EOrganize ); + + CleanupStack::PushL(cb); + if( GetParamFromMapL( inputMap, KFolderId, folderId ) ) + { + iMCSService->OrganizeL( cb, list, folderId, beforeItemId ); + } + else + { + iMCSService->OrganizeL( cb, list[0], beforeItemId ); + } + CleanupStack::Pop(cb); + errcode = KErrNone; + } + + CleanupStack::PopAndDestroy( &list ); + } + } + + aOutParamList.AppendL( TLiwGenericParam( KErrorCode, + TLiwVariant( ErrCodeConversion( errcode ) ) ) ); + } + +// --------------------------------------------------------------------------- +// ErrCode Conversion +// --------------------------------------------------------------------------- +// +TInt32 CMCSMCInterface::ErrCodeConversion(TInt code) + { + TInt32 err; + switch (code) + { + case KErrCancel: + // Returning KErrNone incase of KErrCancel + case KErrNone: + err= SErrNone; + break; + + case KErrNotFound: + err= SErrNotFound; + break; + + case KErrNoMemory: + err = SErrNoMemory; + break; + + case KErrInUse: + err = SErrServiceInUse; + break; + + case KErrNotSupported: + err = SErrServiceNotSupported; + break; + + case KErrBadName: + err = SErrBadArgumentType; + break; + + case KErrArgument: + err = SErrInvalidServiceArgument; + break; + + default: + err = SErrGeneralError; + break; + } + + return err; + } + +// End of file + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/sapi_menucontent/src/mcsservicehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/sapi_menucontent/src/mcsservicehandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#include +#include + +#include "mcsconstants.h" +#include "mcsdsinterface.h" +#include "mcsmcinterface.h" +#include "mcsservicehandler.h" +#include "serviceerrno.h" + +// --------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------- +// +CMCSServiceHandler* CMCSServiceHandler::NewL() + { + return new(ELeave) CMCSServiceHandler(); + } + +// --------------------------------------------------------- +// Constructor. +// --------------------------------------------------------- +// +CMCSServiceHandler::CMCSServiceHandler() + { + } + +// --------------------------------------------------------- +// Called by the LIW framework to initialise necessary information +// from the Service Handler. This method is called when the consumer makes +//the attach operation. +// --------------------------------------------------------- +// +void CMCSServiceHandler::InitialiseL( + MLiwNotifyCallback& /*aFrameworkCallback*/, + const RCriteriaArray& aInterest) + { + TInt count = aInterest.Count(); + for(TInt index = 0; index < count ; index++) + { + if(aInterest[index]->ContentType() == KMCSService) + return; + } + + User::Leave( SErrNotFound ); + } + +// --------------------------------------------------------- +// Executes generic service commands included in criteria +// --------------------------------------------------------- +// +void CMCSServiceHandler::HandleServiceCmdL( + const TInt& aCmdId, + const CLiwGenericParamList& aInParamList, + CLiwGenericParamList& aOutParamList, + TUint /*aCmdOptions*/, + const MLiwNotifyCallback* /*aCallback*/) + { + if ( aCmdId == KLiwCmdAsStr ) + { + TInt pos = 0; + const TLiwGenericParam* content = aInParamList.FindFirst( pos, KContentName ); + const TLiwGenericParam* cmd = aInParamList.FindFirst( pos, KGenericParamID ); + if ( content && cmd ) + { + TPtrC cmdName; + TPtrC8 cmdPtr; + cmdName.Set(content->Value().AsDes()); + cmd->Value().Get(cmdPtr); + + if( cmdPtr == KMCSDataSourceInterface()) // IDataSource + { + CMCSDSInterface* mcsDSInterface = CMCSDSInterface::NewL(cmdName); + CleanupStack::PushL( mcsDSInterface ); + aOutParamList.AppendL(TLiwGenericParam(KMCSDataSourceInterface, + TLiwVariant(mcsDSInterface))); + CleanupStack::Pop( mcsDSInterface ); + } + else if(cmdPtr == KMCSMenuContentInterface()) // IMenuContent + { + CMCSMCInterface* mcsMCInterface = CMCSMCInterface::NewL(cmdName); + CleanupStack::PushL( mcsMCInterface ); + aOutParamList.AppendL(TLiwGenericParam(KMCSMenuContentInterface, + TLiwVariant(mcsMCInterface))); + CleanupStack::Pop( mcsMCInterface ); + } + else + { + aOutParamList.AppendL(TLiwGenericParam(LIW::EGenericParamError, + TLiwVariant((TInt32)SErrInvalidServiceArgument))); + } + + } + else + { + aOutParamList.AppendL(TLiwGenericParam(LIW::EGenericParamError, + TLiwVariant((TInt32)SErrInvalidServiceArgument))); + } + } + } + +// --------------------------------------------------------- +// Map the interface UIDs to implementation factory functions +// --------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2001242D, CMCSServiceHandler::NewL), + IMPLEMENTATION_PROXY_ENTRY(0x2001242E, CMCSServiceHandler::NewL) + + }; + +// --------------------------------------------------------- +// Exported proxy for instantiation method resolution +// --------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/shortcutplugin_extension_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/shortcutplugin_extension_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: AI Shortcut xSP Extension API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/aiscutextserv.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutextserv.h) +../inc/aiscutextdefs.h MW_LAYER_PLATFORM_EXPORT_PATH(aiscutextdefs.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextdefs.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* 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: Common client/server definitions for Shortcut plug-in +* +*/ + + +#ifndef AISCUTEXTDEFS_H +#define AISCUTEXTDEFS_H + +_LIT( KAiScutExtServerName, "AiScutExtServer" ); + +const TUint KAiScutExtServMajorVersionNumber = 1; +const TUint KAiScutExtServMinorVersionNumber = 0; +const TUint KAiScutExtServBuildVersionNumber = 0; + +const TUint KMaxPopupTextLines = 3; + +/** + * xSP extension server requests + */ +enum TAiScutExtServRequest + { + EAiScutExtServSetTargetDefinition = 1, + EAiScutExtServSetPopupText, + EAiScutExtServResetPopupText, + EAiScutExtServSetIcon, + EAiScutExtServResetIcon, + EAiScutExtServIsInShortcuts, + EAiScutExtServIssuePutInShortcuts + }; + +/** + * AiScutExtServer client panic codes + */ +enum TAiScutExtServerPanic + { + EBadRequest = 1 + }; + +#endif // AISCUTEXTDEFS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextserv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/shortcutplugin_extension_api/inc/aiscutextserv.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* 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: AI Shortcut xSP Extension API +* +*/ + + +#ifndef RAISCUTEXTSERV_H +#define RAISCUTEXTSERV_H + +#include +#include + +class CGulIcon; + +/** + * Active Idle Shortcut Plugin extension client side API. + * @since S60 v3.2 + */ +class RAiScutExtServ : public RSessionBase +{ + public: + /** + * Connects a client to the AiScut extension server. + * Target definition is generated automatically from process' uid 3. + * @return KErrNone, if successful, otherwise one of the other + * system-wide error codes. + */ + IMPORT_C TInt Connect(); + + /** + * Connects a client to the AiScut extension server. + * @param aTargetDefinition Target definition string. + * @return KErrNone, if successful, otherwise one of the other + * system-wide error codes. + */ + IMPORT_C TInt Connect( const TDesC& aTargetDefinition ); + + /** + * @return The client side version number. + */ + IMPORT_C TVersion Version() const; + + /** + * Updates a pop-up text box. + * @param aPopupTextLines Array of lines displayed in pop-up text box. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt UpdatePopupTextL( const MDesCArray& aPopupTextLines ); + + /** + * Resets a pop-up text box. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt ResetPopupText(); + + /** + * Updates a shortcut icon. + * @param aIcon Icon to be shown in shortcut. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt UpdateIconL( const CGulIcon& aIcon ); + + /** + * Resets a shortcut icon. Default icon will be shown. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt ResetIcon(); + + /** + * @return ETrue if the shortcut is in shortcuts bar. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt IsInShortcuts( TBool& aIsInShortcuts ) const; + + /** + * Launches AiScutPlugin General Settings view. + * @return KErrNone, if successful, otherwise one of the other system-wide error codes. + */ + IMPORT_C TInt IssuePutInShortcuts(); +}; + +#endif // RAISCUTEXTSERV_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/shortcutplugin_extension_api/shortcutplugin_extension_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/shortcutplugin_extension_api/shortcutplugin_extension_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + AI Shortcut xSP Extension API + Enables client applications to publish dynamic shortcut graphics and tooltips + c++ + activeidle + + + + + + + + + no + no + + diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 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: File that exports the files belonging to +: XCFW Engine observer API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/gecoattributeprovider.h MW_LAYER_PLATFORM_EXPORT_PATH(gecoattributeprovider.h) +../inc/gecodefaultobject.h MW_LAYER_PLATFORM_EXPORT_PATH(gecodefaultobject.h) +../inc/gecodefaultobjectfactory.h MW_LAYER_PLATFORM_EXPORT_PATH(gecodefaultobjectfactory.h) +../inc/gecoobjectbase.h MW_LAYER_PLATFORM_EXPORT_PATH(gecoobjectbase.h) +../inc/gecoobjectfactorybase.h MW_LAYER_PLATFORM_EXPORT_PATH(gecoobjectfactorybase.h) +../inc/xcfwengine.h MW_LAYER_PLATFORM_EXPORT_PATH(xcfwengine.h) +../inc/xcfwnodeinterface.h MW_LAYER_PLATFORM_EXPORT_PATH(xcfwnodeinterface.h) +../inc/xcfwtree.h MW_LAYER_PLATFORM_EXPORT_PATH(xcfwtree.h) diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/gecoattributeprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/gecoattributeprovider.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2002-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: Class definition for attribute access interface +* +*/ + + +#ifndef CGECOATTRIBUTEPROVIDER_H +#define CGECOATTRIBUTEPROVIDER_H + +#include + + +//CLASS DESCRIPTION +/** +* Attribute provider interface that content object factories must implement +* to allow generic access to attribute names/values/localisation reference ids +* and possible object text data in string format. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class MGECOAttributeProvider + { + public: + + /** + * Returns number of attributes for this object / tag + * @since Series 60 3.1 + * @return Number of attributes for this object / tag + */ + virtual TInt NumAttributes() = 0; + + /** + * Returns name, value and localization status of an attribute + * @since Series 60 3.1 + * @param aIndex Index of attribute to get. + * @param aAttributeName Attribute name returned + * @param aAttributeValue Attribute value returned + * @param aIsLocalized Attribute localization status returned + */ + virtual void AttributeDetailsL(const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue, TBool& aIsLocalized) = 0; + + /** + * Returns name and value of an attribute + * @since Series 60 3.1 + * @param aIndex Index of attribute to get. + * @param aAttributeName Attribute name returned + * @param aAttributeValue Attribute value returned + */ + virtual void AttributeDetailsL(const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue) = 0; + + /** + * Returns ETrue if object / tag has text data + * @since Series 60 3.1 + * @return ETrue if object / tag has text data + */ + virtual TBool HasTextData() = 0; + + /** + * Returns XML node / content object text data if any + * @since Series 60 3.1 + * @param aText Text data returned + * @param aIsLocalized Textdata localization status returned + */ + virtual void TextDetailsL(TPtrC& aText, TBool& aIsLocalized) = 0; + + }; + + +#endif //CGECOATTRIBUTEPROVIDER_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/gecodefaultobject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/gecodefaultobject.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2002-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: Default content object definition +* +*/ + + + +#ifndef CGECODEFAULTOBJECT_H +#define CGECODEFAULTOBJECT_H + +// INCLUDES +#include +#include +#include "gecoobjectbase.h" +#include "gecoattributeprovider.h" + +// CLASS DECLARATION +/** +* Default implementation for CGECOObjectBase +* Implements basic descriptor type arrays for storing object attributes. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CGECODefaultObject: public CGECOObjectBase, public MGECOAttributeProvider + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @param aTypeIdentifier Object identifier (e.g. XML tag with namespace) + */ + IMPORT_C static CGECODefaultObject* NewL( const TDesC& aTypeIdentifier ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CGECODefaultObject(); + + public: // From base classes + + + public: // new functions + + /** + * Returns value for given attribute + * @since Series 60 3.1 + * @param aAttrName Attribute to search for + * @param aAttrValue Attribute value returned + * @return Error code + */ + IMPORT_C TInt GetAttribute( const TDesC& aAttrName, TPtrC& aAttrValue ); + + /** + * Returns value and localization status for given attribute + * @since Series 60 3.1 + * @param aAttrName Attribute to search for + * @param aAttrValue Attribute value returned + * @param aIsLocalized Attribute localization status returned + * @return Error code + */ + IMPORT_C TInt GetAttribute( const TDesC& aAttrName, TPtrC& aAttrValue, + TBool& aIsLocalized ); + + /** + * Adds new attribute to this object + * Attribute's localization status will be EFalse. + * @since Series 60 3.1 + * @param aAttrName New attribute name + * @param aAttrValue New attribute value + */ + IMPORT_C void SetAttributeL( const TDesC& aAttrName, + const TDesC& aAttrValue ); + + /** + * Adds new attribute to this object + * @since Series 60 3.1 + * @param aAttrName New attribute name + * @param aAttrValue New attribute value + * @param aIsLocalized New attribute's localization status + */ + IMPORT_C void SetAttributeL( const TDesC& aAttrName, + const TDesC& aAttrValue, + TBool aIsLocalized ); + + /** + * Removes an attribute from this object + * @since Series 60 3.1 + * @param aAttrName Attribute to be removed + * @return Error code + */ + IMPORT_C TInt RemoveAttribute( const TDesC& aAttrName ); + + /** + * Sets object's text data. + * This function will set the localization status for text to EFalse + * @param aText New text for the object + */ + IMPORT_C void SetTextL( const TDesC& aText ); + + /** + * Sets object's text data and localization status + * @since Series 60 3.1 + * @param aText New text for the object + * @param aIsLocalized text data's localization status + */ + IMPORT_C void SetTextL( const TDesC& aText, TBool aIsLocalized ); + + /** + * Returns possible text data from this object + * @since Series 60 3.1 + * @param aText Text data returned + * @return Error code, e.g. KErrNotFound if object has no text data + */ + IMPORT_C TInt GetText( TPtrC& aText ); + + /** + * Removes object's text data + * @since Series 60 3.1 + */ + IMPORT_C void RemoveText(); + + public: // From base classes + + + /** + * From CGECOObjectBase: Returns Object type identifier for this object + */ + IMPORT_C const TDesC& TypeIdentifier(); + + /** + * From MGECOAttributeProvider. Returns number of attributes + */ + IMPORT_C TInt NumAttributes(); + + /** + * From MGECOAttributeProvider. Returns name, value and localization + * status for attribute in given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue, TBool& aIsLocalized ); + + /** + * From MGECOAttributeProvider. Returns name, value + * for attribute in given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue); + + /** + * From MGECOAttributeProvider. Returns node / data object text + * and and localization status for the text. + */ + IMPORT_C void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + + /** + * From MGECOAttributeProvider. Returns ETrue if object has text data + */ + IMPORT_C TBool HasTextData(); + + + protected: // New functions + + /** + * C++ default constructor. + */ + IMPORT_C CGECODefaultObject(); + + /** + * 2nd phase constructor + */ + IMPORT_C void BaseConstructL( const TDesC& aTypeIdentifier ); + + protected: + //Object identifier (e.g. XML tag name) + HBufC* iTypeIdentifier; + + //Object text (e.g. TEXT) + //this should be set to NULL if object has no text data, only + //attributes + HBufC* iText; + + //object text localization status + TBool iTextLocStatus; + + //Array holding attribute names for this object + CDesCArraySeg* iAttrNames; + + //Array holding attribute values for this object + CDesCArraySeg* iAttrValues; + + //Array holding localization status per attribute + RArray iAttrLocStatus; + }; + +#endif // CGECODEFAULTOBJECT_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/gecodefaultobjectfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/gecodefaultobjectfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2002-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: Base content object factory interface. +* +*/ + + + +#ifndef CGECODEFAULTOBJECTFACTORY_H +#define CGECODEFAULTOBJECTFACTORY_H + +// INCLUDES +#include +#include "gecoattributeprovider.h" //MGECOAttributeProvider +#include "gecoobjectfactorybase.h" + +// CLASS DECLARATION + +/** +* Generic content object factory. All object factories derive from this class. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CGECODefaultObjectFactory: public CGECOObjectFactoryBase + { + public: //constructors and destructor + /** + /* Two-phased constructor + */ + IMPORT_C static CGECODefaultObjectFactory* NewL(); + + //destructor + virtual ~CGECODefaultObjectFactory(); + + public: //new functions + + /** + * Get object parser + * @param aTypeIdentifier Object type identifier + * @return CGECOObjectBase derived object. Caller takes ownership. + */ + IMPORT_C CGECOObjectBase* GetContentObjectAndSetContextL( + const TDesC& aTypeIdentifier ); + + /** + * Initializes the current object with attribute provider data + * @param aAttributeProvider Attribute provider for data initialization + */ + IMPORT_C void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ); + + /** + * Set context object for initialize and preparesave operations + * @param aContext Object to use in InitializeL operations + * @return Error code, e.g. when the factory does not know this object. + */ + IMPORT_C TInt SetContext( CGECOObjectBase* aContext ); + + + public: //from base classes + + /** + * From MGECOAttributeProvider. Returns number of attributes + */ + IMPORT_C TInt NumAttributes(); + + /** + * From MGECOAttributeProvider. Returns name, value and localization status + * for attribute in given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue, TBool& aIsLocalized); + + /** + * From MGECOAttributeProvider. Returns name and value + * for attribute in given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue); + + /** + * From MGECOAttributeProvider. Returns node / data object text data + * and localization status + */ + IMPORT_C void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + + /** + * From MGECOAttributeProvider. Returns ETrue if object has text data + */ + IMPORT_C TBool HasTextData(); + + + protected: //new functions + + /** + * C++ default constructor. + */ + IMPORT_C CGECODefaultObjectFactory(); + + private: //new function + + /** + * 2nd phase constructor + */ + void ConstructL(); + + private: //data + + }; + + +#endif //CGECODEFAULTOBJECTFACTORY_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/gecoobjectbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/gecoobjectbase.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2002-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: Base content object parser interface definition +* +*/ + + + +#ifndef CGECOOBJECTBASE_H +#define CGECOOBJECTBASE_H + +// INCLUDES +#include + + +// CLASS DECLARATION +/** +* Generic Content Object Base Class +* Base class that all content objects derive from. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CGECOObjectBase : public CBase + { + public: // New functions + + /** + * Returns Object type identifier for this object + * @since Series 60 3.1 + * @return Object identifier + */ + virtual const TDesC& TypeIdentifier() = 0; + }; + +#endif // CXCFWOBJECTPARSER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/gecoobjectfactorybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/gecoobjectfactorybase.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2002-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: Base content object factory interface. +* +*/ + + + +#ifndef CGECOOBJECTFACTORYBASE_H +#define CGECOOBJECTFACTORYBASE_H + +// INCLUDES +#include +#include "gecoattributeprovider.h" //MGECOAttributeProvider + +// FORWARD DECLARATIONS +class CGECOObjectBase; + +// CLASS DECLARATION + +/** +* Abstract base class for object factories. +* All object factories derive from this class. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CGECOObjectFactoryBase: public CBase, + public MGECOAttributeProvider + { + public: //new functions + + /** + * Get object parser + * @param aTypeIdentifier Object type identifier + * @return CGECOObjectBase derived object. Caller takes ownership. + */ + virtual CGECOObjectBase* GetContentObjectAndSetContextL( + const TDesC& aTypeIdentifier ) = 0; + + /** + * Initializes the current object with attribute provider data + * @param aAttributeProvider Attribute provider for data initialization + */ + virtual void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ) = 0; + + /** + * Set context object for initialize and preparesave operations + * @param aContext Object to use in InitializeL operations + * @return Error code, e.g. when the factory does not know this object. + */ + virtual TInt SetContext( CGECOObjectBase* aContext ) = 0; + + + public: //from base classes + + /** + * From MGECOAttributeProvider. Returns number of attributes + */ + virtual TInt NumAttributes() = 0; + + /** + * From MGECOAttributeProvider. Returns name, value and localization + * status for attribute in given index. + */ + virtual void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue, TBool& aIsLocalized ) = 0; + + /** + * From MGECOAttributeProvider. Returns name and value + * for attribute in given index. + */ + virtual void AttributeDetailsL( const TInt aIndex, TPtrC& aAttrName, + TPtrC& aAttrValue) = 0; + + /** + * From MGECOAttributeProvider. Returns ETrue if object / tag + * has text data + */ + virtual TBool HasTextData() = 0; + + /** + * From MGECOAttributeProvider. Returns XML node / content object + * text data if any + */ + virtual void TextDetailsL(TPtrC& aText, TBool& aIsLocalized) = 0; + + + protected: //data + //Current factory context. Not owned. + CGECOObjectBase* iContext; + }; + + +#endif //CGECOOBJECTFACTORYBASE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/xcfwengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/xcfwengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,380 @@ +/* +* Copyright (c) 2002-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: Class definitions for XCFW Engine +* +*/ + + + +#ifndef XCFWENGINE_H +#define XCFWENGINE_H + +// INCLUDES +#include +#include +#include +#include "gecodefaultobjectfactory.h" + +// FORWARD DECLARATIONS +class CXCFWEntityConverter; +class CMDXMLNode; +class MXCFWTree; +class MXCFWNode; +class CXCFWLocalizer; + +// DATA TYPES +typedef RPointerArray RFactoryArray; + +// CONSTANTS +// XCFW error range: -32350, -32379 +const TInt KErrDTDLoadFailed = -32350; + +// CLASS DECLARATION +/** +* Engine observer interface. Engine user must implement this interface +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class MXCFWEngineObserver + { + public: //event enumeration + + enum TXCFWEngineEvent //Engine events + { + EEvtNull = 0, //for module testing purposes only + EEvtParsingStarted, //triggered when DOM to Tree parsing starts + EEvtParsingComplete, //triggered when whole DOM has been processed + EEvtSavingStarted, //triggered when Tree to DOM composing starts + EEvtSavingComplete, //triggered when composing is done + EEvtParsingCanceled, //triggered when parsing is canceled by client + EEvtSavingCanceled, //triggered when saving is canceled by client + }; + + public: //new functions + /** + * Called when Engine parsing / saving state changes + * User can do desired actions on corresponding events. + * @param aEvent Engine event + */ + virtual void HandleEngineEventL( TXCFWEngineEvent aEvent ) = 0; + + /** + * Called when there's an error during parsing / saving + * @param aErrorCode Error code from engine + */ + virtual void HandleEngineErrorL( TInt aErrorCode ) = 0; + }; + + + +/** +* XCFW Engine class +* Responsible for internalizing / externalizing XML files +* to and from a XCFW tree +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CXCFWEngine: public CActive, + public MGECOAttributeProvider, + public MMDXMLParserObserver, + public MMDXMLComposerObserver + { + public: + + enum TXCFWEngineState // Engine states + { + EStateIdle = 0, //when engine is not active + EStateInitializingLoad, //when initializing Load operation + EStateLoadingFile, //when GMXML parser is loading + EStateInitializingSave, //when initializing save op + EStateSavingFile, //when GMXML Composer is saving + EStateParsing, //when parsing DOM to content tree + EStateConstructingDOM //when constructing DOM from XCFWTree + }; + + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXCFWEngine* NewL( MXCFWEngineObserver* aObserver ); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXCFWEngine(); + + public: // New functions + + /** + * Cancels currently ongoing load/save operation + * @since Series 60 3.1 + */ + IMPORT_C void CancelOperation(); + + /** + * Loads given XML content definition to given tree. + * Operation is asynchronous. Engine will notify client through + * MXCFWEngineObserver interface when parsing completes. + * XCFW Engine will look for localization DTD based on the + * doctype declaration of loaded XML file. It assumes that + * the localization files are stored in language variant + * specific subdirectories under the directory where the + * loaded content file exists. + * @since Series 60 3.1 + * @param aTree Target tree to construct the content into + * @param aFile File to load + */ + IMPORT_C void LoadL( MXCFWTree& aTree, const TDesC& aFile ); + + /** + * Loads given XML content definition to given tree with + * localized strings from given DTD file + * Operation is asynchronous. + * @since Series 60 3.1 + * @param aTree Target tree to construct the content into + * @param aFile File to load + * @param aDTDFile DTD to use for localization. This parameter + * overrides the possible DOCTYPE definition in the XML file. + */ + IMPORT_C void LoadL( MXCFWTree& aTree, const TDesC& aFile, + const TDesC& aDTDFile ); + + /** + * Saves given Tree to given XML content definition file. + * Operation is asynchronous. + * @since Series 60 3.1 + * @param aTree Target tree to construct XML from + * @param aFile File to save the XML definition to + */ + IMPORT_C void SaveL( MXCFWTree& aTree, const TDesC& aFile ); + + /** + * Saves given Tree to given XML content definition file with + * entity references from given DTD file. + * Operation is asynchronous. + * @since Series 60 3.1 + * @param aTree Target tree to construct XML from + * @param aFile File to save the XML definition to + * @param aDTDFile DTD to use for entity localization. This + * parameter overrides the possible DOCTYPE definition that was + * internalized to content tree when it was loaded from XML. + */ + IMPORT_C void SaveL( MXCFWTree& aTree, const TDesC& aFile, + const TDesC& aDTDFile ); + + /** + * Adds new object factory to engine factory array. + * Engine does NOT take ownership of the factory. + * @since Series 60 3.1 + * @param aFactory Object factory to add. Engine will + * query factories for objects when constructing tree. + */ + IMPORT_C void RegisterObjectFactoryL( + CGECOObjectFactoryBase* aFactory ); + + /** + * Removes a factory from Engine's object factory array. + * @since Series 60 3.1 + * @param aFactory Object factory to be removed + */ + IMPORT_C TInt UnRegisterObjectFactory( + CGECOObjectFactoryBase* aFactory ); + + /** + * Returns engine's current state + * Client may want to check state at error events + * @since Series 60 3.1 + * @return Engine state + */ + IMPORT_C TXCFWEngineState CurrentState(); + + + public: // Functions from base classes + + /** + * From MGECOAttributeProvider. + * Returns attribute details for given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, + TPtrC& aAttributeName, + TPtrC& aAttributeValue, + TBool& aIsLocalized); + + /** + * From MGECOAttributeProvider. + * Returns attribute details for given index. + */ + IMPORT_C void AttributeDetailsL( const TInt aIndex, + TPtrC& aAttributeName, + TPtrC& aAttributeValue); + + /** + * From MGECOAttributeProvider. + * Returns number of attributes for a xml tag. + */ + IMPORT_C TInt NumAttributes(); + + /** + * From MGECOAttributeProvider. Returns node / data object text + * and possible localization status for the text. + */ + IMPORT_C void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + + /** + * From MGECOAttributeProvider. Returns ETrue if xml node has text data + */ + IMPORT_C TBool HasTextData(); + + /** + * From MMDXMLParserObserver. Called when XML to DOM + * parsing is done + */ + void ParseFileCompleteL(); + + /** + * From MMDXMLComposerObserver. Called when DOM to XML + * composing is done. + */ + void ComposeFileCompleteL(); + + protected: // Functions from base classes + + //From CActive + void RunL(); + void DoCancel(); + TInt RunError( TInt aError ); + + private: + + /** + * C++ default constructor. + * @param aObserver Engine observer + */ + CXCFWEngine( MXCFWEngineObserver* aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + /** + * Traverses XML DOM and constructs XCFW tree + * Each call to this function processes one DOM element + * @since Series 60 3.1 + */ + void DOM2TreeNextCycleL(); + + /** + * Traverses content tree and constructs XML DOM + * Each call to this function processes one XCFW Tree element + * @since Series 60 3.1 + */ + void Tree2DOMNextCycleL(); + + /** + * Adds a XCFW Tree node to DOM + * Called repeatedly during parsing from Tree2DOMNextCycle() + * @since Series 60 3.1 + */ + void AddCurrentTreeNodeToDOML(); + + /** + * Adds a XML element to content tree + * Called repeatedly during parsing from Dom2TreeNextCycle() + * @since Series 60 3.1 + */ + void AddCurrentXMLNodeToTreeL(); + + /** + * Frees resources used during parse / compose operation + * @since Series 60 3.1 + */ + void FreeResources(); + + /** + * Loads DTD for the requested save / load op + * and sets engine active. + * @since Series 60 3.1 + */ + void PrepareEntityConverterAndSetActiveL(); + + /** + * Prepares DTD file path for localization file loading + * This function checks the DTD path from XML doctype declaration + */ + void PrepareDTDPathL(); + + + private: // Data + // Engine observer. Not owned + MXCFWEngineObserver* iObserver; + + // Object factory array. Factory pointers are not owned. + RFactoryArray iFactoryList; + + // Default factory (used if there's no object factory from client) + CGECODefaultObjectFactory* iDefaultFactory; + + // file system handle for load / save ops + RFs iFileSystem; + + // XML file name buffer + HBufC* iFile; + + // DTD file name buffer + HBufC* iDTD; + + // Current node's text (all text with cdatasections included) + HBufC* iNodeText; + + // XML Parser + CMDXMLParser* iParser; + + // XML Composer + CMDXMLComposer* iComposer; + + //XML document to operate with. + CMDXMLDocument* iXMLDoc; + + //Current XML node + CMDXMLNode* iCurrentXMLNode; + + // Localization utility class + CXCFWLocalizer* iLocalizer; + + //Tree to operate with. Not owned. + MXCFWTree* iTree; + + //Current parent node used during parsing. Not owned. + MXCFWNode* iCurrentTreeNode; + + // engine internal state + TXCFWEngineState iState; + + // engine internal state by last error + TXCFWEngineState iStateByLastError; + + // Entity converter + CXCFWEntityConverter* iConverter; + + }; + +#endif // XCFWENGINE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/xcfwnodeinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/xcfwnodeinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002-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: XCFW tree node interface +* +*/ + + + +#ifndef MXCFWNODEINTERFACE_H +#define MXCFWNODEINTERFACE_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CGECOObjectBase; + +// CLASS DECLARATION +/* +* +* Node interface for accessing data and relative nodes +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class MXCFWNode + { + public: + /** + * Returns parent of this node + * @since Series 60 3.1 + * @return Parent node + */ + virtual MXCFWNode* Parent() = 0; + + /** + * Returns first child of this node + * @since Series 60 3.1 + * @return First child node + */ + virtual MXCFWNode* FirstChild() = 0; + + /** + * Returns last child of this node + * @since Series 60 3.1 + * @return Last child node + */ + virtual MXCFWNode* LastChild() = 0; + + /** + * Returns next sibling of this node + * @since Series 60 3.1 + * @return Next sibling node + */ + virtual MXCFWNode* NextSibling() = 0; + + /** + * Returns previous sibling of this node + * @since Series 60 3.1 + * @return Previous sibling node + */ + virtual MXCFWNode* PrevSibling() = 0; + + /** + * Returns Object parser from this node + * @since Series 60 3.1 + * @return Object parser instance + */ + virtual CGECOObjectBase* Data() = 0; + }; + + +#endif // MXCFWNODEINTERFACE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/inc/xcfwtree.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/inc/xcfwtree.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 2002-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: Class definitions for XCFW Tree +* +*/ + + + +#ifndef CXCFWTREE_H +#define CXCFWTREE_H + +// INCLUDES +#include +//#include +#include "xcfwnodeinterface.h" + +// FORWARD DECLARATIONS +class CGECOObjectBase; +class CXCFWNode; + + +// DATA TYPES +typedef RPointerArray RNodeArray; +typedef RPointerArray RInternalNodeArray; + +// CLASS DECLARATION +/** +* XCFW Tree interface +* Provides access to tree functions +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class MXCFWTree + { + public: + /** + * Adds new node to content tree. Returns reference to added node. + * Three overloads are provided to allow use without parent when creating + * root, or use without insertbefore reference to allow adding nodes as + * last child of the given parent. + * aData ownership is transferred at the beginning of the method! + * @since Series60 3.1 + * @param aData The CXCFWObjectParser (derived) object to be added to tree + * @param aParent Parent node for the added node + * @param aInsertBefore Reference node - new node will be inserted before + * this node in the siblings of given parent. + * @return pointer to newly added node + */ + virtual MXCFWNode* AddNodeL( CGECOObjectBase* aData, MXCFWNode* aParent, + MXCFWNode* aInsertBefore ) = 0; + virtual MXCFWNode* AddNodeL( CGECOObjectBase* aData, + MXCFWNode* aParent ) = 0; + virtual MXCFWNode* AddNodeL( CGECOObjectBase* aData ) = 0; + + /** + * Returns child nodes of the given parentm from tree + * @since Series60 3.1 + * @param aParent Parent node whose child nodes will be returned + * @param aNodeList Reference to array where child nodes are added + */ + virtual void GetChildNodesL( MXCFWNode* aParent, + RNodeArray& aNodeList ) = 0; + + /** + * Returns nodes of certain type from tree + * @since Series60 3.1 + * @param aType Node type identifier that corresponds to a XML tag + * @param aNodeList Reference to array where found nodes are added + * @param aParent Parent node where the search is started from + * @param aRecursive Determines if search is done recursively + * (finds also grandchildren) + */ + virtual void GetNodesOfTypeL( const TDesC& aType, RNodeArray& aNodeList, + MXCFWNode* aParent, TBool aRecursive ) = 0; + + /** + * Moves a node to another position in tree + * @since Series60 3.1 + * @param aNodeToMove Node that is to be repositioned + * @param aNewParent New parent for node to be repositioned + * @param aInsertBefore New node will be inserted before this node + * among the given parents children + */ + virtual void MoveNodeL( MXCFWNode* aNodeToMove, MXCFWNode* aNewParent, + MXCFWNode* aInsertBefore ) = 0; + + /** + * Returns all tree nodes in an array of MXCFWNode pointers + * NOTE: node order does not necessarily + * reflect the current order in tree, as nodes may have been moved. + * @since Series60 3.1 + * @return Array of MXCFWNode pointers + */ + virtual RNodeArray& Nodes() = 0; + + /** + * Removes a node from the tree + * @since Series60 3.1 + * @param aNodeToRemove Node to be removed from tree + */ + virtual void RemoveNodeL( MXCFWNode* aNodeToRemove ) = 0; + + + /** + * Returns root node of the tree + * @since Series60 3.1 + * @return Tree root + */ + virtual MXCFWNode* Root() = 0; + + /** + * Sets tree lock status + * If tree is locked, nodes cannot be added/moved/removed + * @param aLockStatus sets the lock status + */ + virtual void SetLocked( TBool aLockStatus ) = 0; + + /** + * Returns tree lock status + * @return ETrue, if tree structure is locked + */ + virtual TBool IsLocked() = 0; + + /** + * Returns name of localization DTD file (by default without path) + * @return name of localization DTD file, if set + */ + virtual const TDesC& DTDName() = 0; + + /** + * Sets localization dtd name for this content tree + * This information is used when saving the tree if + * no DTD is specified in SaveL command + * @param aName DTD file name (by default without path) + */ + virtual void SetDTDNameL( const TDesC& aName ) = 0; + + }; + + +/** +* CXCFWTree implements MXCFWTree interface. It owns the actual tree nodes. +* +* @lib XCFW.lib +* @since Series 60 3.1 +*/ +class CXCFWTree : public CBase, public MXCFWTree + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CXCFWTree* NewL(); + + /** + * Destructor. + */ + IMPORT_C virtual ~CXCFWTree(); + + public: // Functions from base classes + + /** + * From MXCFWTree. Adds a node to tree. + * aData ownership is transferred at the beginning of the method! + */ + IMPORT_C MXCFWNode* AddNodeL( CGECOObjectBase* aData, + MXCFWNode* aParent, MXCFWNode* aInsertBefore ); + + /** + * From MXCFWTree. Adds a node to tree. + * aData ownership is transferred at the beginning of the method! + */ + IMPORT_C MXCFWNode* AddNodeL( CGECOObjectBase* aData, + MXCFWNode* aParent ); + + /** + * From MXCFWTree. Adds a node to tree. + * aData ownership is transferred at the beginning of the method! + */ + IMPORT_C MXCFWNode* AddNodeL( CGECOObjectBase* aData ); + + /** + * From MXCFWTree. Gets list of child nodes for a parent + */ + IMPORT_C void GetChildNodesL( MXCFWNode* aParent, + RNodeArray& aNodeList ); + + /** + * From MXCFWTree. Gets list of certain type nodes. + */ + IMPORT_C void GetNodesOfTypeL( const TDesC& aType, + RNodeArray& aNodeList, + MXCFWNode* aParent, + TBool aRecursive ); + + /** + * From MXCFWTree. Moves a node in tree to another position. + */ + IMPORT_C void MoveNodeL( MXCFWNode* aNodeToMove, + MXCFWNode* aNewParent, + MXCFWNode* aInsertBefore ); + + /** + * From MXCFWTree. Returns tree nodes in an MXCFWNode pointer array + */ + IMPORT_C RNodeArray& Nodes(); + + /** + * From MXCFWTree. Removes a node from tree. + */ + IMPORT_C void RemoveNodeL( MXCFWNode* aNodeToRemove ); + + /** + * From MXCFWTree. Returns tree root node. + */ + IMPORT_C MXCFWNode* Root(); + + /** + * From MXCFWTree. Sets tree structure lock status + */ + IMPORT_C void SetLocked( TBool aLockStatus ); + + /** + * From MXCFWTree. Returns lock status + */ + IMPORT_C TBool IsLocked(); + + /** + * From MXCFWTree. Returns default DTD name for this tree's content + */ + const TDesC& DTDName(); + + /** + * From MXCFWTree. Sets DTD name for this tree content + */ + void SetDTDNameL( const TDesC& aName ); + + private: + + /** + * C++ default constructor. + */ + CXCFWTree(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // new functions + + /** + * Removes a tree node branch starting from given node recursively + * @since Series 60 3.1 + * @param Node to remove (whole branch will be removed) + */ + void RemoveNodeRecursiveL( MXCFWNode* aNode) ; + + /** + * Removes a tree node branch starting from given node recursively + * @since Series 60 3.1 + * @param Node to remove (whole branch will be removed) + */ + void RemoveFromNodeList( MXCFWNode* aNode ); + + private: // Data + //tree node array for client ( MXCFWNode pointer array ) + RInternalNodeArray iNodeList; + //root node (owned in the node array) + CXCFWNode* iRoot; + //node list for client (array of MXCFWNodes). Populated at request. + RNodeArray iNodeListForClient; + //marks client node list dirty =>needs to be updated on next request. + TBool iClientListDirty; + //Lock status. If locked, no changes to tree structure are allowed + TBool iLocked; + //DTD file name related to this content (engine needs to know this) + HBufC* iDTDName; + + private: + friend class CXCFWEngine; + + + + }; + +#endif // CXCFWTREE_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 homescreensrv_plat/xcfw_api/xcfw_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/xcfw_api/xcfw_api.metaxml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,18 @@ + + + XCFW API + API for observing XCFW progress. Engine reports about progress and errors through this interface. + c++ + xcfw + + + + + + + + + yes + no + + diff -r 000000000000 -r 79c6a41cd166 idlefw/BWINS/aifwuU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/BWINS/aifwuU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?NewLC@CAiFw@@SAPAV1@XZ @ 1 NONAME ; class CAiFw * CAiFw::NewLC(void) + ?RunL@CAiFw@@QAEXXZ @ 2 NONAME ; void CAiFw::RunL(void) + diff -r 000000000000 -r 79c6a41cd166 idlefw/BWINS/aiidleintU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/BWINS/aiidleintU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + ?NewLC@CAiIdleAppRegister@@SAPAV1@XZ @ 1 NONAME ; class CAiIdleAppRegister * CAiIdleAppRegister::NewLC(void) + ?NewL@CAiWsPluginManager@@SAPAV1@AAVCCoeEnv@@@Z @ 2 NONAME ; class CAiWsPluginManager * CAiWsPluginManager::NewL(class CCoeEnv &) + ?NewL@CAiUiIdleIntegration@@SAPAV1@AAVCEikonEnv@@ABUTAiIdleKeySoundConfig@@PAVMAiFwEventHandler@@@Z @ 3 NONAME ; class CAiUiIdleIntegration * CAiUiIdleIntegration::NewL(class CEikonEnv &, struct TAiIdleKeySoundConfig const &, class MAiFwEventHandler *) + diff -r 000000000000 -r 79c6a41cd166 idlefw/BWINS/aisettingsU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/BWINS/aisettingsU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CAiPluginSettings@@SAPAV1@XZ @ 1 NONAME ; class CAiPluginSettings * CAiPluginSettings::NewL(void) + \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/BWINS/aiutilsU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/BWINS/aiutilsU.DEF Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,20 @@ +EXPORTS + ?CreateContentItemArrayIteratorL@AiUtility@@YAPAVMAiContentItemIterator@@PBUTAiContentItem@@H@Z @ 1 NONAME ; class MAiContentItemIterator * AiUtility::CreateContentItemArrayIteratorL(struct TAiContentItem const *, int) + ?CreatePSPropertyObserverL@AiUtility@@YAPAVMAiPSPropertyObserver@@VTCallBack@@VTUid@@H@Z @ 2 NONAME ; class MAiPSPropertyObserver * AiUtility::CreatePSPropertyObserverL(class TCallBack, class TUid, int) + ?CreatePluginSettingsL@AiUtility@@YAPAVMAiPluginSettings@@XZ @ 3 NONAME ; class MAiPluginSettings * AiUtility::CreatePluginSettingsL(void) + ?CreateStrParserL@AiUtility@@YAPAVMAiStrParser@@XZ @ 4 NONAME ; class MAiStrParser * AiUtility::CreateStrParserL(void) + ?CopyToBufferL@AiUtility@@YAPAVHBufC16@@PAV2@ABVTDesC16@@@Z @ 5 NONAME ; class HBufC16 * AiUtility::CopyToBufferL(class HBufC16 *, class TDesC16 const &) + ?CopyToBufferL@AiUtility@@YAPAVHBufC16@@PAV2@ABVTDesC8@@@Z @ 6 NONAME ; class HBufC16 * AiUtility::CopyToBufferL(class HBufC16 *, class TDesC8 const &) + ?CopyToBufferL@AiUtility@@YAPAVHBufC8@@PAV2@ABVTDesC16@@@Z @ 7 NONAME ; class HBufC8 * AiUtility::CopyToBufferL(class HBufC8 *, class TDesC16 const &) + ?CopyToBufferL@AiUtility@@YAPAVHBufC8@@PAV2@ABVTDesC8@@@Z @ 8 NONAME ; class HBufC8 * AiUtility::CopyToBufferL(class HBufC8 *, class TDesC8 const &) + ?EnsureBufMaxLengthL@AiUtility@@YA?AVTPtr16@@AAPAVHBufC16@@H@Z @ 9 NONAME ; class TPtr16 AiUtility::EnsureBufMaxLengthL(class HBufC16 * &, int) + ?ParseInt@AiUtility@@YAHAAJABVTDesC8@@@Z @ 10 NONAME ; int AiUtility::ParseInt(long &, class TDesC8 const &) + ?CreatePluginToolL@AiUtility@@YAPAVMAiPluginTool@@XZ @ 11 NONAME ; class MAiPluginTool * AiUtility::CreatePluginToolL(void) + ?ClearPriority@CContentPriorityMap@AiUtility@@QAEXABVTDesC8@@@Z @ 12 NONAME ; void AiUtility::CContentPriorityMap::ClearPriority(class TDesC8 const &) + ?CurrentPriority@CContentPriorityMap@AiUtility@@QBEHABVTDesC8@@@Z @ 13 NONAME ; int AiUtility::CContentPriorityMap::CurrentPriority(class TDesC8 const &) const + ?NewL@CContentPriorityMap@AiUtility@@SAPAV12@XZ @ 14 NONAME ; class AiUtility::CContentPriorityMap * AiUtility::CContentPriorityMap::NewL(void) + ?OverrideContent@CContentPriorityMap@AiUtility@@QBEHABVTDesC8@@H@Z @ 15 NONAME ; int AiUtility::CContentPriorityMap::OverrideContent(class TDesC8 const &, int) const + ?Reset@CContentPriorityMap@AiUtility@@QAEXXZ @ 16 NONAME ; void AiUtility::CContentPriorityMap::Reset(void) + ?SetCurrentPriority@CContentPriorityMap@AiUtility@@QAEHABVTDesC8@@H@Z @ 17 NONAME ; int AiUtility::CContentPriorityMap::SetCurrentPriority(class TDesC8 const &, int) + ?ParseInt@AiUtility@@YAHAAJABVTDesC16@@@Z @ 18 NONAME ; int AiUtility::ParseInt(long &, class TDesC16 const &) + diff -r 000000000000 -r 79c6a41cd166 idlefw/EABI/aifwuU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/EABI/aifwuU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + _ZN5CAiFw5NewLCEv @ 1 NONAME + _ZN5CAiFw4RunLEv @ 2 NONAME + diff -r 000000000000 -r 79c6a41cd166 idlefw/EABI/aiidleintU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/EABI/aiidleintU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _ZN18CAiWsPluginManager4NewLER7CCoeEnv @ 1 NONAME + _ZN18CAiIdleAppRegister5NewLCEv @ 2 NONAME + _ZN20CAiUiIdleIntegration4NewLER9CEikonEnvRK21TAiIdleKeySoundConfigP17MAiFwEventHandler @ 3 NONAME + diff -r 000000000000 -r 79c6a41cd166 idlefw/EABI/aisettingsU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/EABI/aisettingsU.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN17CAiPluginSettings4NewLEv @ 1 NONAME + diff -r 000000000000 -r 79c6a41cd166 idlefw/EABI/aiutilsU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/EABI/aiutilsU.DEF Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,22 @@ +EXPORTS + _ZN9AiUtility16CreateStrParserLEv @ 1 NONAME + _ZN9AiUtility21CreatePluginSettingsLEv @ 2 NONAME + _ZN9AiUtility25CreatePSPropertyObserverLE9TCallBack4TUidi @ 3 NONAME + _ZN9AiUtility31CreateContentItemArrayIteratorLEPK14TAiContentItemi @ 4 NONAME + _ZN9AiUtility13CopyToBufferLEP6HBufC8RK6TDesC8 @ 5 NONAME + _ZN9AiUtility13CopyToBufferLEP6HBufC8RK7TDesC16 @ 6 NONAME + _ZN9AiUtility13CopyToBufferLEP7HBufC16RK6TDesC8 @ 7 NONAME + _ZN9AiUtility13CopyToBufferLEP7HBufC16RK7TDesC16 @ 8 NONAME + _ZN9AiUtility19EnsureBufMaxLengthLERP7HBufC16i @ 9 NONAME + _ZN9AiUtility8ParseIntERlRK6TDesC8 @ 10 NONAME + _ZN9AiUtility17CreatePluginToolLEv @ 11 NONAME + _ZN9AiUtility19CContentPriorityMap13ClearPriorityERK6TDesC8 @ 12 NONAME + _ZN9AiUtility19CContentPriorityMap18SetCurrentPriorityERK6TDesC8i @ 13 NONAME + _ZN9AiUtility19CContentPriorityMap4NewLEv @ 14 NONAME + _ZN9AiUtility19CContentPriorityMap5ResetEv @ 15 NONAME + _ZNK9AiUtility19CContentPriorityMap15CurrentPriorityERK6TDesC8 @ 16 NONAME + _ZNK9AiUtility19CContentPriorityMap15OverrideContentERK6TDesC8i @ 17 NONAME + _ZTIN9AiUtility19CContentPriorityMapE @ 18 NONAME ; ## + _ZTVN9AiUtility19CContentPriorityMapE @ 19 NONAME ; ## + _ZN9AiUtility8ParseIntERlRK7TDesC16 @ 20 NONAME + diff -r 000000000000 -r 79c6a41cd166 idlefw/cenrep/keys_activeidle2.xls Binary file idlefw/cenrep/keys_activeidle2.xls has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/conf/activeidle2.confml Binary file idlefw/conf/activeidle2.confml has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/conf/activeidle2_10275102.crml Binary file idlefw/conf/activeidle2_10275102.crml has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/group/aifw.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/aifw.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,87 @@ +/* +* 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: Project definition file for project AI framework +* +*/ + +#include +#include +#include + +TARGET aifw.dll +TARGETTYPE dll +UID 0x1000008D AI_UID3_AIFW_DLL +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +// Framework sources +SOURCEPATH ../src/framework +SOURCE aifw.cpp +SOURCE aicontentpluginmanager.cpp +SOURCE aiuicontrollermanager.cpp +SOURCE aicallstatusobserver.cpp +SOURCE ailightstatusobserver.cpp +SOURCE aibackuprestorestatusobserver.cpp +SOURCE aienvironmentchangeobserver.cpp +SOURCE aifocusobserver.cpp +SOURCE aikeylockobserver.cpp +SOURCE aipsstatusobserver.cpp +SOURCE aipluginstatemanager.cpp +SOURCE aipluginstatemachineimpl.cpp +SOURCE aistatealive.cpp +SOURCE aistatesuspended.cpp +SOURCE aistateidle.cpp +SOURCE aipluginfactory.cpp +SOURCE aiuiframeworkobserverimpl.cpp +SOURCE ainetworklistener.cpp + +// Active Idle Framework shared sources +SOURCEPATH ../src/common +SOURCE aifwpanic.cpp + +USERINCLUDE . +USERINCLUDE ../inc/framework +USERINCLUDE ../inc/common +USERINCLUDE ../inc/idleint +USERINCLUDE ../cenrep + +MW_LAYER_SYSTEMINCLUDE + +// Symbian OS dependencies +LIBRARY euser.lib bafl.lib ecom.lib +LIBRARY centralrepository.lib +LIBRARY apparc.lib apgrfx.lib +LIBRARY ws32.lib cone.lib commonengine.lib +LIBRARY cenrepnotifhandler.lib + +// S60 Dependencies +LIBRARY avkon.lib +LIBRARY aknnotify.lib +LIBRARY featmgr.lib +LIBRARY eikcore.lib +LIBRARY hwrmlightclient.lib +LIBRARY networkhandling.lib + +// Active Idle internal dependencies +LIBRARY aiutils.lib aiidleint.lib + +// Debugging dependencies +LIBRARY flogger.lib + +//++HV +LIBRARY akntransitionutils.lib +//--HV + +DEFFILE aifwu.def + diff -r 000000000000 -r 79c6a41cd166 idlefw/group/aiidleint.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/aiidleint.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 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: Project definition file for Active Idle Idle integration +* library. +* +*/ + +#include +#include +#include + +TARGET aiidleint.dll +TARGETTYPE dll +UID 0x1000008D AI_UID3_AIFW_DLL +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src/idleint +SOURCE aiidleappregister.cpp +SOURCE aiwspluginmanager.cpp +SOURCE aiuiidleintegration.cpp +SOURCE aistate.cpp + +SOURCEPATH ../src/common +SOURCE aifwpanic.cpp + +USERINCLUDE . +USERINCLUDE ../inc/common +USERINCLUDE ../inc/idleint +USERINCLUDE ../inc/framework + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib flogger.lib +LIBRARY apgrfx.lib +LIBRARY ws32.lib +LIBRARY cone.lib eikcore.lib +LIBRARY avkon.lib aknnotify.lib + +LIBRARY aiutils.lib diff -r 000000000000 -r 79c6a41cd166 idlefw/group/ailaunch.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/ailaunch.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +#include +#include +#include + +TARGET ailaunch.exe +TARGETTYPE exe +UID 0x100039CE AI_UID3_AIFW_EXE +SECUREID AI_SID_AIFW_EXE +VENDORID VID_DEFAULT + +CAPABILITY CAP_APPLICATION PowerMgmt NetworkControl + +EPOCSTACKSIZE 0x5000 +EPOCHEAPSIZE 0x300000 0xC00000 + +SOURCEPATH ../src/framework +SOURCE main.cpp + +START RESOURCE ailaunch.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +START RESOURCE ailaunch_reg.rss +DEPENDS ailaunch.rsg +TARGETPATH /private/10003a3f/apps +END + +USERINCLUDE . +USERINCLUDE ../inc/common +USERINCLUDE ../inc/framework + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY aifw.lib +LIBRARY eikcore.lib +LIBRARY ecom.lib +LIBRARY flogger.lib + diff -r 000000000000 -r 79c6a41cd166 idlefw/group/aiutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/aiutils.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* 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: AI Utilities Factory +* +*/ + +#include +#include +//#include + +TARGET aiutils.dll +TARGETTYPE dll +UID 0x1000008D 0x10281865 +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src/utility +SOURCE aiutility.cpp +SOURCE caipspropertyobserver.cpp +SOURCE caistrparser.cpp +SOURCE caiplugintool.cpp +SOURCE caicontentitemarrayiterator.cpp +SOURCE contentprioritymap.cpp +SOURCE aipluginsettingsimpl.cpp + +USERINCLUDE . +USERINCLUDE ../inc/utility + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY charconv.lib + diff -r 000000000000 -r 79c6a41cd166 idlefw/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/backup_registration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r 79c6a41cd166 idlefw/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +#include + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS +../plugins/devicestatus/loc/aidevstaplgres.loc MW_LAYER_LOC_EXPORT_PATH(aidevstaplgres.loc) +../loc/aifw.loc MW_LAYER_LOC_EXPORT_PATH(aifw.loc) + +// Generic configuration interface for component cenrep settings +../conf/activeidle2.confml APP_LAYER_CONFML(activeidle2.confml) +../conf/activeidle2_10275102.crml APP_LAYER_CRML(activeidle2_10275102.crml) + +../rom/idlefw.iby CORE_MW_LAYER_IBY_EXPORT_PATH(idlefw.iby) +../rom/idlefw_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(idlefw_resources.iby) + +PRJ_MMPFILES +aiutils.mmp +aiidleint.mmp +aifw.mmp +ailaunch.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// +// Include subprojects +// + +// Plug-ins +#include "../plugins/group/bld.inf" + +#endif // RD_CUSTOMIZABLE_AI diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/common/aifwpanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/common/aifwpanic.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2005-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: AI2 debug panic helper +* +*/ + + +#ifndef AIFWPANIC_H +#define AIFWPANIC_H + +#ifdef _DEBUG + +namespace AiFwPanic + { + + enum TAiPanicCodes + { + EAiFwPanic_FwCreationFailed, + EAiFwPanic_UnsupportedContentType, + EAiFwPanic_NullPointerReference, + EAiFwPanic_IllegalPluginStateChange + }; + + void Panic(TAiPanicCodes aPanicCode); + + } + +#endif // _DEBUG + +#endif // AIFWPANIC_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/common/aiwspluginanimdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/common/aiwspluginanimdef.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 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: Defines constants shared between this subsystem and +* clients of this subsystem. +* +*/ + + +#ifndef AIWSPLUGINANIMDEF_H +#define AIWSPLUGINANIMDEF_H + +// INCLUDES +#include +#include + +// CONSTANTS + +_LIT( KAiWsPluginAnimDllName, "aiwsplugin.dll" ); + +// DATA TYPES + +/** +* Animation services +* +* EAnimKeyForward - Key forwarding to call handling application +*/ +enum TAiWsPluginAnimType + { + EAnimKeyForward + }; + +/** +* Active Idle anim plugin initialisation data. +*/ +struct TAiWsPluginAnimInitData + { + // Idle window group id + TInt iAiWgId; + // Window group to activate + TInt iTargetWgId; + }; + +#endif // AIWSPLUGINANIMDEF_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aibackuprestorestatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aibackuprestorestatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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: Backup / Restore status observer +* +*/ + + +#ifndef C_AIBACKUPRESTORESTATUSOBSERVER_H +#define C_AIBACKUPRESTORESTATUSOBSERVER_H + +#include +#include +#include "aipsstatusobserver.h" + +class MAiPSPropertyObserver; + +/** + * @ingroup group_aifw + * + * Publish and subscribe key observer + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiBackupRestoreStatusObserver ) : public CAiPSStatusObserver + { +public: + +// Construction + + static CAiBackupRestoreStatusObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiBackupRestoreStatusObserver(); + +// functions from base class CAiPSStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiBackupRestoreStatusObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// new functions + + static TInt HandleBackupOperationEvent( TAny* aPtr ); + + }; + +#endif // C_AIBACKUPRESTORESTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aicallstatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aicallstatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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: Call status observer +* +*/ + + +#ifndef C_AICALLSTATUSOBSERVER_H +#define C_AICALLSTATUSOBSERVER_H + +#include +#include +#include "aipsstatusobserver.h" + +class MAiPSPropertyObserver; + +/** + * @ingroup group_aifw + * + * Publish and subscribe key observer + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiCallStatusObserver ) : public CAiPSStatusObserver + { +public: + +// Construction + + static CAiCallStatusObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiCallStatusObserver(); + +// functions from base class CAiPSStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiCallStatusObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// new functions + + static TInt HandleCallStateChange( TAny* aPtr ); + + }; + +#endif // C_AICALLSTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aicontentpluginmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aicontentpluginmanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,153 @@ +/* +* 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: Content plugin manager class for Active idle framework. +* +*/ + + + +#ifndef C_AICONTENTPLUGINMANAGER_H +#define C_AICONTENTPLUGINMANAGER_H + +#include +#include "aicontentmodel.h" +#include "aicontentpublisher.h" +#include "aifwdefs.h" +#include "aipluginsettings.h" +#include "aipluginfactory.h" + +class MAiContentObserver; +class MAiEventHandlerExtension; +class MAiPluginTool; +class CAiContentPublisher; +class CAiPluginStateManager; +class CAiUiController; +class CImplementationInformation; + +/** + * @ingroup group_aifw + * + * Content plugin manager class for Active idle framework. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiContentPluginManager ) : public CBase + + { +public: // Constructor and destructor + + static CAiContentPluginManager* NewL(); + + virtual ~CAiContentPluginManager(); + +public: // New functions + + /** + * Forward plugin event to plugins. + * + * @since S60 3.2 + * @param aParam event string. + */ + void HandlePluginEvent( const TDesC& aParam ); + + /** + * Forward plugin event to plugins. + * + * @since S60 5.0 + * @param aPublisherInfo publisher info. + * @param aParam event string. + */ + void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); + + /** + * Queries wheter a plugin has settigns or not. + */ + TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + + /** + * Requests a Content publisher plug-in to refresh a content item. + */ + TBool RefreshContent( const TDesC& aContentCid ); + + /** + * Sets plugins to online/offline + * + * @since S60 5.0 + * @param aOnline ETrue to set plugins online, EFalse to offline + * @paran aPublishers List of publishers + */ + void ProcessOnlineState( TBool aOnline ); + + /** + * Gets plugin state manager. + * + * @since S60 5.0 + * @return plugin state manager. + */ + CAiPluginStateManager& StateManager() const; + + /** + * Gets plugin factory. + * + * @since S60 5.0 + * @return plugin factory. + */ + CAiPluginFactory& PluginFactory() const; + + +private: // Constructors + + CAiContentPluginManager(); + + void ConstructL(); + +private: // New functions + + void GetIdL( CAiContentPublisher& aContentPublisher, + TAiPublisherProperty aProperty, + const TDesC& aName, TInt& aId ); + + TInt RefreshContentL( const TDesC& aContentCid ); + +private: // Data + + /** + * Plugins array. + * Owned. + */ + RPointerArray< CAiContentPublisher > iPlugins; + + /** + * Plugin factory. + * Owned. + */ + CAiPluginFactory* iPluginFactory; + + /** + * System state observer. + * Owned. + */ + CAiPluginStateManager* iStateManager; + + /** + * Plugin tool from utility lib. + * Owned. + */ + MAiPluginTool* iPluginTool; + }; + +#endif // C_AICONTENTPLUGINMANAGER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aidevicestatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aidevicestatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* 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: Device status observer +* +*/ + + +#ifndef M_AIDEVICESTATUSOBSERVER_H +#define M_AIDEVICESTATUSOBSERVER_H + +#include "aipluginstatemachine.h" + +/** + * description + * + * @lib aifw + * @since S60 3.2 + */ +class MAiDeviceStatusObserver + { + +public: + + virtual ~MAiDeviceStatusObserver(){} + + virtual TAiStateChanges Status() = 0; + + }; + +#endif // M_AIDEVICESTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aienvironmentchangeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aienvironmentchangeobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Environment observer +* +*/ + + +#ifndef C_AIENVIROMENTCHANGEOBSERVER_H +#define C_AIENVIROMENTCHANGEOBSERVER_H + +#include +#include "aidevicestatusobserver.h" +#include "aiuiframeworkobserver.h" + +class MAiStateManager; +class CEnvironmentChangeNotifier; + +/** + * @ingroup group_aifw + * + * System enviroment change observer. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiEnvironmentChangeObserver ) : public CBase, + public MAiDeviceStatusObserver + { +public: + +// Construction + + static CAiEnvironmentChangeObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiEnvironmentChangeObserver(); + +// functions from base class CAiEnvironmentChangeObserver + + TAiStateChanges Status(); + +// new functions + + static TInt EnvironmentChangeCallBack(TAny* aPtr); + +private: + +// Construction + + CAiEnvironmentChangeObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +protected: // Data + + /** + * State manager. + * Not own. + */ + MAiStateManager* iStateManager; + + /** + * Enviroment change notifier: time, locale and midnight crossover + * Own. + */ + CEnvironmentChangeNotifier* iEnvironmentChangeNotifier; + }; + +#endif // C_AIENVIROMENTCHANGEOBSERVER_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aifocusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aifocusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* 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: AI2 focus observer. +* +*/ + + +#ifndef C_AIFOCUSOBSERVER_H +#define C_AIFOCUSOBSERVER_H + +#include +#include +//++HV +#include +//--HV +#include "aipsstatusobserver.h" + +class MAiPSPropertyObserver; + +/** + * @ingroup group_aifw + * + * Focus change observer. Using telephony idle visiblity PS. + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiFocusObserver ) : public CAiPSStatusObserver + //++HV + ,public MAknTransitionUtilsObserver + //--HV + { +public: + +// Construction + + static CAiFocusObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiFocusObserver(); + +// functions from base class CAiPSStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiFocusObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// new functions + + //++HV + + static TInt StaticHandleFocusChangeEvent( TAny* aPtr ); + TInt HandleFocusChangeEvent(); + + + // From MAknTransitionUtilsObserver + TInt AknTransitionCallback(TInt aEvent, TInt aState = 0, const TDesC8* aParams = NULL); + + +private: + TBool iTfxEffectActive; + + + //--HV + }; + +#endif // C_AIFOCUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aifw.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aifw.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,199 @@ +/* +* 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: AI2 main class +* +*/ + + +#ifndef C_AIFW_H +#define C_AIFW_H + +#include +#include +#include +#include + +#include "aifwdefs.h" +#include "aicontentmodel.h" +#include "aifweventhandler.h" + +class CAiUiControllerManager; +class CAiContentPluginManager; +class CAiWsPluginManager; +class CAiPluginStateManager; +class RConeResourceLoader; +class CAiContentPublisher; +class MAiPSPropertyObserver; +class CAiNetworkListener; + +/** + * @ingroup group_aifw + * + * Active Idle Framework main class. + */ +NONSHARABLE_CLASS( CAiFw ) : + public CBase, + public MAiFwEventHandler, + public MCenRepNotifyHandlerCallback + { +public: // Constructors and destructors + + /** + * Creates and returns a new Active Idle Framework object. + * + * @return new Active Idle Framework object. The object is also left + * on the cleanup stack. + * @exception Any of the system-wide error codes if framework creation + * fails due to an unrecoverable error. + */ + IMPORT_C static CAiFw* NewLC(); + + ~CAiFw(); + +public: // New functions + + /** + * Runs the Active Idle Framework. This function returns when the + * framework is shut down. + * + * @exception Any of the system-wide error codes if the framework + * encounters a fatal initialization or run-time error. + */ + IMPORT_C void RunL(); + +private: // Constructors + CAiFw(); + void ConstructL(); + +private: // From MAiFwEventHandler + + /** + * @see MAiFwEventHandler + */ + void AppEnvReadyL(); + + /** + * @see MAiFwEventHandler + */ + void HandleUiReadyEventL( CAiUiController& aUiController ); + + /** + * @see MAiFwEventHandler + */ + void HandleActivateUI(); + + /** + * @see MAiFwEventHandler + */ + void HandleUiShutdown( CAiUiController& aUiController ); + + /** + * @see MAiFwEventHandler + */ + void HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ); + + /** + * @see MAiFwEventHandler + */ + void HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ); + + /** + * @see MAiFwEventHandler + */ + void HandlePluginEvent( const TDesC& aParam ); + + /** + * @see MAiFwEventHandler + */ + void HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ); + + /** + * @see MAiFwEventHandler + */ + TBool HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); + + /** + * @see MAiFwEventHandler + */ + TBool RefreshContent( const TDesC& aContentCid ); + + /** + * @see MAiFwEventHandler + */ + TBool QueryIsMenuOpen(); + + /** + * @see MAiFwEventHandler + */ + void ProcessStateChange( TAifwStates aState ); + +private: // From MCenRepNotifyHandlerCallback + + /** + * @see MCenRepNotifyHandlerCallback + */ + void HandleNotifyInt( TUint32 aId, TInt aNewValue ); + +private: // New functions + + static TInt HandleFocusChangeEvent( TAny* aSelf ); + static TInt HandleRestartEvent( TAny* aSelf ); + void SwapUiControllerL( TBool aToExtHS ); + +private: // Data + + /** + * UI Controller manager, Owned. + */ + CAiUiControllerManager* iUiControllerManager; + + /** + * Content plugin manager, Owned. + */ + CAiContentPluginManager* iPluginManager; + + /** + * Window server plug-in manager, Owned. + */ + CAiWsPluginManager* iWsPluginManager; + + /** + * Notify handler for cenrep, Owned. + */ + CCenRepNotifyHandler* iNotifyHandler; + + /** + * Notify handler for cenrep, Owned. + */ + CCenRepNotifyHandler* iNotifyHandlerESS; + + /** + * Idle repository, Owned. + */ + CRepository* iAIRepository; + + /** + * Idle restart PS observer, Owned. + */ + MAiPSPropertyObserver* iIdleRestartObserver; + + TBool iLibrariesLoaded; + + RLibrary iLibrary1; + RLibrary iLibrary2; + RLibrary iLibrary3; + }; + +#endif // C_AIFW_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aifwstartupscheduler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aifwstartupscheduler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,59 @@ +/* +* 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: Custom active scheduler for Active Idle Framework startup. +* +*/ + + +#ifndef C_AIFWSTARTUPSCHEDULER_H +#define C_AIFWSTARTUPSCHEDULER_H + + +#include + +/** + * Custom active scheduler for Active Idle Framework startup. + */ +NONSHARABLE_CLASS( CAiFwStartupScheduler ) : public CActiveScheduler + { +public: + static CAiFwStartupScheduler* NewLC(); + + ~CAiFwStartupScheduler(); + + /** + * Returns result code from this scheduler's execution. + * + * @return - KErrNone if the scheduler loop executed succesfully + * - Any of the system-wide error codes in case of an error. + */ + TInt Result(); + +private: +// from base class CActiveScheduler + void Error(TInt aError) const; + +// Construction + CAiFwStartupScheduler(); +private: // data + + /** + * Result code returned by Result(). + */ + mutable TInt iResult; + }; + + +#endif // ? C_AIFWSTARTUPSCHEDULER_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aikeylockobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aikeylockobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,67 @@ +/* +* 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: AI2 keylock status observer. +* +*/ + + +#ifndef C_AIKEYLOCKOBSERVER_H +#define C_AIKEYLOCKOBSERVER_H + +#include +#include +#include "aipsstatusobserver.h" + +class MAiPSPropertyObserver; + +/** + * @ingroup group_aifw + * + * Keylock status change observer. + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiKeylockObserver ) : public CAiPSStatusObserver + { +public: + +// Construction + + static CAiKeylockObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiKeylockObserver(); + +// functions from base class CAiPSStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiKeylockObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// new functions + + static TInt HandleKeylockStatusEvent( TAny* aPtr ); + + }; + +#endif // C_AIKEYLOCKOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/ailightstatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/ailightstatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Light status observer +* +*/ + + +#ifndef C_AILIGHTSTATUSOBSERVER_H +#define C_AILIGHTSTATUSOBSERVER_H + +#include +#include +#include +#include "aidevicestatusobserver.h" + +class MAiStateManager; + +/** + * @ingroup group_aifw + * + * Publish and subscribe key observer + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiLightStatusObserver ) : public CBase, + public MHWRMLightObserver, + public MAiDeviceStatusObserver + { +public: + +// Construction + + static CAiLightStatusObserver* NewL( MAiStateManager* aStateManager ); + + ~CAiLightStatusObserver(); + +// functions from base class MAiDeviceStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiLightStatusObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// from MHWRMLightObserver + + void LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus ); + +protected: // Data + + /** + * Light client. + * Own. + */ + CHWRMLight* iLight; + + /** + * State manager. + * Not own. + */ + MAiStateManager* iStateManager; + + }; + +#endif // C_AILIGHTSTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/ainetworklistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/ainetworklistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2009 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: Network info listener +* +*/ + +#ifndef C_NETWORKLISTENER_H +#define C_NETWORKLISTENER_H + +#include +#include +#include "ainetworkobserver.h" + +class MAiNetworkObserver; +class CNWSession; + +/** + * @ingroup group_xmluicontroller + * + * Network info listener. + * + * Client can use this object to listen network state changes. Client must implement + * MAiNetworkObserver interface to retrieve network state changes + * + * @since S60 5.0 + */ +NONSHARABLE_CLASS(CAiNetworkListener) : public CBase, + public MNWMessageObserver + { +public: + + static CAiNetworkListener* CAiNetworkListener::NewL(MAiNetworkObserver& aNetworkObserver); + + virtual ~CAiNetworkListener(); + + /** + * Get current network status + * @return TNetworkState + */ + MAiNetworkObserver::TNetworkState NetworkState(); + +// from base class MNWMessageObserver + + /** + * From MNWMessageObserver. + * Called by network handling engine when network info changes. + * + * @since S60 5.0 + * @param aMessage is type of the change. + */ + void HandleNetworkMessage( const TNWMessages aMessage ); + + /** + * From MNWMessageObserver. + * Called if network handling engine fails. + * + * @since S60 5.0 + * @param aOperation is failed operation. + * @param aErrorCode is fail reason. + */ + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + +private: + TBool HasNetworkInfoChanged( const TNWMessages aMessage ); + + MAiNetworkObserver::TNetworkState InterpretNWMessage(const TNWMessages aMessage, const TNWInfo); + + CAiNetworkListener(MAiNetworkObserver& aNetworkObserver); + + void ConstructL(); + + +private: // data + + /** + * Session to network handling engine. + * Own. + */ + CNWSession* iSession; + + /** + * Cached network info structure. + */ + TNWInfo iInfo; + + /** + * Previous network information. + */ + TNWInfo iOldInfo; + + /** + * Reference to client observing + */ + MAiNetworkObserver& iObserver; + + + /** + * Network related message flags + */ + + enum TNetInfoFlags + { + ENetworkProviderNameReceived = 0x00000001, + ENetworkProviderNameOk = 0x00000002, + EServiceProviderNameReceived = 0x00000004, + EServiceProviderNameOk = 0x00000008, + ERegistrationStatusReceived = 0x00000010, + ENetworkInfoChangeReceived = 0x00000020, + EProgrammableOperatorInfoReceived = 0x00000040, + EProgrammableOperatorInfoReceivedOk = 0x00000080 + }; + + /** + * Subset of sum of TNetInfoFlags. + */ + TUint iReceivedMessageFlags; + + /** + * Subset of sum of old TNetInfoFlags. + */ + TUint iOldReceivedMessageFlags; + + /** + * current state of network + */ + MAiNetworkObserver::TNetworkState iCurrentNwState; + }; +//} + +#endif // C_AINETWORKINFOLISTENER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/ainetworkobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/ainetworkobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 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: Network info observer +* +*/ + +#ifndef M_NETWORKOBSERVER_H +#define M_NETWORKOBSERVER_H + +#include +#include + +/** + * @ingroup group_xmluicontroller + * + * Network info observer. + * + * Client gets network state changes through this interface. + * + * @since S60 5.0 + */ +class MAiNetworkObserver + { + +public: + enum TNetworkState + { + ENone = 0, + EHomeNetwork, + ERoaming + }; + +protected: + + /** + * Virtual destructor. + * Cannot be used to destruct the object. + */ + virtual ~MAiNetworkObserver() {}; + +public: + + /** + * Called when network info changes. + * + * @since S60 5.0 + * @param aNewState new network state + */ + virtual void HandleNetworkStateChange( TNetworkState aNewState ) = 0; + + }; + +#endif // M_AINETWORKINFOOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/ainwsdlgcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/ainwsdlgcontroller.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Network selection dialog controller +* +*/ + + +#ifndef C_AINWSDLGCONTROLLER_H +#define C_AINWSDLGCONTROLLER_H + +#include +#include +#include + +class CNWSession; + +/** + * Network Selection Dialog controller. + */ +NONSHARABLE_CLASS( CAiNwSDlgController ) : + public CBase, + public MNWMessageObserver + { +public: + +// Constructors and destructors + + /** + * Creates a new instance of the class. + * + * @return A new instance of the class. + * @exception Any of the system-wide error codes if instance creation + * fails due to an unrecoverable error. + */ + static CAiNwSDlgController* NewL(); + + ~CAiNwSDlgController(); + +// from MNWMessageObserver + + void HandleNetworkMessage( const TNWMessages aMessage ); + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + +private: + +// Constructors + + CAiNwSDlgController(); + + void ConstructL(); + +private: + +// New functions + + /** + * Take action according to current state change. + */ + void HandleStateChange(); + + /** + * + */ + void HandleNetworkFound(); + + /** + * + */ + void HandleNetworkLost(); + + /** + * Opens the network selection dialog. + */ + void LaunchDialog(); + + /** + * Cancels the network selection dialog. + */ + void CancelDialog(); + + /** + * Tests if offline mode is engaged. + * + * @return ETrue if offline mode is currently active + */ + TBool IsOffLineMode() const; + + /** + * Tests if Bluetooth SAP is in connected mode. + * + * @return ETrue if Bluetooth SAP is active. + */ + TBool IsBluetoothSAPConnected() const; + + static TInt DelayCallBack(TAny* aParam); + +private: + +// Data + + /** + * Notifier service + * Own + */ + CAknSoftNotifier* iSoftNotifier; + + /** + * Session to network handling engine. + * Own. + */ + CNWSession* iSession; + + /** + * Cached network info structure. + */ + TNWInfo iInfo; + + /** + * A true value if registered to network. + */ + TBool iRegistered; + + /** + * Profile API. + */ + CRepository* iProfileApi; + + /** + * Timer object for 1-minute delay + */ + CPeriodic* iPeriodic; + }; + +#endif // C_AINWSDLGCONTROLLER_H + +// End of file. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginactivitypstool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginactivitypstool.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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: Plugin activity PS tool +* +*/ + + +#ifndef AIPLUGINACTIVITYPSTOOL_H +#define AIPLUGINACTIVITYPSTOOL_H + +#include // TUid +#include // RProperty + +struct TAiPublisherInfo; + +NONSHARABLE_CLASS(CAiPluginActivityRegistry) : public CBase + { + public: + + static CAiPluginActivityRegistry* NewL(); + + TInt SetPluginActive( const TAiPublisherInfo& aPubInfo ); + + void CleanRegistry(); + + ~CAiPluginActivityRegistry(); + + private: + + // construction + + void ConstructL(); + + CAiPluginActivityRegistry(); + + // new methods + + /** + * Update PS registry count register. + */ + TInt UpdateCountRegister(); + + /** + * Update PS registry ordinal register. + */ + TInt UpdateOrdinalRegister( TInt aPluginUid ); + + /** + * Update plugins name register. + */ + TInt UpdateNameRegister( TInt aPluginUid, + const TDesC& aName ); + + /** + * Clean last added entry. In case of failure. + */ + void CleanLastEntry( TInt aPluginUid, + TInt aOrdinal, + TInt aLastCount ); + + private: // Members + + /** + * Ordinal in registry. Ascending. + */ + TInt iRegistryOrdinal; + + /** + * Plugin count in registry. + */ + TInt iPluginCount; + + /** + * PS property that is updated. + */ + RProperty iProperty; + + }; + +#endif // AIPLUGINACTIVITYPSTOOL_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,144 @@ +/* +* 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: Content plugin manager class for Active idle framework. +* +*/ + + + +#ifndef C_AIPLUGINASYNCFACTORY_H +#define C_AIPLUGINASYNCFACTORY_H + +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include "aifwdefs.h" +#include + +class MAiContentObserver; +class MAiEventHandlerExtension; +class MAiContentItemIterator; +class CAiContentPublisher; +class CAiUiController; +class CAiPluginActivityRegistry; +class CImplementationInformation; +class CAiContentPluginManager; +class MAiPluginTool; +class MAiPluginLifecycleObserver; + +/** + * @ingroup group_aifw + * + * Content plugin factory class for Active idle framework. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiPluginFactory ) : public CBase + { + public: + +// Constructor and destructor + + static CAiPluginFactory* NewL( RPointerArray& aPlugins, + CAiContentPluginManager& aManager ); + + virtual ~CAiPluginFactory(); + +// New functions + + /** + * Create plugin + * + * @since S60 5.0 + * @param aPublisherInfo plugin to load. + * @param aControllerArray array of active UI controllers. + */ + void CreatePluginL( const TAiPublisherInfo& aPublisherInfo, + RPointerArray& aControllerArray ); + + /** + * Destroy plugin + * + * @since S60 5.0 + * @param aPublisherInfo plugin to destroy. + * @param aControllerArray array of active UI controllers. + */ + void DestroyPluginL( const TAiPublisherInfo& aPublisherInfo, + RPointerArray& aControllerArray ); + + /** + * Destroys all plugins + * + * @since S60 5.0 + */ + void DestroyPlugins(); + + + void AddLifecycleObserverL( MAiPluginLifecycleObserver& aObserver ); + + /** + * Finds plugin by publisher info. + * + * @since S60 5.0 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. + */ + CAiContentPublisher* PluginByInfoL( const TAiPublisherInfo& aInfo ) const; + + /** + * Finds plugin by name. + * + * @since S60 5.0 + * @param aInfo publisher info. + * @return Pointer to plugin, NULL if not found. + */ + CAiContentPublisher* PluginByNameL( const TDesC& aName ) const; + + private: + +// Constructors + + CAiPluginFactory( RPointerArray& aPlugins, + CAiContentPluginManager& aManager ); + + void ConstructL(); + +// New functions + + CAiContentPublisher* CreatePluginLC( const TAiPublisherInfo& aPluginInfo ); + + void SubscribeContentObserversL( CAiContentPublisher& aContentPublisher, + const TAiPublisherInfo& aPublisherInfo, + RPointerArray& aControllerArray ); + + void ConfigurePluginL( RPointerArray& aControllerArray, + CAiContentPublisher& aContentPublisher, + const TAiPublisherInfo& aPubInfo ); + + private: // Data + // Array of loaded data plugins, Not owned + RPointerArray& iPlugins; + // Content plugin manager, Not owned + CAiContentPluginManager& iManager; + // Ecom implementation info, Owned + RImplInfoPtrArray iEComPlugins; + // Plugin tool from utility lib, Owned + MAiPluginTool* iPluginTool; + // Life cycle observers, Owned + RPointerArray iLifecycleObservers; + }; + +#endif // C_AIPLUGINASYNCFACTORY_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginlifecycleobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginlifecycleobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,82 @@ +/* +* 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: Plugin lifecycle observer +* +*/ + + + +#ifndef M_AIPLUGINLIFECYCLEOBSERVER_H +#define M_AIPLUGINLIFECYCLEOBSERVER_H + +#include "aipropertyextension.h" +#include + +class CAiContentPublisher; + +// Unnamed namespace for local definitions +namespace + { + const TInt KAIUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; + + const TInt KAIUidShortCutPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN; + + const TInt KAIUidProfilePlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; + + const TInt KAIUidSATPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SATPLUGIN; + } + +/** + * Plugin lifecycle observer base class. + * + * @lib aifw + * @since S60 3.2 + */ +class MAiPluginLifecycleObserver + { +public: + + /** + * Report plugin created. + * @param aPlugin reference to the created plugin. + */ + virtual void PluginCreatedL( CAiContentPublisher& aPlugin ) = 0; + + /** + * Report plugin destroyed. + * @param aPlugin reference to the dtored plugin. + */ + virtual void PluginDestroyed( CAiContentPublisher& aPlugin ) = 0; + + /** + * Report all plugins created. + */ + virtual void AllPluginsCreated() = 0; + + /** + * Report all plugins destroyed. + */ + virtual void AllPluginsDestroyed() = 0; + +protected: + + /** + * Protected destructor prevents deletion through this interface. + */ + ~MAiPluginLifecycleObserver() { }; + }; + +#endif // M_AIPLUGINSTATEMANAGER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginstate.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,74 @@ +/* +* 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: Plugin state main class +* +*/ + + +#ifndef M_AIPLUGINSTATE_H +#define M_AIPLUGINSTATE_H + +#include "aipluginstatemachine.h" + +/** + * Plugin state interface. + * + * @lib aifw + * @since S60 3.2 + */ +class MAiPluginState + { +public: + + /** + * This method is called when state is entered. + * + * @param aStateMachine reference to the owning state machine. + * @param aStateChange the system state variable change that caused this + * state change. + */ + virtual void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) = 0; + + /** + * This method handles system state variable state changes + * handles events in the current state. + * + * @param aStateMachine reference to the owning state machine. + * @param aStateChange the system state variable change that is the cause + * of this event. + * @return TBool did the state handle the event. + */ + virtual TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) = 0; + + /** + * This method is called when state is exited. + * + * @param aStateMachine reference to the owning state machine. + * @param aStateChange the system state variable change that caused this + * state change. + */ + virtual void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) = 0; + +protected: + + ~MAiPluginState() + { + }; + + }; + +#endif // M_AIPLUGINSTATE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginstatemachine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginstatemachine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,169 @@ +/* +* 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: Plugin state mmchine base class +* +*/ + + +#ifndef M_AIPLUGINSTATEMACHINE_H +#define M_AIPLUGINSTATEMACHINE_H + +#include + +class MAiPluginState; + +/** + * TAiStateChanges state change enumeration for each separate monitored state. + */ +enum TAiStateChanges + { + ESMAIInCall, + ESMAINoCall, + ESMAIBacklightOn, + ESMAIBacklightOff, + ESMAIBackupOn, + ESMAIBackupOff, + ESMAIIdleForeground, + ESMAIIdleBackground, + ESMAISystemBoot, + ESMAISystemShutdown, + ESMAILocaleChanged, + ESMAITimeChanged, + ESMAIMidnightCrossover, + ESMAIReportThemeChangeStarted, + ESMAIReportThemeChangeReady, + ESMAIRelayoutScreen, + ESMAIGeneralThemeChanged, + ESMAIT1Timeout, + ESMAIKeylockEnabled, + ESMAIKeylockDisabled, + ESMAIUnknownState, + ESMAIEnterEditMode, + ESMAIExitEditMode, + ESMAIOffLine, + ESMAIOnLine, + ESMAIPageSwitch + }; + +/** + * Sate variable enumeration for querying the status of the monitored item. + */ +enum TAiStateVariable + { + ESMAICallStatus, + ESMAILightStatus, + ESMAIBackupRestoreStatus, + ESMAIIdleFocusStatus + }; + +/** + * Possible states of the state machine (and plugin). + */ +enum TAiState + { + EAiIdle = 1, + EAiSuspended, + EAiAlive, + EAiAliveActive, + EAiAliveIncall, + EAiAliveInactive + }; + +/** + * Sub states of idle state. + */ +enum TAiIdleSubState + { + EAiIdleCreatingPlugins = EAiAliveInactive + 1, + EAiIdleBackupRestore + }; + +/** + * @ingroup group_aifw + * + * Plugin state resource interface. + * + * @lib aifw + * @since S60 3.2 + */ +class MAiPluginStateResources + { +public: + + /* + * Check whether the specified state variable is active or not. + * + * @param aStateVariable system variable state change that is to be checked. + */ + virtual TBool StateVariable( TAiStateVariable aStateVariable ) = 0; + + /** + * Translates system state change reason to plugin state state reason. + * + * @param aStateChange the system state variable change to be translated. + * @return TAiTransitionReason plugin state transition reason. + */ + virtual TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ) = 0; + + /** + * Restart plugin suspend timer. + */ + virtual void RestartSuspendTimer() = 0; + +protected: + ~MAiPluginStateResources() {} + }; + +/** + * Plugin state machine interface. + * + * @lib aifw + * @since S60 3.2 + */ +class MAiPluginStateMachine : public MAiPluginStateResources + { +public: + + /* + * Method that changes this state machine to a state. + * + * @param aState state to change to. + * @param aStateChange system variable state change that is the cause for this call. + */ + virtual void SwitchToState( TAiState aState, + TAiStateChanges aStateChange ) = 0; + + /* + * Reference to the plugin that is managed by this state machine. + * + * @return CAiContentPublisher reference to the plugin. + */ + virtual CAiContentPublisher& Plugin() const = 0; + + /** + * Change plugin states. + * + * @param aReason for transition + * @param aStateChangeMethod state change method to call + * @param aLogOpCode operation code for logging + */ + virtual void ChangePluginState( + TAiTransitionReason aReason, + void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ) = 0; + +protected: + ~MAiPluginStateMachine() {} + }; + +#endif // M_AIPLUGINSTATEMACHINE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginstatemachineimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginstatemachineimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* 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: Plugin state machine implementation +* +*/ + + +#ifndef C_AIPLUGINSTATEMACHINEIMPL_H +#define C_AIPLUGINSTATEMACHINEIMPL_H + +#include +#include +#include "aipluginstatemachine.h" +#include "aistatealive.h" +#include "aistatesuspended.h" +#include "aistateidle.h" + +class MAiPluginStateControl; +class MAiPluginState; + +/** + * Plugin state machine implementation. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiPluginStateMachine ) : public CBase, + public MAiPluginStateMachine + { +public: // Constructor + + CAiPluginStateMachine( MAiPluginStateResources& aPluginStateResource, + CAiContentPublisher& aPlugin ); + +public: // from MAiPluginStateMachine + + TBool StateVariable( TAiStateVariable aStateVariable ); + + TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); + + void RestartSuspendTimer(); + + void SwitchToState( TAiState aState, TAiStateChanges aStateChange ); + + CAiContentPublisher& Plugin() const; + + void ChangePluginState( TAiTransitionReason aReason, + void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ); + +public: // new methods + + TBool HandleEvent( TAiStateChanges aStateChange ); + +private: // data + + /** + * Alive master state. + */ + TAiStateAlive iAlive; + + /** + * Suspended state. + */ + TAiStateSuspended iSuspended; + + /** + * Idle master state. + */ + TAiStateIdle iIdle; + + /** + * Pointer to current state. + * Not owned. + */ + MAiPluginState* iCurrentState; + + /** + * Pointer to parent state machine. + * Not owned. + */ + MAiPluginStateResources& iPluginStateResource; + + /** + * Pointer to managed plugin. + * Not owned. + */ + CAiContentPublisher& iPlugin; + + /** + * Online sub-state + */ + TBool iOnline; + }; + +#endif // C_AIPLUGINSTATEMACHINEIMPL_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipluginstatemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipluginstatemanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,242 @@ +/* +* 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: Plugin state manager +* +*/ + + +#ifndef C_AIPLUGINSTATEMANAGER_H +#define C_AIPLUGINSTATEMANAGER_H + +#include +#include "aistatemanager.h" +#include "aipluginstatemachine.h" +#include "aipluginlifecycleobserver.h" + +#include "aistatealive.h" +#include "aistatesuspended.h" +#include "aistateidle.h" +#include "aifwdefs.h" + +class MAiPSPropertyObserver; +class MAiDeviceStatusObserver; +class CAiPluginStateManager; +class CAiContentPluginManager; +class CAiPluginStateMachine; +class CAiUiFrameworkObserverImpl; +class MAiUiFrameworkObserver; + +/** + * Plugin state manager implementation. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiPluginStateManager ) : public CBase, + public MAiStateManager, + public MAiPluginStateResources, + public MAiPluginLifecycleObserver + { + +public: // Constructor and destructor + + static CAiPluginStateManager* NewL(); + + virtual ~CAiPluginStateManager(); + +public: // From MAiStateManager + + void ReportStateChange( TAiStateChanges aState ); + +public: // From MAiPluginStateMachine + + TBool StateVariable( TAiStateVariable aStateVariable ); + + TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); + + void RestartSuspendTimer(); + +public: // From MAiPluginLifecycleObserver + + void PluginCreatedL( CAiContentPublisher& aPlugin ); + + void PluginDestroyed( CAiContentPublisher& aPlugin ); + + void AllPluginsCreated(); + + void AllPluginsDestroyed(); + +public: // new methods + + /** + * Create system status observers (lights/backup/restore etc.). + */ + void CreateSystemStateObserversL(); + + /** + * Destroy system status observers. + */ + void DestroySystemStateObservers(); + + /** + * Provide accessor for fw observer. + * @return MAiUiFrameworkObserver pointer to fw observer. + */ + MAiUiFrameworkObserver* UiFwObserver() const; + + /** + * Process online state change for a plugin + * @param aPlugin plugin + */ + void ProcessOnlineState( CAiContentPublisher& aPlugin ); + + /** + * Process offline state change for a plugin + * @param aPlugin plugin + */ + void ProcessOfflineState( CAiContentPublisher& aPlugin ); + +private: // Constructors + + CAiPluginStateManager(); + + void ConstructL(); + +private: // New functions + + /** + * Handles Statemachine event event and error array update. + * @param aState new state. + * @param aMachine reference to single state machine. + */ + void ProcessStateChange( TAiStateChanges aState, + CAiPluginStateMachine& aMachine ); + + /** + * Handles Statemachine event event and error array update + * for all state machines. + * @param aState new state. + */ + void ProcessStateChangeForAll( TAiStateChanges aState ); + + /** + * Helper to check idle focus status. + * @return ETrue if idle is focused / foreground app. + */ + TBool IdleFocused() const; + + /** + * Helper to check backup (or restore) status. + * @return ETrue if backup (or restore) is ongoing. + */ + TBool BackupOngoing() const; + + /** + * Helper to check phone lights status. + * @return ETrue if lights are on. + */ + TBool LightsOn() const; + + /** + * Helper to check phone call status. + * @return ETrue if call is ongoing. + */ + TBool CallOngoing() const; + + /** + * Standard callback for CPeriodic ie. T1 timer. + */ + static TInt T1TimerCallback( TAny* aPtr ); + +private: // Data + + /** + * Backup operation state observer. + * Own. + */ + MAiDeviceStatusObserver* iBackupOperationObserver; + + /** + * Call state observer. + * Own. + */ + MAiDeviceStatusObserver* iCallStateObserver; + + /** + * Light state observer. + * Own. + */ + MAiDeviceStatusObserver* iLightStateObserver; + + /** + * Enviroment change observer. + * Own. + */ + MAiDeviceStatusObserver* iEnvironmentObserver; + + /** + * Focus change observer. Using telephony idle visiblity PS. + * Own. + */ + MAiDeviceStatusObserver* iFocusObserver; + + /** + * Keylock observer. + * Own. + */ + MAiDeviceStatusObserver* iKeylockObserver; + + /** + * Enviroment change observer. Full class type is used because + * we need to provide accessor for implemented type MAiUiFrameworkObserver. + * Own. + */ + CAiUiFrameworkObserverImpl* iFrameworkObserver; + + /** + * Timer for suspend, screensaver timout + light fadeout. + * Own. + */ + CPeriodic* iT1Timer; + + /** + * Timer for suspend, screensaver timout + light fadeout. + */ + TInt iT1Delay; + + /** + * New state to be timed. + */ + TAiState iTimedState; + + /** + * Reason for timers activity. + */ + TAiTransitionReason iTimedReason; + + /** + * Indicates whether the device has been properly started. + */ + TBool iIsDeviceStarted; + + /** + * State machines for plugins. + * Own. + */ + RPointerArray iStateMachines; + }; + +#endif // C_AIPLUGINSTATEMANAGER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aipsstatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aipsstatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,71 @@ +/* +* 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: PS status observer +* +*/ + + +#ifndef C_AIPSSTATUSOBSERVER_H +#define C_AIPSSTATUSOBSERVER_H + +#include +#include +#include "aidevicestatusobserver.h" + +class MAiPSPropertyObserver; +class MAiStateManager; + +/** + * description + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiPSStatusObserver ) : public CBase, + public MAiDeviceStatusObserver + { + +public: + +// Construction + + virtual ~CAiPSStatusObserver(); + +// New functions + + virtual TAiStateChanges Status(); + +protected: + +// Construction + + CAiPSStatusObserver(); + + void BaseConstructL( TCallBack aCallBack, + TUid aCategory, + TInt aKey, + MAiStateManager* aStateManager ); + +protected: // Data + + MAiPSPropertyObserver* iObserver; + + MAiStateManager* iStateManager; + + }; + +#endif // C_AIPSSTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aissaverstatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aissaverstatusobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + +#ifndef C_AISSAVERSTATUSOBSERVER_H +#define C_AISSAVERSTATUSOBSERVER_H + +#include +#include +#include "aipsstatusobserver.h" + +class MAiPSPropertyObserver; + +/** + * Publish and subscribe key observer + * + * @lib aifw + * @since S60 3.2 + */ + +NONSHARABLE_CLASS( CAiSSaverStatusObserver ) : public CAiPSStatusObserver + { +public: + +// Construction + + static CAiSSaverStatusObserver* NewL( MAiStateManager* aStateManager ); + + virtual ~CAiSSaverStatusObserver(); + +// functions from base class CAiSSaverStatusObserver + + TAiStateChanges Status(); + +private: + +// Construction + + CAiSSaverStatusObserver(); + + void ConstructL( MAiStateManager* aStateManager ); + +// new functions + + static TInt HandleScreenSaverStateChanged( TAny* aPtr ); + + }; + +#endif // C_AISSAVERSTATUSOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aistatealive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistatealive.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,169 @@ +/* +* 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: State alive +* +*/ + + +#ifndef T_AISTATEALIVE_H +#define T_AISTATEALIVE_H + +#include "aipluginstate.h" +#include "aipluginstatemachine.h" + +/** + * @ingroup group_aifw + * + * Alive active state + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateAliveActive ) : public MAiPluginState + { +public: // Constructor + + TAiStateAliveActive(); + +public: // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + }; + +/** + * Alive inactive state + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateAliveInactive ) : public MAiPluginState + { +public: // Constructor + + TAiStateAliveInactive(); + +public: // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + }; + +/** + * Alive incall state + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateAliveIncall ) : public MAiPluginState + { +public: // Constructor + + TAiStateAliveIncall(); + +public: // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + }; + +/** + * Alive switch state + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateAlive ) : public MAiPluginState, + public MAiPluginStateMachine + { +public: // Constructor + + TAiStateAlive( MAiPluginStateMachine& aParentStateMachine ); + +public: // from MAiPluginStateMachine + + TBool StateVariable( TAiStateVariable aStateVariable ); + + TAiTransitionReason TranslateReason( TAiStateChanges aStateChange ); + + void RestartSuspendTimer(); + + void SwitchToState( TAiState aState, TAiStateChanges aStateChange ); + + CAiContentPublisher& Plugin() const; + + void ChangePluginState( TAiTransitionReason aReason, + void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ); + +public: // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + +private: // data + + /** + * Pointer to current state. + * Not owned. + */ + MAiPluginState* iCurrentState; + + /** + * Pointer to parent state machine. + * Not owned. + */ + MAiPluginStateMachine* iParentStateMachine; + + /** + * Alive active state. + */ + TAiStateAliveActive iStateAliveActive; + + /** + * Alive incall state. + */ + TAiStateAliveIncall iStateAliveIncall; + + /** + * Alive inactive state. + */ + TAiStateAliveInactive iStateAliveInactive; + }; + +#endif // T_AISTATEALIVE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aistateidle.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistateidle.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* 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: State idle +* +*/ + + +#ifndef T_AISTATEIDLE_H +#define T_AISTATEIDLE_H + +#include "aipluginstate.h" +#include "aipluginstatemachine.h" + +/** + * @ingroup group_aifw + * + * Idle state. + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateIdle ) : public MAiPluginState + { +public: + // Construction + + TAiStateIdle(); + + // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + }; + +#endif // T_AISTATEIDLE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aistatemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistatemanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,51 @@ +/* +* 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: State manager base class +* +*/ + + +#ifndef M_AISTATEMANAGER_H +#define M_AISTATEMANAGER_H + +#include "aipluginstatemachine.h" + +/** + * description + * + * @lib aifw + * @since S60 3.2 + */ +class MAiStateManager + { + + public: + + /** + * System status observers use this method to report status variable + * changes to state manager. + * + * @param TAiStateChanges aState the state that has changed. + */ + virtual void ReportStateChange( TAiStateChanges aState ) = 0; + + protected: + + ~MAiStateManager(){} + + }; + +#endif // M_AISTATEMANAGER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aistatesuspended.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aistatesuspended.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +/* +* 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: State suspended +* +*/ + + +#ifndef T_AISTATESUSPENDED_H +#define T_AISTATESUSPENDED_H + +#include "aipluginstate.h" + +/** + * @ingroup group_aifw + * + * Suspended state + * + * @lib aifw + * @since S60 3.2 + */ +NONSHARABLE_CLASS( TAiStateSuspended ) : public MAiPluginState + { +public: + // Construction + + TAiStateSuspended(); + + // from MAiPluginState + + void Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + TBool HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + void Exit( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ); + + }; + +#endif // T_AISTATESUSPENDED_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aiuicontrollermanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aiuicontrollermanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,156 @@ +/* +* 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: UI controller manager +* +*/ + + +#ifndef C_AIUICONTROLLERMANAGER_H +#define C_AIUICONTROLLERMANAGER_H + + +#include +#include "aiuiframeworkobserver.h" +#include "aicontentmodel.h" +#include "aifwdefs.h" + +class CAiUiController; +class CAiContentPublisher; +class MAiMainUiController; +class MAiFwEventHandler; +class CRepository; +class CCoeEnv; + +/** + * @ingroup group_aifw + * + * Active Idle UI Controller manager. + * + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiUiControllerManager ) : public CBase, + public MAiUiFrameworkObserver + { + public: // Constructors and destructor + + static CAiUiControllerManager* NewL(); + ~CAiUiControllerManager(); + + public: // New functions + + /** + * Returns all UI controllers in an array. + */ + RPointerArray< CAiUiController >& UiControllers() const; + + /** + * Calls ActivateUI() for all UI controllers. + */ + void ActivateUI(); + + /** + * Returns the main ui controller object. + */ + MAiMainUiController& MainUiController() const; + + /** + * Returns true if aUiController is the main UI controller. + */ + TBool IsMainUiController(CAiUiController& aUiController) const; + + /** + * Sets framework event handler for all UI controllers. + */ + void SetEventHandler(MAiFwEventHandler& aEventHandler); + + /** + * Calls RunApplicationL for the main UI controller. + */ + void RunApplicationL(); + + /** + * Calls LoadUIDefinitionL for all UI controllers. + */ + void LoadUIDefinition(); + + /** + * Returns the main UI Controller's CONE environment object. + */ + CCoeEnv& CoeEnv() const; + + /** + * Destroys all UI controllers except the main controller. + */ + void DestroySecondaryUiControllers(); + + /** + * Adds an UI Framework observer. No duplicates are allowed. + */ + void AddObserverL( MAiUiFrameworkObserver& aUiFwObserver ); + + /** + * Removes an UI Framework observer. + */ + void RemoveObserver( MAiUiFrameworkObserver& aUiFwObserver ); + + /** + * Removes plugin from UI. + */ + void RemovePluginFromUI( CAiContentPublisher& aPlugin ); + + /** + * Exits main UI controller + */ + void ExitMainController(); + + private: // From MAiUiFrameworkObserver + + void HandleResourceChange( TInt aType ); + void HandleForegroundEvent( TBool aForeground ); + + private: // Constructors + + CAiUiControllerManager(); + void ConstructL(); + + private: // new functions + + void LoadMainControllerL(CRepository& aCenRepConfig); + void LoadSecondaryControllersL(CRepository& aCenRepConfig); + + private: // data + /** + * UI controller array. + * Own. + */ + mutable RPointerArray iUiControllerArray; + + /** + * Main UI controller for app session. Owned in above array. + */ + MAiMainUiController* iMainUiController; + + /** + * List of UI framework observers to delegate events + */ + RPointerArray iUiFrameworkObservers; + + /** + * List to check for duplicated creations. + */ + RArray iCreatedUICList; + }; + +#endif // C_AIUICONTROLLERMANAGER_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/framework/aiuiframeworkobserverimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/framework/aiuiframeworkobserverimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,72 @@ +/* +* 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: UI Framework observer for Active Idle +* +*/ + + +#ifndef C_AIUIFRAMEWORKOBSERVERIMPL_H +#define C_AIUIFRAMEWORKOBSERVERIMPL_H + + +#include +#include "aistatemanager.h" +#include "aiuiframeworkobserver.h" +#include "aidevicestatusobserver.h" + +/** + * CAiUiFrameworkObserverImpl implements MAiUiFrameworkObserver for + * Active Idle framework. It is also a bridge between MAiUiFrameworkObserver + * and Active Idle system state manager. + * + * @lib aifw.lib + * @since S60 3.2 + */ +NONSHARABLE_CLASS( CAiUiFrameworkObserverImpl ) + : public CBase, + public MAiUiFrameworkObserver, + public MAiDeviceStatusObserver + { +public: + + static CAiUiFrameworkObserverImpl* NewL( MAiStateManager& aManager ); + + virtual ~CAiUiFrameworkObserverImpl(); + +// from base class MAiDeviceStatusObserver + + TAiStateChanges Status(); + +private: + + CAiUiFrameworkObserverImpl( MAiStateManager& aManager ); + + void ConstructL(); + +// from base class MAiUiFrameworkObserver + + void HandleResourceChange( TInt aType ); + + void HandleForegroundEvent( TBool aForeground ); + +private: // data + + /** + * State manager. + */ + MAiStateManager& iManager; + + }; + +#endif // C_AIUIFRAMEWORKOBSERVERIMPL_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/idleint/aiidleappregister.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/idleint/aiidleappregister.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 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: Idle application registration interface. +* +*/ + + +#ifndef C_AIIDLEAPPREGISTER_H +#define C_AIIDLEAPPREGISTER_H + +#include + +/** + * @ingroup group_aiidleint + * + * Idle application registration interface. + */ +class CAiIdleAppRegister : public CBase + { + +public: + + IMPORT_C static CAiIdleAppRegister* NewLC(); + + ~CAiIdleAppRegister() { } + + /** + * Registers Active Idle as the system idle application. + */ + virtual void RegisterL() = 0; + }; + + +#endif // C_AIIDLEAPPREGISTER_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/idleint/aiwspluginmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/idleint/aiwspluginmanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* 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: Window server plug-in manager. +* +*/ + + +#ifndef C_AIWSPLUGINMANAGER_H +#define C_AIWSPLUGINMANAGER_H + +#include + +class CCoeEnv; + +/** + * @ingroup group_aiidleint + * + * Registers Active Idle Window Server Plug-in at construction and + * deregisters it at destruction. + */ +class CAiWsPluginManager : public CBase + { +public: + + IMPORT_C static CAiWsPluginManager* NewL( CCoeEnv& aCoeEnv ); + + ~CAiWsPluginManager() { } + }; + + +#endif // C_AIWSPLUGINMANAGER_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/aipluginsettingsimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/aipluginsettingsimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: +* +*/ + + +#ifndef M_AIPLUGINSETTINGSIMPL_H +#define M_AIPLUGINSETTINGSIMPL_H + +#include "aipluginsettings.h" + +class CAiPluginSettingsItem; +class MAiPluginContentItem; + +/** + * Implementation of Active Idle framework settings access interface. + * + * @since S60 3.2 + */ +NONSHARABLE_CLASS(CAiPluginSettings) : public CBase, public MAiPluginSettings + { +public: + + static CAiPluginSettings* NewL(); + + ~CAiPluginSettings(); + + MAiPluginSettingsItem& AiPluginSettingsItem(); + + TInt AiPluginItemType(); + + MAiPluginContentItem& AiPluginContentItem(); + + MAiPluginConfigurationItem& AiPluginConfigurationItem(); + +private: + + CAiPluginSettings(); + + void ConstructL(); + +private: + + CAiPluginSettingsItem* iSettingsItem; + + TInt iItemType; + + }; + +#endif // M_AIPLUGINSETTINGSIMPL_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/aipluginsettingsitemimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/aipluginsettingsitemimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,170 @@ +/* +* 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: +* +*/ + + +#ifndef C_AIPLUGINSETTINGSITEMIMPL_H +#define C_AIPLUGINSETTINGSITEMIMPL_H + +#include "aipluginsettings.h" + +/** + * Implementation of Active Idle framework settings item interface. + * + * @lib ?library + * @since S60 3.2 + */ +NONSHARABLE_CLASS(CAiPluginSettingsItem) : public CBase, public MAiPluginSettingsItem, + public MAiPluginContentItem, public MAiPluginConfigurationItem + { +public: // Constructors and destructor + + /** + * Constructor. + */ + CAiPluginSettingsItem(); + + /** + * + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CAiPluginSettingsItem(); + +public: // From MAiPluginSettingsItem + + /** + * Get a pointer to the descriptor value of the setting. + * + * @return returns the value of the setting item. + * + * @since S60 3.2 + */ + TPtrC Value(); + + /** + * Sets the setting value. + * + * @param aValue the descriptor value for the Setting. + * @param aSaveToStore (this parameter is ignored) + * + * @since S60 3.2 + */ + void SetValueL(const TDesC& aValue, TBool aSaveToStore = ETrue); + + /** + * Get publisher uid this setting item belongs to. + * + * @return publisher uid. + * + * @since S60 3.2 + */ + const TUid& PublisherId() const; + + /** + * Set publisher uid this setting item belongs to. + * + * @param aUid publisher uid. + * + * @since S60 3.2 + */ + void SetPublisherId(const TUid& aUid); + + /** + * Get setting item key. + * + * @return key value. + * + * @since S60 3.2 + */ + TInt32 Key() const; + + /** + * Set setting item key. + * + * @param aKey setting item key. + * + * @since S60 3.2 + */ + void SetKey(TInt32 aKey); + + /** + * Set storer for this setting item. + * + * @param aStorer pointer to instance of storer interface. + * + * @since S60 3.2 + */ + void SetStorer(MAiPluginSettingsStorer* aStorer); + + /** + * Reads this setting item value from settings store. + * + * @since S60 3.2 + */ + virtual void ReadFromStoreL(); + + /** + * Saves this setting item value to settings store. + * + * @since S60 3.2 + */ + virtual void SaveToStoreL(); + +public: //From MAiPluginContentItem + + TPtrC Name(); + + void SetNameL( const TDesC& aName ); + + TPtrC Type(); + + void SetTypeL( const TDesC& aType ); + +public: //From MAiPluginConfigurationItem + + TPtrC Owner(); + + void SetOwnerL( const TDesC& aOwner ); + + void SetValueL( const TDesC& aValue ); + +private: // Data + + // Setting value. + HBufC* iValue; + + // Uid of publisher plugin this setting item belongs to. + TUid iPublisherId; + + // Setting item key. + TInt32 iKey; + + // Settings storer. + MAiPluginSettingsStorer* iStorer; + + HBufC* iName; + + HBufC* iType; + + HBufC* iOwner; + }; + +#endif // C_AIPLUGINSETTINGSITEMIMPL_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/caicontentitemarrayiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/caicontentitemarrayiterator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: +* +*/ + + + +#ifndef C_AIARRAYITERATOR_H +#define C_AIARRAYITERATOR_H + + +#include +#include + +/** + * @ingroup group_aiutils + * + * Content item array iterator. + * + * Iterator implementation for content item arrays + * Usage example: + * + * const TAiContentItem KExPluginContent[] = + * { + * { 1, "Counter", "text/plain" }, + * { 2, "Status", "text/plain" } + * }; + * + * CAiContentItemArrayIterator* iContent = + * CreateIteratorL( KExPluginContent ); + * + * while( iContent->HasNext() ) + * { + * TAiContentItem& myItem = iContent->NextL(); + * // My ops using myItem + * } + * + * @since S60 3.1 + */ +NONSHARABLE_CLASS(CAiContentItemArrayIterator) : + public CBase, public MAiContentItemIterator + { +public: + + /** + * Creates a new iterator instance from a TAiContentItem array. + * + * @param aArray content item array. + * @param aCount number of content items in aArray. + * @return a new iterator object for aArray. + * @see CreateIteratorL + * @since S60 3.2 + */ + static CAiContentItemArrayIterator* NewL + ( const TAiContentItem* aArray, TInt aCount ); + + virtual ~CAiContentItemArrayIterator(); + + void Release(); + +// from base class MAiContentItemIterator + + TBool HasNext() const; + + const TAiContentItem& NextL(); + + const TAiContentItem& ItemL(TInt aId) const; + + const TAiContentItem& ItemL( const TDesC& aCid ) const; + + void Reset(); + +private: + + CAiContentItemArrayIterator( const TAiContentItem* aArray, TInt aCount ); + +private: // data + + /** + * Array of items + * Not Own. + */ + const TAiContentItem* iArray; + + /** + * Total number of items + */ + TInt iCount; + + /** + * Current iterator index + */ + TInt iIndex; + }; + + +#endif // C_CAiContentItemArrayIterator_H diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/caiplugintool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/caiplugintool.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,73 @@ +/* +* 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: Collection of content plugin helper functions +* +*/ + + +#ifndef C_AIPLUGINTOOL_H +#define C_AIPLUGINTOOL_H + +#include +#include "aiplugintool.h" + +class TAiPublisherInfo; +class CAiContentPublisher; +class MAiContentItemIterator; +class MAiPropertyExtension; +class MAiEventHandlerExtension; + +/** +* @ingroup group_aiutils +* +* Plugin tool. +* +* @since S60 3.2 +*/ +NONSHARABLE_CLASS( CAiPluginTool ) : + public CBase, public MAiPluginTool + { +public: + + static CAiPluginTool* NewL(); + +private: + + CAiPluginTool(); + + void ConstructL(); + + void Release(); + + const TAiPublisherInfo* PublisherInfoL( + CAiContentPublisher& aContentPublisher ); + + MAiContentItemIterator* ContentItemIteratorL( + CAiContentPublisher& aContentPublisher, + TInt aContentType = EAiPublisherContent ); + + MAiPropertyExtension* PropertyExt( + CAiContentPublisher& aContentPublisher ); + + MAiEventHandlerExtension* EventHandlerExt( + CAiContentPublisher& aContentPublisher ); + + }; + +#endif // M_AIPLUGINTOOL_H + + + + + diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/caipspropertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/caipspropertyobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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: +* +*/ + + +#ifndef C_CPSPROPERTYOBSERVER_H +#define C_CPSPROPERTYOBSERVER_H + +#include +#include +#include "aipspropertyobserver.h" + +/** + * @ingroup group_aiutils + * + * Publish and subscribe key observer + * + * @lib aiutils.lib + * @since S60 3.2 + */ + +NONSHARABLE_CLASS(CPSPropertyObserver) : + public CActive, public MAiPSPropertyObserver + { + +public: + + /** + * Two-phased constructor. + */ + static CPSPropertyObserver* NewL (TCallBack aCallBack, TUid aCategory, TInt aKey); + + /** + * Destructor. + */ + ~CPSPropertyObserver(); + + /** + * Release the observer + */ + void Release(); + +// from base class CActive + + void RunL(); + + void DoCancel(); + +// from base class MAiPSPropertyObserver + + TInt Get( TInt& aValue ); + + TInt Get( TDes8& aString ); + + TInt Get( TDes16& aString ); + +private: + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * C++ default constructor. + */ + CPSPropertyObserver( TCallBack aCallBack, + TUid aCategory, + TInt aKey ); + +private: + + /** + * Callback member + */ + TCallBack iCallBack; + + /** + * PS category id + */ + TUid iCategory; + + /** + * PS key + */ + TInt iKey; + + /** + * Property member + */ + RProperty iProperty; + + }; + +#endif // C_CPSPROPERTYOBSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/inc/utility/caistrparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/inc/utility/caistrparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,68 @@ +/* +* 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: Collection of string parsing methods. +* +*/ + + +#ifndef C_STRPARSER_H +#define C_STRPARSER_H + +#include +#include +#include "aistrparser.h" + +// CLASS DECLARATION + +/** +* @ingroup group_aiutils +* +* String Parser +* +* @since S60 3.2 +*/ +NONSHARABLE_CLASS(CStrParser) : + public CBase, public MAiStrParser + { + +public: + + static CStrParser* NewL(); + +private: + + CStrParser(); + + void ConstructL(); + + void Release(); + + TInt ParseInt( TInt32& aResult, const TDesC8& aSourceString ); + + HBufC16* CopyToBufferL( HBufC16* aTargetBuffer, const TDesC16& aSourceText ); + + HBufC16* CopyToBufferL( HBufC16* aTargetBuffer, const TDesC8& aSourceText ); + + HBufC8* CopyToBufferL( HBufC8* aTargetBuffer, const TDesC8& aSourceText ); + + HBufC8* CopyToBufferL( HBufC8* aTargetBuffer, const TDesC16& aSourceText ); + + }; + +#endif // C_STRPARSER_H + + + + + diff -r 000000000000 -r 79c6a41cd166 idlefw/loc/aifw.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/loc/aifw.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 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: Localization strings for project IdleFW +* +*/ + + +// d: It is text of Active Idle 3 application in application shell grid. +// d: When user selects that item, then phone goes to idle state +// d: or call related state. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_idle_grid "Idle" + +// d: It is possible that user activates Idle theme which +// d: contains one or more plug-ins which can not be loaded to framework. +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_idle_theme_error_incompatible "Problems with theme. It may not work correctly." + +// d: In case plug-in dies during operation error note is shown. +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_idle_theme_error_notloaded "Error in theme." diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aibtsappublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aibtsappublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Listens Bluetooth SIM Access Profile (BT SAP) and publishes +* text when BT SAP is activated. +* +*/ + + +#ifndef C_AIBTSAPPUBLISHER_H +#define C_AIBTSAPPUBLISHER_H + + +#include +#include +#include +#include +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; + +/** + * @ingroup group_devicestatusplugin + * + * Listens Bluetooth SIM Access Profile (BT SAP) and publishes text from + * resource file with EAiDeviceStatusContentBTSAP content id when + * BT SAP is activated. + * + * @since S60 3.2 + */ +class CAiBTSAPPublisher : public CActive, public MAiDeviceStatusPublisher + { +public: + + static CAiBTSAPPublisher* NewL(); + + virtual ~CAiBTSAPPublisher(); + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); + +protected: + +// from base class CActive + + void RunL(); + void DoCancel(); + TInt RunError( TInt aError ); + +private: + + CAiBTSAPPublisher(); + + void ConstructL(); + + void FreeEngine(); + +private: // data + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + + /** + * Publish broadcaster. + * Not own. + */ + MAiPublisherBroadcaster* iBroadcaster; + + /** + * Publish-subscribe client used to observer BT SAP activation. + */ + RProperty iPubSub; + + /** + * Variable which tells if publisher has published previously or not. + */ + TBool iFirstPublish; + + /** + * True if publish was successful. + */ + TBool iSuccess; + }; + + +#endif // C_AIBTSAPPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aicontentobserveroptimizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aicontentobserveroptimizer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 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: Active Idle Content Observer optimizer +* +*/ + + +#ifndef C_AIMULTICONTENTOBSERVEROPTIMIZER_H +#define C_AIMULTICONTENTOBSERVEROPTIMIZER_H + + +#include +#include "aicontentobserver.h" + +/** + * @ingroup group_devicestatusplugin + * + * Active Idle Content Observer optimizer. + * + * Optimizes the Commit calls to different UI controllers. In + * case nothing is published nothing is committed. + * + * @see MAiContentObserver + * @since S60 3.2 + */ +class CAiContentObserverOptimizer : public CBase + { + +private: + struct TAiPublishBlackList + { + TInt iContentId; + + TInt iIndex; + }; + +public: + static CAiContentObserverOptimizer* NewL(MAiContentObserver& aObserver); + ~CAiContentObserverOptimizer(); + + /** + * Starts a transaction + * + * @return KErrAlreadyExists in case transaction already ongoing. + * KErrNotSupported in case transaction not supported + * KErrNone in case transaction succesfuly started + */ + TInt StartTransaction( TInt aTxId ); + + /** + * Commits a started transaction. In case no committing is needed + * (no publish calls has been made) the transaction is cancelled. + * + * @return KErrNotReady in case no transaction is ongoing. + * KErrNotSupported in case transaction not supported + * KErrNone in case succesfully committed. + */ + TInt Commit( TInt aTxId ); + + /** + * Cancels a transactions in case a transaction was started. + * + * @return KErrNotReady in case no transaction is ongoing. + * KErrNotSupported in case transactions are not supported + * KErrNone in case transaction succesfully cancelled + */ + TInt CancelTransaction( TInt aTxId ); + + /* + * @see MAiContentObserver + */ + TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ); + + /** + * @see MAiContentObserver + */ + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ); + /** + * @see MAiContentObserver + */ + TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + + /** + * Returns the actual content observer. + */ + MAiContentObserver& Observer() const; + +private: + CAiContentObserverOptimizer(MAiContentObserver& aObserver); + + TInt AddToBlackList( TInt aContentId, TInt aIndex ); + + TBool IsInBlackList( TInt aContentId, TInt aIndex ) const; + +private: // data + + /** + * Handle to the observer that receives + * the publish calls. + */ + MAiContentObserver &iObserver; + + TBool iCommitNeeded; + + TBool iTransactionStarted; + + RArray iBlackList; + }; + + +#endif // C_AIMULTICONTENTOBSERVEROPTIMIZER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aicugmcnpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aicugmcnpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* 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: Closed user group (CUG) publisher. +* +*/ + + +#ifndef C_AICUGMCNPUBLISHER_H +#define C_AICUGMCNPUBLISHER_H + + +#include +#include +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" +#include "ainetworkinfoobserver.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CAiNetworkInfoListener; + +const TInt KAnimDelay = 2000000; + +/** + * @ingroup group_devicestatusplugin + * + * Closed user group (CUG) and Micro Cellular Network (MCN) publisher. + * + * @since S60 3.2 + */ +class CAiCUGMCNPublisher : public CBase, public MAiDeviceStatusPublisher, + public MSSSettingsObserver, public MAiNetworkInfoObserver + { +public: + + static CAiCUGMCNPublisher* NewL(); + + virtual ~CAiCUGMCNPublisher(); + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + +// from base class MSSSettingsObserver + + void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue ); + +//from base class MAiNetworkInfoObserver + + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + +private: + + CAiCUGMCNPublisher(); + + void ConstructL(); + + /** + * Updates CUGMCN indicator if needed. + */ + void UpdateCUGMCNIndicatorL( TInt aValue ); + + void Animate(); + + void PublishCUG(); + + void PublishMCN(); + + /** + * The call back function. + * \param aAny A pointer to this class. + */ + static TInt PeriodicTimerCallBack(TAny* aAny); + + void DoAnimation(); + + +private: // data + + /** + * Used for doing the animation. + * Own. + */ + CPeriodic* iPeriodic; + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * SS Settings client. Used to observer CUGMCN changes. + */ + RSSSettings iSSSettings; + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + + /** + * Soft indicators. + */ + HBufC* iCUG; + HBufC* iMCN; + + TBool iAnimationDone; + }; + +#endif // C_AICUGMCNPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aicugpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aicugpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: Closed user group (CUG) publisher. +* +*/ + + +#ifndef C_AICUGPUBLISHER_H +#define C_AICUGPUBLISHER_H + + +#include +#include +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; + +/** + * @ingroup group_devicestatusplugin + * + * Closed user group (CUG) publisher. + * + * @since S60 3.2 + */ +class CAiCUGPublisher : public CBase, public MAiDeviceStatusPublisher, + public MSSSettingsObserver + { +public: + + static CAiCUGPublisher* NewL(); + + virtual ~CAiCUGPublisher(); + + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + +// from base class MSSSettingsObserver + + void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue ); + + +private: + + CAiCUGPublisher(); + + void ConstructL(); + + /** + * Updates CUG indicator if needed. + */ + void UpdateCUGIndicatorL( TInt aValue ); + + +private: // data + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * SS Settings client. Used to observer CUG changes. + */ + RSSSettings iSSSettings; + + /** + * Published CUG text. Owned. + */ + HBufC* iCugText; + + /** + * Previous CUG value + */ + TInt iCugValue; + }; + + +#endif // C_AICUGPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidatepublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidatepublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* 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: Date publisher +* +*/ + + +#ifndef C_AIDATEPUBLISHER_H +#define C_AIDATEPUBLISHER_H + +#include +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CEnvironmentChangeNotifier; + +/** + * @ingroup group_devicestatusplugin + * + * Date publisher. + * + * Publishes current date formatted according to current locale if profile + * if either general or offline. + * + * @since S60 3.2 + */ +class CAiDatePublisher : public CBase, public MAiDeviceStatusPublisher + { +public: + + static CAiDatePublisher* NewL(); + + virtual ~CAiDatePublisher(); + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + +private: + + CAiDatePublisher(); + + void ConstructL(); + + /// Re-publish date + void RefreshDateL(); + + /// Create day name string + HBufC* GetDayNameStringLC( TDay aDay, CCoeEnv& aCoeEnv ); + + /// Create date string + HBufC* ConstructDateStringL(); + + /// Callback when enviroment changed. + static TInt HandleCallBackL( TAny *aPtr ); + + + +protected: // data + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + + /** + * Environment notifier. + * own. + */ + CEnvironmentChangeNotifier* iEnvNotifier; + + /** + * Constructed date text. + * Own. + */ + HBufC* iDateText; + + }; + + +#endif // C_AIDATEPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidevicestatuscontentmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuscontentmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,164 @@ +/* +* 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: Device Status plug-in content model +* +*/ + + +#ifndef AIDEVICESTATUSCONTENTMODEL_H +#define AIDEVICESTATUSCONTENTMODEL_H + +#include + +/** + * Content model for Device Status plug-in. + * This header defines which information Device Status publishes + */ + +// ================================= CONTENT =================================== + +//content item id's +enum TAiDeviceStatusContentIds + { + EAiDeviceStatusContentNetworkIdentity, + EAiDeviceStatusContentProfileName, + EAiDeviceStatusContentGeneralProfileName, + EAiDeviceStatusContentDate, + EAiDeviceStatusContentSilentIndicator, + EAiDeviceStatusContentTimedProfileIndicator, + EAiDeviceStatusContentSIMRegStatus, + EAiDeviceStatusContentNWStatus, + EAiDeviceStatusContentMCNIndicator, + EAiDeviceStatusContentVHZIndicator, + EAiDeviceStatusContentCUGIndicator, + EAiDeviceStatusContentGeneralIndicator, + EAiDeviceStatusContentVHZText, + EAiDeviceStatusContentCUGMCNIndicator + }; + + +//content item textual id's +const wchar_t KAiDeviceStatusContentNetworkIdentity_Cid[] = L"NetworkIdentity"; +const wchar_t KAiDeviceStatusContentProfileName_Cid[] = L"ProfileName"; +const wchar_t KAiDeviceStatusContentGeneralProfileName_Cid[] = L"GeneralProfileName"; +const wchar_t KAiDeviceStatusContentDate_Cid[] = L"Date"; +const wchar_t KAiDeviceStatusContentSilentIndicator_Cid[] = L"SilentIndicator"; +const wchar_t KAiDeviceStatusContentTimedProfileIndicator_Cid[] = L"TimedProfileIndicator"; +const wchar_t KAiDeviceStatusContentSIMRegStatus_Cid[] = L"SIMRegStatus"; +const wchar_t KAiDeviceStatusContentNWStatus_Cid[] = L"NWStatus"; +const wchar_t KAiDeviceStatusContentMCNIndicator_Cid[] = L"MCNIndicator"; +const wchar_t KAiDeviceStatusContentVHZIndicator_Cid[] = L"VHZIndicator"; +const wchar_t KAiDeviceStatusContentCUGIndicator_Cid[] = L"CUGIndicator"; +const wchar_t KAiDeviceStatusContentGeneralIndicator_Cid[] = L"GeneralIndicator"; +const wchar_t KAiDeviceStatusContentVHZText_Cid[] = L"VHZText"; +const wchar_t KAiDeviceStatusContentCUGMCNIndicator_Cid[] = L"CUGMCNIndicator"; + + +const char KAiDeviceStatusMimeTypeTextPlain[] = "text/plain"; + +/** +* Content what device status plugin publishes +*/ + +const TAiContentItem KAiDeviceStatusContent[] = + { + //Published data can be service provider name, offline profile, + //operator logo or anything related to network status + { EAiDeviceStatusContentNetworkIdentity, KAiDeviceStatusContentNetworkIdentity_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is name of the profile from profiles engine + { EAiDeviceStatusContentProfileName, KAiDeviceStatusContentProfileName_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is name of the general profile from profiles engine + { EAiDeviceStatusContentGeneralProfileName, KAiDeviceStatusContentGeneralProfileName_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is current date as a text. Formatted according to current locale + { EAiDeviceStatusContentDate, KAiDeviceStatusContentDate_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data silent indicator as a text + { EAiDeviceStatusContentSilentIndicator, KAiDeviceStatusContentSilentIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data timed profile indicator as a text + { EAiDeviceStatusContentTimedProfileIndicator, KAiDeviceStatusContentTimedProfileIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is resource id + { EAiDeviceStatusContentSIMRegStatus, KAiDeviceStatusContentSIMRegStatus_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is resource id + { EAiDeviceStatusContentNWStatus, KAiDeviceStatusContentNWStatus_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is MCN message + { EAiDeviceStatusContentMCNIndicator, KAiDeviceStatusContentMCNIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is VHZ name + { EAiDeviceStatusContentVHZIndicator, KAiDeviceStatusContentVHZIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is localized text, for example "Group 1" + { EAiDeviceStatusContentCUGIndicator, KAiDeviceStatusContentCUGIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data general indicator as a text + { EAiDeviceStatusContentGeneralIndicator, KAiDeviceStatusContentGeneralIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data VHZ text + { EAiDeviceStatusContentVHZText, KAiDeviceStatusContentVHZText_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + + //Published data is localized text, for example "Group 1" or MCN message + { EAiDeviceStatusContentCUGMCNIndicator, KAiDeviceStatusContentCUGMCNIndicator_Cid, + KAiDeviceStatusMimeTypeTextPlain } + }; + +const TInt KAiDeviceStatusContentCount = sizeof( KAiDeviceStatusContent ) / + sizeof( KAiDeviceStatusContent[0] ); + + + +//content item id's +enum TAiDeviceStatusResourceIds + { + EAiDeviceStatusResourceSIMRegFail, + EAiDeviceStatusResourceNWOk, + EAiDeviceStatusResourceNWLost + }; + +const wchar_t KAiDeviceStatusResourceSIMRegFail_Cid[] = L"SIMRegFail"; +const wchar_t KAiDeviceStatusResourceShowNWLost_Cid[] = L"NWLost"; + + +const TAiContentItem KAiDeviceStatusResources[] = +{ + //Published data is resource id + { EAiDeviceStatusResourceSIMRegFail, KAiDeviceStatusResourceSIMRegFail_Cid, + KAiDeviceStatusMimeTypeTextPlain }, + { EAiDeviceStatusResourceNWLost, KAiDeviceStatusResourceShowNWLost_Cid, + KAiDeviceStatusMimeTypeTextPlain }, +}; + +const TInt KAiDeviceStatusResourceCount = sizeof( KAiDeviceStatusResources ) / + sizeof( KAiDeviceStatusResources[0] ); + + +#endif // AIDEVICESTATUSCONTENTMODEL_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidevicestatuscontentobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuscontentobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Device status content publisher +* +*/ + + +#ifndef M_AIDEVICESTATUSCONTENTOBSERVER_H +#define M_AIDEVICESTATUSCONTENTOBSERVER_H + + +class MAiDeviceStatusPublisher; + +/** + * @ingroup group_devicestatusplugin + * + * Device status content publisher. + * + * All of the publishers uses this interface to publish content. + * + * @since S60 3.2 + */ +class MAiDeviceStatusContentObserver + { + +protected: + /** + * Virtual destructor. + * + * This cannot be used to destroy observer object. + */ + virtual ~MAiDeviceStatusContentObserver() {}; + +public: + + /** + * Publish unicode text. + * + * @since S60 3.2 + * @param aPublisher is reference to publisher which is publishing. + * @param aContent is content id. + * @param aText is published text. + * @param aPriority is priority of the content. + * @return KErrNone if publish is successful, otherwise system wide error code. + */ + virtual TInt Publish( MAiDeviceStatusPublisher& aPublisher, TInt aContent, + const TDesC16& aText, TInt aPriority ) = 0; + + /** + * Publish data buffer. + * + * @since S60 3.2 + * @param aPublisher is reference to publisher which is publishing. + * @param aContent is content id. + * @param aBuf is data buffer. + * @param aPriority is priority of the content. + * @return KErrNone if publish is successful, otherwise system wide error code. + */ + virtual TInt Publish( MAiDeviceStatusPublisher& aPublisher, TInt aContent, + const TDesC8& aBuf, TInt aPriority ) = 0; + + /** + * Publish resource. + * + * @since S60 3.2 + * @param aPublisher is reference to publisher which is publishing. + * @param aContent is content id. + * @param aResource is resource id. + * @param aPriority is priority of the content. + * @return KErrNone if publish is successful, otherwise system wide error code. + */ + virtual TInt Publish( MAiDeviceStatusPublisher& aPublisher, TInt aContent, + TInt aResource, TInt aPriority ) = 0; + + /** + * Clean content. + * + * @since S60 3.2 + * @param aPublisher is reference to publisher which is publishing. + * @param aContent is content id. + * @param aPriority is priority of the content. + * @return KErrNone if publish is successful, otherwise system wide error code. + */ + virtual TInt Clean( MAiDeviceStatusPublisher& aPublisher, TInt aContent, TInt aPriority ) = 0; + + }; + + +#endif // M_AIDEVICESTATUSCONTENTOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatusplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Device status plugin interface. +* +*/ + + +#ifndef C_AIDEVICESTATUSPLUGIN_H +#define C_AIDEVICESTATUSPLUGIN_H + + +#include +#include +#include + +class MAiDeviceStatusPublisher; +class CAiContentItemArrayIterator; +class CAiDeviceStatusPluginEngine; +class CAiMultiContentObserver; +class CAiPublishPrioritizer; +class CAiNetworkInfoListener; + +/** + * @ingroup group_devicestatusplugin + * + * Device status plugin interface. + * + * This class implements required active idle plugin API. + * + * @since S60 3.2 + */ +class CAiDeviceStatusPlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiContentRequest + { +public: + + static CAiDeviceStatusPlugin* NewL(); + static CAiDeviceStatusPlugin* NewLC(); + + virtual ~CAiDeviceStatusPlugin(); + +protected: + +// from base class CAiContentPublisher + void Resume( TAiTransitionReason aReason ); + void Suspend( TAiTransitionReason aReason ); + void Stop( TAiTransitionReason aReason ); + void SubscribeL(MAiContentObserver& aObserver); + TAny* Extension(TUid aUid); + void ConfigureL(RAiSettingsItemArray& aSettings); + +protected: + +// from base class MAiPropertyExtension + TAny* GetPropertyL(TInt aProperty); + void SetPropertyL(TInt aProperty, TAny* aValue); + +// from base class MAiContentRequest + TBool RefreshContent( TInt aContentId ); + + +private: + + CAiDeviceStatusPlugin(); + void ConstructL(); + + void AllocateResourcesL(); + void FreeResources(); + void DoResumeL( TAiTransitionReason aReason ); + TBool IgnoreReason( TAiTransitionReason aReason ); + + /** + * Add device status publisher. + */ + void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); + +private: // data + + /** + * Device Status Plug-in Engine. + * Own. + */ + CAiDeviceStatusPluginEngine* iEngine; + + /** + * Content observers. + * Own. + */ + CAiMultiContentObserver* iContentObservers; + + /** + * Device Status Plug-in content prioritizer. + * Own. + */ + CAiPublishPrioritizer* iPrioritizer; + + /** + * Content item array iterator. + * Own. + */ + MAiContentItemIterator* iContent; + + /** + * Content item array iterator for resources. + * Own. + */ + MAiContentItemIterator* iResources; + + /** + * Publisher info. + */ + TAiPublisherInfo iInfo; + + /** + * Offset of the loaded resource file. + */ + TInt iResourceOffset; + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + }; + + +#endif // C_AIDEVICESTATUSPLUGIN_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuspluginengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,127 @@ +/* +* 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: Engine class for Device Status Plug-in +* +*/ + + +#ifndef AIDEVICESTATUSPLUGINENGINE_H +#define AIDEVICESTATUSPLUGINENGINE_H + +#include +#include + +#include "aipublisherbroadcaster.h" +#include "aidevicestatuspublisher.h" + +//device status plugin UI +const TInt KImplUidDevStaPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; + +class MAiContentObserver; +class MAiPropertyExtension; +class MAiPublishPrioritizer; + + +/** + * @ingroup group_devicestatusplugin + * + * Engine class for Device Status Plug-in + * + * This class works as an engine for Device Status Plug-in. + * It owns the publishers and communicates between them and + * the subscribers. + * + * @since S60 v3.2 + */ +class CAiDeviceStatusPluginEngine : public CBase, public MAiPublisherBroadcaster + { + +public: + + static CAiDeviceStatusPluginEngine* NewL( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer); + + virtual ~CAiDeviceStatusPluginEngine(); + + /** + * Resumes all publishers. + */ + void ResumePublishersL(); + + /** + * Refreshes all publishers. + * @param aClean Indicates if publishers should clean their content before + * re-publish. + */ + void RefreshPublishersL( TBool aClean ); + + /** + * Refreshes specific publishers. + * @param aContentId Indicates which publishers should publish their + * content. + * @param aClean Indicates if publishers should clean their content before + * re-publish. + * @return ETrue if publisher informed that publish was successful. + */ + TBool RefreshPublishersL( TInt aContentId, TBool aClean ); + + +public: // from MAiPublisherBroadcaster + + TBool RefreshPriorizedPublishersL( TInt aContentId, TInt aPriority ); + + +private: + + CAiDeviceStatusPluginEngine( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer); + + void ConstructL(); + + /** + * Add Device Status publisher. + */ + void AddPublisherL( MAiDeviceStatusPublisher* aPublisher ); + + +private: // data + + /** + * Array of publishers. + * Own. + */ + RPointerArray iPublishers; + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + }; + +#endif // AIDEVICESTATUSPLUGINENGINE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aidevicestatuspublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aidevicestatuspublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,99 @@ +/* +* 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: Interface for device status publisher. +* +*/ + + +#ifndef M_AIDEVICESTATUSPUBLISHER_H +#define M_AIDEVICESTATUSPUBLISHER_H + +#include +#include "aicontentobserver.h" + +class MAiPublishPrioritizer; +class MAiPublisherBroadcaster; + +/** + * @ingroup group_devicestatusplugin + * + * Interface for device status publisher. + * + * @since S60 3.2 + */ +class MAiDeviceStatusPublisher + { + +public: + /** + * Virtual destructor. + * + * Publisher can be destroyed through this interface. + */ + virtual ~MAiDeviceStatusPublisher() {}; + + /** + * Subscribe content observer. + * + * @param aObserver is reference to content observer. + * @param aExtension is reference to property extension. + * @param aPrioritizer is reference to publish prioritizer. + * @param aBroadcaster is reference for publisher broadcaster. + */ + virtual void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ) = 0; + + /** + * Resume publisher. + * + * Publisher publishes content if it is available. + */ + virtual void ResumeL() = 0; + + /** + * Refresh publisher. + * + * This has the same effect as the publisher would get content update from system. + * Publisher publishes content if it is available. + * @param aClean ETrue if current content needs to be cleaned. + */ + virtual void RefreshL( TBool aClean ) = 0; + + /** + * Refresh specific content. + * + * This has the same effect as the publisher would get content update from system. + * Publisher publishes content if it is available. + * @param aContentId Id of the content item that is requested to republish. + * @param aClean ETrue if current content needs to be cleaned. + * @return true if content was republished. + */ + virtual TBool RefreshL( TInt /*aContentId*/, TBool /*aClean*/ ) { return EFalse; } + + /** + * Refresh specific content with specific priority. + * + * This has the same effect as the publisher would get content update from system. + * Publisher publishes content if it is available and has correct priority. + * @param aContentId Id of the content item that is requested to republish. + * @param aPriority Priority of the content that needs to be refreshed. + * @return true if content was republished. + */ + virtual TBool RefreshContentWithPriorityL( TInt /*aContentId*/, TInt /*aPriority*/ ) { return EFalse; } + }; + + +#endif // M_AIDEVICESTATUSPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aimcnpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aimcnpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Micro Cellular Network (MCN) publisher. +* +*/ + + +#ifndef C_AIMCNPUBLISHER_H +#define C_AIMCNPUBLISHER_H + + +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" +#include "ainetworkinfoobserver.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CAiNetworkInfoListener; + +/** + * @ingroup group_devicestatusplugin + * + * Micro Cellular Network (MCN) publisher. + * + * This publisher listens network info changes and publishes + * received MCN messages. + * + * @since S60 3.2 + */ +class CAiMCNPublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver + { +public: + + static CAiMCNPublisher* NewL(); + + virtual ~CAiMCNPublisher(); + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + + +//from base class MAiNetworkInfoObserver + + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + + +private: + + CAiMCNPublisher(); + + void ConstructL(); + +private: // data + + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + }; + + +#endif // C_AIMCNPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aimulticontentobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aimulticontentobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 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: Active Idle Content Observer interface multiplexer interface. +* +*/ + + +#ifndef C_AIMULTICONTENTOBSERVER_H +#define C_AIMULTICONTENTOBSERVER_H + + +#include +#include "aicontentobserver.h" + + +// Forward declarations +class CAiContentObserverOptimizer; +/** + * @ingroup group_devicestatusplugin + * + * Active Idle Content Observer interface multiplexer. + * + * @see MAiContentObserver + * @since S60 3.2 + */ +class CAiMultiContentObserver : + public CBase, + public MAiContentObserver + { +public: + static CAiMultiContentObserver* NewL(); + ~CAiMultiContentObserver(); + + /** + * Adds a new observer to this multiplexer. + */ + void AddObserverL(MAiContentObserver& aObserver); + +//from base class MAiContentObserver + TInt StartTransaction( TInt aTxId ); + TInt Commit( TInt aTxId ); + TInt CancelTransaction( TInt aTxId ); + TBool CanPublish( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + TInt aResource, TInt aIndex ); + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC16& aText, TInt aIndex ); + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + const TDesC8& aBuf, TInt aIndex ); + TInt Publish( MAiPropertyExtension& aPlugin, TInt aContent, + RFile& aFile, TInt aIndex ); + TInt Clean( MAiPropertyExtension& aPlugin, TInt aContent, TInt aIndex ); + TAny* Extension( TUid aUid ); + TBool RequiresSubscription( const TAiPublisherInfo& aPublisherInfo ) const; + +private: + CAiMultiContentObserver(); + void ConstructL(); + +private: // data + /** + * Array of observers. + * Own. + */ + RPointerArray iObserverOptimizers; + + }; + + +#endif // C_AIMULTICONTENTOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,245 @@ +/* +* 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: Network info listener. +* +*/ + + +#ifndef C_AINETWORKINFOLISTENER_H +#define C_AINETWORKINFOLISTENER_H + + +#include +#include + + +class MAiNetworkInfoObserver; +class CNWSession; + +/** + * @ingroup group_devicestatusplugin + * + * Network info listener. + * + * Client can use this object to listen network info changes. Client must implement + * MAiNetworkInfoObserver interface to retrieve network info change events. + * + * @since S60 3.2 + */ +class CAiNetworkInfoListener : public CBase, public MNWMessageObserver + { +public: + + /** + * Get pointer to network info listener. + * When this is called first time, object is created, later calls + * gets pointer to previously created object. + * + * @since S60 3.2 + * @return pointer to network info listener. + */ + static CAiNetworkInfoListener* InstanceL(); + + /** + * Release network info listener. + * This must be called when client doesn't listen network info + * changes anymore. When all of the listener instances are released, + * the object is destroyed. After client calls this method, the pointer + * returned by InstanceL must not be used anymore. + * + * @since S60 3.2 + * @param ?arg1 + * @param ?arg2 + * @return + */ + void Release(); + + /** + * Add network info observer. + * + * @since S60 3.2 + * @param aObserver is interface which is used to inform network info changes. + */ + void AddObserverL( MAiNetworkInfoObserver& aObserver ); + + /** + * Remove network info observer. + * + * @since S60 3.2 + * @param aObserver must be exactly same object as was given to AddObserverL call. + */ + void RemoveObserver( MAiNetworkInfoObserver& aObserver ); + + /** + * Get cached network info structure. + * When network info changes, it is stored in this listener, client can use this + * method to receive the latest network info. + * + * @since S60 3.2 + * @return latest network info structure. + */ + const TNWInfo& NetworkInfo() const; + + /** + * Is the operator indicator allowed to be shown. + * + * @since S60 v3.2 + * @return ETrue if the indicator can be shown. + */ + TBool IsOperatorIndicatorAllowed() const; + + /** + * Client can use this method to check if certain network message has been already + * received. + * + * @since S60 3.2 + * @param aMessage is type of the message. + * @return ETrue if the message has been received. + */ + TBool MessageReceived( MNWMessageObserver::TNWMessages aMessage ); + + /** + * Check if it's allowed to show operator indicator. + * Number of rules control operator indicator visibility. + * Parameter aMessage is used for fulfilling these rules - it can have + * various values so this method is called many times. The sum of the + * calls (and thus sum of different aMessage values) defines whether + * rules are fulfilled and indicator is shown. + * @param aMessage Network message + * @return ETrue if rules are not fulfilled and indicator should + * not be shown. + */ + TBool NotAllowedToDisplayOperatorIndicator( const TNWMessages aMessage ); + + /** + * Check if network info has been changed. + * @param aMessage Network message + * @return ETrue if network info has changed since last check. + */ + TBool HasNetworkInfoChanged( const TNWMessages aMessage ); + + +// from base class MNWMessageObserver + + /** + * From MNWMessageObserver. + * Called by network handling engine when network info changes. + * + * @since S60 3.2 + * @param aMessage is type of the change. + */ + void HandleNetworkMessage( const TNWMessages aMessage ); + + /** + * From MNWMessageObserver. + * Called fi network handling engine fails. + * + * @since S60 3.2 + * @param aOperation is failed operation. + * @param aErrorCode is fail reason. + */ + void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); + +private: + + CAiNetworkInfoListener(); + + void ConstructL(); + + ~CAiNetworkInfoListener(); + + /** + * Increase access count. + */ + TInt IncAccessCount(); + + /** + * Decrease access count, when this goes to zero, object is deleted. + */ + TInt DecAccessCount(); + +private: // data + + /** + * Array of observers. + * Not own. + */ + RArray iObservers; + + /** + * Session to network handling engine. + * Own. + */ + CNWSession* iSession; + + /** + * Cached network info structure. + */ + TNWInfo iInfo; + + /** + * Previous network information. + */ + TNWInfo iOldInfo; + + /** + * Message cache. There is only one instance of one type of message. + * Own. + */ + CArrayFixFlat* iMessageCache; + + /** + * Sorting rule. + */ + TKeyArrayFix iKeyProperties; + + /** + * Access count. + */ + TInt iAccessCount; + + /** + * Network related message flags + */ + enum TNetInfoFlags + { + ENetworkProviderNameReceived = 0x00000001, + ENetworkProviderNameOk = 0x00000002, + EServiceProviderNameReceived = 0x00000004, + EServiceProviderNameOk = 0x00000008, + ERegistrationStatusReceived = 0x00000010, + ENetworkInfoChangeReceived = 0x00000020, + EProgrammableOperatorInfoReceived = 0x00000040, + EProgrammableOperatorInfoReceivedOk = 0x00000080 + }; + + /** + * Subset of sum of TNetInfoFlags. + */ + TUint iReceivedMessageFlags; + + /** + * Subset of sum of old TNetInfoFlags. + */ + TUint iOldReceivedMessageFlags; + + /** + * Is the operator indicator allowed to show + */ + TBool iShowOpInd; + }; + + + +#endif // C_AINETWORKINFOLISTENER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/ainetworkinfoobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/ainetworkinfoobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,60 @@ +/* +* 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: Network info observer. +* +*/ + + +#ifndef M_AINETWORKINFOOBSERVER_H +#define M_AINETWORKINFOOBSERVER_H + +#include +#include + +/** + * @ingroup group_devicestatusplugin + * + * Network info observer. + * + * Client gets network info changes through this interface. + * + * @since S60 3.2 + */ +class MAiNetworkInfoObserver + { + +protected: + + /** + * Virtual destructor. + * Cannot be used to destruct the object. + */ + virtual ~MAiNetworkInfoObserver() {}; + +public: + + /** + * Called when network info changes. + * + * @since S60 3.2 + * @param aMessage is type of the change. + * @param aInfo is new network info structure. + */ + virtual void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ) = 0; + }; + + +#endif // M_AINETWORKINFOOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/ainwidpriorities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/ainwidpriorities.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 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: Network identity related priorities. +* +*/ + + + +#ifndef AINWIDPRIORITIES_H +#define AINWIDPRIORITIES_H + +#include + + +const TInt KHighestPriority = 20; + +enum TAiNWIdPrioritities + { + EAiInvalidPriority = -1, + EAiOperatorNetInfoName = 0, + EAiMCC_MCN, + EAiCountryMNC, + EAiLatinOperatorName, + EAiUnicodeOperatorName, + EAiNITZ, + EAiNetworkOperatorName, + EAiServiceProviderName, + EAiFlexiblePLMN, + EAiProgOperatorLogo, + EAiOTAOperatorLogo, + EAiOfflineProfile, + EAiBTSAP + }; + + +#endif // AINWIDPRIORITIES_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/ainwspublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/ainwspublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,133 @@ +/* +* 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: Network status publisher +* +*/ + + +#ifndef C_AINWSPUBLISHER_H +#define C_AINWSPUBLISHER_H + + +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" +#include "ainetworkinfoobserver.h" + + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CAiNetworkInfoListener; +class CRepository; + +/** + * @ingroup group_devicestatusplugin + * + * Listens Network status and publishes data if network selection dialog is needed. + * + * @since S60 3.2 + */ +class CAiNwsPublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver + { +public: + + static CAiNwsPublisher* NewL(); + + virtual ~CAiNwsPublisher(); + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + + void RefreshL( TBool aClean ); + + TBool RefreshL( TInt aContentId, TBool aClean ); + +protected: + +//from base class MAiNetworkInfoObserver + + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + +private: + + + CAiNwsPublisher(); + + void ConstructL(); + + void HandleStateChange( const TNWInfo& aInfo ); + + void HandleNetworkFound(); + + void HandleNetworkLost( const TNWNetworkSelectionSetting &aSelectionSetting ); + + + /** + * Tests if offline mode is engaged. + * + * @return ETrue if offline mode is currently active + */ + TBool IsOffLineMode() const; + + /** + * Tests if Bluetooth SAP is in connected mode. + * + * @return ETrue if Bluetooth SAP is active. + */ + TBool IsBluetoothSAPConnected() const; + +private: // data + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + + /** + * Profile API. + */ + CRepository* iProfileApi; + + + /** + * A true value if registered to network. + */ + TBool iRegistered; + + }; + + +#endif // C_AINWSPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aioperatorlogopublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aioperatorlogopublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,225 @@ +/* +* 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: Operator logo publisher. +* +*/ + + +#ifndef C_AIOPERATORLOGOPUBLISHER_H +#define C_AIOPERATORLOGOPUBLISHER_H + + +#include +#include +#include +#include +#include "aidevicestatuspublisher.h" +#include "ainetworkinfoobserver.h" + +class CAiNetworkInfoListener; +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CGulIcon; +class CCenRepNotifyHandler; + +/** + * @ingroup group_devicestatusplugin + * + * Operator logo publisher. + * + * Listens operator logo changes (OTA and programmable) and publishes + * the new logo when it is updated. + * + * @since S60 3.2 + */ +class CAiOperatorLogoPublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver, /*public MAiCenRepNotifierCallBack*/ + public MCenRepNotifyHandlerCallback + { +public: + + static CAiOperatorLogoPublisher* NewL(); + + virtual ~CAiOperatorLogoPublisher(); + +protected: + +//from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); + + +//from base class MAiNetworkInfoObserver + + /** + * From MAiNetworkInfoObserver. + * Called when network info changes. + */ + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + + +// from base class MCenRepNotifyHandlerCallback + + /** + * This callback method is used to notify the client about + * changes for integer value keys, i.e. key type is EIntKey. + * + * @param aId Id of the key that has changed. + * @param aNewValue The new value of the key. + */ + void HandleNotifyInt( TUint32 aId, TInt aNewValue ); + + + + +private: + + CAiOperatorLogoPublisher(); + + void ConstructL(); + + /** + * Called when central repository key changes. + * + * @since S60 3.2 + * @param aMCC is country code. + * @param aMNC is network code. + * @return pointer to loaded logo. Ownership is transferred to caller. + */ + CFbsBitmap* LoadLogoL( TInt aMCC, + TInt aMNC ); + + /** + * Update operator logo. + * @param aClean ETrue if currently published logo must be cleaned. + */ + void UpdateOperatorLogoL( TBool aClean ); + + /** + * Returns ETrue if operator logo is allowed to be displayed. + */ + TBool AllowToShowLogoL() const; + + /** + * Create monochrome bitmaps (main & mask). + * + * @since S60 3.2 + * @param aBitmap monochrome bitmap. + * @param aNewLogoMain bitmap, ownership passed to caller. + * @param aNewLogoMask bitmap mask, ownership passed to caller. + */ + void CreateMonochromeBitmapsL( + const CFbsBitmap& aBitmap, + CFbsBitmap*& aNewLogoMain, + CFbsBitmap*& aNewLogoMask ); + + /** + * Getter method for title pane size. + * @param aSize Initialized with title pane size in return. + * @return KErrNotFound if title pane is not found, KErrNone otherwise. + */ + TInt GetTitlePaneSize( TSize& aSize ); + + /** + * Callback method for changes in operator logo. + * Called if operator logo has been changed. + */ + static TInt HandleOperatorLogoUpdateL( TAny *aPtr ); + + +private: // data + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + + /** + * Operator logo bitmap and mask. + * Own. + */ + CGulIcon* iIcon; + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + + /** + * Publish broadcaster. + * Not own. + */ + MAiPublisherBroadcaster* iBroadcaster; + + /** + * Publish-subscribe client. + */ + MAiPSPropertyObserver* iOperatorLogoObserver; + + /** + * Central repository client. + * Own. + */ + CRepository* iCenRep; + + /** + * Central repository notifier. + * Own. + */ + CCenRepNotifyHandler* iCenRepNotify; + + /** + * Operator logo priority, can have one of the following values: + * 1) EAiOTAOperatorLogo + * 2) EAiProgOperatorLogo + * 3) EAiInvalidPriority + */ + TInt iPriority; + + /** + * True if publish was successful. + */ + TBool iSuccess; + + /** + * Show operator indicator. + */ + TBool iShowOpInd; + }; + + +#endif // C_AIOPERATORLOGOPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aioperatornamepublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,196 @@ +/* +* 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: Operator/Service provider name publisher. +* +*/ + + +#ifndef C_AIOPERATORPROVIDERNAMEPUBLISHER_H +#define C_AIOPERATORPROVIDERNAMEPUBLISHER_H + + +#include +#include +#include "aidevicestatuspublisher.h" +#include "ainetworkinfoobserver.h" + +class CAiNetworkInfoListener; +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; + +/** + * @ingroup group_devicestatusplugin + * + * Operator/Service provider name publisher. + * + * Listens network info changes and publishes operator name + * if it is received. + * + * @since S60 3.2 + */ +class CAiOperatorNamePublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver + { +public: + + static CAiOperatorNamePublisher* NewL(); + + virtual ~CAiOperatorNamePublisher(); + +//from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); + + +protected: + +//from base class MAiNetworkInfoObserver + + /** + * From MAiNetworkInfoObserver. + * Called when network info changes. + */ + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + + +private: + + CAiOperatorNamePublisher(); + + void ConstructL(); + + /** + * Check SPN status from PLMNField. Also check if current country and network + * codes are in PLMNField. + */ + void CAiOperatorNamePublisher::CheckServiceProviderDisplayListStatus( + TInt aMCC, + TInt aMNC, + TBool& aShowSPN, + TBool& aIsInSPDI ) const; + + /** + * Check if current network is ready. Returns ETrue if all needed messages are + * received from network info listener. + */ + TBool CurrentNetworkOk() const; + + /** + * Returns ETrue if phone is currently roaming. + */ + TBool IsRoaming() const; + + /** + * If operator indicator needs to be animated, start delayed clean operation. + * Operator indicator will be replaced by plmn indicator after clean operation. + */ + void StartDelayedPLMNOperation(); + + /** + * Called by CPeriodic when timer expires. + */ + static TInt CleanAndShowPLMNOperationCallback( TAny* aPtr ); + + /** + * Do delayed clean operation. + */ + void DoCleanOperationL(); + + /** + * Show network indicator + * @param aTryToPublish + * ETrue: Sets operator name, priority and tries to publish operator name. + * EFalse: Sets operator name, priority and not to try to publish it. + */ + void ShowNetworkIdentityNameL( TBool aTryToPublish ); + + /** + * Check priority of operator name + */ + TBool OperatorNamePriority( TInt& aPriority ); + + /** + * Construct PLMN and SPN indicators to same string + */ + HBufC* ConstructOperatorNameStringL( const TDesC& aServiceProviderName ); + + /** + * Check status of keylock + */ + TBool IsKeyLockEnabled(); + +private: // data + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + + /** + * Publish broadcaster. + * Not own. + */ + MAiPublisherBroadcaster* iBroadcaster; + + /** + * Used to do delayed clean operation. + * Own. + */ + CPeriodic* iPeriodic; + + /** + * True if publish was successful. + */ + TBool iSuccess; + + /** + * Operator name priority + */ + TInt iPriority; + + /** + * Show operator indicator. + */ + TBool iShowOpInd; + + /** + * Network identity name + */ + TPtrC iNetworkIdentityName; + }; + + +#endif // C_AIOPERATORPROVIDERNAMEPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aiprioritizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aiprioritizer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 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: Network identity related prioritizer. +* +*/ + + + +#ifndef M_AIPUBLISHPRIORITIZER_H +#define M_AIPUBLISHPRIORITIZER_H + +#include "aicontentobserver.h" + +class MAiPublisherBroadcaster; + + +/** + * @ingroup group_devicestatusplugin + * + * Network identity related prioritizer. + * + * This class is used as proxy between publishers which publish data that + * needs to be priorised and content observers. It keeps record of published + * data and decides if new published data has high enough priority to go + * through to content observer. + * + * @since S60 3.2 + */ +class MAiPublishPrioritizer + { + +public: + + /** + * Invoked by publisher that publishes prioritized data. + * Data is published only if aPriority is same or higher than + * current priority. + * + * @param aBroadcaster - Publisher broadcaster implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aResource - identification of content reference, MUST correspond + * single content reference supported by plug-in. The framework + * utilizes the reference if to match for cid and MIME type of the + * content supplied with in UI definition. + * @param aPriority - priority of published data. + */ + virtual void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + TInt aResource, + TInt aPriority ) = 0; + + /** + * Invoked by publisher that publishes prioritized data. + * Data is published only if aPriority is same or higher than + * current priority. + * + * @param aBroadcaster - Publisher broadcaster implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aText - Textual content in UNICODE. + * @param aPriority - priority of published data. + */ + virtual void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + const TDesC16& aText, + TInt aPriority ) = 0; + + /** + * Invoked by publisher that publishes prioritized data. + * Data is published only if aPriority is same or higher than + * current priority. + * + * @param aBroadcaster - Publisher broadcaster implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aBuf - instance of content. + * @param aPriority - priority of published data. + */ + virtual void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + const TDesC8& aBuf, + TInt aPriority ) = 0; + + /** + * Invoked by publisher that wants to clean previously published data. + * Data is cleaned only if aPriority is same than current priority. + * + * @param aBroadcaster - Publisher broadcaster implementation. + * @param aContent - identification of content selector, MUST correspond + * single content selector supported by plug-in. The framework + * utilizes the selector id to match for cid and MIME type. + * @param aPriority - priority of published data. + */ + virtual void TryToCleanL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + TInt aPriority ) = 0; + + }; + + +#endif // M_AIPUBLISHPRIORITIZER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aiprofilepublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aiprofilepublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,176 @@ +/* +* 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: Profile publisher +* +*/ + + +#ifndef C_AIPROFILEPUBLISHER_H +#define C_AIPROFILEPUBLISHER_H + +#include +#include +#include +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" + +class MProfileEngine; +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CProfileChangeNotifyHandler; + +/** + * @ingroup group_devicestatusplugin + * + * Observers profile changes and publishes profile name when profile + * has been changed or if ALS status changes. + * + * @since S60 3.2 + */ +class CAiProfilePublisher : public CBase, public MAiDeviceStatusPublisher, + public MSSSettingsObserver, public MProfileChangeObserver + { +public: + + static CAiProfilePublisher* NewL(); + + virtual ~CAiProfilePublisher(); + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + TBool RefreshContentWithPriorityL( TInt aContentId, TInt aPriority ); + + +protected: + +// from base class MSSSettingsObserver + + /** + * Called when SS Settings changes. + */ + void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue ); + +// from base class MProfileChangeObserver + + /** + * Called when active profile changes. + */ + void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId ); + +private: + + CAiProfilePublisher(); + + void ConstructL(); + + /** + * Clean last published profile. + */ + void CleanLastProfileL(); + + /** + * Get active profile from profile engine and publish it. + */ + void RefreshProfileL(TBool aClean); + + +protected: // data + + /** + * Client to listen SS setting changes. + */ + RSSSettings iSSSettings; + + /** + * Profile engine. + * Own. + */ + MProfileEngine* iProfileEngine; + + /** + * Profile change notifier. + * Own. + */ + CProfileChangeNotifyHandler* iProfileNotifier; + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Content prioritizer. + * Not own. + */ + MAiPublishPrioritizer* iPrioritizer; + + /** + * Publish broadcaster. + * Not own. + */ + MAiPublisherBroadcaster* iBroadcaster; + + enum TLastPublishedProfile + { + ENothingPublished = -1, + EGeneralProfilePublished = 0, + EOfflineProfilePublished = 5, + EOtherProfilePublished = 10 + }; + + /** + * Last published profile. + */ + TLastPublishedProfile iLastPublishedProfileId; + + /** + * True if last published profile was silent. + */ + TBool iLastPublishedProfileSilent; + + /** + * True if last published profile was timed. + */ + TBool iLastPublishedProfileTimed; + + /** + * True if publish was successful. + */ + TBool iSuccess; + + /** + * True if active profile is changed or modified. + */ + TBool iActiveProfilePublish; + }; + + +#endif // C_AIPROFILEPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aipublisherbroadcaster.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aipublisherbroadcaster.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 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: Owner of publishers. +* +*/ + + + +#ifndef M_AIPUBLISHERBROADCASTER_H +#define M_AIPUBLISHERBROADCASTER_H + +/** + * @ingroup group_devicestatusplugin + * + * Broadcaster for Device Status Plug-in. + * + * This class should be implemented by an instance that owns Device Status + * Plug-in publishers. The purpose of this class is to offer a method for + * single publisher to broadcast events to all other publishers. + * + * @since S60 3.2 + */ +class MAiPublisherBroadcaster + { + +public: + + /** + * Invoke a refresh call for publishers that publish specific content + * with specific priority. + * + * This has the same effect as the publisher would get content update from system. + * Publisher publishes content if it is available and has correct priority. + * @param aContentId Id of the content item that is requested to republish. + * @param aPriority Priority of the content that needs to be refreshed. + * @return true if content was republished. + */ + virtual TBool RefreshPriorizedPublishersL( TInt aContentId, TInt aPriority ) = 0; + }; + + +#endif // M_AIPUBLISHERBROADCASTER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aipublisherfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aipublisherfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,137 @@ +/* +* 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: Static factory class used to create publishers. +* +*/ + + +#ifndef AIPUBLISHERFACTORY_H +#define AIPUBLISHERFACTORY_H + +class MAiDeviceStatusPublisher; + +/** + * @ingroup group_devicestatusplugin + * + * Static factory class used to create publishers. + * + * @since S60 3.2 + */ +class AiPublisherFactory + { + +public: + + /** + * Create profile publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateProfilePublisherL(); + + /** + * Create date profile publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateDatePublisherL(); + + /** + * Create operator logo publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateOperatorLogoPublisherL(); + + /** + * Create operator name publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateOperatorNamePublisherL(); + + /** + * Create BT SAP publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateBTSAPPublisherL(); + + /** + * Create MCN publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateMCNPublisherL(); + + /** + * Create CUG publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateCUGPublisherL(); + + /** + * Create SIM registration status publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateSimRegPublisherL(); + + /** + * Create Network status publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateNWSPublisherL(); + + /** + * Create VHZ publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateVHZPublisherL(); + + /** + * Create CUGMCN publisher. + * + * @since S60 3.2 + * @return pointer to publisher or NULL if publisher is not supported + * by platform. + */ + static MAiDeviceStatusPublisher* CreateCUGMCNPublisherL(); + }; + + +#endif // AIPUBLISHERFACTORY_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aipublishprioritizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aipublishprioritizer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 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: Network identity related prioritizer. +* +*/ + + +#ifndef C_AIPUBLISHPRIORITIZER_H +#define C_AIPUBLISHPRIORITIZER_H + +#include +#include "ainwidpriorities.h" +#include "aiprioritizer.h" +#include "aipropertyextension.h" + +/** + * @ingroup group_devicestatusplugin + * + * Network identity related prioritizer. + * + * This class is used as proxy between publishers which publish data that + * needs to be priorised and content observers. It keeps record of published + * data and decides if new published data has high enough priority to go + * through to content observer. + * + * @since S60 3.2 + */ + +class CAiPublishPrioritizer : public CBase, public MAiPublishPrioritizer + { + +public: + + static CAiPublishPrioritizer* NewL( MAiContentObserver& aContentObserver, + MAiPropertyExtension& aPropertyExtension ); + + virtual ~CAiPublishPrioritizer(); + + + // from MAiPublishPrioritizer + + void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + TInt aResource, + TInt aPriority ); + + void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + const TDesC16& aText, + TInt aPriority ); + + void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + const TDesC8& aBuf, + TInt aPriority ); + + void TryToCleanL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + TInt aPriority ); + + TInt NextPriority() const; + + +private: + + CAiPublishPrioritizer( MAiContentObserver& aContentObserver, + MAiPropertyExtension& aPropertyExtension ); + + +private: // data + + /** + * Content observer. + */ + MAiContentObserver& iContentObserver; + + /** + * Property extension. + */ + MAiPropertyExtension& iPropertyExtension; + + /// Current priority + TInt iPriority; + }; + + +#endif // C_AIPUBLISHPRIORITIZER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aisimregpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aisimregpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,97 @@ +/* +* 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: SIM registration status publisher +* +*/ + + +#ifndef C_AISIMREGFAILPUBLISHER_H +#define C_AISIMREGFAILPUBLISHER_H + + +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" +#include "ainetworkinfoobserver.h" + + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CAiNetworkInfoListener; + +/** + * @ingroup group_devicestatusplugin + * + * Listens SIM Registration status and publishes data if SIM registration failed. + * + * @since S60 3.2 + */ +class CAiSimRegPublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver + { +public: + + static CAiSimRegPublisher* NewL(); + + virtual ~CAiSimRegPublisher(); + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + +protected: + +//from base class MAiNetworkInfoObserver + + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + + +private: + + CAiSimRegPublisher(); + + void ConstructL(); + + +private: // data + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Network info listener. + * Own. + */ + CAiNetworkInfoListener* iListener; + }; + + +#endif // C_AISIMREGFAILPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/inc/aivhzpublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/inc/aivhzpublisher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,104 @@ +/* +* 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: Viag Home Zone (VHZ) publisher. +* +*/ + + +#ifndef C_AIVHZPUBLISHER_H +#define C_AIVHZPUBLISHER_H + + +#include +#include "aidevicestatuspublisher.h" +#include "aidevicestatuscontentmodel.h" +#include "ainetworkinfoobserver.h" + +class MAiDeviceStatusContentObserver; +class MAiPropertyExtension; +class CAiNetworkInfoListener; + +/** + * @ingroup group_devicestatusplugin + * + * Viag Home Zone (VHZ) publisher. + * + * Observes network info changes and publishes zone name + * when phone arrives to home or city zone. + * + * @since S60 3.2 + */ +class CAiVHZPublisher : public CBase, public MAiDeviceStatusPublisher, + public MAiNetworkInfoObserver + { +public: + + static CAiVHZPublisher* NewL(); + + virtual ~CAiVHZPublisher(); + +protected: + +// from base class MAiDeviceStatusPublisher + + void ResumeL(); + void Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ); + void RefreshL( TBool aClean ); + TBool RefreshL( TInt aContentId, TBool aClean ); + +//from base class MAiNetworkInfoObserver + + void HandleNetworkInfoChange( const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool aShowOpInd ); + + +private: + + CAiVHZPublisher(); + + void ConstructL(); + +private: // data + + /** + * Content observer. + * Not own. + */ + MAiContentObserver* iContentObserver; + + /** + * Property extension. + * Not own. + */ + MAiPropertyExtension* iExtension; + + /** + * Network info listener. + * Not own. + */ + CAiNetworkInfoListener* iListener; + + /** + * Flag to indiate whether vhz is in navi or mainpane. + */ + TBool iVhzInMainpane; + + }; + + +#endif // C_AIVHZPUBLISHER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/loc/aidevstaplgres.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/loc/aidevstaplgres.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* 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: Localization strings for project Active Idle +* +*/ + + + +// d: The format string defines how date are shown on the navi pane of idle state. +// d: %0U stands for the week day, and %1U stands for date. +// l: navi_text_pane_t1 +// w: +// r: 3.2 +// +#define qtn_idle_time_format "%0U %1U" + + +// d: Text in title pane in idle state +// d: Remote SIM Access Profile is active. SIM or network is not accessible +// d: from the terminal. This doesn't relate to normal user profiles like General +// d: or Meeting. +// l: title_pane_t2/opt9 +// w: +// r: 3.2 +// +#define qtn_mode_sap "Remote SIM" + + +// d: The unit format of the cug soft indicator +// l: soft_indicator_pane_t1 +// w: +// r: 3.2 + +#define qtn_cug_indic_group "Group %N" + +// d: The format string defines how operator and service provider names +// d: are concatenated to one string, which is shown on the title pane +// d: of idle state. +// d: %0U stands for operator name, %1U stands for service provider name. +// l: title_pane_t2/opt9 +// w: +// r: 3.2 +// +#define qtn_ai_opn_spn_separator "%0U - %1U" diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aibtsappublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aibtsappublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,193 @@ +/* +* 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: Listens Bluetooth SIM Access Profile (BT SAP) and publishes +* text when BT SAP is activated. +* +*/ + + +#include +#include +#include +#include +#include +#include "aibtsappublisher.h" +#include "aiprioritizer.h" +#include "ainwidpriorities.h" + + +// ======== MEMBER FUNCTIONS ======== + +CAiBTSAPPublisher::CAiBTSAPPublisher() +: CActive( CActive::EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + + +void CAiBTSAPPublisher::ConstructL() + { + //if platform doesn't support BTSAP, there is no reason + //to create this object. + if( !FeatureManager::FeatureSupported( KFeatureIdBtSap ) ) + { + User::Leave( KErrNotSupported ); + } + } + + +CAiBTSAPPublisher* CAiBTSAPPublisher::NewL() + { + CAiBTSAPPublisher* self = new( ELeave ) CAiBTSAPPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiBTSAPPublisher::~CAiBTSAPPublisher() + { + Cancel(); + iPubSub.Close(); + } + + +void CAiBTSAPPublisher::ResumeL() + { + Cancel(); + + iPubSub.Close(); + //attach to BTSAP key. + User::LeaveIfError( iPubSub.Attach( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState ) ); + + iFirstPublish = ETrue; + + //subscribe to get notification when key changes. + iPubSub.Subscribe( iStatus ); + SetActive(); + } + + +void CAiBTSAPPublisher::Subscribe( MAiContentObserver& /*aObserver*/, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ) + { + iExtension = &aExtension; + iPrioritizer = &aPrioritizer; + iBroadcaster = &aBroadcaster; + } + + +void CAiBTSAPPublisher::RefreshL( TBool aClean ) + { + iSuccess = EFalse; + if( aClean ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + EAiBTSAP ); + } + + //Get BTSAP state + TInt sapState( 0 ); + TInt err = RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + sapState ); + + //If key is not found, it is treated same way as the BTSAP is not on. + if( err == KErrNotFound ) + { + err = KErrNone; + sapState = EBTSapNotConnected; + } + + User::LeaveIfError( err ); + + if( sapState == EBTSapConnected ) + { + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + R_ACTIVEIDLE_BT_SIM_ACCESS_PROFILE_STRING, + EAiBTSAP ); + iSuccess = ETrue; + } + + else if( !iFirstPublish ) + { + //BTSAP is not anymore active, call clean. + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + EAiBTSAP ); + } + iFirstPublish = EFalse; + } + + +void CAiBTSAPPublisher::RunL() + { + if( iStatus.Int() == KErrNone ) + { + //PS key changed, refresh publisher. + RefreshL( ETrue ); + iPubSub.Subscribe( iStatus ); + SetActive(); + } + } + + +void CAiBTSAPPublisher::DoCancel() + { + iPubSub.Cancel(); + } + + +TInt CAiBTSAPPublisher::RunError( TInt /*aError*/ ) + { + iPubSub.Cancel(); + //failed to publish, lets however ignore it + return KErrNone; + } + + +TBool CAiBTSAPPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + RefreshL( aClean ); + if( iSuccess ) + { + return ETrue; + } + } + return EFalse; + } + + +TBool CAiBTSAPPublisher::RefreshContentWithPriorityL( TInt aContentId, + TInt aPriority ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity && + aPriority == EAiBTSAP ) + { + RefreshL( EFalse ); + if( iSuccess ) + { + return ETrue; + } + } + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aicontentobserveroptimizer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 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: Active Idle Content Observer optimizer +* +*/ + + +#include "aicontentobserveroptimizer.h" + +CAiContentObserverOptimizer* CAiContentObserverOptimizer::NewL(MAiContentObserver& aObserver) + { + return new(ELeave) CAiContentObserverOptimizer( aObserver ); + } + +CAiContentObserverOptimizer::~CAiContentObserverOptimizer() + { + iBlackList.Close(); + } + +TInt CAiContentObserverOptimizer::StartTransaction( TInt aTxId ) + { + TInt err = KErrAlreadyExists; + if ( iTransactionStarted ) + { + return err; + } + iCommitNeeded = EFalse; + + err = iObserver.StartTransaction( aTxId ); + if ( err == KErrNone ) + { + iTransactionStarted = ETrue; + } + return err; + } + + +TInt CAiContentObserverOptimizer::Commit( TInt aTxId ) + { + TInt err = KErrNotReady; + if ( iTransactionStarted ) + { + if ( iCommitNeeded ) + { + iCommitNeeded = EFalse; + err = iObserver.Commit( aTxId ); + } + else + { + err = CancelTransaction( aTxId ); + } + } + iTransactionStarted = EFalse; + return err; + } + + +TInt CAiContentObserverOptimizer::CancelTransaction( TInt aTxId ) + { + TInt err = KErrNotReady; + if ( iTransactionStarted ) + { + err = iObserver.CancelTransaction( aTxId ); + } + iTransactionStarted = EFalse; + return err; + } + + +TBool CAiContentObserverOptimizer::CanPublish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ) + { + return iObserver.CanPublish( aPlugin, aContent, aIndex ); + } + +TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ) + { + if ( IsInBlackList( aContent, aIndex ) ) + { + return KErrNotFound; + } + TInt err = iObserver.Publish( aPlugin, aContent, aResource, aIndex ); + // Publish went through OK, we need to commit the transaction + if ( err == KErrNone && iTransactionStarted ) + { + iCommitNeeded = ETrue; + } + // publish failed because the ui declaration doesn't + // include this content => add to black list and + // don't try to publish again + else if ( err == KErrNotFound || err == KErrNotSupported ) + { + AddToBlackList( aContent, aIndex ); + } + return err; + } + + +TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ) + { + if ( IsInBlackList( aContent, aIndex ) ) + { + return KErrNotFound; + } + TInt err = iObserver.Publish( aPlugin, aContent, aText, aIndex ); + // Publish went through OK, we need to commit the transaction + if ( err == KErrNone && iTransactionStarted ) + { + iCommitNeeded = ETrue; + } + // publish failed because the ui declaration doesn't + // include this content => add to black list and + // don't try to publish again + else if ( err == KErrNotFound || err == KErrNotSupported ) + { + AddToBlackList( aContent, aIndex ); + } + return err; + } + + +TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ) + { + if ( IsInBlackList( aContent, aIndex ) ) + { + return KErrNotFound; + } + TInt err = iObserver.Publish( aPlugin, aContent, aBuf, aIndex ); + // Publish went through OK, we need to commit the transaction + if ( err == KErrNone && iTransactionStarted ) + { + iCommitNeeded = ETrue; + } + // publish failed because the ui declaration doesn't + // include this content => add to black list and + // don't try to publish again + else if ( err == KErrNotFound || err == KErrNotSupported ) + { + AddToBlackList( aContent, aIndex ); + } + return err; + + } + + +TInt CAiContentObserverOptimizer::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ) + { + if ( IsInBlackList( aContent, aIndex ) ) + { + return KErrNotFound; + } + TInt err = iObserver.Publish( aPlugin, aContent, aFile, aIndex ); + // Publish went through OK, we need to commit the transaction + if ( err == KErrNone && iTransactionStarted ) + { + iCommitNeeded = ETrue; + } + // publish failed because the ui declaration doesn't + // include this content => add to black list and + // don't try to publish again + else if ( err == KErrNotFound || err == KErrNotSupported ) + { + AddToBlackList( aContent, aIndex ); + } + return err; + } + + +TInt CAiContentObserverOptimizer::Clean( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ) + { + return iObserver.Clean( aPlugin, aContent, aIndex ); + } + +MAiContentObserver& CAiContentObserverOptimizer::Observer() const + { + return iObserver; + } + +TInt CAiContentObserverOptimizer::AddToBlackList( TInt aContentId, TInt aIndex ) + { + TInt err = KErrNone; + if ( !IsInBlackList( aContentId, aIndex ) ) + { + TAiPublishBlackList entry; + entry.iContentId = aContentId; + entry.iIndex = aIndex; + err = iBlackList.Append( entry ); + } + return err; + } + +TBool CAiContentObserverOptimizer::IsInBlackList( TInt aContentId, TInt aIndex ) const + { + for (TInt i = 0; i < iBlackList.Count(); ++i ) + { + if ( iBlackList[i].iContentId == aContentId && + iBlackList[i].iIndex == aIndex ) + { + return ETrue; + } + } + return EFalse; + } + +CAiContentObserverOptimizer::CAiContentObserverOptimizer(MAiContentObserver& aObserver): + iObserver( aObserver ) + { + } + +// end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aicugmcnpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aicugmcnpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,268 @@ +/* +* 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: Closed user group (CUG) publisher. +* +*/ + + +#include +#include +#include "aicugmcnpublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" + +// ======== MEMBER FUNCTIONS ======== + +CAiCUGMCNPublisher::CAiCUGMCNPublisher() + { + } + + +void CAiCUGMCNPublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + User::LeaveIfError( iSSSettings.Open() ); + + // Initialize the periodic timer. + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + + +CAiCUGMCNPublisher* CAiCUGMCNPublisher::NewL() + { + CAiCUGMCNPublisher* self = new( ELeave ) CAiCUGMCNPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( ); + //CleanupStack::Pop( self ); + return self; + } + + +CAiCUGMCNPublisher::~CAiCUGMCNPublisher() + { + if( iPeriodic ) + { + iPeriodic->Cancel(); + delete iPeriodic; + } + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + //Cancel listenning CUG changes. + iSSSettings.CancelAll( *this ); + iSSSettings.Close(); + + delete iCUG; + delete iMCN; + } + +TInt CAiCUGMCNPublisher::PeriodicTimerCallBack(TAny* aAny) + { + CAiCUGMCNPublisher* self = static_cast( aAny ); + + if( self ) + { + self->DoAnimation(); + } + + return KErrNone; + } + +void CAiCUGMCNPublisher::DoAnimation() + { + if ( iAnimationDone ) + { + PublishCUG(); + iPeriodic->Cancel(); + } + else + { + iAnimationDone = ETrue; + PublishMCN(); + } + + } + + +void CAiCUGMCNPublisher::ResumeL() + { + iListener->AddObserverL( *this ); + + //Start listening CUG changes. + TInt err = iSSSettings.Register( ESSSettingsCug, *this ); + + if( err == KErrNotSupported || + err == KErrAlreadyExists ) + { + //CUG not supported, or already registered + err = KErrNone; + } + + User::LeaveIfError( err ); + } + + +void CAiCUGMCNPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiCUGMCNPublisher::RefreshL( TBool /*aClean*/ ) + { + //Get current CUG value and publish it. + TInt value; + if ( iSSSettings.Get( ESSSettingsCug, value ) != KErrNone ) + { + value = ESSSettingsCugDefault; + } + + UpdateCUGMCNIndicatorL( value ); + } + + +void CAiCUGMCNPublisher::PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt aNewValue ) + { + if( aSetting == ESSSettingsCug ) + { + TRAP_IGNORE( UpdateCUGMCNIndicatorL( aNewValue ) ); + } + } + +void CAiCUGMCNPublisher::UpdateCUGMCNIndicatorL( TInt aValue ) + { + //Check if the CUG is valid... + if( iSSSettings.IsValueValidCugIndex( aValue ) ) + { + //...and then read CUG indicator format from resource file and publish + // content as a text. + if (iCUG) + { + delete iCUG; + iCUG = NULL; + } + iCUG = StringLoader::LoadL( + R_ACTIVEIDLE_CUG_INDICATOR_FORMAT, + aValue ); + + Animate(); + } + else + { + //CUG is not valid, call clean. + if ( iCUG ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentCUGMCNIndicator, + 0 ); + iCUG = NULL; + } + } + } + +void CAiCUGMCNPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool /*aShowOpInd*/ ) + { + //If MSN message was received, publish it. + if ( aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage ) + { + if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) + { + TPtrC msg = aInfo.iMCNName; + if (iMCN) + { + delete iMCN; + iMCN = NULL; + } + + TRAP_IGNORE(iMCN = msg.AllocL()); + Animate(); + } + else if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeNone ) + { + if ( iMCN ) + { + //MCN is not valid, call clean. + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentCUGMCNIndicator, + 0 ); + iMCN = NULL; + } + } + } + } + + +TBool CAiCUGMCNPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( ( aContentId == EAiDeviceStatusContentCUGMCNIndicator ) + || ( aContentId == EAiDeviceStatusContentNetworkIdentity ) ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } + +void CAiCUGMCNPublisher::Animate() + { + if ( iCUG && iMCN ) + { + if ( !iPeriodic->IsActive() ) + { + iAnimationDone = EFalse; + PublishCUG(); + iPeriodic->Start( KAnimDelay, KAnimDelay, TCallBack( PeriodicTimerCallBack, this ) ); + } + } + else + { + if ( iCUG ) + { + PublishCUG(); + } + else if ( iMCN ) + { + PublishMCN(); + } + } + } + +void CAiCUGMCNPublisher::PublishCUG() + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentCUGMCNIndicator, + *iCUG, + 0 ); + } + +void CAiCUGMCNPublisher::PublishMCN() + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentCUGMCNIndicator, + *iMCN, + 0 ); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aicugpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aicugpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,158 @@ +/* +* 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: Closed user group (CUG) publisher. +* +*/ + + +#include +#include +#include "aicugpublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" + + +// ======== MEMBER FUNCTIONS ======== + +CAiCUGPublisher::CAiCUGPublisher() + { + } + + +void CAiCUGPublisher::ConstructL() + { + User::LeaveIfError( iSSSettings.Open() ); + } + + +CAiCUGPublisher* CAiCUGPublisher::NewL() + { + CAiCUGPublisher* self = new( ELeave ) CAiCUGPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiCUGPublisher::~CAiCUGPublisher() + { + //Cancel listenning CUG changes. + iSSSettings.CancelAll( *this ); + iSSSettings.Close(); + delete iCugText; + } + + +void CAiCUGPublisher::ResumeL() + { + //Start listening CUG changes. + TInt err = iSSSettings.Register( ESSSettingsCug, *this ); + + if( err == KErrNotSupported || + err == KErrAlreadyExists ) + { + //CUG not supported, or already registered + err = KErrNone; + } + + User::LeaveIfError( err ); + } + + +void CAiCUGPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiCUGPublisher::RefreshL( TBool /*aClean*/ ) + { + //Get current CUG value and publish it. + TInt value; + if ( iSSSettings.Get( ESSSettingsCug, value ) != KErrNone ) + { + value = ESSSettingsCugDefault; + } + + UpdateCUGIndicatorL( value ); + } + + +void CAiCUGPublisher::PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt aNewValue ) + { + if( aSetting == ESSSettingsCug ) + { + TRAP_IGNORE( UpdateCUGIndicatorL( aNewValue ) ); + } + } + + +void CAiCUGPublisher::UpdateCUGIndicatorL( TInt aValue ) + { + //Check if the CUG is valid + if( iSSSettings.IsValueValidCugIndex( aValue ) ) + { + // Information already current, no need to update text + if ( iCugValue != aValue ) + { + iCugValue = aValue; + delete iCugText; + iCugText = NULL; + // Read CUG indicator format from resource file and publish + // content as a text. + iCugText = StringLoader::LoadL( + R_ACTIVEIDLE_CUG_INDICATOR_FORMAT, + aValue ); + + } + if ( iCugText ) + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentCUGIndicator, + *iCugText, + 0 ); + } + else + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentCUGIndicator, + 0 ); + } + } + else + { + //CUG is not valid, call clean. + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentCUGIndicator, + 0 ); + } + } + + +TBool CAiCUGPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentCUGIndicator ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aidatepublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aidatepublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,221 @@ +/* +* 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: Date publisher +* +*/ + + +#include +#include +#include +#include +#include +#include "aidatepublisher.h" +#include "aicontentobserver.h" + +const TInt KMaxDateStringLength = 100; + +// ======== MEMBER FUNCTIONS ======== + +CAiDatePublisher::CAiDatePublisher() + { + } + + +void CAiDatePublisher::ConstructL() + { + // Create enviroment notifier + iEnvNotifier = CEnvironmentChangeNotifier::NewL( + CActive::EPriorityStandard, TCallBack( HandleCallBackL, this ) ); + iDateText = NULL; + // Start listening notifications + iEnvNotifier->Start(); + } + + +CAiDatePublisher* CAiDatePublisher::NewL() + { + CAiDatePublisher* self = new( ELeave ) CAiDatePublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiDatePublisher::~CAiDatePublisher() + { + delete iDateText; + delete iEnvNotifier; + } + + +void CAiDatePublisher::ResumeL() + { + RefreshDateL(); + } + + +void CAiDatePublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiDatePublisher::RefreshL( TBool /*aClean*/ ) + { + RefreshDateL(); + } + + +void CAiDatePublisher::RefreshDateL() + { + if( !iContentObserver ) + { + return; + } + + delete iDateText; + iDateText = NULL; + iDateText = ConstructDateStringL(); + if ( iDateText ) + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentDate, + *iDateText, + 0 ); + } + } + + +HBufC* CAiDatePublisher::GetDayNameStringLC( TDay aDay, CCoeEnv& aCoeEnv ) + { + //Create week day string + TInt wkDayRes = KErrNotFound; + + switch( aDay ) + { + case EMonday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_MO; + break; + case ETuesday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_TU; + break; + case EWednesday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_WE; + break; + case EThursday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_TH; + break; + case EFriday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_FR; + break; + case ESaturday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_SA; + break; + case ESunday: + wkDayRes = R_QTN_WEEK_TWO_CHARS_SU; + break; + default: + // invalid weekday fetched + User::Leave( KErrNotFound ); + } + + return StringLoader::LoadLC( wkDayRes, &aCoeEnv ); + } + + +HBufC* CAiDatePublisher::ConstructDateStringL() + { + // Construct date string using date format from resource file + CCoeEnv* coeEnv = CCoeEnv::Static(); + + if( !coeEnv ) + { + User::Leave( KErrNotReady ); + } + + TTime time; + time.HomeTime(); + + HBufC* aiDateString = HBufC::NewLC( KMaxDateStringLength ); + HBufC* aiDateFormatString = StringLoader::LoadLC( R_ACTIVEIDLE_TIME_FORMAT, + coeEnv ); + HBufC* dateStringBuf = HBufC::NewLC( KMaxDateStringLength ); + HBufC* dateFormatString = StringLoader::LoadLC( R_QTN_DATE_SHORT_WITH_ZERO, + coeEnv ); + TPtr dateString( dateStringBuf->Des() ); + time.FormatL( dateString, *dateFormatString ); + CleanupStack::PopAndDestroy( dateFormatString ); + + //now dateString contains string which is formatted using + //R_QTN_DATE_USUAL_WITH_ZERO + + // To arabic + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( dateString ); + + TPtr aiDateStringPtr = aiDateString->Des(); + + TDayNameAbb wkDayAbb = TDayNameAbb(); + wkDayAbb.Set(time.DayNoInWeek()); + + //add date to string + StringLoader::Format( aiDateStringPtr, *aiDateFormatString, 1,dateString ); + + //reuse dateString + dateString.Copy( aiDateStringPtr ); + + //add weekday to string + StringLoader::Format( aiDateStringPtr, dateString, 0, wkDayAbb ); + + CleanupStack::PopAndDestroy( dateStringBuf );//dateStringBuf, aiDateFormatString + CleanupStack::PopAndDestroy( aiDateFormatString ); + + CleanupStack::Pop( aiDateString ); + return aiDateString; + } + + +TBool CAiDatePublisher::RefreshL( TInt aContentId, TBool /*aClean*/ ) + { + if( aContentId == EAiDeviceStatusContentDate ) + { + RefreshDateL(); + return ETrue; + } + return EFalse; + } + + +TInt CAiDatePublisher::HandleCallBackL( TAny *aPtr ) + { + CAiDatePublisher* self = static_cast( aPtr ); + + if( self ) + { + TInt changes( self->iEnvNotifier->Change() ); + + if ( changes & + ( EChangesLocale | EChangesMidnightCrossover | EChangesSystemTime ) ) + { + self->RefreshDateL(); + } + } + + return KErrNone; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aidevicestatusplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aidevicestatusplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,307 @@ +/* +* 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: Device status plugin interface. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include "aidevicestatusplugin.h" +#include "aidevicestatuspluginengine.h" +#include "aipublishprioritizer.h" +#include "aidevicestatuscontentmodel.h" +#include "aimulticontentobserver.h" +#include "aipluginsettings.h" +#include "ainetworkinfolistener.h" + +_LIT( KResourceDrive, "Z:" ); +_LIT( KResourceFile, "aidevstaplgres.rsc" ); +#define KResourcePath KDC_APP_RESOURCE_DIR + +// ECOM implementation table +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KImplUidDevStaPlugin, CAiDeviceStatusPlugin::NewL) + }; + + +// ======== MEMBER FUNCTIONS ======== + +CAiDeviceStatusPlugin::CAiDeviceStatusPlugin() : + iResourceOffset( KErrNotFound ) + { + } + + +void CAiDeviceStatusPlugin::ConstructL() + { + iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN; + + FeatureManager::InitializeLibL(); + + // Create master instance to prevent deletion on Stop() + iListener = CAiNetworkInfoListener::InstanceL(); + + //Create content here since this is needed in optimization phase. + iContent = AiUtility::CreateContentItemArrayIteratorL( KAiDeviceStatusContent ); + iResources = AiUtility::CreateContentItemArrayIteratorL( KAiDeviceStatusResources ); + iContentObservers = CAiMultiContentObserver::NewL(); + iPrioritizer = CAiPublishPrioritizer::NewL( *iContentObservers, *this ); + } + + +CAiDeviceStatusPlugin* CAiDeviceStatusPlugin::NewL() + { + CAiDeviceStatusPlugin* self = CAiDeviceStatusPlugin::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +CAiDeviceStatusPlugin* CAiDeviceStatusPlugin::NewLC() + { + CAiDeviceStatusPlugin* self = new( ELeave ) CAiDeviceStatusPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CAiDeviceStatusPlugin::~CAiDeviceStatusPlugin() + { + delete iPrioritizer; + FreeResources(); + delete iContentObservers; + Release( iResources ); + Release( iContent ); + FeatureManager::UnInitializeLib(); + if( iListener ) + { + iListener->Release(); + } + } + + +/** + * Allocates all resourcers required for plug-in operation. + */ +void CAiDeviceStatusPlugin::AllocateResourcesL() + { + //create engine + if( !iEngine ) + { + iEngine = CAiDeviceStatusPluginEngine::NewL( *iContentObservers, + *this, + *iPrioritizer); + } + + if( iResourceOffset < 0 ) + { + CCoeEnv* coe = CCoeEnv::Static(); + + if( !coe ) + { + User::Leave( KErrNotReady ); + } + + //Add resource file to cone + TFullName resourceFile( KResourceDrive ); + resourceFile.Append( KResourcePath ); + resourceFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resourceFile ); + iResourceOffset = coe->AddResourceFileL( resourceFile ); + } + } + + +/** + * Frees all allocated resources. + */ +void CAiDeviceStatusPlugin::FreeResources() + { + if( iResourceOffset >= 0 ) + { + CCoeEnv* coe = CCoeEnv::Static(); + //If device status plugin is created when CCoeEnv is available and + //destroyed when it is not anymore available, cone will inform about + //resource leak. + if ( coe ) + { + coe->DeleteResourceFile( iResourceOffset ); + iResourceOffset = KErrNotFound; + } + } + + delete iEngine; + iEngine = NULL; + } + + +void CAiDeviceStatusPlugin::Resume(TAiTransitionReason aReason) + { + if( IgnoreReason( aReason ) ) + { + return; + } + // resume all publishers only in startup + if( iEngine ) + { + if ( aReason == EAiIdleForeground || aReason == EAiKeylockDisabled ) + { + // not much can be done if some publisher cannot be refreshed + TRAP_IGNORE( iEngine->RefreshPublishersL( + EAiDeviceStatusContentNetworkIdentity, ETrue ) ); + + TRAP_IGNORE( iEngine->RefreshPublishersL( + EAiDeviceStatusContentCUGMCNIndicator, ETrue ) ); + } + // if layout changed republish some information + else if ( aReason == EAiScreenLayoutChanged ) + { + TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentDate, ETrue )); + TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentCUGMCNIndicator, ETrue )); + TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentVHZText, ETrue )); + TRAP_IGNORE( iEngine->RefreshPublishersL( EAiDeviceStatusContentNetworkIdentity, ETrue )); + } + return; + } + // If engine has been deleted. create it again. + else + { + iContentObservers->StartTransaction( KImplUidDevStaPlugin ); + + TRAPD( err, DoResumeL(aReason) ); + + if( err == KErrNone ) + { + iContentObservers->Commit( KImplUidDevStaPlugin ); + } + else + { + iContentObservers->CancelTransaction( KImplUidDevStaPlugin ); + } + } + } + + +void CAiDeviceStatusPlugin::DoResumeL(TAiTransitionReason /*aReason*/) + { + AllocateResourcesL( ); + iEngine->ResumePublishersL(); + iEngine->RefreshPublishersL( EFalse ); + } + + +TBool CAiDeviceStatusPlugin::IgnoreReason( TAiTransitionReason aReason ) + { + switch( aReason ) + { + case EAiBacklightOff: + return ETrue; + } + return EFalse; + } + + +void CAiDeviceStatusPlugin::Stop(TAiTransitionReason /*aReason*/) + { + FreeResources(); + } + + +void CAiDeviceStatusPlugin::Suspend(TAiTransitionReason /*aReason*/) + { + } + + +void CAiDeviceStatusPlugin::SubscribeL(MAiContentObserver& aObserver) + { + iContentObservers->AddObserverL( aObserver ); + } + + +TAny* CAiDeviceStatusPlugin::Extension(TUid aUid) + { + //Access to extensions + if( aUid == KExtensionUidProperty ) + { + return static_cast(this); + } + + return NULL; + } + + +void CAiDeviceStatusPlugin::ConfigureL(RAiSettingsItemArray& aSettings) + { + aSettings.ResetAndDestroy(); + } + +TAny* CAiDeviceStatusPlugin::GetPropertyL(TInt aProperty) + { + //Return properties. + switch (aProperty) + { + case EAiPublisherInfo: + return &iInfo; + + case EAiPublisherContent: + return static_cast(iContent); + + case EAiPublisherResources: + return static_cast(iResources); + + case EAiContentRequest: + return static_cast(this); + } + + return NULL; + } + +void CAiDeviceStatusPlugin::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aProperty == EAiPublisherInfo ) + { + ASSERT( aValue ); + + const TAiPublisherInfo* info( + static_cast( aValue ) ); + + iInfo = *info; + } + } + +TBool CAiDeviceStatusPlugin::RefreshContent( TInt aContentId ) + { + TBool result = EFalse; + + TRAP_IGNORE( result = iEngine->RefreshPublishersL( aContentId, EFalse ) ); + return result; + } + + +/** + * ECom component entry point. + */ +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + return KImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aidevicestatuspluginengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aidevicestatuspluginengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,221 @@ +/* +* 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: Engine class for Device Status Plug-in +* +*/ + + +#include "aidevicestatuspluginengine.h" +#include "aipublisherfactory.h" +#include "aidevicestatuspublisher.h" + +CAiDeviceStatusPluginEngine::CAiDeviceStatusPluginEngine( + MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer ) + : iContentObserver( &aObserver ), + iExtension( &aExtension ), + iPrioritizer( &aPrioritizer ) + { + } + + +void CAiDeviceStatusPluginEngine::ConstructL() + { + // Instantiate all publishers via factory + MAiDeviceStatusPublisher* publisher = AiPublisherFactory::CreateProfilePublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateDatePublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateSimRegPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateNWSPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateBTSAPPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateOperatorLogoPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateOperatorNamePublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateMCNPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateCUGPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateVHZPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + publisher = AiPublisherFactory::CreateCUGMCNPublisherL(); + CleanupStack::PushL( publisher ); + AddPublisherL( publisher ); + CleanupStack::Pop( publisher ); + + // Subscribe all publishers once they are instantiated + const TInt count = iPublishers.Count(); + + for( TInt i( 0 ); i < count; i++ ) + { + iPublishers[i]->Subscribe( *iContentObserver, + *iExtension, + *iPrioritizer, + *this ); + } + } + + +CAiDeviceStatusPluginEngine* CAiDeviceStatusPluginEngine::NewL( + MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer) + { + CAiDeviceStatusPluginEngine* self = + new( ELeave ) CAiDeviceStatusPluginEngine( aObserver, + aExtension, + aPrioritizer); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiDeviceStatusPluginEngine::~CAiDeviceStatusPluginEngine() + { + iPublishers.ResetAndDestroy(); + } + + +void CAiDeviceStatusPluginEngine::AddPublisherL( MAiDeviceStatusPublisher* aPublisher ) + { + //Add publisher to list. + if( aPublisher ) + { + CleanupDeletePushL( aPublisher ); + User::LeaveIfError( iPublishers.Append( aPublisher ) ); + CleanupStack::Pop(aPublisher);//aPublisher + } + } + + +void CAiDeviceStatusPluginEngine::ResumePublishersL() + { + const TInt count = iPublishers.Count(); + + for( TInt i( 0 ); i < count; i++ ) + { + iPublishers[i]->ResumeL(); + } + } + + +void CAiDeviceStatusPluginEngine::RefreshPublishersL( TBool aClean ) + { + iContentObserver->StartTransaction( KImplUidDevStaPlugin ); + + const TInt count = iPublishers.Count(); + + for( TInt i( 0 ); i < count; i++ ) + { + iPublishers[i]->RefreshL( aClean ); + } + + iContentObserver->Commit( KImplUidDevStaPlugin ); + } + + +TBool CAiDeviceStatusPluginEngine::RefreshPublishersL( TInt aContentId, + TBool aClean ) + { + TBool success = EFalse; + + iContentObserver->StartTransaction( KImplUidDevStaPlugin ); + + const TInt count = iPublishers.Count(); + + for( TInt i( 0 ); i < count; i++ ) + { + if( iPublishers[i]->RefreshL( aContentId, aClean ) ) + { + success = ETrue; + } + } + + if ( success ) + { + iContentObserver->Commit( KImplUidDevStaPlugin ); + } + else + { + iContentObserver->CancelTransaction( KImplUidDevStaPlugin ); + } + + return success; + } + + +TBool CAiDeviceStatusPluginEngine::RefreshPriorizedPublishersL( TInt aContentId, + TInt aPriority ) + { + iContentObserver->StartTransaction( KImplUidDevStaPlugin ); + TBool success = EFalse; + const TInt count = iPublishers.Count(); + + for( TInt i( 0 ); i < count; i++ ) + { + if( iPublishers[i]->RefreshContentWithPriorityL( aContentId, + aPriority ) ) + { + success = ETrue; + break; + } + } + if ( success ) + { + iContentObserver->Commit( KImplUidDevStaPlugin ); + } + else + { + iContentObserver->CancelTransaction( KImplUidDevStaPlugin ); + } + return success; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aidevstaplg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aidevstaplg.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,61 @@ +/* +* 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: +* +*/ + + +// INCLUDES +#include + + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// ?resource_name +// +// +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + // UID for the DLL + dll_uid = 0x102750F7; + + // Interface info array + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface + interface_uid = 0x102750ED; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x102750F8; + version_no = 1; + display_name = "DeviceStatus"; + default_data = ""; + opaque_data = ""; + rom_only = 1; + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aidevstaplgres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aidevstaplgres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: Resource definitions for project ?myapp +* +*/ + + + +NAME AIDP + +#include +#include +#include +#include +#include + +#include + +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf=""; } + +// --------------------------------------------------------------------------- +// ?resource_name +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_activeidle_time_format + { + buf = qtn_idle_time_format; + } + +RESOURCE TBUF r_activeidle_bt_sim_access_profile_string + { + buf = qtn_mode_sap; + } + +RESOURCE TBUF r_activeidle_cug_indicator_format + { + buf = qtn_cug_indic_group; + } + +RESOURCE TBUF r_ai_opn_spn_separator_format + { + buf = qtn_ai_opn_spn_separator; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aimcnpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aimcnpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,114 @@ +/* +* 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: Micro Cellular Network (MCN) publisher. +* +*/ + + +#include "aimcnpublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" + + +// ======== MEMBER FUNCTIONS ======== + +CAiMCNPublisher::CAiMCNPublisher() + { + } + + +void CAiMCNPublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + } + + +CAiMCNPublisher* CAiMCNPublisher::NewL() + { + CAiMCNPublisher* self = new( ELeave ) CAiMCNPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiMCNPublisher::~CAiMCNPublisher() + { + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + } + + +void CAiMCNPublisher::ResumeL() + { + iListener->AddObserverL( *this ); + } + + +void CAiMCNPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiMCNPublisher::RefreshL( TBool /*aClean*/ ) + { + //cannot be refreshed + } + + +void CAiMCNPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool /*aShowOpInd*/ ) + { + //If MSN message was received, publish it. + if ( aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage ) + { + if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) + { + TPtrC msg = aInfo.iMCNName; + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentMCNIndicator, + msg, + 0 ); + } + else if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeNone ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentMCNIndicator, + 0 ); + } + } + } + + +TBool CAiMCNPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentMCNIndicator ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aimulticontentobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 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: Active Idle Content Observer interface multiplexer +* implementation. +* +*/ + + +#include "aimulticontentobserver.h" +#include "aicontentobserveroptimizer.h" + +CAiMultiContentObserver* CAiMultiContentObserver::NewL() + { + return new(ELeave) CAiMultiContentObserver; + } + + +CAiMultiContentObserver::~CAiMultiContentObserver() + { + iObserverOptimizers.ResetAndDestroy(); + } + + +void CAiMultiContentObserver::AddObserverL(MAiContentObserver& aObserver) + { + TBool foundExisting = EFalse; + + for( TInt i = 0; i < iObserverOptimizers.Count(); ++i ) + { + if ( &(iObserverOptimizers[i]->Observer()) == &aObserver ) + { + foundExisting = ETrue; + break; + } + } + if( !foundExisting ) + { + CAiContentObserverOptimizer *optimizer = + CAiContentObserverOptimizer::NewL( aObserver ); + iObserverOptimizers.AppendL( optimizer ); + } + } + + +TInt CAiMultiContentObserver::StartTransaction( TInt aTxId ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->StartTransaction( aTxId ); + + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::Commit( TInt aTxId ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Commit( aTxId ); + + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::CancelTransaction( TInt aTxId ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->CancelTransaction( aTxId ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TBool CAiMultiContentObserver::CanPublish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ) + { + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + if( iObserverOptimizers[i]->CanPublish( aPlugin, aContent, aIndex ) ) + { + return ETrue; + } + } + return EFalse; + } + + +TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aResource, + TInt aIndex ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Publish( aPlugin, aContent, aResource, aIndex ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC16& aText, + TInt aIndex ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Publish( aPlugin, aContent, aText, aIndex ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + const TDesC8& aBuf, + TInt aIndex ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Publish( aPlugin, aContent, aBuf, aIndex ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::Publish( MAiPropertyExtension& aPlugin, + TInt aContent, + RFile& aFile, + TInt aIndex ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Publish( aPlugin, aContent, aFile, aIndex ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TInt CAiMultiContentObserver::Clean( MAiPropertyExtension& aPlugin, + TInt aContent, + TInt aIndex ) + { + TInt result = KErrNone; + const TInt count = iObserverOptimizers.Count(); + for ( TInt i = 0; i < count; ++i ) + { + const TInt r = iObserverOptimizers[i]->Clean( aPlugin, aContent, aIndex ); + if ( r != KErrNone ) + { + result = r; + } + } + return result; + } + + +TAny* CAiMultiContentObserver::Extension( TUid /*aUid*/ ) + { + return NULL; + } + +TBool CAiMultiContentObserver::RequiresSubscription( + const TAiPublisherInfo& /*aPublisherInfo*/ ) const + { + return ETrue; + } + +CAiMultiContentObserver::CAiMultiContentObserver() + { + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,347 @@ +/* +* 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: Network info listener. +* +*/ + + +#include +#include +#include "ainetworkinfolistener.h" +#include "ainetworkinfoobserver.h" +#include "debug.h" + +const TInt KAiMessageCacheGranularity = 4; + +// ======== MEMBER FUNCTIONS ======== + +CAiNetworkInfoListener::CAiNetworkInfoListener() +: iKeyProperties( 0, ECmpTInt ) + { + } + + +void CAiNetworkInfoListener::ConstructL() + { + //Store pointer in TLS + User::LeaveIfError( Dll::SetTls( this ) ); + + //Create network handling engine session. + iSession = CreateL( *this, iInfo ); + + iShowOpInd = EFalse; + //Create message cache + iMessageCache = new( ELeave )CArrayFixFlat + ( KAiMessageCacheGranularity ); + } + + +CAiNetworkInfoListener* CAiNetworkInfoListener::InstanceL() + { + CAiNetworkInfoListener* self = static_cast( Dll::Tls() ); + + if( !self ) + { + //If instance of network listener is not already constructed, create it + self = new( ELeave ) CAiNetworkInfoListener; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + } + + //increase access count + self->IncAccessCount(); + return self; + } + + +void CAiNetworkInfoListener::Release() + { + //Decrease access count, if it goes to zero, delete object. + if( !DecAccessCount() ) + { + delete this; + } + } + + +CAiNetworkInfoListener::~CAiNetworkInfoListener() + { + //Remove object from TLS + Dll::SetTls( NULL ); + iObservers.Reset(); + delete iSession; + delete iMessageCache; + } + + +TInt CAiNetworkInfoListener::IncAccessCount() + { + return iAccessCount++; + } + +TInt CAiNetworkInfoListener::DecAccessCount() + { + return --iAccessCount; + } + + +void CAiNetworkInfoListener::AddObserverL( MAiNetworkInfoObserver& aObserver ) + { + //Removing observer doesn't remove slots from array, removed observers are only + //set to NULL. Reason for this is found out later on the code. Adding observer + //first tries to find free slot, if it is not found, observer is appended to the + //array. + TInt freeSlot = iObservers.Find( NULL ); + + if( freeSlot == KErrNotFound ) + { + User::LeaveIfError( iObservers.Append( &aObserver ) ); + } + else + { + User::LeaveIfError( iObservers.Insert( &aObserver, freeSlot ) ); + } + } + + +void CAiNetworkInfoListener::RemoveObserver( MAiNetworkInfoObserver& aObserver ) + { + //Remove observer, removing is done by replacing it with NULL pointer. + const TInt count( iObservers.Count() ); + + for( TInt i( 0 ); i < count; i++ ) + { + if( iObservers[i] == &aObserver ) + { + //replace it with NULL + iObservers.Remove( i ); + iObservers.Insert( NULL, i ); + break; + } + } + } + + +const TNWInfo& CAiNetworkInfoListener::NetworkInfo() const + { + return iInfo; + } + +TBool CAiNetworkInfoListener::IsOperatorIndicatorAllowed() const + { + return iShowOpInd; + } + +TBool CAiNetworkInfoListener::MessageReceived( MNWMessageObserver::TNWMessages aMessage ) + { + //check if the message is in message cache. + TInt index( KErrNotFound ); + TBool found = ( iMessageCache->FindIsq( aMessage, iKeyProperties, index ) == 0 ); + return found; + } + + +void CAiNetworkInfoListener::HandleNetworkMessage( const TNWMessages aMessage ) + { + __PRINTS("XAI: Handle NW message"); + //Insert message into the message cache. Only one messsage of one type. + TRAPD( err, iMessageCache->InsertIsqL( aMessage, iKeyProperties ) ); + if( err == KErrAlreadyExists ) + { + err = KErrNone; + } + + if( err != KErrNone ) + { + return; + } + + iShowOpInd = !NotAllowedToDisplayOperatorIndicator( aMessage ); + + + TBool hasNetInfoChanged = HasNetworkInfoChanged( aMessage ); + + if ( !hasNetInfoChanged ) + { + return; + } + + __PRINT(__DBG_FORMAT("XAI: Show operator indicator %d, info changed %d"), iShowOpInd, hasNetInfoChanged ); + + const TInt count( iObservers.Count() ); + + + for( TInt i( 0 ); i < count; i++ ) + { + //Observer might be NULL. When HandleNetworkInfoChange is called, it may + //cause deleting of the publisher which means that observer is removed from listener. + //This is the reason why observer pointers are replaced by NULL when it is removed + //from this listener. If the slot would be removed, it would easily cause index overflow + //or missing HandleNetworkInfoChange calls. + //For example lets assume that we have 5 observers, we are going in loop 3, so variable i + //has value 2. When third call is done, it would cause two publishers to be deleted and + //observers removed. Lets assume that these observers are in place 0 and 1. So now we have + //only 3 observers and the count is still 2. So we miss a call to a observers in index 3 and 4. + + if( iObservers[i] ) + { + iObservers[i]->HandleNetworkInfoChange( aMessage, iInfo, iShowOpInd ); + } + } + } + + +void CAiNetworkInfoListener::HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ) + { + __PRINT(__DBG_FORMAT("XAI: Error code %d"), aErrorCode ); + switch ( aOperation ) + { + case MNWMessageObserver::ENWGetNetworkProviderName: + iReceivedMessageFlags |= ENetworkProviderNameReceived; + iReceivedMessageFlags &= ~ENetworkProviderNameOk; + iInfo.iNPName.Zero(); + __PRINTS("XAI: NPN error received"); + break; + case MNWMessageObserver::ENWGetProgrammableOperatorName: + iReceivedMessageFlags |= EProgrammableOperatorInfoReceived; + iReceivedMessageFlags &= ~EProgrammableOperatorInfoReceivedOk; + iInfo.iOperatorNameInfo.iName.Zero(); + __PRINTS("XAI: PON error received"); + break; + case MNWMessageObserver::ENWGetServiceProviderName: + iReceivedMessageFlags |= EServiceProviderNameReceived; + iReceivedMessageFlags &= ~EServiceProviderNameOk; + iInfo.iServiceProviderNameDisplayReq = RMobilePhone::KDisplaySPNNotRequired; + iInfo.iSPName.Zero(); + iInfo.iPLMNField.Zero(); + __PRINTS("XAI: SPN error received"); + break; + default: + break; + } + + HandleNetworkMessage( TNWMessages( KErrGeneral ) ); + } + + +TBool CAiNetworkInfoListener::NotAllowedToDisplayOperatorIndicator( const TNWMessages aMessage ) + { + // Service provider name must have been fetched. + // Network provider name must have been fetched. + // Registration status and network information must have been received. + // Operator name information must have been received. + // Device must be camped to a network. + + switch ( aMessage ) + { + case MNWMessageObserver::ENWMessageNetworkInfoChange: + iReceivedMessageFlags |= ENetworkInfoChangeReceived; + break; + case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange: + iReceivedMessageFlags |= ERegistrationStatusReceived; + break; + case MNWMessageObserver::ENWMessageNetworkProviderNameChange: + iReceivedMessageFlags |= + ( ENetworkProviderNameReceived + ENetworkProviderNameOk ); + break; + case MNWMessageObserver::ENWMessageServiceProviderNameChange: + iReceivedMessageFlags |= + ( EServiceProviderNameReceived + EServiceProviderNameOk ); + break; + case MNWMessageObserver::ENWMessageProgrammableOperatorInfoChange: + iReceivedMessageFlags |= + ( EProgrammableOperatorInfoReceived + + EProgrammableOperatorInfoReceivedOk ); + break; + case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating: + iReceivedMessageFlags &= + ~( ENetworkProviderNameReceived + ENetworkProviderNameOk ); + break; + case MNWMessageObserver::ENWMessageServiceProviderNameUpdating: + iReceivedMessageFlags &= + ~( EServiceProviderNameReceived + EServiceProviderNameOk ); + break; + case MNWMessageObserver::ENWMessageProgrammableOperatorInfoUpdating: + iReceivedMessageFlags &= + ~( EProgrammableOperatorInfoReceived + + EProgrammableOperatorInfoReceivedOk ); + break; + default: + break; + } + + TBool serviceProviderNameFetched( EServiceProviderNameReceived & iReceivedMessageFlags ); + TBool networkProviderNameFetched( ENetworkProviderNameReceived & iReceivedMessageFlags ); + TBool registrationStatusReceived( ERegistrationStatusReceived & iReceivedMessageFlags ); + TBool networkInformationReceived( ENetworkInfoChangeReceived & iReceivedMessageFlags ); + TBool operatorNameInformationReceived( + EProgrammableOperatorInfoReceived & iReceivedMessageFlags ); + TBool currentNetworkOk( + ( ENetworkInfoChangeReceived & iReceivedMessageFlags ) && + ( ERegistrationStatusReceived & iReceivedMessageFlags ) && + ( iInfo.iStatus == ENWStatusCurrent ) ); + + return + !serviceProviderNameFetched || + !networkProviderNameFetched || + !( registrationStatusReceived && networkInformationReceived + && operatorNameInformationReceived ) || + !currentNetworkOk; + } + + +TBool CAiNetworkInfoListener::HasNetworkInfoChanged( const TNWMessages aMessage ) + { + TBool result = ETrue; + + // pass through + if ( aMessage == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage || + aMessage == MNWMessageObserver::ENWMessageNetworkConnectionFailure || + aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage ) + { + return result; + } + + result = ( iReceivedMessageFlags != iOldReceivedMessageFlags ); + + if ( !result ) + { + // Check if contents of iInfo has changed. Most probable to the + // beginning of the expression. + result = + iInfo.iRegistrationStatus != iOldInfo.iRegistrationStatus || + iInfo.iStatus != iOldInfo.iStatus || + iInfo.iCountryCode != iOldInfo.iCountryCode || + iInfo.iNetworkId != iOldInfo.iNetworkId || + iInfo.iOperatorNameInfo.iType != + iOldInfo.iOperatorNameInfo.iType || + iInfo.iOperatorNameInfo.iName != + iOldInfo.iOperatorNameInfo.iName || + iInfo.iDisplayTag != iOldInfo.iDisplayTag || + iInfo.iShortName != iOldInfo.iShortName || + iInfo.iLongName != iOldInfo.iLongName || + iInfo.iSPName != iOldInfo.iSPName || + iInfo.iServiceProviderNameDisplayReq != + iOldInfo.iServiceProviderNameDisplayReq || + iInfo.iNPName != iOldInfo.iNPName || + iInfo.iPLMNField != iOldInfo.iPLMNField; + } + + iOldReceivedMessageFlags = iReceivedMessageFlags; + iOldInfo = iInfo; + + return result; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/ainwspublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/ainwspublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,188 @@ +/* +* 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: Network status publisher +* +*/ + + +#include "ainwspublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" + +#include +#include +#include +#include +#include + +#include "debug.h" + +// Offline profile, from ProfileEngineSDKCRKeys.h +const TInt KOfflineProfileId = 5; + +// ======== MEMBER FUNCTIONS ======== + +CAiNwsPublisher::CAiNwsPublisher() + { + iRegistered = ETrue; + } + + +void CAiNwsPublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + iProfileApi = CRepository::NewL( KCRUidProfileEngine ); + } + +CAiNwsPublisher* CAiNwsPublisher::NewL() + { + CAiNwsPublisher* self = new( ELeave ) CAiNwsPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiNwsPublisher::~CAiNwsPublisher() + { + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + delete iProfileApi; + } + + +void CAiNwsPublisher::ResumeL() + { + iListener->AddObserverL( *this ); + } + + +void CAiNwsPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiNwsPublisher::RefreshL( TBool /*aClean*/ ) + { + HandleStateChange( iListener->NetworkInfo() ); + } + +TBool CAiNwsPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentNWStatus ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } + + + +void CAiNwsPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& /*aMessage*/, + const TNWInfo& aInfo, + const TBool /*aShowOpInd*/ ) + { + HandleStateChange( aInfo ); + } + +void CAiNwsPublisher::HandleStateChange( const TNWInfo& aInfo ) + { + switch( aInfo.iRegistrationStatus ) + { + case ENWNotRegisteredNoService: + // Fall-through + case ENWNotRegisteredEmergencyOnly: + // Fall-through + case ENWNotRegisteredSearching: + // Fall-through + case ENWRegistrationDenied: + HandleNetworkLost( aInfo.iSelectionSetting ); + break; + + case ENWRegisteredBusy: + // Fall-through + case ENWRegisteredOnHomeNetwork: + // Fall-through + case ENWRegisteredRoaming: + HandleNetworkFound(); + break; + + case ENWRegistrationUnknown: + // Take no action + default: + break; + } + } + +void CAiNwsPublisher::HandleNetworkFound() + { + __PRINTS( "XAI: Network found, clean state" ); + iRegistered = ETrue; + if ( iContentObserver && iExtension ) + { + iContentObserver->Clean( *iExtension, EAiDeviceStatusContentNWStatus, 0 ); + } + } + +void CAiNwsPublisher::HandleNetworkLost( const TNWNetworkSelectionSetting &aSelectionSetting ) + { + if( aSelectionSetting == ENWNetworkSelectionManual ) + { + // See if we were registered before + if( iRegistered ) + { + iRegistered = EFalse; + + if( !IsOffLineMode() && + !IsBluetoothSAPConnected() && + iContentObserver && + iExtension ) + { + __PRINTS( "XAI: Network lost, publish state" ); + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentNWStatus, + EAiDeviceStatusResourceNWLost, + 0 ); + } + } + } + } + +TBool CAiNwsPublisher::IsOffLineMode() const + { + TInt profileId; + TInt err = iProfileApi->Get( KProEngActiveProfile, profileId ); + return profileId == KOfflineProfileId && err == KErrNone; + } + +TBool CAiNwsPublisher::IsBluetoothSAPConnected() const + { + TInt btSapState( EBTSapNotConnected ); + TInt err = RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + btSapState ); + return btSapState != EBTSapNotConnected && err == KErrNone; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aioperatorlogopublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aioperatorlogopublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,571 @@ +/* +* 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: Operator logo publisher. +* +*/ + + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "aioperatorlogopublisher.h" +#include "ainetworkinfolistener.h" +#include "aidevicestatuscontentmodel.h" +#include "aiprioritizer.h" +#include "ainwidpriorities.h" +#include "debug.h" + +// Operator Logo showing state is OFF. +const TInt KAIDisplayOperatorLogoOff = 0; + +// Operator Logo showing state is ON. +const TInt KAIDisplayOperatorLogoOn = 1; + +const TInt KAddTwoPixels = 2; +const TInt KMaskBlitStartOffset = -1; +const TInt KMaskBlitEndOffset = 2; + + +// ======== MEMBER FUNCTIONS ======== + +CAiOperatorLogoPublisher::CAiOperatorLogoPublisher() +: iPriority( EAiInvalidPriority ) + { + + } + + +void CAiOperatorLogoPublisher::ConstructL() + { + __PRINTS("CAiOperatorLogoPublisher:: ConstructL >>"); + iListener = CAiNetworkInfoListener::InstanceL(); + + iOperatorLogoObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleOperatorLogoUpdateL, this ), + KPSUidPhoneClientServerInformation, KTelOperatorLogoUpdated ); + + iCenRep = CRepository::NewL( KCRUidPersonalizationSettings ); + + iCenRepNotify = CCenRepNotifyHandler::NewL( *this, + *iCenRep, + CCenRepNotifyHandler::EIntKey, + KSettingsDisplayOperatorLogo ); + + iCenRepNotify->StartListeningL(); + __PRINTS("CAiOperatorLogoPublisher:: ConstructL <<"); + } + + +CAiOperatorLogoPublisher* CAiOperatorLogoPublisher::NewL() + { + CAiOperatorLogoPublisher* self = new( ELeave ) CAiOperatorLogoPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiOperatorLogoPublisher::~CAiOperatorLogoPublisher() + { + __PRINTS("CAiOperatorLogoPublisher:: ~CAiOperatorLogoPublisher >>"); + if( iCenRepNotify ) + { + iCenRepNotify->StopListening(); + } + delete iCenRepNotify; + delete iCenRep; + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + delete iIcon; + Release( iOperatorLogoObserver ); + __PRINTS("CAiOperatorLogoPublisher:: ~CAiOperatorLogoPublisher <<"); + } + + +void CAiOperatorLogoPublisher::ResumeL() + { + __PRINTS("CAiOperatorLogoPublisher:: ResumeL >>"); + iListener->AddObserverL( *this ); + __PRINTS("CAiOperatorLogoPublisher:: ResumeL <<"); + } + + +void CAiOperatorLogoPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& /*aMessage*/, + const TNWInfo& /*aInfo*/, + const TBool aShowOpInd ) + { + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: HandleNetworkInfoChange >> aShowOpInd %d "), aShowOpInd); + if( aShowOpInd ) + { + TRAP_IGNORE(UpdateOperatorLogoL( ETrue )); + } + else + { + TRAP_IGNORE (iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority )); + } + + __PRINTS("CAiOperatorLogoPublisher:: HandleNetworkInfoChange <<"); + } + + +void CAiOperatorLogoPublisher::HandleNotifyInt( TUint32 aId, TInt /*aNewValue*/ ) + { + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: HandleNotifyInt >> aId %d "), aId); + if( aId == KSettingsDisplayOperatorLogo ) + { + TRAP_IGNORE( UpdateOperatorLogoL( ETrue ) ); + } + __PRINTS("CAiOperatorLogoPublisher:: HandleNotifyInt <<"); + } + + +void CAiOperatorLogoPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + iPrioritizer = &aPrioritizer; + iBroadcaster = &aBroadcaster; + } + + +void CAiOperatorLogoPublisher::RefreshL( TBool aClean ) + { + __PRINTS("CAiOperatorLogoPublisher:: RefresL >> "); + TRAP_IGNORE( UpdateOperatorLogoL( aClean ) ); + __PRINTS("CAiOperatorLogoPublisher:: RefresL << "); + } + + +CFbsBitmap* CAiOperatorLogoPublisher::LoadLogoL( TInt aMCC, + TInt aMNC ) + { + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: LoadLogo >> aMCC %d, aMNC %d"), aMCC, aMNC); + CPhCltImageHandler* imageHandler = CPhCltImageHandler::NewL(); + User::LeaveIfNull( imageHandler ); + + CleanupStack::PushL( imageHandler ); + + // Create image parameter class + CPhCltImageParams* params = + imageHandler->CPhCltBaseImageParamsL( EPhCltTypeOperatorLogo ); + CleanupStack::PushL( params ); + + TInt err = KErrNotFound; + iPriority = EAiOTAOperatorLogo; + + CPhCltExtOperatorLogoParams* opLogoParams = + static_cast(params); + + if( opLogoParams ) + { + opLogoParams->SetCodesL( aMCC, aMNC, EPhCltLogoTypeOTA ); + err = imageHandler->LoadImages( params ); + + if( err == KErrNotFound ) + { + // OTA logo wasn't found, try programmable logo + opLogoParams->SetCodesL( aMCC, aMNC, EPhCltLogoTypeProgrammable ); + err = imageHandler->LoadImages( params ); + iPriority = EAiProgOperatorLogo; + } + } + else + { + err = KErrNotFound; + } + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: LoadLogo >> err %d"), err); + User::LeaveIfError( err ); + + //take always first image, we can show only one logo + TInt bitmapHandle = params->GetImageL( 0 ); + + CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Duplicate( bitmapHandle ) ); + + CleanupStack::Pop( bitmap ); + + CleanupStack::PopAndDestroy( params ); + CleanupStack::PopAndDestroy( imageHandler ); + __PRINTS("CAiOperatorLogoPublisher:: LoadLogo << "); + return bitmap; + } + + +void CAiOperatorLogoPublisher::UpdateOperatorLogoL( TBool aClean ) + { + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: UpdateOperatorLogoL >> aClean %d"), aClean); + iSuccess = EFalse; + if( aClean ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority ); + } + + if( !AllowToShowLogoL() ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority ); + + delete iIcon; + iIcon = NULL; + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL : not allowed to show logo"); + return; + } + + const TNWInfo& info = iListener->NetworkInfo(); + + if ( info.iRegistrationStatus == ENWNotRegisteredNoService || + info.iRegistrationStatus ==ENWRegistrationUnknown ) + { + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL : registrationstatus unknown"); + return; + } + + TInt mcc; + + TLex lex( info.iCountryCode ); + User::LeaveIfError( lex.Val( mcc ) ); + + TInt mnc; + lex.Assign( info.iNetworkId ); + User::LeaveIfError( lex.Val( mnc ) ); + + CFbsBitmap* opLogo = NULL; + CFbsBitmap* opLogoMask = NULL; + + TRAPD( err, opLogo = LoadLogoL( mcc, + mnc ) ); + + if( err ) + { + opLogo = NULL; + } + + if ( opLogo && opLogo->IsMonochrome() ) + { + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL : monochrome icon"); + CFbsBitmap* bitmap = opLogo; + opLogo = NULL; + + CleanupStack::PushL( bitmap ); + CreateMonochromeBitmapsL( *bitmap, opLogo, opLogoMask ); + + CleanupStack::PopAndDestroy( bitmap ); + } + + //clean always, might be that there is old logo published + //and now the logo isn't valid anymore. So publish clean + //even if we didn't get new logo + if( opLogo ) + { + delete iIcon; + iIcon = NULL; + + if( opLogoMask ) + { + iIcon = CGulIcon::NewL( opLogo, opLogoMask ); + } + else + { + iIcon = CGulIcon::NewL( opLogo, NULL ); + } + + opLogo = NULL; + opLogoMask = NULL; + + TPckg pckg( iIcon ); + + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + pckg, + iPriority ); + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL : logo published "); + iSuccess = ETrue; + } + else + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority ); + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL : logo cleaned "); + } + __PRINTS("CAiOperatorLogoPublisher:: UpdateOperatorLogoL << "); + } + + +TBool CAiOperatorLogoPublisher::AllowToShowLogoL() const + { + TInt val; + iCenRep->Get( KSettingsDisplayOperatorLogo, val ); + return val && iListener->IsOperatorIndicatorAllowed(); + } + + +void CAiOperatorLogoPublisher::CreateMonochromeBitmapsL( + const CFbsBitmap& aBitmap, + CFbsBitmap*& aNewLogoMain, + CFbsBitmap*& aNewLogoMask ) + { + + __PRINTS("CAiOperatorLogoPublisher:: CreateMonochromeBitmapsL >> "); + TSize size = aBitmap.SizeInPixels(); + const TRgb white = TRgb::Gray2( 1 ); + + // New size 2 pixels larger in every dimension. + TSize newSize( size.iWidth + KAddTwoPixels, size.iHeight + KAddTwoPixels ); + TPoint delta( 1, 1 ); // adjust image position. + + TSize opLogoSize; + TInt err = GetTitlePaneSize( opLogoSize ); + if ( err != KErrNone ) + { + return; + } + + if ( newSize.iWidth > opLogoSize.iWidth && + size.iWidth <= opLogoSize.iWidth ) + { + newSize.iWidth = size.iWidth; + delta.iX = 0; + } + if ( newSize.iHeight > opLogoSize.iHeight && + size.iHeight <= opLogoSize.iHeight ) + { + newSize.iHeight = size.iHeight; + delta.iY = 0; + } + + // Create mask image + CFbsBitmap* bitmapLargeMain = + new (ELeave) CFbsBitmap; + CleanupStack::PushL( bitmapLargeMain ); + User::LeaveIfError( + bitmapLargeMain->Create( newSize, EGray2 ) ); + + CFbsBitmapDevice* device = + CFbsBitmapDevice::NewL( bitmapLargeMain ); + CleanupStack::PushL( device ); + + CFbsBitGc* gc = NULL; + User::LeaveIfError( device->CreateContext( gc ) ); + + gc->SetPenStyle(CGraphicsContext::ENullPen); + gc->SetBrushColor( white ); + gc->SetBrushStyle(CGraphicsContext::ESolidBrush); + gc->Clear(); + + gc->BitBlt( TPoint() + delta, &aBitmap ); + + delete gc; + gc = NULL; + + CleanupStack::PopAndDestroy( device ); + + // Create main image + CFbsBitmap* bitmapLargeMask = + new (ELeave) CFbsBitmap; + CleanupStack::PushL( bitmapLargeMask ); + User::LeaveIfError( + bitmapLargeMask->Create( newSize, EGray2 ) ); + + CFbsBitmapDevice* deviceMask = + CFbsBitmapDevice::NewL( bitmapLargeMask ); + CleanupStack::PushL( deviceMask ); + + User::LeaveIfError( deviceMask->CreateContext( gc ) ); + + gc->SetPenStyle(CGraphicsContext::ENullPen); + gc->SetBrushColor( white ); + gc->SetBrushStyle(CGraphicsContext::ESolidBrush); + gc->Clear(); + gc->SetBrushStyle(CGraphicsContext::ENullBrush); + + TPoint point; + TRect rect( point, size ); + + // Blit with mask 3 points from top left to down right. + for ( TInt j = KMaskBlitStartOffset; + j < KMaskBlitEndOffset; + j++ ) + { + for ( TInt i = KMaskBlitStartOffset; + i < KMaskBlitEndOffset; + i++ ) + { + point = TPoint( i, j ); + point += delta; + gc->BitBltMasked( + point, &aBitmap, rect, &aBitmap, ETrue ); + } + } + + delete gc; + gc = NULL; + + CleanupStack::PopAndDestroy( deviceMask ); + + CleanupStack::Pop( bitmapLargeMask ); + CleanupStack::Pop( bitmapLargeMain ); + + aNewLogoMain = bitmapLargeMain; + aNewLogoMask = bitmapLargeMask; + __PRINTS("CAiOperatorLogoPublisher:: CreateMonochromeBitmapsL << "); + } + + +TInt CAiOperatorLogoPublisher::GetTitlePaneSize( TSize& aSize ) + { + TRect titlePaneRect; + TBool hasTitlePane = AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::ETitlePane, titlePaneRect ); + + if ( !hasTitlePane ) + { + return KErrNotFound; + } + + TAknLayoutRect oplogoLayout; + + if ( AknStatuspaneUtils::StaconPaneActive() ) + { + // stacon + oplogoLayout.LayoutRect( titlePaneRect, + AknLayoutScalable_Avkon::title_pane_stacon_g2(0).LayoutLine() ); + } + else if ( AknStatuspaneUtils::FlatLayoutActive() ) + { + // flat + oplogoLayout.LayoutRect( titlePaneRect, + AknLayoutScalable_Avkon::title_pane_stacon_g2(0).LayoutLine() ); + } + else + { + // usual idle + oplogoLayout.LayoutRect( titlePaneRect, + AknLayout::Title_pane_elements_Line_1() ); + } + + aSize = oplogoLayout.Rect().Size(); + + + return KErrNone; + } + + +TBool CAiOperatorLogoPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + + if(aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + __PRINTS("CAiOperatorLogoPublisher:: RefreshL >> "); + RefreshL( aClean ); + if( iSuccess ) + { + __PRINTS("CAiOperatorLogoPublisher:: RefreshL << success "); + return ETrue; + } + __PRINTS("CAiOperatorLogoPublisher:: RefreshL << failed "); + } + return EFalse; + } + + +TInt CAiOperatorLogoPublisher::HandleOperatorLogoUpdateL( TAny *aPtr ) + { + __PRINTS("CAiOperatorLogoPublisher:: HandleOperatorLogoUpdateL >> "); + CAiOperatorLogoPublisher* self = static_cast( aPtr ); + + TTelOTALogoUpdate logoUpd; + TTelOTALogoUpdate::TOTALogoUpdatePckg logoUpdPckg( logoUpd ); + + if ( RProperty::Get( + KPSUidPhoneClientServerInformation, + KTelOperatorLogoUpdated, + logoUpdPckg ) == KErrNone ) + { + __PRINT(__DBG_FORMAT("CAiOperatorLogoPublisher:: HandleOperatorLogoUpdateL >> logoUpd.iEvent %d"), logoUpd.iEvent); + if ( logoUpd.iEvent == TTelOTALogoUpdate::EPSTelephonyLogoChanged ) + { + if(self) + { + __PRINTS("CAiOperatorLogoPublisher:: HandleOperatorLogoUpdateL: logo changed "); + self->iCenRep->Set( KSettingsDisplayOperatorLogo, KAIDisplayOperatorLogoOn ); + self->UpdateOperatorLogoL( ETrue ); + } + } + else if ( logoUpd.iEvent == TTelOTALogoUpdate::EPSTelephonyLogoDeleted || + logoUpd.iEvent == TTelOTALogoUpdate::EPSTelephonyAllLogosDeleted ) + { + if(self) + { + __PRINTS("CAiOperatorLogoPublisher:: HandleOperatorLogoUpdateL: logo deleted "); + self->iCenRep->Set( KSettingsDisplayOperatorLogo, KAIDisplayOperatorLogoOff ); + self->UpdateOperatorLogoL( ETrue ); + } + } + + } + __PRINTS("CAiOperatorLogoPublisher:: HandleOperatorLogoUpdateL << "); + return KErrNone; + } + + +TBool CAiOperatorLogoPublisher::RefreshContentWithPriorityL( TInt aContentId, + TInt aPriority ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity && + ( aPriority == EAiOTAOperatorLogo || + aPriority == EAiProgOperatorLogo ) ) + { + __PRINTS("CAiOperatorLogoPublisher:: RefreshContentWithPriorityL >> "); + RefreshL( EFalse ); + if( iSuccess ) + { + __PRINTS("CAiOperatorLogoPublisher:: RefreshContentWithPriorityL << success"); + return ETrue; + } + __PRINTS("CAiOperatorLogoPublisher:: RefreshContentWithPriorityL << failed"); + } + return EFalse; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aioperatornamepublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,710 @@ +/* +* 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: Operator/Service provider name publisher. +* +*/ + + +#include +#include +#include +#include +#include +#include "aioperatornamepublisher.h" +#include "ainetworkinfolistener.h" +#include "aidevicestatuscontentmodel.h" +#include "aiprioritizer.h" +#include "ainwidpriorities.h" +#include "activeidle2domaincrkeys.h" + +//Delay used to animate +const TInt KCleanOperationDelay = 2 * 1000000; + + +const TInt KBitShiftByFour = 4; +const TInt KIsDigitLowLimit = 0; +const TInt KIsDigitHighLimit = 10; + +LOCAL_C void AppendDigit( TDes& aCode, TInt aValue ) + { + // add a digit if valid value. + if ( aValue >= KIsDigitLowLimit && aValue < KIsDigitHighLimit ) + { + aCode.AppendNumUC( static_cast( aValue ) ); + } + } + + +//Convert string to integer. +LOCAL_C TInt StrToInt( const TDesC& aDesc ) + { + TLex lex( aDesc ); + + TInt ret; + TInt err = lex.Val( ret ); + + if( err != KErrNone ) + { + ret = KErrNotFound; + } + return ret; + } + + +// ======== MEMBER FUNCTIONS ======== + +CAiOperatorNamePublisher::CAiOperatorNamePublisher() +: iPriority( EAiInvalidPriority ) + { + } + + +void CAiOperatorNamePublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + } + + +CAiOperatorNamePublisher* CAiOperatorNamePublisher::NewL() + { + CAiOperatorNamePublisher* self = new( ELeave ) CAiOperatorNamePublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiOperatorNamePublisher::~CAiOperatorNamePublisher() + { + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + if( iPeriodic ) + { + iPeriodic->Cancel(); + delete iPeriodic; + } + } + + +void CAiOperatorNamePublisher::ResumeL() + { + iListener->AddObserverL( *this ); + } + + +void CAiOperatorNamePublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& /*aMessage*/, + const TNWInfo& /*aInfo*/, + const TBool aShowOpInd ) + { + if( aShowOpInd ) + { + TRAP_IGNORE ( RefreshL( ETrue )); + } + else + { + TRAP_IGNORE ( + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority )); + } + + } + + +void CAiOperatorNamePublisher::Subscribe( MAiContentObserver& /*aObserver*/, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ) + { + iExtension = &aExtension; + iPrioritizer = &aPrioritizer; + iBroadcaster = &aBroadcaster; + } + + +void CAiOperatorNamePublisher::RefreshL( TBool aClean ) + { + iSuccess = EFalse; + + if( aClean ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iPriority ); + } + + const TNWInfo& nwInfo = iListener->NetworkInfo(); + +#if defined(WINSCW) || defined(__WINS__) + // Show operator name in emulator +#else + if ( nwInfo.iRegistrationStatus == ENWNotRegisteredNoService || + nwInfo.iRegistrationStatus == ENWRegistrationUnknown || + !iListener->IsOperatorIndicatorAllowed() ) + { + return; + } +#endif + + TBool showSimultaneously = EFalse; + + TUid uid = { KCRUidActiveIdleLV }; + CRepository* cenRep = CRepository::NewLC( uid ); + TInt err = cenRep->Get( KAISPNAndEONS, showSimultaneously ); + if( err ) + { + showSimultaneously = EFalse; + } + CleanupStack::PopAndDestroy( cenRep ); + + const TBool isKeyLockEnabled = IsKeyLockEnabled(); + + //Check if PLMN must be shown. + + const TBool showPLMN = nwInfo.iServiceProviderNameDisplayReq & ENWDisplayPLMNRequired; + + TBool isInSPDI = EFalse; + TBool showSPN = EFalse; + + //Check if we are in SPDI and SPN (Service Provider Name) must be shown. + CheckServiceProviderDisplayListStatus( StrToInt( nwInfo.iCountryCode ), + StrToInt( nwInfo.iNetworkId ), + showSPN, + isInSPDI ); + + //SPN must be shown if it is defined in PLMNField or if it is set in service provider name + //display requirements. + showSPN = + showSPN || + ( nwInfo.iServiceProviderNameDisplayReq & ENWDisplaySPNRequired ); + + +#if defined(WINSCW) || defined(__WINS__) + _LIT( KOperator, "Operator" ); + const TPtrC serviceProviderName( KOperator() ); +#else + const TPtrC serviceProviderName = nwInfo.iSPName; +#endif + + if ( ( !IsRoaming() || isInSPDI ) && serviceProviderName.Length() ) + { + if ( showPLMN ) + { + if ( showSimultaneously ) + { + //spn & plmn (SPN.And.EONS) + HBufC* operatorName = ConstructOperatorNameStringL( serviceProviderName ); + CleanupStack::PushL( operatorName ); + + iPriority = EAiServiceProviderName; + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + operatorName->Des(), + iPriority ); + CleanupStack::PopAndDestroy(operatorName); + } + else if( isKeyLockEnabled ) + { + //only plmn + ShowNetworkIdentityNameL( ETrue ); + } + else + { + //spn & plmn (SPN.And.EONS.No) + iPriority = EAiServiceProviderName; + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + serviceProviderName, + iPriority ); + StartDelayedPLMNOperation();//to publish PLMN name + } + } + else + { + //only spn + iPriority = EAiServiceProviderName; + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + serviceProviderName, + iPriority ); + iSuccess = ETrue; + } + } + else + { + if ( showSPN && serviceProviderName.Length() ) + { + if ( showSimultaneously ) + { + //spn & plmn (SPN.And.EONS) + HBufC* operatorName = ConstructOperatorNameStringL( serviceProviderName ); + CleanupStack::PushL( operatorName ); + + iPriority = EAiServiceProviderName; + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + operatorName->Des(), + iPriority ); + CleanupStack::PopAndDestroy(operatorName); + } + else if( isKeyLockEnabled ) + { + //only plmn + ShowNetworkIdentityNameL( ETrue ); + } + else + { + //spn & plmn (SPN.And.EONS.No) + iPriority = EAiServiceProviderName; + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + serviceProviderName, + iPriority ); + StartDelayedPLMNOperation();//to publish PLMN name + } + } + else + { + //only plmn + ShowNetworkIdentityNameL( ETrue ); + } + } + } + +HBufC* CAiOperatorNamePublisher::ConstructOperatorNameStringL( const TDesC& aServiceProviderName ) + { + ShowNetworkIdentityNameL( EFalse ); + + CCoeEnv* coeEnv = CCoeEnv::Static(); + HBufC* opnSpnFormatString = StringLoader::LoadLC( R_AI_OPN_SPN_SEPARATOR_FORMAT, + coeEnv ); + HBufC* opnSpnStringTemp = HBufC::NewLC( iNetworkIdentityName.Length() + + opnSpnFormatString->Length() + + aServiceProviderName.Length() ); + + HBufC* opnSpnString = HBufC::NewLC( iNetworkIdentityName.Length() + + opnSpnFormatString->Length() + + aServiceProviderName.Length() ); + + TPtr opnSpnStringTempPtr = opnSpnStringTemp->Des(); + StringLoader::Format( opnSpnStringTempPtr, + *opnSpnFormatString, + 1, + aServiceProviderName ); + + TPtr opnSpnStringPtr = opnSpnString->Des(); + StringLoader::Format( opnSpnStringPtr, + opnSpnStringTempPtr, + 0, + iNetworkIdentityName ); + + CleanupStack::Pop( opnSpnString ); + CleanupStack::PopAndDestroy( opnSpnStringTemp ); //opnSpnStringTemp, opnSpnFormatString + CleanupStack::PopAndDestroy( opnSpnFormatString ); + + return opnSpnString; + } + + + +void CAiOperatorNamePublisher::ShowNetworkIdentityNameL( TBool aTryToPublish ) + { + const TNWInfo& nwInfo = iListener->NetworkInfo(); + + iNetworkIdentityName.Set( KNullDesC ); + + iPriority = EAiInvalidPriority; + + // *** Network operator name (CPHS-ONS) *** + if( nwInfo.iNPName.Length() > 0 && + nwInfo.iOperatorNameInfo.iType != RMmCustomAPI::EOperatorNameFlexiblePlmn && + nwInfo.iRegistrationStatus == ENWRegisteredOnHomeNetwork ) + { + //priority + iPriority = EAiNetworkOperatorName; + //name + iNetworkIdentityName.Set( nwInfo.iNPName ); + //publish network identity name + if( aTryToPublish ) + { + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iNetworkIdentityName, + iPriority ); + } + + iSuccess = ETrue; + return; + } + + // *** Operator name *** + if( nwInfo.iOperatorNameInfo.iName.Length() > 0 ) + { + //priority + OperatorNamePriority( iPriority ); + //name + iNetworkIdentityName.Set( nwInfo.iOperatorNameInfo.iName ); + //converted name + HBufC* convertedOperatorName = NULL; + + if ( nwInfo.iOperatorNameInfo.iType == RMmCustomAPI::EOperatorNameFlexiblePlmn ) + { + // Long & short name may be in the same buffer. + const TInt separatorPos = iNetworkIdentityName.Locate( KFlexibleNameSeparator ); + if ( separatorPos != KErrNotFound ) + { + convertedOperatorName = nwInfo.iOperatorNameInfo.iName.Left( separatorPos ).AllocLC(); + } + } + else if ( nwInfo.iOperatorNameInfo.iType == + RMmCustomAPI::EOperatorNameMccMnc || + nwInfo.iOperatorNameInfo.iType == + RMmCustomAPI::EOperatorNameCountryMcn ) + { + // Perform display language specific conversion. + convertedOperatorName = nwInfo.iOperatorNameInfo.iName.AllocLC(); + TPtr ptr = convertedOperatorName->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); + } + else + { + // No changes needed. + } + + if ( convertedOperatorName ) + { + iNetworkIdentityName.Set( *convertedOperatorName ); + } + + if( iPriority != EAiInvalidPriority ) + { + //Publish network identity name + if( aTryToPublish ) + { + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iNetworkIdentityName, + iPriority ); + } + + iSuccess = ETrue; + } + + if ( convertedOperatorName ) + { + CleanupStack::PopAndDestroy( convertedOperatorName ); + convertedOperatorName = NULL; + } + + if( iPriority != EAiInvalidPriority ) + { + return; + } + } + + // *** Network info name *** + if( iPriority == EAiInvalidPriority ) + { + //priority + iPriority = EAiOperatorNetInfoName; + + if ( nwInfo.iLongName.Length() > 0 ) + { + iNetworkIdentityName.Set( nwInfo.iLongName ); + } + else if ( nwInfo.iShortName.Length() > 0 ) + { + iNetworkIdentityName.Set( nwInfo.iShortName ); + } + else if ( nwInfo.iDisplayTag.Length() > 0 ) + { + iNetworkIdentityName.Set( nwInfo.iDisplayTag ); + } + else + { + iPriority = EAiInvalidPriority; + } + + //Publish network identity name + if( aTryToPublish ) + { + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + iNetworkIdentityName, + iPriority ); + } + + iSuccess = ETrue; + return; + } + } + + +void CAiOperatorNamePublisher::CheckServiceProviderDisplayListStatus( + TInt aMCC, + TInt aMNC, + TBool& aShowSPN, + TBool& aIsInSPDI ) const + { + + // Not in list by default + aIsInSPDI = EFalse; + aShowSPN = EFalse; + + if ( !CurrentNetworkOk() ) + { + return; + } + + + const TNWInfo& nwInfo = iListener->NetworkInfo(); + + TInt bufferLength = nwInfo.iPLMNField.Length(); + if ( !bufferLength ) + { + return; + } + + const TUint8* field = + reinterpret_cast< const TUint8* >( nwInfo.iPLMNField.Ptr() ); + + TInt octetIndex = 0; + + // Update SPN showing. (in 3GPP a tag). + aShowSPN = static_cast( field[ octetIndex ] ) ? EFalse : ETrue ; + octetIndex++; + + // Number of PLMN pairs. (in 3GPP number of octets). + const TUint8 length = static_cast( ( field[ octetIndex ] ) ); + octetIndex++; + + // Empty list (always with SIM and sometimes with UICC) + if ( !( length > 0 ) ) + { + return; + } + + // Compare MCC&MNC pairs + TNWCountryCode mcc; + TNWIdentity mnc; + + const TUint numberOfPairs = length; // each pair has 3 octets + + for( TUint pair = 0; pair < numberOfPairs; pair++ ) + { + // 1st octet + AppendDigit( mcc, field[ octetIndex ] & 0x0F ); + AppendDigit( mcc, ( field[ octetIndex ] & 0xF0 ) >> KBitShiftByFour ); + octetIndex++; + + // 2nd octet + AppendDigit( mcc, field[ octetIndex ] & 0x0F ); + TInt tmp = ( field[ octetIndex ] & 0xF0 ) >> KBitShiftByFour; + octetIndex++; + + // 3rd octet + AppendDigit( mnc, field[ octetIndex ] & 0x0F ); + AppendDigit( mnc, ( field[ octetIndex ] & 0xF0 ) >> KBitShiftByFour ); + octetIndex++; + + AppendDigit( mnc, tmp ); // mnc 3rd digit. + + TInt imcc = StrToInt( mcc ); + TInt imnc = StrToInt( mnc ); + + if ( ( aMNC == imnc ) && ( aMCC == imcc ) ) + { + // match. + aIsInSPDI = ETrue; + break; + } + + + // Reset + mnc.Zero(); + mcc.Zero(); + } + } + + +TBool CAiOperatorNamePublisher::CurrentNetworkOk() const + { + TBool ok = iListener->MessageReceived( + MNWMessageObserver::ENWMessageNetworkInfoChange ) || + iListener->MessageReceived( + MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ); + + ok = ok & ( iListener->NetworkInfo().iStatus == ENWStatusCurrent ); + + return ok; + } + + +TBool CAiOperatorNamePublisher::IsRoaming() const + { + const TNWInfo& nwInfo = iListener->NetworkInfo(); + + return iListener->MessageReceived( + MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ) && + ( nwInfo.iRegistrationStatus == ENWRegisteredRoaming ); + } + + + +void CAiOperatorNamePublisher::StartDelayedPLMNOperation() + { + if( !iPeriodic->IsActive() ) + { + iPeriodic->Start( KCleanOperationDelay, + 0, + TCallBack( CleanAndShowPLMNOperationCallback, this ) ); + } + } + + +TInt CAiOperatorNamePublisher::CleanAndShowPLMNOperationCallback( TAny* aPtr ) + { + CAiOperatorNamePublisher* self = + static_cast( aPtr ); + + if( self ) + { + TRAP_IGNORE + ( + //clean + self->DoCleanOperationL(); + //show PLMN name + self->ShowNetworkIdentityNameL( ETrue ); + ); + } + + return KErrNone; + } + + +void CAiOperatorNamePublisher::DoCleanOperationL() + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + EAiServiceProviderName ); + iPeriodic->Cancel(); + } + + +TBool CAiOperatorNamePublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity ) + { + RefreshL( aClean ); + if( iSuccess ) + { + return ETrue; + } + } + + return EFalse; + } + + +TBool CAiOperatorNamePublisher::RefreshContentWithPriorityL( + TInt aContentId, + TInt aPriority ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity && aPriority == EAiServiceProviderName ) + { + RefreshL( EFalse ); + if( iSuccess ) + { + return ETrue; + } + } + return EFalse; + } + + +TBool CAiOperatorNamePublisher::OperatorNamePriority( TInt& aPriority ) + { + TBool succeeded = ETrue; + + const TNWInfo& nwInfo = iListener->NetworkInfo(); + + switch ( nwInfo.iOperatorNameInfo.iType ) + { + case RMmCustomAPI::EOperatorNameFlexiblePlmn: + aPriority = EAiFlexiblePLMN; + break; + + case RMmCustomAPI::EOperatorNameNitzFull: + aPriority = EAiNITZ; + break; + + case RMmCustomAPI::EOperatorNameNitzShort: + aPriority = EAiNITZ; + break; + + case RMmCustomAPI::EOperatorNameProgrammableUcs2: + aPriority = EAiUnicodeOperatorName; + break; + + case RMmCustomAPI::EOperatorNameProgrammableLatin: + aPriority = EAiLatinOperatorName; + break; + + case RMmCustomAPI::EOperatorNameHardcodedUcs2: + aPriority = EAiUnicodeOperatorName; + break; + + case RMmCustomAPI::EOperatorNameHardcodedLatin: + aPriority = EAiLatinOperatorName; + break; + + case RMmCustomAPI::EOperatorNameCountryMcn: + aPriority = EAiCountryMNC; + break; + + case RMmCustomAPI::EOperatorNameMccMnc: + aPriority = EAiMCC_MCN; + break; + + default: + aPriority = EAiInvalidPriority; + succeeded = EFalse; + break; + } + return succeeded; + } + +TBool CAiOperatorNamePublisher::IsKeyLockEnabled() + { + TInt value; + TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); + if ( err != KErrNone ) + return EFalse; + switch( value ) + { + case EKeyguardLocked: + case EKeyguardAutolockEmulation: + return ETrue; + case EKeyguardNotActive: + default: + return EFalse; + } + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aiprofilepublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aiprofilepublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,299 @@ +/* +* 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: Profile publisher +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include "aiprofilepublisher.h" +#include "aiprioritizer.h" +#include "ainwidpriorities.h" + +// ======== MEMBER FUNCTIONS ======== + +// PUA code for the timed profile, missing from PUAcodes.hrh +#define KAiTimedProfilePUA 0xF815 + +CAiProfilePublisher::CAiProfilePublisher() : + iLastPublishedProfileId(ENothingPublished), + iLastPublishedProfileSilent( EFalse ), + iLastPublishedProfileTimed( EFalse ) + { + } + + +void CAiProfilePublisher::ConstructL() + { + User::LeaveIfError( iSSSettings.Open() ); + + iProfileEngine = CreateProfileEngineL(); + } + + +CAiProfilePublisher* CAiProfilePublisher::NewL() + { + CAiProfilePublisher* self = new( ELeave ) CAiProfilePublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiProfilePublisher::~CAiProfilePublisher() + { + //TRAP_IGNORE: leaving function called in non-leaving function + TRAP_IGNORE(CleanLastProfileL()); + iSSSettings.CancelAll( *this ); + iSSSettings.Close(); + delete iProfileNotifier; + + if( iProfileEngine ) + { + iProfileEngine->Release(); + } + } + + +void CAiProfilePublisher::ResumeL() + { + User::LeaveIfError( iSSSettings.Open() ); + //Register to listen ALS activation, if ALS status changes, + //profile must be republished. + TInt err = iSSSettings.Register( ESSSettingsAls, *this ); + + if( err == KErrNotSupported || + err == KErrAlreadyExists ) + { + //ALS not supported or already registered, that's fine + err = KErrNone; + } + + User::LeaveIfError( err ); + + //Start to listen profile changes. + delete iProfileNotifier; + iProfileNotifier = NULL; + iProfileNotifier = CProfileChangeNotifyHandler::NewL( this ); + } + + +void CAiProfilePublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& aPrioritizer, + MAiPublisherBroadcaster& aBroadcaster ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + iPrioritizer = &aPrioritizer; + iBroadcaster = &aBroadcaster; + } + + +void CAiProfilePublisher::RefreshL( TBool aClean ) + { + TRAP_IGNORE( RefreshProfileL( aClean ) ); + } + + +void CAiProfilePublisher::PhoneSettingChanged( TSSSettingsSetting aSetting, + TInt /*aNewValue*/ ) + { + if( aSetting == ESSSettingsAls ) + { + //refresh profile, can't do much if it doesn't work + TRAP_IGNORE( RefreshProfileL( ETrue ) ); + } + } + + +void CAiProfilePublisher::HandleActiveProfileEventL( + TProfileEvent aProfileEvent, + TInt /*aProfileId*/ ) + { + //Profile activated or modified. + if( ( aProfileEvent == EProfileNewActiveProfile ) || + ( aProfileEvent == EProfileActiveProfileModified ) ) + { + iActiveProfilePublish = ETrue; + RefreshProfileL( ETrue ); + } + } + + +void CAiProfilePublisher::CleanLastProfileL() + { + if ( iLastPublishedProfileSilent ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentSilentIndicator, + 0 ); + iLastPublishedProfileSilent = EFalse; + } + + if ( iLastPublishedProfileTimed ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentTimedProfileIndicator, + 0 ); + iLastPublishedProfileTimed = EFalse; + } + + if( iLastPublishedProfileId == EGeneralProfilePublished ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentGeneralProfileName, + 0 ); + } + else if( iLastPublishedProfileId == EOfflineProfilePublished ) + { + iPrioritizer->TryToCleanL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + EAiOfflineProfile ); + } + else + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentProfileName, + 0 ); + } + + iLastPublishedProfileId = ENothingPublished; + iActiveProfilePublish = EFalse; + } + + +void CAiProfilePublisher::RefreshProfileL( TBool aClean ) + { + // Profile is changed or Refresh is called for some other reason + // -> re-publish profile + iSuccess = EFalse; + if( !iContentObserver ) + { + return; + } + + MProfile* profile = iProfileEngine->ActiveProfileLC(); + + const MProfileName& name = profile->ProfileName(); + + TInt profileNameId = name.Id(); + + if( ( aClean && iLastPublishedProfileId != profileNameId ) || iActiveProfilePublish ) + { + CleanLastProfileL(); + } + + switch( profileNameId ) + { + case EProfileGeneralId: + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentGeneralProfileName, + name.Name(), + 0 ); + break; + } + + case EProfileOffLineId: + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentGeneralProfileName, + name.Name(), + 0 ); + + iPrioritizer->TryToPublishL( *iBroadcaster, + EAiDeviceStatusContentNetworkIdentity, + name.Name(), + EAiOfflineProfile ); + iSuccess = ETrue; + break; + } + + default: + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentProfileName, + name.Name(), + 0 ); + break; + } + } + + iLastPublishedProfileId = (TLastPublishedProfile)profileNameId; + + if ( iProfileEngine->IsActiveProfileTimedL() ) + { + TBuf<1> timed; // one character + timed.Append( KAiTimedProfilePUA ); + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentTimedProfileIndicator, + timed, + 0 ); + iLastPublishedProfileTimed = ETrue; + } + + //If profile is silent, publish silent indicator. + if( profile->IsSilent() ) + { + TBuf<1> silent; // one character + silent.Append( KPuaCodeSilentSymbol ); + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentSilentIndicator, + silent, + 0 ); + iLastPublishedProfileSilent = ETrue; + } + + CleanupStack::PopAndDestroy();//profile + } + + +TBool CAiProfilePublisher::RefreshL( TInt aContentId, TBool aClean ) + { + switch( aContentId ) + { + case EAiDeviceStatusContentProfileName: + case EAiDeviceStatusContentGeneralProfileName: + case EAiDeviceStatusContentNetworkIdentity: + { + RefreshProfileL( aClean ); + return ETrue; + } + } + return EFalse; + } + + +TBool CAiProfilePublisher::RefreshContentWithPriorityL( TInt aContentId, + TInt aPriority ) + { + if( aContentId == EAiDeviceStatusContentNetworkIdentity && + aPriority == EAiOfflineProfile ) + { + RefreshProfileL( EFalse ); + if( iSuccess ) + { + return ETrue; + } + } + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aipublisherfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aipublisherfactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* 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: Static factory class used to create publishers. +* +*/ + + +#include "aipublisherfactory.h" + +// Publishers +#include "aiprofilepublisher.h" +#include "aidatepublisher.h" +#include "aioperatorlogopublisher.h" +#include "aioperatornamepublisher.h" +#include "aibtsappublisher.h" +#include "aimcnpublisher.h" +#include "aicugpublisher.h" +#include "aivhzpublisher.h" +#include "ainwspublisher.h" +#include "aisimregpublisher.h" +#include "aicugmcnpublisher.h" + +template +class TPublisherFactory + { + public: + MAiDeviceStatusPublisher* CreatePublisherL() + { + //Create publisher.. + MAiDeviceStatusPublisher* publisher = NULL; + TRAPD( err, publisher = T::NewL() ); + + //If publisher creation fails with error code KErrNotSupported, + //return NULL. + if( err == KErrNotSupported ) + { + err = KErrNone; + } + + User::LeaveIfError( err ); + + return publisher; + } + }; + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateProfilePublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateDatePublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateOperatorLogoPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateOperatorNamePublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateBTSAPPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateMCNPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateCUGPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateSimRegPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateNWSPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateVHZPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } + +MAiDeviceStatusPublisher* AiPublisherFactory::CreateCUGMCNPublisherL() + { + TPublisherFactory factory; + return factory.CreatePublisherL(); + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aipublishprioritizer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 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: Network identity related prioritizer. +* +*/ + + +#include "aipublishprioritizer.h" +#include "ainwidpriorities.h" +#include "aidevicestatuscontentmodel.h" +#include +#include "aipropertyextension.h" +#include "aipublisherbroadcaster.h" +#include "debug.h" + + +CAiPublishPrioritizer::CAiPublishPrioritizer( + MAiContentObserver& aContentObserver, + MAiPropertyExtension& aPropertyExtension ) + : iContentObserver( aContentObserver ), + iPropertyExtension( aPropertyExtension ), + iPriority( EAiInvalidPriority ) + { + } + + +CAiPublishPrioritizer* CAiPublishPrioritizer::NewL( + MAiContentObserver& aContentObserver, + MAiPropertyExtension& aPropertyExtension ) + { + return new( ELeave ) CAiPublishPrioritizer( aContentObserver, + aPropertyExtension ); + } + + +CAiPublishPrioritizer::~CAiPublishPrioritizer() + { + } + + +void CAiPublishPrioritizer::TryToPublishL( MAiPublisherBroadcaster& /*aBroadcaster*/, + TInt aContent, + TInt aResource, + TInt aPriority ) + { + if( aPriority >= iPriority ) + { + iPriority = aPriority; + (void)iContentObserver.Publish( iPropertyExtension, + aContent, + aResource, + 0 ); + } + } + + +void CAiPublishPrioritizer::TryToPublishL( MAiPublisherBroadcaster& /*aBroadcaster*/, + TInt aContent, + const TDesC16& aText, + TInt aPriority ) + { + __PRINT(__DBG_FORMAT("XAI: prio publish - content %d, priority %d, text %S"), aContent, aPriority, &aText ); + + if( aPriority >= iPriority ) + { + __PRINTS("XAI: prio publish - priority check ok"); + iPriority = aPriority; + (void)iContentObserver.Publish( iPropertyExtension, + aContent, + aText, + 0 ); + } + + __PRINTS("XAI: prio publish - done"); + } + + +void CAiPublishPrioritizer::TryToPublishL( MAiPublisherBroadcaster& /*aBroadcaster*/, + TInt aContent, + const TDesC8& aBuf, + TInt aPriority ) + { + if( aPriority >= iPriority ) + { + iPriority = aPriority; + (void)iContentObserver.Publish( iPropertyExtension, + aContent, + aBuf, + 0 ); + } + } + + +void CAiPublishPrioritizer::TryToCleanL( MAiPublisherBroadcaster& aBroadcaster, + TInt aContent, + TInt aPriority ) + { + __PRINT(__DBG_FORMAT("XAI: prio clean - content %d, priority %d"), aContent, aPriority ); + if( aPriority == EAiInvalidPriority ) + { + // do nothing + return; + } + + else if( aPriority == iPriority ) + { + __PRINTS("XAI: prio clean - priority matched"); + // Clean the current content... + (void)iContentObserver.Clean( iPropertyExtension, aContent, 0 ); + + TInt currentPriority = iPriority; + iPriority = EAiInvalidPriority; + + TBool refreshed = EFalse; + while( --currentPriority != EAiInvalidPriority && !refreshed ) + { + __PRINT(__DBG_FORMAT("XAI: prio clean - refreshing %d"), currentPriority ); + refreshed = aBroadcaster.RefreshPriorizedPublishersL( aContent, + currentPriority ); + if( refreshed ) + { + __PRINTS("XAI: prio clean - refresh success"); + } + else + { + __PRINTS("XAI: prio clean - refresh failed"); + } + } + } + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aisimregpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aisimregpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,190 @@ +/* +* 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: SIM registration status publisher +* +*/ + + +#include "aisimregpublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" +#include +#include + +#include + +// ======== LOCAL FUNCTIONS ======= + +TBool AllowedToShowSimRegFailed() + { + TInt simCardStatus = ESimStatusUninitialized; + TInt err = RProperty::Get( KPSUidStartup, KPSSimStatus, simCardStatus ); + + // Show note only when the SIM is usable + if( err == KErrNone && simCardStatus == ESimUsable ) + { + return ETrue; + } + return EFalse; + } + + +// ======== MEMBER FUNCTIONS ======== + +CAiSimRegPublisher::CAiSimRegPublisher() + { + } + + +void CAiSimRegPublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + } + + +CAiSimRegPublisher* CAiSimRegPublisher::NewL() + { + CAiSimRegPublisher* self = new( ELeave ) CAiSimRegPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiSimRegPublisher::~CAiSimRegPublisher() + { + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + } + + +void CAiSimRegPublisher::ResumeL() + { + iListener->AddObserverL( *this ); + } + + +void CAiSimRegPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiSimRegPublisher::RefreshL( TBool /*aClean*/ ) + { + TInt status = EPSSimRegFailedMessageNotReceived; + RProperty::Get( + KPSUidAiInformation, + KActiveIdleSimRegFailedReceived, + status ); + //this cannot be refreshed + switch( iListener->NetworkInfo().iRegistrationStatus ) + { + case ENWRegistrationUnknown: + case ENWNotRegisteredNoService: + case ENWNotRegisteredEmergencyOnly: + case ENWRegistrationDenied: // fallthrough + { + if( status == EPSSimRegFailedMessageReceived && + ::AllowedToShowSimRegFailed() ) + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentSIMRegStatus, + EAiDeviceStatusResourceSIMRegFail, + 0 ); + } + break; + } + case ENWRegisteredOnHomeNetwork: + case ENWRegisteredRoaming: + case ENWRegisteredBusy: // fallthrough + { + if( status == EPSSimRegFailedMessageReceived ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentSIMRegStatus, + 0 ); + } + break; + } + default: + { + // no op + break; + } + } + } + + +void CAiSimRegPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& aInfo, + const TBool /*aShowOpInd*/ ) + { + if ( aMessage == + MNWMessageObserver::ENWMessageNetworkConnectionFailure && + ::AllowedToShowSimRegFailed()) + { + + // SIM registration failed. Publish SIM registration status. + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentSIMRegStatus, + EAiDeviceStatusResourceSIMRegFail, + 0 ); + RProperty::Set( + KPSUidAiInformation, + KActiveIdleSimRegFailedReceived, + EPSSimRegFailedMessageReceived ); + } + + else if ( aMessage == + MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ) + { + switch ( aInfo.iRegistrationStatus ) + { + case ENWRegisteredOnHomeNetwork: + case ENWRegisteredRoaming: + case ENWRegisteredBusy: + { + //Call clean if registration is fine. + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentSIMRegStatus, + 0 ); + break; + } + default: + break; + } + } + } + + +TBool CAiSimRegPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentSIMRegStatus ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/devicestatus/src/aivhzpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/devicestatus/src/aivhzpublisher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,149 @@ +/* +* 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: Viag Home Zone (VHZ) publisher. +* +*/ + + +#include +#include "activeidle2domaincrkeys.h" +#include "aivhzpublisher.h" +#include "aicontentobserver.h" +#include "ainetworkinfolistener.h" + + +// ======== MEMBER FUNCTIONS ======== + +CAiVHZPublisher::CAiVHZPublisher() + { + } + + +void CAiVHZPublisher::ConstructL() + { + iListener = CAiNetworkInfoListener::InstanceL(); + + CRepository* rep = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + CleanupStack::PushL( rep ); + + TBool value = EFalse; + TInt err = rep->Get( KAIVHZInMainpane, value ); + if( err == KErrNone ) + { + iVhzInMainpane = value; + } + CleanupStack::PopAndDestroy( rep ); + } + + +CAiVHZPublisher* CAiVHZPublisher::NewL() + { + CAiVHZPublisher* self = new( ELeave ) CAiVHZPublisher; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CAiVHZPublisher::~CAiVHZPublisher() + { + if( iListener ) + { + iListener->RemoveObserver( *this ); + iListener->Release(); + } + } + + +void CAiVHZPublisher::ResumeL() + { + iListener->AddObserverL( *this ); + } + + +void CAiVHZPublisher::Subscribe( MAiContentObserver& aObserver, + MAiPropertyExtension& aExtension, + MAiPublishPrioritizer& /*aPrioritizer*/, + MAiPublisherBroadcaster& /*aBroadcaster*/ ) + { + iContentObserver = &aObserver; + iExtension = &aExtension; + } + + +void CAiVHZPublisher::RefreshL( TBool /*aClean*/ ) + { + const TNWInfo& nwInfo = iListener->NetworkInfo(); + + //Check if the Viag indicator in network info is different than none... + if( nwInfo.iViagIndicatorType != ENWViagIndicatorTypeNone ) + { + //... and then publish it. + if( !iVhzInMainpane ) + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentVHZIndicator, + nwInfo.iViagTextTag, + 0 ); + } + else + { + iContentObserver->Publish( *iExtension, + EAiDeviceStatusContentVHZText, + nwInfo.iViagTextTag, + 0 ); + } + } + else + { + if( !iVhzInMainpane ) + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentVHZIndicator, + 0 ); + } + else + { + iContentObserver->Clean( *iExtension, + EAiDeviceStatusContentVHZText, + 0 ); + } + } + } + + +void CAiVHZPublisher::HandleNetworkInfoChange( + const MNWMessageObserver::TNWMessages& aMessage, + const TNWInfo& /*aInfo*/, + const TBool /*aShowOpInd*/ ) + { + //if home zone message has arrived, call refresh + if ( aMessage == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage ) + { + TRAP_IGNORE( RefreshL( ETrue ) ); + } + } + + +TBool CAiVHZPublisher::RefreshL( TInt aContentId, TBool aClean ) + { + if( aContentId == EAiDeviceStatusContentVHZIndicator ) + { + RefreshL( aClean ); + return ETrue; + } + + return EFalse; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/group/aidevstaplg.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/group/aidevstaplg.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#include +#include + +TARGET aidevstaplg.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x102750F7 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../devicestatus/src +SOURCE aidevicestatusplugin.cpp +SOURCE aidevicestatuspluginengine.cpp +SOURCE aimulticontentobserver.cpp +SOURCE aiprofilepublisher.cpp +SOURCE aidatepublisher.cpp +SOURCE aipublisherfactory.cpp +SOURCE ainetworkinfolistener.cpp +SOURCE aioperatornamepublisher.cpp +SOURCE aibtsappublisher.cpp +SOURCE aisimregpublisher.cpp +SOURCE aimcnpublisher.cpp +SOURCE aicugpublisher.cpp +SOURCE aicugmcnpublisher.cpp +SOURCE aivhzpublisher.cpp +SOURCE aipublishprioritizer.cpp +SOURCE aicontentobserveroptimizer.cpp +SOURCE aioperatorlogopublisher.cpp +SOURCE ainwspublisher.cpp + +START RESOURCE aidevstaplg.rss +TARGET aidevstaplg.rsc +END + +START RESOURCE aidevstaplgres.rss +HEADER +TARGET aidevstaplgres.rsc +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END + +USERINCLUDE . + +USERINCLUDE ../devicestatus/inc +USERINCLUDE ../devicestatus/loc +USERINCLUDE ../../inc/common +USERINCLUDE ../../cenrep + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY sssettings.lib +LIBRARY profileeng.lib +LIBRARY networkhandling.lib +LIBRARY phoneclient.lib +LIBRARY fbscli.lib +LIBRARY cone.lib +LIBRARY commonengine.lib +LIBRARY featmgr.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY egul.lib +LIBRARY aknlayout2scalable.lib +LIBRARY cdlengine.lib +LIBRARY gdi.lib +LIBRARY bitgdi.lib +LIBRARY aiutils.lib +LIBRARY flogger.lib +LIBRARY bafl.lib + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/group/aiwsplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/group/aiwsplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,60 @@ +/* +* 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: This is project specification for idle window server plug- +* in. The plug-in provides service for routing of numeric key +* events to Phone application and activation of key lock. +* +*/ + +#include + +TARGET aiwsplugin.dll +TARGETTYPE ANI +UID 0x10003B22 0x10207206 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE ../wsplugin/inc +USERINCLUDE ../../inc/common +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../wsplugin/src +SOURCE aiwspluginanimdll.cpp +SOURCE aiwspluginanim.cpp +SOURCE modifierkeytracker.cpp +SOURCE keylockhandler.cpp +SOURCE keylockstates.cpp +SOURCE keypadsettings.cpp +SOURCE numerickeyhandler.cpp +SOURCE logslaunchhandler.cpp +SOURCE sindlaunchhandler.cpp +SOURCE keyhandlertimer.cpp +SOURCE panic.cpp + + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib +LIBRARY centralrepository.lib +LIBRARY flogger.lib + +LIBRARY featmgr.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY ptiengine.lib +LIBRARY keylockpolicyapi.lib + +LIBRARY aiutils.lib + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 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: Bld.inf for all plugins under ActiveIdle2 project. +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +aidevstaplg.mmp +aiwsplugin.mmp + +PRJ_EXPORTS +../wsplugin/rom/aiwsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiwsplugin.iby) + +// Include bld.inf-files of new plugins here + +#include "../shortcutplugin/group/bld.inf" +//#include "../pslnactiveidleplugin/group/bld.inf" +#include "../profileplugin/group/bld.inf" +#include "../sapidataplugin/group/bld.inf" +#include "../wrtdataplugin/group/bld.inf" +#include "../mcsplugin/group/bld.inf" + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/commoninc/mcspluginwatcher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 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 __MCSPLUGINWATCHER_H +#define __MCSPLUGINWATCHER_H + +#include + +class CMenuOperation; +class CMCSPluginEngine; + +/** + * @ingroup group_mcsplugin + * + * MCS Plugin Watcher Observer + * + * @since S60 9.1 + */ +class MMCSPluginWatcherObserver + { + public: + /** + * HandleNotifyL + */ + virtual void HandleNotifyL() = 0; + }; + +/** + * @ingroup group_mcsplugin + * + * This class implements MCS menu action watcher for async calls. + * + * @since S60 9.1 + */ +class CMCSPluginWatcher: public CActive + { + public: + + /** + * enum Type + */ + enum Type + { + EOperation, + ENotify + }; + + /** + * Two-phased constructor. + * + * @param aType + */ + static CMCSPluginWatcher* NewL( const Type& aType ); + + /** + * Destructor. + */ + virtual ~CMCSPluginWatcher(); + + /** + * Watch menu operation or notification. + * + * @param aOperation + */ + void Watch( CMenuOperation* aOperation = NULL ); + + /** + * WatchNotify + * + * @param aObserver + */ + void WatchNotify( MMCSPluginWatcherObserver* aObserver ); + + /** + * StopAndWatch + * + * @param aOperation + * @param aWaitScheduler + */ + void StopAndWatch( CMenuOperation* aOperation, + CActiveSchedulerWait* aWaitScheduler ); + + /** + * GetStatus + */ + TInt GetStatus(); + + private: + + /** + * Default constructor. + * + * @param aType + */ + CMCSPluginWatcher( const Type& aType ); + + /** + * ConstructL + */ + void ConstructL(); + + /** + * Inherited from CActive class + */ + void RunL(); + + /** + * Inherited from CActive class + */ + void DoCancel(); + + private: + + /** + * Menu operation + * Owned + */ + CMenuOperation* iOperation; + + /** + * Wait scheduler + * Not owned + */ + CActiveSchedulerWait* iWaitScheduler; + + /** + * Observer reference + * Not owned + */ + MMCSPluginWatcherObserver* iObserver; + + /** + * iType + */ + Type iType; + }; + +#endif /*__MCSPLUGINWATCHER_H*/ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/commonsrc/mcspluginwatcher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 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: Menu item operation watcher. +* +*/ + +#include +#include "mcspluginwatcher.h" +#include "../publisher/inc/mcspluginengine.h" + +// --------------------------------------------------------------------------- +// two-phased constructor +// --------------------------------------------------------------------------- +CMCSPluginWatcher* CMCSPluginWatcher::NewL( const Type& aType ) + { + CMCSPluginWatcher* self = new (ELeave) CMCSPluginWatcher( aType ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// default constructor +// --------------------------------------------------------------------------- +CMCSPluginWatcher::CMCSPluginWatcher( const Type& aType ) + : CActive( CActive::EPriorityStandard ), + iType( aType ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// destructor +// --------------------------------------------------------------------------- +CMCSPluginWatcher::~CMCSPluginWatcher() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// second phase constructor +// --------------------------------------------------------------------------- +void CMCSPluginWatcher::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// Watch Async +// --------------------------------------------------------------------------- +void CMCSPluginWatcher::Watch( CMenuOperation* aOperation) + { + __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); + //__ASSERT_DEBUG( !iOperation, User::Invariant() ); + iOperation = aOperation; + SetActive(); + } + +// --------------------------------------------------------------------------- +// Watch Async +// --------------------------------------------------------------------------- +void CMCSPluginWatcher::WatchNotify( MMCSPluginWatcherObserver* aObserver ) + { + __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); + //__ASSERT_DEBUG( !iOperation, User::Invariant() ); + iObserver = aObserver; + SetActive(); + } + +void CMCSPluginWatcher::StopAndWatch( CMenuOperation* aOperation, + CActiveSchedulerWait* aWaitScheduler ) + { + __ASSERT_DEBUG( KRequestPending == iStatus.Int(), User::Invariant() ); + iWaitScheduler = aWaitScheduler; + iOperation = aOperation; + SetActive(); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSPluginWatcher::RunL() + { + delete iOperation; + iOperation = NULL; + + if( iType == ENotify ) + { + iObserver->HandleNotifyL(); + } + if ( iWaitScheduler && iWaitScheduler->IsStarted() ) + { + Cancel(); + iWaitScheduler->AsyncStop(); + } + //CActiveScheduler::Stop(); + } + +// --------------------------------------------------------------------------- +// Inherited from CActive class +// --------------------------------------------------------------------------- +void CMCSPluginWatcher::DoCancel() + { + delete iOperation; + iOperation = NULL; + } + +TInt CMCSPluginWatcher::GetStatus() + { + return iStatus.Int(); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcsplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcsplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 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: Registry info + * +*/ + + +// INCLUDES +#include +#include "mcspluginuids.hrh" + + +// ----------------------------------------------------------------------------- +// +// registry_info +// Registry information required for identifying the ECOM component +// +// ----------------------------------------------------------------------------- +// + +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = AI_UID_ECOM_DLL_CONTENTPUBLISHER_MCSPLUGIN; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN; + version_no = 1; + display_name = "MCS plug-in"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; +} + + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcspluginhandler.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcspluginhandler.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include "mcspluginuids.hrh" +#include + +#define str_datatype_shortcut "menu:shortcut" + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = AI_UID_ECOM_DLL_MCSPLUGIN_HANDLER; + interfaces = + { + INTERFACE_INFO + { + interface_uid = MENU_HANDLER_IF_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_MCSPLUGIN_HANDLER; + version_no = 1; + display_name = ""; + default_data = str_datatype_shortcut; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcspluginres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcspluginres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 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: Resource definitions for MCS plug-in settings +* +*/ + + +#include +#include +#include +#include +#include + +#include + + +NAME MCPL + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="MCPL"; } + +//---------------------------------------------------- +// EIK_APP_INFO +// Contains application information. +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO +{ +} + +//---------------------------------------------------- +// R_MCS_DISABLE_OPEN_ITEM +// Contains application information. +//---------------------------------------------------- +// +RESOURCE TBUF r_mcs_disable_open_item +{ + buf = qtn_mcs_disable_open_item; +} + +//---------------------------------------------------- +// R_MCS_DISABLE_OPEN_ITEM_DLG +// Contains application information. +//---------------------------------------------------- +// +RESOURCE DIALOG r_mcs_disable_open_item_dlg +{ + flags = EAknWarningNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_INFO_ANIM; + }; + } + }; +} + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcspluginsettings.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcspluginsettings.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: ECOM plug-in resource file +* +*/ + + +#include + +#include "mcspluginuids.hrh" + +// --------------------------------------------------------------------------- +// registry_info +// +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = AI_UID_ECOM_DLL_SETTINGS_MCSPLUGIN; + + // Interface info array. + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface. + interface_uid = 0x10207236; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN; + version_no = 1; + display_name = "MCSplugin"; + default_data = "0x1020723B"; // Parent UID (PrslnPlugin) + opaque_data = "-1"; // Order number + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcspluginsettingsres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcspluginsettingsres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2009 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: Resource definitions for MCS plug-in settings +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "mcspluginsettings.hrh" + + +NAME MCSE + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="MCSE"; } + +//---------------------------------------------------- +// EIK_APP_INFO +// Contains application information. +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO +{ +} + +//---------------------------------------------------- +// r_ai_mcs_settings_menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_ai_mcs_settings_menubar +{ + titles = + { + MENU_TITLE { menu_pane = r_ai_mcs_settings_menupane; } + }; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_menupane +// Options menu. +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_ai_mcs_settings_menupane +{ + items = + { + MENU_ITEM + { + command = EAiScutSettingsCmdChange; + txt = qtn_options_change; + } + +#ifdef __SERIES60_HELP + , + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + } +#endif // __SERIES60_HELP + , + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_view +// Settings views. +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_ai_mcs_settings_view +{ + menubar = r_ai_mcs_settings_menubar; + //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + cba = r_scut_softkeys_options_back_change; +} + +//---------------------------------------------------- +// r_ai_mcs_setting_listbox +// Common listbox editor resource for setting pages. +//---------------------------------------------------- +// +RESOURCE LISTBOX r_ai_mcs_setting_listbox +{ + flags = EEikListBoxMultipleSelection; +} + +//---------------------------------------------------- +// r_ai_mcs__settings_applist_page +// Selection key idle softkey setting page. +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_ai_mcs_settings_applist_page +{ + number = EAknSettingPageNoOrdinalDisplayed; + // label = qtn_set_idle_selec_key; + // note: default cba resource is ok_cancel_select + //softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; + type = EAknSetListBox; + editor_resource_id = r_ai_mcs_setting_listbox; +} + +//---------------------------------------------------- +// r_ai_mcs_change_to_page_lbx +// "Change To" setting page. +//---------------------------------------------------- +// +RESOURCE ARRAY r_ai_mcs_change_to_page_lbx +{ + items = + { + LBUF { txt = qtn_ai_mcs_set_change_apps; }, + LBUF { txt = qtn_ai_mcs_set_change_bookmark; } + + // Only this menu option disabled. + // The implementation of url functionality still exists in code, + // even though this option has been decided to remove due to better + // usability. Affects lots of code if removed entirely. + /*, + LBUF { txt = qtn_ai_mcs_set_change_url; }*/ + }; +} + +//---------------------------------------------------- +// r_ai_mcs_listquery_change_to_page +// "Change To" setting page. +//---------------------------------------------------- +// +RESOURCE AVKON_LIST_QUERY r_ai_mcs_listquery_change_to_page +{ + softkeys=R_AVKON_SOFTKEYS_SELECT_CANCEL; + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + heading = qtn_ai_mcs_set_change_prompt; + listbox = AVKON_LIST_QUERY_LIST + { + // array of items will be defined dynamically + }; + }; + } + }; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_view_caption +// View caption for plug-in. max 256 +//---------------------------------------------------- +// +RESOURCE TBUF r_ai_mcs_settings_view_caption +{ + buf = qtn_ai_mcs_set_pers_shortcuts; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_view_title +// View title. +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_ai_mcs_settings_view_title +{ + txt = qtn_ai_mcs_set_title_pers_shortcuts; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_txt_fixed_item +// Text used in information note when attempting +// to change a read-only shortcut +//---------------------------------------------------- +// +RESOURCE TBUF r_ai_mcs_settings_txt_fixed_item +{ + buf = qtn_ai_mcs_set_app_note_fixed; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_txt_all_fixed +// Text for empty listbox item +//---------------------------------------------------- +// +RESOURCE TBUF r_ai_mcs_settings_txt_all_fixed +{ + buf = qtn_ai_mcs_set_all_fixed; +} + +//---------------------------------------------------- +// r_ai_mcs_settings_txt_linkn +// +//---------------------------------------------------- +// +RESOURCE TBUF r_ai_mcs_settings_txt_linkn +{ + buf = qtn_ai_mcs_set_myt_linkn; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_scut_softkeys_options_back_change +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } + }; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_scut_softkeys_options_exit_change +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyExit; txt = text_softkey_exit; }, + CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/data/mcspluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/data/mcspluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2005-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: UIDs for the Active Idle subsystem components. +* +*/ + + +#ifndef MCSPLUGINUIDS_HRH +#define MCSPLUGINUIDS_HRH + +#include + +/** + * Ecom dll uid for MCS plug-in. + */ +#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_MCSPLUGIN 0x2001CB57 + +/** + * Ecom implementation uid for MCS plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN 0x2001CB58 + +/** + * Ecom dll uid for MCS settings plug-in. + */ +#define AI_UID_ECOM_DLL_SETTINGS_MCSPLUGIN 0x20022FDC + +/** + * Ecom implementation uid for MCS settings plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN 0x20022FDD + +/** + * Ecom dll uid for MCS handler plug-in. + */ +#define AI_UID_ECOM_DLL_MCSPLUGIN_HANDLER 0x20022FDE + +/** + * Ecom implementation uid for MCS handler plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_MCSPLUGIN_HANDLER 0x20022FDF + +#endif //MCSPLUGINUIDS_HRH diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 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: The build information file of Profile Plugin +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI +#include + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../loc/mcspluginsettings.loc MW_LAYER_LOC_EXPORT_PATH(mcspluginsettings.loc) +../loc/mcsplugin.loc MW_LAYER_LOC_EXPORT_PATH(mcsplugin.loc) + + +../rom/mcsplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(mcsplugin_resources.iby) +../rom/mcsplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mcsplugin.iby) + +../handler/inc/mcspluginparamval.h MW_LAYER_PLATFORM_EXPORT_PATH(mcspluginparamval.h) + +qgn_mcsplugin_log_out.svg /epoc32/s60/icons/qgn_mcsplugin_log_out.svg + + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE aimcsplugin.mif +OPTION HEADERFILE aimcsplugin.mbg +OPTION SOURCES -c8,8 qgn_prop_ai_shortcut -c8,8 qgn_menu_url \ + -c8,8 qgn_menu_mce_sel_mes -c8,8 qgn_menu_mce_syncmail \ + -c8,8 qgn_menu_am -c8,8 qgn_prop_cp_conn_shortcut \ + -c8,8 qgn_prop_psln_ai_sub -c8,8 qgn_mcsplugin_log_out +END + + +PRJ_MMPFILES +mcsplugin.mmp +mcspluginsettings.mmp +mcspluginhandler.mmp + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/group/mcsplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/group/mcsplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2005-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: Project definition file for project ProfilePlugin +* +*/ + +#include +#include + +#include "../data/mcspluginuids.hrh" + +TARGET mcsplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_CONTENTPUBLISHER_MCSPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../publisher/src +SOURCE mcsplugin.cpp +SOURCE mcspluginengine.cpp +SOURCE mcsplugindata.cpp +SOURCEPATH ../commonsrc +SOURCE mcspluginwatcher.cpp + +USERINCLUDE ../publisher/inc +USERINCLUDE ../loc +USERINCLUDE ../data +USERINCLUDE ../commoninc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE mcsplugin.rss +TARGET mcsplugin.rsc +END + +START RESOURCE mcspluginres.rss +HEADER +TARGET mcspluginres.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END +LIBRARY euser.lib +LIBRARY mcsmenu.lib +LIBRARY mcsextendedmenu.lib +LIBRARY egul.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY aiutils.lib +LIBRARY aknskins.lib +LIBRARY aknicon.lib +LIBRARY mcsmenuutils.lib +LIBRARY hspluginsettings.lib +LIBRARY msgs.lib +LIBRARY apgrfx.lib +LIBRARY apparc.lib + + +LIBRARY bafl.lib +LIBRARY avkon.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY efsrv.lib +LIBRARY fbscli.lib +LIBRARY gslauncher.lib +LIBRARY eikdlg.lib +LIBRARY commonengine.lib +LIBRARY favouritesengine.lib + +LIBRARY gfxtrans.lib + + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/group/mcspluginhandler.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/group/mcspluginhandler.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include +#include "../data/mcspluginuids.hrh" + +TARGET mcspluginhandler.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_MCSPLUGIN_HANDLER + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../handler/src + +SOURCE mcspluginhandler.cpp +SOURCE mcsplugincompletedoperation.cpp + +USERINCLUDE ../data +USERINCLUDE ../handler/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY cone.lib +LIBRARY mcsmenu.lib +LIBRARY mcsmenuutils.lib +LIBRARY sendui.lib +LIBRARY viewcli.lib +LIBRARY apparc.lib +LIBRARY apgrfx.lib + +SOURCEPATH ../data +START RESOURCE mcspluginhandler.rss +TARGET mcspluginhandler.rsc +END // RESOURCE + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/group/mcspluginsettings.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 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: Project definition file for project MCSPlugin settings +* +*/ + + +#include + +#include + +#include "../data/mcspluginuids.hrh" + + +TARGET mcspluginsettings.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_SETTINGS_MCSPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../settings/src +SOURCE mcspluginsettings.cpp +SOURCE mcspluginsettingscontainer.cpp +SOURCE mcspluginsettingsmodel.cpp +SOURCE mcspluginsettingsapplist.cpp +SOURCE mcspluginsettingsbkmlist.cpp +SOURCEPATH ../commonsrc +SOURCE mcspluginwatcher.cpp + +USERINCLUDE ../settings/inc +USERINCLUDE ../commoninc +USERINCLUDE ../data + +SOURCEPATH ../data +START RESOURCE mcspluginsettings.rss +TARGET mcspluginsettings.rsc +END + +START RESOURCE mcspluginsettingsres.rss +HEADER +TARGET mcspluginsettingsres.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY cdlengine.lib +//LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY gsecomplugin.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY inetprotutil.lib // For TUriParser +//LIBRARY apgrfx.lib // For RApaLsSession +//LIBRARY apparc.lib // For TApaAppInfo +LIBRARY msgs.lib // For Message Server +LIBRARY platformenv.lib // For PathInfo +LIBRARY hlplch.lib // for HlpLauncher +LIBRARY featmgr.lib // For feature manager +LIBRARY favouritesengine.lib +//LIBRARY javaregistryclient.lib // For JavaRegistry +#ifdef __WEB_WIDGETS +//LIBRARY widgetregistryclient.lib +#endif + +// Debugging dependencies +//LIBRARY flogger.lib +LIBRARY mcsmenu.lib +LIBRARY hspluginsettings.lib +LIBRARY aiutils.lib + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/group/qgn_mcsplugin_log_out.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/group/qgn_mcsplugin_log_out.svg Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/handler/inc/mcsplugincompletedoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/handler/inc/mcsplugincompletedoperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of completed menu operation +* +*/ + + +#ifndef __MCSPLUGINCOMPLETEDOPERATION_H__ +#define __MCSPLUGINCOMPLETEDOPERATION_H__ + +#include +#include + +class RMenu; + +/** + * @ingroup group_mcsplugin + * + * Completed CMenuOperation. + * Utility class to wrap synchronous functionality as asynchronous menu + * operation. Used in CMenuHandlers and other menu operations where the + * API requires an asynchronous operation but the concrete functionality + * is synchronous and the result is already available. + * @lib mcsmenu.lib + * @since S60 v9.1 + */ +NONSHARABLE_CLASS( CMCSPluginCompletedOperation ): public CMenuOperation + { + +public: + + /** + * Destructor. + */ + virtual ~CMCSPluginCompletedOperation(); + + /** + * Two-phased constructor. Constructs an operation that is already complete. + * @param aMenu Menu. + * @param aPriority Active Object priority. + * @param aStatus Observer request status. Completes with aError. + * @param aError Completion code (result of the operation). + * @return Asynchronous operation. Owned by the caller. + */ + static CMCSPluginCompletedOperation* NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + TInt aError ); + +private: + + /** + * Constructor + * @param aMenu Menu. + * @param aPriority Active Object priority. + * @param aStatus Observer request status. + */ + CMCSPluginCompletedOperation( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus ); + + /** + * Report completion. + * @param aError Completion code (result of the operation). + */ + void ReportCompletion( TInt aError ); + +// from base class CActive + + /** + * Report completion to observer. + */ + void RunL(); + + /** + * Cancel object (never called). + */ + void DoCancel(); + + /** + * Handle error. + * @param aError Error code. + * @return KErrNone. + */ + TInt RunError( TInt aError ); + + }; + +#endif // __MCSPLUGINCOMPLETEDOPERATION_H__ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/handler/inc/mcspluginhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/handler/inc/mcspluginhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 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 __MCSPLUGINHANDLER_H__ +#define __MCSPLUGINHANDLER_H__ + +#include + +#include +#include // For CVwsSessionWrapper +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +#include // For TVwsViewId + + +class CEikonEnv; +class CVwsSessionWrapper; + +/** + * @ingroup group_mcsplugin + * +* Handler for menu items of type "menu:shortcut" "menu:folder" and "menu:suite". + * + * @since S60 9.1 +*/ +NONSHARABLE_CLASS( CMCSPluginHandler ): public CMenuHandlerPlugin + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMCSPluginHandler(); + + /** + * Two-phased constructor. Leaves on failure. + * @param aMenu Menu. + * @return The constructed object. + */ + static CMCSPluginHandler* NewL( RMenu &aMenu ); + +protected: // construction + + /** + * Constructor. + * @param aMenu Menu. + */ + CMCSPluginHandler( RMenu &aMenu ); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +public: // from CMenuHandler + + /** + * Query support for item type. + * @param aType Type. + * @return ETrue if handler supports this type, EFalse otherwise. + */ + TBool SupportsType( const TDesC& aType ); + + /** + * Handle command. + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: // internal + + void LaunchShortcutL( CMenuItem& aItem ); + +private: // data + + CEikonEnv* iEikEnv; + + /** + * View server session wrapper. + * Own + */ + CVwsSessionWrapper* iVwsSession; + + }; + +#endif // __MCSPLUGINHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/handler/inc/mcspluginparamval.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/handler/inc/mcspluginparamval.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 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 __MCSPLUGINPARAMVAL_H__ +#define __MCSPLUGINPARAMVAL_H__ + + +/** Parameter value for new message shortcuts. */ +_LIT( KParamValueSelType, "messaging:seltype" ); + +/** Parameter value for new message shortcuts. */ +_LIT( KParamValueMsg, "messaging:msg" ); + +/** Parameter value for new email shortcuts */ +_LIT( KParamValueEmail, "messaging:email" ); + +/** Parameter value for new syncml mail shortcuts */ +_LIT( KParamValueSyncMLMail, "messaging:syncmlmail" ); + +/** Parameter value for new postcard shortcuts */ +_LIT( KParamValuePostcard, "messaging:postcard" ); + +/** Parameter value for new audio message shortcuts */ +_LIT( KParamValueAudioMsg, "messaging:audiomsg" ); + +/** Parameter value for mailbox shortcuts */ +_LIT( KParamValueMailbox, "mailbox:" ); + +#endif // __MCSPLUGINPARAMVAL_H__ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/handler/src/mcsplugincompletedoperation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/handler/src/mcsplugincompletedoperation.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "mcsplugincompletedoperation.h" +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::~CMCSPluginCompletedOperation +// --------------------------------------------------------- +// +CMCSPluginCompletedOperation::~CMCSPluginCompletedOperation() + { + Cancel(); + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::NewL +// --------------------------------------------------------- +// +CMCSPluginCompletedOperation* CMCSPluginCompletedOperation::NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + TInt aError ) + { + CMCSPluginCompletedOperation* op = new (ELeave) CMCSPluginCompletedOperation + ( aMenu, aPriority, aObserverStatus ); + op->ReportCompletion( aError ); + return op; + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::CMCSPluginCompletedOperation +// --------------------------------------------------------- +// +CMCSPluginCompletedOperation::CMCSPluginCompletedOperation +( RMenu &aMenu, TInt aPriority, TRequestStatus &aObserverStatus ) +: CMenuOperation( aMenu, aPriority, aObserverStatus ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::ReportCompletion +// --------------------------------------------------------- +// +void CMCSPluginCompletedOperation::ReportCompletion( TInt aError ) + { + iObserverStatus = KRequestPending; + TRequestStatus* ownStatus = &iStatus; + *ownStatus = KRequestPending; + SetActive(); + User::RequestComplete( ownStatus, aError ); + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::RunL +// --------------------------------------------------------- +// +void CMCSPluginCompletedOperation::RunL() + { + // Propagate completion to observer. + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::DoCancel +// --------------------------------------------------------- +// +void CMCSPluginCompletedOperation::DoCancel() + { + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, KErrCancel ); + } + +// --------------------------------------------------------- +// CMCSPluginCompletedOperation::RunError +// --------------------------------------------------------- +// +TInt CMCSPluginCompletedOperation::RunError( TInt aError ) + { + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, aError ); + + return KErrNone; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,235 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include + +#include +#include + +#include // For CVwsSessionWrapper +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +#include // For TVwsViewId +#include +#include + +#include "mcsplugincompletedoperation.h" +#include "mcspluginhandler.h" +#include "mcspluginuids.hrh" + +#include "aiscutdefs.h" +class CVwsSessionWrapper; + +_LIT( KMenuTypeShortcut, "menu:shortcut" ); ///< Menu folder type. +_LIT( KMenuAttrParamLogs, "logs:dialed" ); + +/** Argument value for parameter*/ +_LIT( KMenuAttrParam, "param" ); + +const TInt KImplUidMCSPluginHandler = AI_UID_ECOM_IMPLEMENTATION_MCSPLUGIN_HANDLER; + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidMCSPluginHandler, CMCSPluginHandler::NewL) + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMCSPluginHandler::~CMCSPluginHandler +// --------------------------------------------------------- +// +CMCSPluginHandler::~CMCSPluginHandler() + { + delete iVwsSession; + } + +// --------------------------------------------------------- +// CMCSPluginHandler::NewL +// --------------------------------------------------------- +// +CMCSPluginHandler* CMCSPluginHandler::NewL( RMenu &aMenu ) + { + CMCSPluginHandler* handler = new (ELeave) CMCSPluginHandler( aMenu ); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; + } + +// --------------------------------------------------------- +// CMCSPluginHandler::CMCSPluginHandler +// --------------------------------------------------------- +// +CMCSPluginHandler::CMCSPluginHandler( RMenu &aMenu ) +: CMenuHandlerPlugin( aMenu ) + { + iEikEnv = CEikonEnv::Static(); + } + +// --------------------------------------------------------- +// CMCSPluginHandler::ConstructL +// --------------------------------------------------------- +// +void CMCSPluginHandler::ConstructL() + { + BaseConstructL(); + iVwsSession = CVwsSessionWrapper::NewL(); + } + +// --------------------------------------------------------- +// Supported menu item types +// --------------------------------------------------------- +// +TBool CMCSPluginHandler::SupportsType( const TDesC& aType ) + { + if ( !aType.Compare( KMenuTypeFolder() ) || + !aType.Compare( KMenuTypeSuite() ) || + !aType.Compare( KMenuTypeShortcut ) ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------- +// Main command handler +// --------------------------------------------------------- +// +CMenuOperation* CMCSPluginHandler::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& /*aParams*/, + TRequestStatus& aStatus ) + { + if ( aCommand != KMenuCmdOpen() ) + { + User::Leave ( KErrNotSupported ); + } + + if( aItem.Type() == KMenuTypeFolder() ) + { + + return CMCSPluginCompletedOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + else if ( aItem.Type() == KMenuTypeSuite() ) + { + return CMCSPluginCompletedOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + else if ( aItem.Type() == KMenuTypeShortcut() ) + { + LaunchShortcutL( aItem ); + return CMCSPluginCompletedOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + else + { + User::Leave ( KErrNotSupported ); + } + return NULL; + } + +// --------------------------------------------------------- +// Handles menu:shortcut specific commands +// Must be extended to launch e.g. MailBoxes +// caiscuttargetmessagingview.cpp implements the mailbox launching in old shortcut plugin +// --------------------------------------------------------- +// +void CMCSPluginHandler::LaunchShortcutL( CMenuItem& aItem ) + { + + // menu:shortcut type of items are launched based on attribute param + TBool attrExists = ETrue; + TPtrC param = aItem.GetAttributeL( KMenuAttrParam, attrExists ); + + if ( !attrExists ) + { + User::Leave( KErrCorrupt ); + } + + // Messaging specific commands + CSendUi* sendUi = CSendUi::NewLC(); + if ( param == KParamValueSelType ) // Select message type + { + TSendingCapabilities capabs( 0, 0, TSendingCapabilities::ESupportsEditor ); + + TUid uid = sendUi->ShowTypedQueryL( CSendUi::EWriteMenu, NULL, capabs, NULL, KNullDesC ); + if ( uid != KNullUid ) + { + sendUi->ServiceCapabilitiesL( uid, capabs ); + sendUi->CreateAndSendMessageL( uid, NULL, KNullUid, EFalse ); // launch standalone + } + } + else if ( param == KParamValueMsg ) // New text message + { + sendUi->CreateAndSendMessageL(KSenduiMtmUniMessageUid, NULL, KNullUid, EFalse); + } + else if ( param == KParamValueEmail ) // New email + { + sendUi->CreateAndSendMessageL( KSenduiMtmSmtpUid, NULL, KNullUid, EFalse ); + } +#ifdef __SYNCML_DS_EMAIL + else if ( param == KParamValueSyncMLMail ) // New SyncML mail + { + sendUi->CreateAndSendMessageL( KSenduiMtmSyncMLEmailUid, NULL, KNullUid, EFalse ); + } +#endif + else if ( param == KParamValuePostcard ) // New postcard + { + sendUi->CreateAndSendMessageL( KSenduiMtmPostcardUid, NULL, KNullUid, EFalse ); + } + else if ( param == KParamValueAudioMsg ) // New audio message + { + sendUi->CreateAndSendMessageL( KSenduiMtmAudioMessageUid, NULL, KNullUid, EFalse ); + } + else if ( param.Find( KParamValueMailbox ) != KErrNotFound ) // Mailbox + { + TBool attrExists = ETrue; + TInt pos = param.Locate( TChar( ':' ) ) + 1; + TPtrC mailboxId = param.Mid( pos ); + + if ( attrExists ) + { + TInt number; + TLex16 lextmp( mailboxId ); + lextmp.Val( number ); + TUid uId = TUid::Uid( number ); + const TVwsViewId viewId( KScutMessagingUid, KScutRemoteMailboxViewId ); + iVwsSession->CreateActivateViewEvent( viewId, uId, KNullDesC8() ); + } + } + else if ( param.Find( KMenuAttrParamLogs ) != KErrNotFound ) + { + LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KDialledView() ); + } + CleanupStack::PopAndDestroy( sendUi ); + } + +// ============================ GLOBAL FUNCTIONS =============================== + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/loc/mcsplugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/loc/mcsplugin.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 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: Localization strings for project MCS Plugin +* +*/ + +// d: A dialog which is shown to user when (s)he is trying to +// d: launch shortcut item during backup state. +// l: popup_note_window +// w: +// r: tb9.2 +// +#define qtn_mcs_disable_open_item "Application cannot be opened during backup" + +//End file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/loc/mcspluginsettings.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/loc/mcspluginsettings.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 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: Localization strings for project MCS Plugin +* +*/ + +// d: Text in title pane +// l: title_pane_t2/opt9 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_title_pers_shortcuts "Shortcuts" + +// d: Text of a list item in personalisation view's folder list +// d: Item opens Shortcuts folder +// l: list_setting_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_pers_shortcuts "Shortcuts" + +// d: Shortcuts Item caption +// d: Active Idle Shortcut Settings View +// d: %N order number of the shortcut item +// l: list_setting_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_myt_linkn "%N. Shortcut item" + +// d: Prompt text for change shortcut type query +// d: Active Idle Shortcut Settings View +// l: heading_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_change_prompt "Change to:" + +// d: Application shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_change_apps "Application" + +// d: Bookmark shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_change_bookmark "Bookmark" + +// d: URL shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_change_url "Web address" + +// d: Text for fixed item information note +// d: Shown when user tries to change fixed shortcut in settings +// l: popup_note_window +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_app_note_fixed "Fixed item. Can't be changed" + +// d: Text for empty listbox item +// d: Shown when there are no modifiable shortcuts in settings +// l: main_list_empty_pane +// w: +// r: tb9.2 +// +#define qtn_ai_mcs_set_all_fixed "(No editable shortcuts available in this Idle theme.)" diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef CMCSPLUGIN_H +#define CMCSPLUGIN_H + +#include +#include +#include +#include + + +class MAiContentObserver; +class MAiContentItemIterator; +class CMCSPluginEngine; +class TMCSData; +//class CMCSPluginData; + +//class RAiSettingsItemArray; + +/** + * @ingroup group_mcsplugin + * + * Plug-in main class + * + * @since S60 v3.2 + */ +class CMCSPlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension + + + { + +public: + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CMCSPlugin* NewL(); + + /** + * CompareItems + * + * @param aFirst + * @param aSecond + */ + static TInt CompareItems(const MAiPluginSettings& aFirst, + const MAiPluginSettings& aSecond ); + /** + * Constructor + * + * @param none + * @return none + */ + CMCSPlugin(); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CMCSPlugin(); + + /** + * Publishes profile names + * + * @param void + * @return void + */ + void PublishL(); + +// from base class CAiContentPublisher + + /** + * From CAiContentPublisher + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, e.g. the plug-in + * should unload its engines due backup operation. The method transits the + * plug-in to "Idle" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Stop( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * allowed to consume CPU resources, e.g plug-in is able to run timers, + * perform asynchronous operations, etc. The method transits the plug-in + * to "Alive" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Resume( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timers, cancel outstanding asynchronous operations, etc. The method + * transits the plug-in to "Suspendend" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Suspend( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @return void + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plugin shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @param aSettings setting items defined in the UI definition. + * @return void + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension( TUid aUid ); + +// from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + */ + TAny* GetPropertyL( TInt aProperty ); + + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + void SetPropertyL( TInt aProperty, TAny* aValue ); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provided to plug-in as-is in the descriptor. + */ + void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + +protected: + +private: + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * Resume the plug-in. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void DoResumeL(TAiTransitionReason aReason); + + /** + * Publishes content for one menu item + */ + void PublishLItemL( MAiContentObserver& aObserver, TMCSData& aDataItem, TInt aIndex ); + + /** + * Free the engine + * + * @param void + * @return void + */ + void FreeEngine(); + + /** + * Delete content model + */ + void DeleteContentModel(); + +private: // data + + // Iterator for plugin content + // Own + MAiContentItemIterator* iContent; + + // Number of data in the content model. + TInt iDataCount; + + // Dynamic content model + // Own. + TAiContentItem* iContentModel; + + // Plugin engine + // Own + CMCSPluginEngine* iEngine; + + // Array of content observers + // not own + RPointerArray iObservers; + + // Information about the content publisher (this plug-in) + TAiPublisherInfo iInfo; + + // Boolean, which expresses whether the content has been updated + //TBool iIsUpdated; + + }; + +#endif // CMCSPLUGIN_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2009 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: Plug-in data class +* +*/ + + +#ifndef CMCSPLUGINDATA_H +#define CMCSPLUGINDATA_H + +// INCLUDE FILES +#include +#include +#include +#include +#include + +class TMenuItem; +class CMCSPluginEngine; +class CMCSPluginWatcher; + + +/** + * @ingroup group_mcsplugin + * + * TMCData class + * + * @since S60 v9.1 + */ +class TMCSData + { +public: + /** + * SetMenuItem + * + * @param aMenuItem + */ + void SetMenuItem( TMenuItem& aMenuItem ); + + /** + * MenuItem + * + * @return TMenuItem + */ + TMenuItem& MenuItem(); + + /** + * SetDirty + * + * @param aDirty + * @return TBool + */ + void SetDirty( TBool aDirty ); + + /** + * IsDirty + * + * @return TBool + */ + TBool IsDirty() const; + +private: + /** + * iMenuItem + */ + TMenuItem iMenuItem; + + /** + * iDirty + */ + TBool iDirty; + }; + +/** + * @ingroup group_mcsplugin + * + * Plug-in data class + * + * @since + */ +class CMCSPluginData : public CBase, + public HSPluginSettingsIf::MHomeScreenSettingsObserver + { + +public: + + /** + * Part of the two phased constuction + * + * @param aEngine + * @param aInstanceUid + * @return Pointer to the created CMCSPluginData object + */ + static CMCSPluginData* NewL( CMCSPluginEngine& aEngine, + const TDesC8& aInstanceUid ); + + /** + * Constructor + * + * @param aEngine + * @param aInstanceUid + * @return none + */ + CMCSPluginData( CMCSPluginEngine& aEngine, const TDesC8& aInstanceUid ); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CMCSPluginData(); + + /** + * DataItem + * + * @param aIndex + * @return TMCSData& + */ + TMCSData& DataItemL( TInt aIndex ); + + /** + * ReplaceMenuItemL + * + * @param aIndex + * @param aMenuItem + */ + void ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem ); + + /** + * SaveSettingsL + * + * @param aIndex + * @param aMenuItem + */ + void SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ); + + /** + * DataCount + * + * @return TInt + */ + TInt DataCount(){ return iData.Count();}; + + /** + * UpdateDataL + */ + void UpdateDataL(); + + // From MHomeScreenSettingsObserver + /** + * SettingsChangedL + * + * @param aEvent + * @param aPluginName + * @param aPluginUid + * @param aPluginId + * @return TInt + */ + TInt SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, + const TDesC8& aPluginUid, const TDesC8& aPluginId ); + +private: + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * CreateMenuItemL + * @param aProperties + * @return TMenuItem + */ + TMenuItem CreateMenuItemL( + RPointerArray& aProperties ); + +private: // data + + // Menu items, which are defined in settings + // Own + RArray iData; + + // Plugin settings + HSPluginSettingsIf::CHomescreenSettings* iPluginSettings; + + // Reference to MCS plug-in engine + CMCSPluginEngine& iEngine; + + // Reference to instance uid of HSPS widget + const TDesC8& iInstanceUid; + }; + +#endif // CMCSPLUGINDATA_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcspluginengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 2009 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 CMCSPLUGINENGINE_H +#define CMCSPLUGINENGINE_H + +// INCLUDE FILES +#include +#include +#include +#include // For MFavouritesDbObserver +#include // For RFavouritesDb +#include // For MMsvSessionObserver + +#include "mcspluginwatcher.h" + +class CGulIcon; +class CMCSPluginData; +class TMCSData; +class CMCSPlugin; +class CActiveFavouritesDbNotifier; + +/** + * @ingroup group_mcsplugin + * + * MCSPluginEngine class + * + * @since S60 9.1 + */ +class CMCSPluginEngine : public CBase, public MMCSPluginWatcherObserver, + public MFavouritesDbObserver, public MMsvSessionObserver +{ + +public: // Constructors and destructor + + /** + * Constructor to use in the object creation. Initializes the necessary + * data. + * + * @param aPlugin + * @param aInstanceUid + */ + CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ); + + /** + * Part of the two phased constuction + * + * @param aPlugin + * @param aInstanceUid + * @return Pointer to the created CMCSPluginEngine object + */ + static CMCSPluginEngine* NewL( CMCSPlugin& aPlugin, + const TDesC8& aInstanceUid ); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CMCSPluginEngine(); + + /** + * Gets the menu data. + * + * @param aIndex + * @return TMCSData& + */ + TMCSData& MenuDataL( const TInt& aIndex ); + + /** Gets the menu item count + * + * @return TInt + */ + TInt MenuItemCount(); + + /** + * Finds the menu item header for given filter. + * + * @param aFilter + * @return TMenuItem + */ + TMenuItem FindMenuItemL( CMenuFilter& aFilter ); + + /** + * Retrieves the menu item object from MCS. + * + * @param aMenuItem + * @return CMenuItem* + */ + CMenuItem* FetchMenuItemL( const TMenuItem& aMenuItem ); + + /** + * Returns icon for given menu item and given attribute + * + * @param aMenuItem + * @param aAttr + * @return CGulIcon* + */ + CGulIcon* ItemIconL( CMenuItem& aMenuItem, const TDesC& aAttr ); + + /** + * Returns text for given menu item and given attribute + * + * @param aMenuItem + * @param aAttr + */ + TPtrC ItemTextL( CMenuItem& aMenuItem, const TDesC& aAttr ); + + /** + * Launches menu item + * + * @param aIndex + */ + void LaunchItemL( const TInt& aIndex ); + + /** + * Resumes the engine + * + * @param void + * @return void + */ + void ResumeL(); + + /** + * Suspends the engine + * + * @param void + * @return void + */ + void Suspend(); + + /** + * ShowSettingsL + */ + void ShowSettingsL(); + + /** + * From MMCSPluginWatcherObserver + */ + void HandleNotifyL(); + + // From MFavouritesDbObserver + /** + * Handles database event. + * @param aEvent Database event. + */ + void HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent ); + + // from base class MMsvSessionObserver + /** + * Handles an event from the message server. + * Not used, but must be defined to be able to use the messaging server. + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, + TAny* aArg2, TAny* aArg3 ); + + /** + * Called during plugin desctruction + * Decrements reference counters of all run-time generated items + * and deletes those which have reference counter == 0 + */ + void CleanMCSItemsL(); + +private: + /* + * Part of the two phased construction + */ + void ConstructL(); + + /** + * InitL + */ + void InitL(); + + /** + * Tells the settings container to start observing for changes in favorites + * database and mailbox db. + * + */ + void StartObservingL(); + + /** + * Tells the settings container to stop observing for changes in favorites + * database and mailbox db. + * + */ + void StopObserving(); + + /** + * ConstructMenuItemForIconL + * + * @param aPath + * @param aMenuItem + * @return TBool + */ + TBool ConstructMenuItemForIconL( const TDesC& aPath, CMenuItem& aMenuItem ); + + /** + * Helper method. Adds a given constant to a value of reference counter + * + * @param aItem A Menu Item to update + * @param aValueToAdd A constant to add + * @return The actual value of updated reference count + */ + TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, const TInt aValueToAdd ); + +protected: + +private: + + /* Plugin data + * Own + */ + CMCSPluginData* iPluginData; + + // MCS resource + RMenu iMenu; + + // MCS change notifier + RMenuNotifier iNotifier; + + // MCS asynchronous operation watcher + CMCSPluginWatcher* iWatcher; + + // MCS change notifier watcher + CMCSPluginWatcher* iNotifyWatcher; + + // + CMCSPlugin& iPlugin; + + // Reference to plugin owned instanceUid + const TDesC8& iInstanceUid; + // Indicating that backup is in progress + TBool iSuspend; + //Offset of resource file. + TInt iResourceOffset; + + /** + * Bookmark database change observer. + * Own. + */ + CActiveFavouritesDbNotifier* iBookmarkDbObserver; + + /** + * Bookmark database. + */ + RFavouritesDb iBookmarkDb; + + /** + * Bookmark database session. + */ + RFavouritesSession iBookmarkSession; + + /** + * Message server session + * Own. + */ + CMsvSession* iMsvSession; +}; + +#endif // CMCSPLUGINENGINE_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,493 @@ +/* +* Copyright (c) 2009 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: MCS plugin publisher +* +*/ + + +#include +#include +#include +#include +#include +#include +#include + +#include "mcspluginuids.hrh" +#include "mcsplugin.h" +#include "mcsplugindata.h" +#include "mcspluginengine.h" +#include "aipluginsettings.h" + + +const TUint KPluginNameSeprator = '/'; + +const TInt KImplUidMCSPlugin = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN; +// CONST CLASS VARIABLES +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidMCSPlugin, CMCSPlugin::NewL ) + }; + +_LIT( KEventNameLaunchByIndex, "LaunchByIndex" ); +_LIT( KEventNameShowSettings, "ShowSettings" ); +_LIT( KContentItemTypeText, "text" ); +_LIT( KContentItemTypeImage, "image" ); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CMCSPlugin* CMCSPlugin::NewL() + { + CMCSPlugin* self = new (ELeave) CMCSPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CMCSPlugin::CMCSPlugin() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CMCSPlugin::ConstructL() + { + iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_MCSPLUGIN; + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CMCSPlugin::~CMCSPlugin() + { + Release( iContent ); + + if ( iEngine ) + { + TRAP_IGNORE( iEngine->CleanMCSItemsL() ); + } + + delete iEngine; + iObservers.Close(); + + DeleteContentModel(); + } + +// --------------------------------------------------------------------------- +// Publishes the all the items +// --------------------------------------------------------------------------- +// +void CMCSPlugin::PublishL() + { + + if ( !iEngine ) + { + iEngine = CMCSPluginEngine::NewL( *this, iInfo.iNamespace ); + } + + TInt err( KErrNone ); + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + TInt menuItems ( iEngine->MenuItemCount() ); + + for ( TInt i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = iObservers[ i ]; + err = observer->StartTransaction( transactionId ); + if ( err == KErrNotSupported ) + { + return; + } + // Publish content to all items + for ( TInt j = 0; j < menuItems; j++ ) + { + // Index has to start from 1 ( j + 1 ) + PublishLItemL( *observer, iEngine->MenuDataL( j ), ( j + 1 ) ); + }// shortcut count + if ( err == KErrNone ) + { + err = observer->Commit( transactionId ); + if ( err == KErrNotSupported ) + { + return; + } + } + }//observers + + // Set all items not dirty. + for ( TInt j = 0; j < menuItems; j++ ) + { + iEngine->MenuDataL( j ).SetDirty( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// Publishes one item to given index +// --------------------------------------------------------------------------- +// +void CMCSPlugin::PublishLItemL( MAiContentObserver& aObserver, TMCSData& aData, TInt aIndex ) + { + if( !aData.IsDirty() ) + { + return; + } + + CMenuItem* item = iEngine->FetchMenuItemL( aData.MenuItem() ); + CleanupStack::PushL( item ); + // One widget item has iDataCount number of elements + for ( TInt i = 0; i < iDataCount; i++ ) + { + if ( iContentModel[i].type == KAiContentTypeBitmap ) + { + //Publish image + if ( aObserver.CanPublish( *this, i, aIndex ) ) + { + CGulIcon* icon = iEngine->ItemIconL( *item, TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ); + aObserver.PublishPtr( *this, i, icon , aIndex ); + } + } + else if ( iContentModel[ i ].type == KAiContentTypeText ) + { + //Publish text + if ( aObserver.CanPublish( *this, i, aIndex ) ) + { + TPtrC name = iEngine->ItemTextL( *item, TPtrC16( ( const TText16* ) iContentModel[ i ].cid ) ); + aObserver.Publish( *this, i, name, aIndex ); + } + } + }//content items + + CleanupStack::PopAndDestroy( item ); + + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is requested to unload its engines due backup operation +// --------------------------------------------------------------------------- +// +void CMCSPlugin::Stop( TAiTransitionReason aReason ) + { + + if ( aReason == EAiBackupRestoreStarted ) + { + Suspend( aReason ); + } + + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CMCSPlugin::Resume( TAiTransitionReason aReason ) + { + if( aReason == EAiIdleBackground ) + { + return; + } + + if ( aReason == EAiBackupRestoreEnded ) + { + if ( iEngine ) + { + TRAP_IGNORE( iEngine->ResumeL() ); + } + } + + TRAP_IGNORE( DoResumeL( aReason ) ); + return; + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is not allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CMCSPlugin::Suspend( TAiTransitionReason aReason ) + { + if ( aReason == EAiBackupRestoreStarted && iEngine ) + { + iEngine->Suspend(); + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// The plug-in MUST maintain a registry of subscribers and send +// notification to all of them whenever the state changes or new content +// is available +// --------------------------------------------------------------------------- +// +void CMCSPlugin::SubscribeL( MAiContentObserver& aObserver ) + { + iObservers.AppendL( &aObserver ); + } + +// --------------------------------------------------------------------------- +// Compare method to exclude the similar content items from array. +// --------------------------------------------------------------------------- +// +TInt CMCSPlugin::CompareItems( const MAiPluginSettings& aFirst, + const MAiPluginSettings& aSecond ) + { + MAiPluginSettings& first = const_cast(aFirst); + MAiPluginSettings& second = const_cast(aSecond); + return first.AiPluginContentItem().Name().CompareC(second.AiPluginContentItem().Name()); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-ins take ownership of the settings array, so it must either +// store it in a member or free it. +// Creates dynamic content model. +// --------------------------------------------------------------------------- +// +void CMCSPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) + { + + TLinearOrder sortMethod(CMCSPlugin::CompareItems); + RAiSettingsItemArray contentItemsArr; + + TInt count = aSettings.Count(); + for(TInt i = 0; i < count; i++ ) + { + MAiPluginSettings* pluginSetting = aSettings[i]; + if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) + { + MAiPluginContentItem& contItem = pluginSetting->AiPluginContentItem(); + TPtrC name = contItem.Name(); + TPtrC type = contItem.Type(); + contentItemsArr.InsertInOrder( pluginSetting, sortMethod ); + } + + } + iDataCount = contentItemsArr.Count(); + if(iDataCount > 0 ) + { + // Create the dynamic content Model + DeleteContentModel(); + iContentModel = new ( ELeave ) TAiContentItem[iDataCount]; + for(TInt i = 0; i < iDataCount; i++) + { + iContentModel[i].id = i; + MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); + + if( contentItem.Type() == KContentItemTypeText ) + { + // text + iContentModel[i].type = KAiContentTypeText; + } + if( contentItem.Type() == KContentItemTypeImage ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + TInt pos = contentItem.Name().Locate( KPluginNameSeprator ); + + HBufC* contentId = HBufC::NewL( contentItem.Name().Length()); + CleanupStack::PushL( contentId ); + TPtr ptr = contentId->Des(); + ptr = contentItem.Name().Mid( pos + 1 ); + TInt sizeOfContentId = ptr.Size() +sizeof(wchar_t); + iContentModel[i].cid = static_cast( User::AllocL( sizeOfContentId ) ); + Mem::Copy((TAny*)iContentModel[i].cid, ptr.PtrZ(), sizeOfContentId); + CleanupStack::PopAndDestroy( contentId ); + } + iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); + } + contentItemsArr.Reset(); + // We own the array so destroy it + aSettings.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Returns the extension interface. Actual type depends on the passed +// aUid argument. +// --------------------------------------------------------------------------- +// +TAny* CMCSPlugin::Extension( TUid aUid ) + { + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast(this); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Read property of publisher plug-in. +// --------------------------------------------------------------------------- +// +TAny* CMCSPlugin::GetPropertyL( TInt aProperty ) + { + TAny* property = NULL; + + switch ( aProperty ) + { + case EAiPublisherInfo: + { + property = static_cast( &iInfo ); + break; + } + + case EAiPublisherContent: + { + property = static_cast( iContent ); + break; + } + } + return property; + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Write property value to optimize the content model. +// --------------------------------------------------------------------------- +// +void CMCSPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) + { + switch ( aProperty ) + { + case EAiPublisherInfo: + { + if( aValue ) + { + const TAiPublisherInfo* info = static_cast( aValue ); + iInfo.iName.Copy(info->iName); + iInfo.iNamespace.Copy(info->iNamespace); + } + break; + } + default: + break; + } + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CMCSPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) + { + // We have no way of reporting errors to framework so just ignore them. + //TRAP_IGNORE( iEngine->HandleEventL(aEvent, aParam )); + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CMCSPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) + { + if ( iEngine ) + { + if( aEventName == KEventNameLaunchByIndex ) + { + // We have no way of reporting errors to framework so just ignore them. + TInt32 index; + AiUtility::ParseInt( index, aParam ); + TRAP_IGNORE( iEngine->LaunchItemL( index - 1 )); + } + else if( aEventName == KEventNameShowSettings ) + { + TRAP_IGNORE( iEngine->ShowSettingsL() ); + } + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// framework instructs plug-in that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CMCSPlugin::DoResumeL( TAiTransitionReason /*aReason*/ ) + { + PublishL(); + } + +// --------------------------------------------------------------------------- +// Frees engine resources +// --------------------------------------------------------------------------- +// +void CMCSPlugin::FreeEngine() + { + delete iEngine; + iEngine = NULL; + } + +// --------------------------------------------------------------------------- +// Delete content model +// --------------------------------------------------------------------------- +// +void CMCSPlugin::DeleteContentModel() + { + if( iContentModel ) + { + for ( TInt i = 0; i < iDataCount; i++ ) + { + if( iContentModel[i].cid ) + { + TAny* cell = static_cast( const_cast( iContentModel[i].cid ) ); + User::Free( cell ); // Originally allocated with User::Alloc, so delete + // with correlating method. + iContentModel[i].cid = NULL; + } + } + + delete iContentModel; + iContentModel = NULL; + } + } + +// ======== GLOBAL FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Constructs and returns an application object. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / + sizeof( TImplementationProxy ); + return KImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,396 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include + +#include "mcsplugindata.h" +#include "mcspluginengine.h" + +using namespace HSPluginSettingsIf; + +_LIT8( KAppUid, "271012080" ); +_LIT( KMenuAttrParam, "param" ); +_LIT( KMenuAttrLocked, "locked" ); +_LIT8( KProperNameType, "type" ); +_LIT8( KProperNameParam, "param" ); +_LIT8( KProperNameUid, "uid" ); +_LIT8( KProperNameView, "view" ); +_LIT8( KProperValueFolder, "folder" ); +_LIT8( KProperValueSuite, "suite" ); +_LIT8( KProperValueBookmark, "bookmark" ); +_LIT8( KProperValueAppl, "application" ); +_LIT( KMCSPlugin, "MCSPlugin" ); +_LIT( KSuiteName, "suite_name" ); + +// ======== LOCAL FUNCTIONS ======== + +static void ItemMapArrayCleanupFunc( TAny* aPointerArray ) + { + RPointerArray* p = static_cast*>( aPointerArray ); + p->ResetAndDestroy(); + p->Close(); + } + +// ======== MEMBER FUNCTIONS ======== + +void TMCSData::SetMenuItem( TMenuItem& aMenuItem ) + { + iMenuItem = aMenuItem; + } + +TMenuItem& TMCSData::MenuItem() + { + return iMenuItem; + } + +void TMCSData::SetDirty( TBool aDirty ) + { + iDirty = aDirty; + } + +TBool TMCSData::IsDirty() const + { + return iDirty; + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CMCSPluginData* CMCSPluginData::NewL( CMCSPluginEngine& aEngine, const TDesC8& aInstanceUid ) + { + CMCSPluginData* self = new (ELeave) CMCSPluginData( aEngine, aInstanceUid ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CMCSPluginData::CMCSPluginData( CMCSPluginEngine& aEngine, const TDesC8& aInstanceUid ) + : iEngine( aEngine ), iInstanceUid( aInstanceUid ) + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CMCSPluginData::ConstructL() + { + // AILaunch uid in decimal format + iPluginSettings = CHomescreenSettings::NewL( KAppUid, + iInstanceUid, + this ); + UpdateDataL(); + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginData::~CMCSPluginData() + { + iData.Close(); + delete iPluginSettings; + } + +// --------------------------------------------------------------------------- +// Gets the instance specific settings from HSPS and creates data items +// --------------------------------------------------------------------------- +// +void CMCSPluginData::UpdateDataL() + { + RPointerArray settings; + TCleanupItem settingsCleanupItem( ItemMapArrayCleanupFunc, &settings ); + CleanupStack::PushL( settingsCleanupItem ); + iPluginSettings->GetSettingsL( iInstanceUid, settings ); + TInt count = settings.Count(); + for( TInt i = 0; i < count; i++ ) + { + CItemMap* itemMap = settings[i]; + RPointerArray& properties + = itemMap->Properties(); + TMenuItem item = CreateMenuItemL( properties ); + TMCSData data; + TInt id = -1; + + if ( count == iData.Count() ) + { + id = iData[i].MenuItem().Id(); + } + + if ( id > 0 ) + { + if ( item.Id() != id ) + { + data.SetMenuItem( item ); + data.SetDirty( ETrue ); + iData.Remove( i ); + iData.InsertL( data, i ); + } + } + else + { + data.SetMenuItem( item ); + data.SetDirty( ETrue ); + iData.AppendL( data ); + } + } + + CleanupStack::PopAndDestroy(); // settingsCleanupItem + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSPluginData::SettingsChangedL( const TDesC8& /*aEvent*/, const TDesC8& /*aPluginName*/, + const TDesC8& /*aPluginUid*/, const TDesC8& /*aPluginId*/ ) + { + UpdateDataL(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// Gets the menu item from engine using the setting properties as filter +// --------------------------------------------------------------------------- +// +TMenuItem CMCSPluginData::CreateMenuItemL( RPointerArray& aProperties ) + { + CMenuFilter* filter = CMenuFilter::NewLC(); + + // Exclude 'view' and 'param' attributes from search criteria by default + // Criterias will be added to filter if setting defines them + filter->DoNotHaveAttributeL( KMenuAttrView ); + filter->DoNotHaveAttributeL( KMenuAttrParam ); + TBool isFolder = EFalse; + TBool isSuite = EFalse; + + // first, we need to check if the item is folder or suite + for ( TInt i = 0; i < aProperties.Count(); i++ ) + { + if ( aProperties[i]->Name() == KProperNameType ) + { + if ( aProperties[i]->Value() == KProperValueFolder ) + { + isFolder = ETrue; + } + + if ( aProperties[i]->Value() == KProperValueSuite ) + { + isSuite = ETrue; + } + + break; + } + } + + // then add all property/value pairs to the filter + for ( TInt i = 0; i < aProperties.Count(); i++ ) + { + + // skip the type property + if( aProperties[i]->Name() == KProperNameType ) + { + continue; + } + + HBufC* name( NULL ); + HBufC* value( NULL ); + name = AiUtility::CopyToBufferL( name, aProperties[i]->Name() ); + CleanupStack::PushL( name ); + value = AiUtility::CopyToBufferL( value, aProperties[i]->Value() ); + CleanupStack::PushL( value ); + + if ( value->Length() != 0 ) + { + // in case of folder/suite, we just have to extract + // id from param attribute and return item with this id + if ( aProperties[i]->Name() == KProperNameParam && ( isFolder || isSuite ) ) + { + + TMenuItem item; + + // set the type + if ( isFolder ) + { + // convert id to integer + TInt id; + TLex16 lextmp( value->Ptr() ); + lextmp.Val( id ); + item.SetType( KMenuTypeFolder ); + item.SetId( id ); + } + + if ( isSuite ) + { + CMenuFilter* suitefilter = CMenuFilter::NewLC(); + // Exclude 'view' and 'param' attributes from search criteria by default + // Criterias will be added to filter if setting defines them + suitefilter->DoNotHaveAttributeL( KMenuAttrView ); + suitefilter->DoNotHaveAttributeL( KMenuAttrParam ); + suitefilter->HaveAttributeL( KSuiteName, *value ); + // locked property excluded from search pattern + suitefilter->DoNotHaveAttributeL( KMenuAttrLocked ); + item = iEngine.FindMenuItemL( *suitefilter ); + CleanupStack::PopAndDestroy( suitefilter ); + + } + + CleanupStack::PopAndDestroy( value ); + CleanupStack::PopAndDestroy( name ); + CleanupStack::PopAndDestroy( filter ); + + return item; + } + else + { + // otherwise, we just add name/value into filter + filter->HaveAttributeL( *name, *value ); + } + } + CleanupStack::PopAndDestroy( value ); + CleanupStack::PopAndDestroy( name ); + } + + // locked property excluded from search pattern + filter->DoNotHaveAttributeL( KMenuAttrLocked ); + + TMenuItem item = iEngine.FindMenuItemL( *filter ); + CleanupStack::PopAndDestroy( filter ); + return item; + } + +// --------------------------------------------------------------------------- +// Returns menu item for given index +// --------------------------------------------------------------------------- +// +TMCSData& CMCSPluginData::DataItemL( TInt aIndex ) + { + if( aIndex < 0 || aIndex >= iData.Count()) + { + User::Leave( KErrArgument ); + } + return iData[aIndex]; + } + +// --------------------------------------------------------------------------- +// Replaces menuitem in data instance +// --------------------------------------------------------------------------- +// +void CMCSPluginData::ReplaceMenuItemL( const TInt& aIndex, TMenuItem& aMenuItem ) + { + TMCSData& data = iData[aIndex]; + data.SetMenuItem( aMenuItem ); + data.SetDirty( ETrue ); + } + +// --------------------------------------------------------------------------- +// Save the setting persistently to HSPS +// TODO HSPS setting api should be changed so that items and properties can +// be added/removed dynamically. Now widgetconfiguration.xml must have all the +// properties for every item even though property is not used. +// It makes this function more compolicated. +// --------------------------------------------------------------------------- +// +void CMCSPluginData::SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ) + { + RPointerArray settingItems; + CleanupClosePushL( settingItems ); + iPluginSettings->GetSettingsL( iInstanceUid, settingItems ); + if ( aIndex >= 0 && aIndex < settingItems.Count() ) + { + TBool exists( EFalse ); + CItemMap* itemMap = settingItems[aIndex]; + RPointerArray properties; + properties = itemMap->Properties(); + for ( TInt i= 0; i < properties.Count(); i++ ) + { + if ( properties[i]->Name() == KProperNameType ) + { + TPtrC type = aMenuItem.Type(); + if ( type == KMenuTypeUrl ) + { + properties[i]->SetValueL( KProperValueBookmark ); + } + else + { + properties[i]->SetValueL( KProperValueAppl ); + } + } + else if ( properties[i]->Name() == KProperNameUid ) + { + TPtrC uid = aMenuItem.GetAttributeL( KMenuAttrUid, exists ); + if ( exists ) + { + HBufC8* uid8( NULL ); + uid8 = AiUtility::CopyToBufferL( uid8, uid ); + CleanupStack::PushL( uid8 ); + properties[i]->SetValueL( *uid8 ); + CleanupStack::PopAndDestroy( uid8 ); + } + else + { + properties[i]->SetValueL( KNullDesC8 ); + } + } + else if ( properties[i]->Name() == KProperNameView ) + { + TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists ); + if ( exists ) + { + HBufC8* view8( NULL ); + view8 = AiUtility::CopyToBufferL( view8, view ); + CleanupStack::PushL( view8 ); + properties[i]->SetValueL( *view8 ); + CleanupStack::PopAndDestroy( view8 ); + } + else + { + properties[i]->SetValueL( KNullDesC8 ); + } + } + else if ( properties[i]->Name() == KProperNameParam ) + { + TPtrC param = aMenuItem.GetAttributeL( KMenuAttrParam, exists ); + if ( exists ) + { + HBufC8* param8( NULL ); + param8 = AiUtility::CopyToBufferL( param8, param ); + CleanupStack::PushL( param8 ); + properties[i]->SetValueL( *param8 ); + CleanupStack::PopAndDestroy( param8 ); + } + else + { + properties[i]->SetValueL( KNullDesC8 ); + } + } + } + } + // ETrue tells that changes are stored also to plugin reference + iPluginSettings->SetSettingsL( iInstanceUid, settingItems, ETrue ); + CleanupStack::PopAndDestroy( &settingItems ); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,788 @@ +/* +* Copyright (c) 2009 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 engine class of MCS plugin. +* +*/ + + +// INCLUDE FILES +#include "mcspluginengine.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "mcsplugin.h" +#include "mcsplugindata.h" +#include "mcspluginuids.hrh" + +#include +#include +#include +#include // For Transition effect +#include + +#include +_LIT( KMyMenuData, "matrixmenudata" ); +_LIT( KSkin, "skin" ); +_LIT( KMif, "mif" ); +_LIT( KResourceDrive, "Z:" ); +_LIT( KResourceFile, "mcspluginres.rsc" ); +_LIT( KResPath, "\\resource\\" ); +_LIT( KMenuAttrRefcount, "ref_count" ); +_LIT( KMMApplication, "mm://" ); +_LIT( KHideExit, "?exit=hide" ); +_LIT( KHideExit2, "&exit=hide" ); +_LIT( KSetFocusString, "!setfocus?applicationgroup_name=" ); +_LIT( KApplicationGroupName, "applicationgroup_name" ); +_LIT( KSuiteName, "suite_name" ); +_LIT( KIcon, "icon" ); +_LIT( KMenuAttrUndefUid, "0x99999991" ); + +const TUid KHomescreenUid = { AI_UID3_AIFW_COMMON }; +const TUid KMMUid = { 0x101F4CD2 }; + +// ======== LOCAL FUNCTIONS ======== + +static TPtrC NextIdToken( TLex& aLexer ) + { + aLexer.SkipSpace(); + aLexer.Mark(); + while( !aLexer.Eos() && !aLexer.Peek().IsSpace() && aLexer.Peek() != ')' ) + { + aLexer.Inc(); + } + return aLexer.MarkedToken(); + } + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------- +// Default constructor +// --------------------------------------------------------- +// +CMCSPluginEngine::CMCSPluginEngine( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ) + : iPlugin( aPlugin ), iInstanceUid( aInstanceUid ), + iSuspend( EFalse ) + { + } + +// --------------------------------------------------------- +// Two-phased constructor. +// Create instance of concrete ECOM interface implementation +// --------------------------------------------------------- +// +CMCSPluginEngine* CMCSPluginEngine::NewL( CMCSPlugin& aPlugin, const TDesC8& aInstanceUid ) + { + CMCSPluginEngine* self = new( ELeave ) CMCSPluginEngine( aPlugin, aInstanceUid ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------- +// +void CMCSPluginEngine::ConstructL() + { + TFullName resourceFile( KResourceDrive ); + resourceFile.Append( KResPath ); + resourceFile.Append( KResourceFile ); + BaflUtils::NearestLanguageFile( + CCoeEnv::Static()->FsSession(), + resourceFile ); + iResourceOffset = + CCoeEnv::Static()->AddResourceFileL( resourceFile ); + InitL(); + StartObservingL(); + } + + +// --------------------------------------------------------- +// Destructor. +// --------------------------------------------------------- +// +CMCSPluginEngine::~CMCSPluginEngine() + { + StopObserving(); + + delete iPluginData; + iNotifier.Close(); + iMenu.Close(); + //iWatcher->Cancel(); + delete iWatcher; + delete iNotifyWatcher; + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::InitL() + { + iMenu.OpenL( KMyMenuData ); + iPluginData = CMCSPluginData::NewL( *this, iInstanceUid ); + iWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + TInt err = iNotifier.Open( iMenu ); + if ( err == KErrNone ) + { + iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); + iNotifier.Notify( 0, + RMenuNotifier::EItemsAddedRemoved | + RMenuNotifier::EItemsReordered | + RMenuNotifier::EItemAttributeChanged, + iNotifyWatcher->iStatus ); + iNotifyWatcher->WatchNotify( this ); + } + } + +// --------------------------------------------------------------------------- +// Tells the settings container to start observing for changes +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::StartObservingL() + { + // registering to bookmarks db. changes observing + User::LeaveIfError( iBookmarkSession.Connect() ); + User::LeaveIfError( iBookmarkDb.Open( iBookmarkSession, KBrowserBookmarks ) ); + + iBookmarkDbObserver = new (ELeave) CActiveFavouritesDbNotifier( + iBookmarkDb, *this ); + iBookmarkDbObserver->Start(); + + // registering to mailbox db. changes observing + iMsvSession = CMsvSession::OpenAsObserverL( *this) ; + } + +// --------------------------------------------------------------------------- +// Tells the settings container to stop observing for changes +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::StopObserving() + { + if ( iBookmarkDbObserver ) + { + delete iBookmarkDbObserver; + iBookmarkDbObserver = NULL; + } + iBookmarkDb.Close(); + iBookmarkSession.Close(); + + if ( iMsvSession ) + { + delete iMsvSession; + iMsvSession = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TMCSData& CMCSPluginEngine::MenuDataL( const TInt& aIndex ) + { + return iPluginData->DataItemL( aIndex ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CMCSPluginEngine::MenuItemCount() + { + return iPluginData->DataCount(); + } + +// --------------------------------------------------------------------------- +// Returns the menu item header, which matches the given filter. +// --------------------------------------------------------------------------- +// +TMenuItem CMCSPluginEngine::FindMenuItemL( CMenuFilter& aFilter ) + { + TMenuItem item; + const TInt root = iMenu.RootFolderL(); + RArray items; + CleanupClosePushL( items ); + iMenu.GetItemsL( items, root, &aFilter, ETrue ); + if( items.Count() > 0 ) + { + + item = items[0]; + } + + CleanupStack::PopAndDestroy( &items ); + return item; + } + +// --------------------------------------------------------------------------- +// Returns the actual menu item for the given header. +// --------------------------------------------------------------------------- +// +CMenuItem* CMCSPluginEngine::FetchMenuItemL( const TMenuItem& aMenuItem ) + { + return CMenuItem::OpenL( iMenu, aMenuItem ); + } + +// --------------------------------------------------------------------------- +// Returns MCS default icon if attribute is 'icon' else parses the +// skin definition from attribute and sets attributes to aMenuItem. +// --------------------------------------------------------------------------- +// +CGulIcon* CMCSPluginEngine::ItemIconL( CMenuItem& aMenuItem, const TDesC& aAttr ) + { + CAknIcon* icon( NULL ); + CGulIcon* gIcon( NULL ); + TBool exists( ETrue ); + if( aAttr != KIcon ) + { + // Resolve secondary icon definition from attribute + TPtrC iconDef = aMenuItem.GetAttributeL( aAttr, exists ); + if( exists ) + { + exists = ConstructMenuItemForIconL( iconDef, aMenuItem ); + } + } + if( exists ) + { + icon = MenuIconUtility::GetItemIconL( aMenuItem ); + if( icon ) + { + CleanupStack::PushL( icon ); + gIcon = CGulIcon::NewL(icon->Bitmap(), icon->Mask()); + // Detach and delete + icon->SetBitmap( NULL ); + icon->SetMask( NULL ); + CleanupStack::PopAndDestroy( icon ); + } + } + return gIcon; + } + +// --------------------------------------------------------------------------- +// Returns text string for the given attribute +// --------------------------------------------------------------------------- +// +TPtrC CMCSPluginEngine::ItemTextL( CMenuItem& aMenuItem, const TDesC& aAttr ) + { + TBool exists( KErrNotFound ); + TPtrC name = aMenuItem.GetAttributeL( aAttr, exists ); + if( exists ) + { + return name; + } + else + { + return KNullDesC(); + } + } + +// --------------------------------------------------------------------------- +// Calls the open command for the given menu item header +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::LaunchItemL( const TInt& aIndex ) + { + + if ( iSuspend ) + { + HBufC* temp = StringLoader::LoadLC( R_MCS_DISABLE_OPEN_ITEM ); + + CAknNoteDialog* dialog = new (ELeave) CAknNoteDialog( + CAknNoteDialog::EConfirmationTone, + CAknNoteDialog::ENoTimeout ); + dialog->SetTextL( temp->Des() ); + dialog->ExecuteDlgLD( R_MCS_DISABLE_OPEN_ITEM_DLG ); + CleanupStack::PopAndDestroy( temp ); + return; + } + if( iWatcher->IsActive()) + { + return; + } + + + TMCSData& dataItem = iPluginData->DataItemL( aIndex ); + CMenuItem* item = CMenuItem::OpenL( iMenu, dataItem.MenuItem()); + CleanupStack::PushL( item ); + TPtrC type = item->Type(); + + // run suite/folder + if ( type == KMenuTypeSuite || type == KMenuTypeFolder ) + { + + // message for MM application + HBufC8* message; + + if ( type == KMenuTypeSuite ) + { + // prepare message for launching suite + TBool hasSuiteName = EFalse; + TPtrC suiteName = item->GetAttributeL( KSuiteName, hasSuiteName ); + if ( !hasSuiteName ) + { + CleanupStack::PopAndDestroy( item ); + return; + } + message = HBufC8::NewLC( KMMApplication().Length() + + suiteName.Length() + + KHideExit().Length() ); + + message->Des().Copy( KMMApplication ); + message->Des().Append( suiteName ); + message->Des().Append( KHideExit ); + } + else + { + // prepare message for launching folder + TBool hasApplicationGroupName = EFalse; + TPtrC applicationGroupName = item->GetAttributeL( KApplicationGroupName, + hasApplicationGroupName ); + if ( !hasApplicationGroupName ) + { + CleanupStack::PopAndDestroy( item ); + return; + } + message = HBufC8::NewLC( KMMApplication().Length() + + KSetFocusString().Length() + + applicationGroupName.Length() + + KHideExit2().Length() ); + + message->Des().Copy( KMMApplication ); + message->Des().Append( KSetFocusString ); + message->Des().Append( applicationGroupName ); + message->Des().Append( KHideExit2 ); + } + + // find MM application + TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); + TApaTask task = taskList.FindApp( KMMUid ); + + if ( task.Exists() ) + { + // MM is already running in background - send APA Message + task.SendMessage( TUid::Uid( KUidApaMessageSwitchOpenFileValue ), *message ); + } + else + { + // MM not running yet - use Command Line Tail + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); + User::LeaveIfError( appArcSession.Connect() ); + TApaAppInfo appInfo; + TInt err = appArcSession.GetAppInfo( appInfo, KMMUid ); + if ( err == KErrNone ) + { + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + cmdLine->SetTailEndL( *message ); + appArcSession.StartApp( *cmdLine ); + CleanupStack::PopAndDestroy( cmdLine ); + } + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( message ); + } + else + { + TBool exists( EFalse ); + TPtrC desc( item->GetAttributeL( KMenuAttrUid, exists ) ); + + if( exists ) + { + _LIT( KPrefix, "0x" ); + const TInt pos( desc.FindF( KPrefix ) ); + + if( pos != KErrNotFound ) + { + TLex lex( desc.Mid( pos + KPrefix().Length() ) ); + // Hex parsing needs unsigned int + TUint32 value = 0; + const TInt parseResult = lex.Val( value, EHex ); + + if ( parseResult == KErrNone ) + { + TUid uid( KNullUid ); + TInt32 value32( value ); + uid.iUid = value32; + + if( uid != KNullUid ) + { + //start a full screen effect + GfxTransEffect::BeginFullScreen( + AknTransEffect::EApplicationStart, + TRect(0,0,0,0), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( uid, + AknTransEffect::TParameter::EActivateExplicitContinue )); + } + } + } + } + + // run application/shortcut/bookmark + CMenuOperation* operation = item->HandleCommandL( + KMenuCmdOpen, KNullDesC8, iWatcher->iStatus ); + iWatcher->Watch( operation ); + } + CleanupStack::PopAndDestroy( item ); + } + +// --------------------------------------------------------------------------- +// Handle the change in Menu Content +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::HandleNotifyL() + { + TInt count( iPluginData->DataCount()); + for( TInt i = 0; i < count; i++ ) + { + TMCSData& data = iPluginData->DataItemL(i); + // Check that all the data still exist is MCS, if flag is hidden or + // missing, we have to remove data from UI + CMenuItem* menuItem = CMenuItem::OpenL( iMenu, data.MenuItem().Id() ); + CleanupStack::PushL( menuItem ); + if ( !menuItem || + ( menuItem->Flags() & TMenuItem::EHidden ) || + ( menuItem->Flags() & TMenuItem::EMissing ) ) + { + // Get the replacement for hidden data + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + // 'Undefined' item + filter->HaveAttributeL( KMenuAttrUid, KMenuAttrUndefUid ); + TMenuItem undefItem = FindMenuItemL( *filter ); + iPluginData->ReplaceMenuItemL( i, undefItem ); + iPluginData->SaveSettingsL( i, *FetchMenuItemL(undefItem) ); + CleanupStack::PopAndDestroy( filter ); + } + CleanupStack::PopAndDestroy( menuItem ); + menuItem = NULL; + } + // Notification must be activated again + iNotifyWatcher->Cancel(); + iNotifier.Notify( 0, + RMenuNotifier::EItemsAddedRemoved | + RMenuNotifier::EItemsReordered | + RMenuNotifier::EItemAttributeChanged, + iNotifyWatcher->iStatus ); + + iNotifyWatcher->WatchNotify( this ); + // Publish changed data + iPlugin.PublishL(); + } + +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::HandleSessionEventL( + TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) + { + switch ( aEvent ) + { + case EMsvEntriesDeleted: + // fall-through intended here + case EMsvEntriesChanged: + { + + } + break; + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// From class MFavouritesDbObserver. +// Handles database event. +// ----------------------------------------------------------------------------- +// +void CMCSPluginEngine::HandleFavouritesDbEventL( RDbNotifier::TEvent aEvent ) + { + switch ( aEvent ) + { + case RDbNotifier::ERollback: + // fall-through intended here + case RDbNotifier::ERecover: + // fall-through intended here + case RDbNotifier::ECommit: + { + // Get list of favourites bookmarks + CFavouritesItemList* favItems = + new (ELeave) CFavouritesItemList(); + CleanupStack::PushL( favItems ); + TInt err = iBookmarkDb.GetAll( *favItems, KFavouritesNullUid, + CFavouritesItem::EItem ); + if ( err != KErrNone ) + { + ASSERT(0); + } + TInt count_fav = favItems->Count(); + + // Do for each plugin data (4x times) + TInt count_data( iPluginData->DataCount() ); + for ( TInt item_index = 0; item_index < count_data; item_index++ ) + { + // Get item ID and open its menu related item + TMCSData& data = iPluginData->DataItemL( item_index ); + TInt itemID( data.MenuItem().Id() ); + CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemID ); + CleanupStack::PushL( menuItem ); + + // Get URL aatribute + TBool attrExists = EFalse; + TPtrC url = menuItem->GetAttributeL( _L("url"), attrExists ); + // If bookmark... + if ( attrExists ) + { + // Get bookmark UID + TPtrC uid_item_ptr = menuItem->GetAttributeL( + KMenuAttrUid, attrExists ); + + // Compare with each item in fav. bookmarks list + TBool itemExists = EFalse; + for ( TInt fav_index = count_fav - 1; fav_index >= 0; fav_index-- ) // newest on top + { + // Get list item UID + TUid uid_fav = TUid::Uid( favItems->At( fav_index )->Uid() ); + if ( uid_fav.Name() == uid_item_ptr ) + { + // Bookmark still exist in fav. bookmarks list + itemExists = ETrue; + break; + } + } + + if ( !itemExists ) + { + // If item not axist any more, replace it by undefined icon + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + // 'Undefined' item + filter->HaveAttributeL( KMenuAttrUid, + KMenuAttrUndefUid ); + TMenuItem undefItem = FindMenuItemL( *filter ); + iPluginData->ReplaceMenuItemL( item_index, undefItem ); + iPluginData->SaveSettingsL( item_index, *FetchMenuItemL( + undefItem ) ); + CleanupStack::PopAndDestroy( filter ); + } + } + CleanupStack::PopAndDestroy( menuItem ); + } + CleanupStack::PopAndDestroy( favItems ); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// Resumes the engine +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::ResumeL() + { + iSuspend = EFalse; + } + +// --------------------------------------------------------------------------- +// Suspends the engine +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::Suspend() + { + iSuspend = ETrue; + } + +// --------------------------------------------------------------------------- +// Launch General Settings plugin +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::ShowSettingsL() + { + TUid uid = {AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN}; + CGSLauncher* l = CGSLauncher::NewLC(); + l->LaunchGSViewL ( uid, + KHomescreenUid, + iInstanceUid ); + CleanupStack::PopAndDestroy( l ); + + } +// --------------------------------------------------------------------------- +// ResolveSkinItemId +// Syntax: skin(major minor):mif(filename bimapId maskId) +// --------------------------------------------------------------------------- +// +TBool CMCSPluginEngine::ConstructMenuItemForIconL( const TDesC& aPath, CMenuItem& aMenuItem ) + { + TInt pos = aPath.Locate( ':' ); + if( pos == KErrNotFound ) + { + pos = aPath.Length(); + } + TPtrC skin = aPath.Left( pos ); + TInt sf = skin.FindF( KSkin ); + if( sf == KErrNotFound ) + { + return EFalse; + } + TPtrC temp = skin.Mid( sf + KSkin().Length()); + TLex input( temp ); + input.SkipSpace(); + if( !input.Eos() && input.Peek() == '(') + { + input.Inc(); + } + TPtrC majorId = NextIdToken( input ); + TPtrC minorId = NextIdToken( input ); + aMenuItem.SetAttributeL( KMenuAttrIconSkinMajorId, majorId ); + aMenuItem.SetAttributeL( KMenuAttrIconSkinMinorId, minorId ); + + //TPtrC mif = aPath.Mid( pos + 1 ); + //TInt mf = mif.FindF( KMif ); + if( aPath.Length() > pos && (aPath.Mid( pos + 1 ).FindF( KMif ) != KErrNotFound )) + { + TPtrC mif = aPath.Mid( pos + 1 ); + TInt mf = mif.FindF( KMif ); + //TPtrC temp1 = mif.Mid( mf+ KMif().Length()); + TLex input1( mif.Mid( mf+ KMif().Length()) ); + input1.SkipSpace(); + if( !input1.Eos() && input1.Peek() == '(') + { + input1.Inc(); + } + TPtrC file = NextIdToken( input1 ); + TPtrC bitmapId = NextIdToken( input1 ); + TPtrC maskId = NextIdToken( input1 ); + aMenuItem.SetAttributeL( KMenuAttrIconFile, file ); + aMenuItem.SetAttributeL( KMenuAttrIconId, bitmapId ); + aMenuItem.SetAttributeL( KMenuAttrMaskId, maskId ); + } + return ETrue; + } + +// --------------------------------------------------------------------------- +// Called during plugin desctruction +// Decrements reference counters of all run-time generated items +// and deletes those which have reference counter == 0 +// --------------------------------------------------------------------------- +// +void CMCSPluginEngine::CleanMCSItemsL() + { + const TInt count( iPluginData->DataCount() ); + for( TInt i = 0; i < count; i++ ) + { + TMCSData& data = iPluginData->DataItemL(i); + + CMenuItem* menuItem = CMenuItem::OpenL( iMenu, data.MenuItem().Id() ); + if( !menuItem ) + { + continue; + } + CleanupStack::PushL( menuItem ); + + // check if ref_count attribute exists + TBool exists = EFalse; + TPtrC param = menuItem->GetAttributeL( KMenuAttrRefcount, exists ); + if( exists ) + { + const TInt references = UpdateMenuItemsRefCountL( menuItem, -1 ); + + // Create a nested loop inside CActiveScheduler. + CActiveSchedulerWait* wait = new (ELeave) CActiveSchedulerWait; + CleanupStack::PushL( wait ); + + if( references > 0 ) + { + // if counter is still > 0, update its value in MCS + CMenuOperation* op = menuItem->SaveL( iWatcher->iStatus ); + iWatcher->StopAndWatch( op, wait ); + + // Start the nested scheduler loop. + wait->Start(); + } + else + { + // counter reached 0 -> item is not referenced by any shortcut + // so remove it from MCS + if( !iWatcher->IsActive() ) + { + CMenuOperation* op = iMenu.RemoveL( menuItem->Id(), iWatcher->iStatus ); + iWatcher->StopAndWatch( op, wait ); + + // Start the nested scheduler loop. + wait->Start(); + } + } + + CleanupStack::PopAndDestroy( wait ); + wait = NULL; + } + + CleanupStack::PopAndDestroy( menuItem ); + menuItem = NULL; + } + } + + +// --------------------------------------------------------------------------- +// Helper method. Adds a given constant to a value of reference counter +// --------------------------------------------------------------------------- +// +TInt CMCSPluginEngine::UpdateMenuItemsRefCountL( CMenuItem* aItem, + const TInt aValueToAdd ) + { + TBool exists = EFalse; + CleanupStack::PushL( aItem ); + TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); + CleanupStack::Pop( aItem ); + if ( exists ) + { + TInt references; + TLex16 lextmp( param ); + lextmp.Val( references ); + references += aValueToAdd; + TBuf<128> buf; + buf.NumUC( references ); + + // set new ref_count + CleanupStack::PushL( aItem ); + aItem->SetAttributeL( KMenuAttrRefcount, buf); + CleanupStack::Pop( aItem ); + // return new ref_count + return references; + } + return -1; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/rom/mcsplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/rom/mcsplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 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: IBY file for Profile plug-in +* +*/ + + +#ifndef MCSPLUGIN_IBY +#define MCSPLUGIN_IBY +#include + +data=DATAZ_\BITMAP_DIR\aimcsplugin.mif BITMAP_DIR\aimcsplugin.mif + +ECOM_PLUGIN(mcsplugin.dll, mcsplugin.rsc) +ECOM_PLUGIN(mcspluginhandler.dll, mcspluginhandler.rsc) +ECOM_PLUGIN(mcspluginsettings.dll, mcspluginsettings.rsc) + +#endif // MCSPLUGIN_IBY + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/rom/mcsplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/rom/mcsplugin_resources.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 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: IBY file for Profile plug-in +* +*/ + + +#ifndef MCSPLUGIN_RESOURCES_IBY +#define MCSPLUGIN_RESOURCES_IBY + +#include + +data=DATAZ_\RESOURCE_FILES_DIR\mcspluginres.rsc RESOURCE_FILES_DIR\mcspluginres.rsc +data=DATAZ_\RESOURCE_FILES_DIR\mcspluginsettingsres.rsc RESOURCE_FILES_DIR\mcspluginsettingsres.rsc + +#endif // MCSPLUGIN_RESOURCES_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2009 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: MCS settings plug-in main class. +* +*/ + + +#ifndef MCSPLUGINSETTINGS_H +#define MCSPLUGINSETTINGS_H + +#include + +class CMCSPluginSettingsContainer; +class CMCSPluginSettingsModel; + +/** + * @ingroup group_mcsplugin + * + * MCS settings plug-in main class + * + * @lib mcspluginsettings.lib + * @since S60 9.1 + */ +class CMCSPluginSettings : public CGSBaseView +{ + +public: + /** + * Part of the two phased constuction + * + * @param aInitParams + * @return CMCSPluginSettings* + */ + static CMCSPluginSettings* NewL(TAny* aInitParams); + + /** + * Destructor + */ + virtual ~CMCSPluginSettings(); + + // from base class CAknView + + /** + * From CAknView + * Returns view id. + * + * @since S60 3.2 + * @return TUid + */ + TUid Id() const; + + /** + * From CAknView + * Handles commands. + * + * @since S60 3.2 + * @param aCommand Command to be handled. + */ + void HandleCommandL(TInt aCommand); + + /** + * See base class in AknView.h + * + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + */ + void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * See base class. + */ + void DoDeactivate(); + + // from base class CGSPluginInterface + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + * @param aCaption + */ + void GetCaptionL(TDes& aCaption) const; + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + * @return TInt + */ + TInt PluginProviderCategory() const; + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + * @return TBool + */ + TBool Visible() const; + + /** + * From CGSBaseView + * + * @since S60 3.2 + * Returns the container this view has. + * @return pointer to container, does not transfer ownership. + */ + CMCSPluginSettingsContainer* Container(); + + /** + * Check if view is activate + * @since S60 5.1 + * @return ETrue if activated, EFalse otherwise + */ + TBool Activated() const; + +protected: + +private: // From MEikMenuObserver + + /** + * Changes MenuPane dynamically + * + * @param aResourceId + * @param aMenuPane + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + +private: + /** + * CMCSPluginSettings + */ + CMCSPluginSettings(); + + /** + * Part of the two phased construction + */ + void ConstructL(); + + + // from base class CGSBaseView + + /** + * From CGSBaseView + * Functionality for creating a container. Called by DoActivateL(). + */ + void NewContainerL(); + + /** + * From CGSBaseView + * Handles listbox selection. Called by HandleListBoxEventL. + * Implement by sub-class. + */ + void HandleListBoxSelectionL(); + + /** + * DoHandleListBoxSelectionL + * + * @param aAny + * @return TInt + */ + static TInt DoHandleListBoxSelectionL( TAny* aAny ); + + +private: // data + + /** + * Settings plug-in model. + * Own. + */ + CMCSPluginSettingsModel* iModel; +}; + +#endif // MCSPLUGINSETTINGS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettings.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 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: Resource headers for MCS plug-in +* +*/ + + +#ifndef MCSPLUGINSETTINGS_HRH +#define MCSPLUGINSETTINGS_HRH + +/** + * Menu command ids for the Shortcut plug-in Settings + */ +enum TAiScutSettingsMenuCommands +{ + EAiScutSettingsCmdChange = 0x6000, + + EAiScutSettingsCmdChangeToApps, + EAiScutSettingsCmdChangeToUrl, + EAiScutSettingsCmdChangeToBookmark, + EAiScutSettingsCmdChangeShortcutType +}; + +/** + * Shortcut setting types + */ +enum TAiScutSettingType +{ + EAiScutSettingTypeUndefined = -1, + EAiScutSettingTypeApplication, + EAiScutSettingTypeBookmark, + EAiScutSettingTypeUrl +}; + +#endif // MCSPLUGINSETTINGS_HRH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 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: Application list for settings listbox. +* +*/ + + +#ifndef CMCSPLUGINSETTINGSAPPLIST_H +#define CMCSPLUGINSETTINGSAPPLIST_H + +#include +#include // For MDesCArray +#include // For RApaLsSession +#include // For MMsvSessionObserver +#include // For MApaAppListServObserver +#include // For MenuContentService +#include // For HSPS settings property map + +/** + * @ingroup group_mcsplugin + * + * Observer interface for application list events + * + * @since S60 v3.2 + */ +class MMCSPluginListObserver +{ +public: + + /** + * AppList event codes + */ + enum TScutListEvent + { + EAppListReady, + EAppListUpdated, + EBkmListUpdated + }; + + /** + * Callback for application list events + * + * @since S60 v3.2 + * @param aEvent AppList event code + * @param aAdded ETrue if applications were added, EFalse if removed + */ + virtual void HandleScutListEventL( + TScutListEvent aEvent, TBool aAdded ) = 0; + + // virtual TBool IsHidden(const TUid& aAppUid) const = 0; + +}; + +struct TSettingItem; +/** + * Application list for settings listbox + * + * @since S60 v3.2 + */ + +class CMCSPluginWatcher; + +/** + * @ingroup group_mcsplugin + * + * MCSPluginSettingsAppList class + * + * @since S60 v9.1 + */ +class CMCSPluginSettingsAppList : public CBase, //public CActive + public MDesCArray, public MMsvSessionObserver +{ + +public: + /** + * Part of the two phased constuction + * + * @return CMCSPluginSettingsAppList* + */ + static CMCSPluginSettingsAppList* NewL(); + + /** + * CompareNameL + * + * @param aFirst + * @param aSecond + */ + static TInt CompareNameL(const CMenuItem& aFirst, const CMenuItem& aSecond); + + /** + * Destructor + */ + virtual ~CMCSPluginSettingsAppList(); + + // from base class MDesCArray + + /** + * From MDesCArray + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * From MDesCArray + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within a descriptor + * array. + * @return A 16 bit non-modifiable pointer descriptor representing the + * descriptor element located at position aIndex within a descriptor + * array. + */ + TPtrC MdcaPoint( TInt aIndex ) const; + + // from base class MMsvSessionObserver + + /** + * Handles an event from the message server. + * Not used, but must be defined to be able to use the messaging server. + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, + TAny* aArg3 ); + + /** + * Starts the asynchronous appliation list initialization + * + * @since S60 v3.2 + */ + void StartL(); + + /** + * FindItemL + * + * @since S60 + * @param aProperties + * @return TSettingItem + */ + TSettingItem FindItemL( RPointerArray& + aProperties ); + + /** + * + * + * @since S60 + * @param + * @return + */ + CMenuItem& ItemL(const TInt& aIndex ); + /** + * RemoveMenuItemL + * + * @param aIndex + */ + void RemoveMenuItemL( TInt aIndex ); + +protected: + +private: + /** + * Constructor + */ + CMCSPluginSettingsAppList(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + /** + * Adds the static list items to the application list. + * For example "New Message" and "New Email" items are added here. + * + * @since S60 v3.2 + */ + void AddStaticItemsL(); + + /** + * Finds all mailboxes defined in the device + */ + CMsvEntry* GetRootEntryL(); + + /** + * Adds remote mailboxes to the application list. + * + * @since S60 v3.2 + */ + void AddMailboxesL(); + + /** + * Adds a mailbox to the list + * + * @since S60 v3.2 + * @param aMailbox Name of the mailbox to add + */ + void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ); + + /** + * GetID of MCS Plugin Folder + * + * @return TInt + */ + TInt GetMCSPluginFolderIdL(); + + /** + * Update menu items + * + * @return TInt + */ + TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd ); + +private: // data + + /** + * List of application items + * Own. + */ + RPointerArray iListItems; + + /** + * Message server session + * Own. + */ + CMsvSession* iMsvSession; + + /** + * Registered observer for application list events + */ + //MMCSPluginListObserver& iObserver; + + /** + * A flag indicating if the app list should observe changes + */ + TBool iObserving; + + /** + * iMenu + */ + RMenu iMenu; + + /** + * iSaveWatcher + */ + CMCSPluginWatcher* iSaveWatcher; + + /** + * iUpdateWatcher + */ + CMCSPluginWatcher* iUpdateWatcher; + + /** + * iRemoveWatcher + */ + CMCSPluginWatcher* iRemoveWatcher; + + /** + * iMCSPluginFolderId + */ + TInt iMCSPluginFolderId; +}; + +#endif // CMCSPLUGINSETTINGSAPPLIST_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsbkmlist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,355 @@ +/* +* Copyright (c) 2009 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: Bookmark list for settings listbox. +* +*/ + + +#ifndef CMCSPLUGINSETTINGSBKMLIST_H +#define CMCSPLUGINSETTINGSBKMLIST_H + +#include +#include // For MDesCArray +#include // For MFavouritesDbObserver +#include // For RFavouritesDb +#include // For CFavouritesItemList +#include // For MenuContentService + +class CActiveFavouritesDbNotifier; +class CAiScutSettingsItem; +class CMCSPluginSettingsModel; +class CMCSPluginWatcher; +struct TSettingItem; +/** + * @ingroup group_mcsplugin + * + * Bookmark list for settings listbox + * + * @since S60 v3.2 + */ +class CMCSPluginSettingsBkmList : public CBase, public MDesCArray +{ + + /** + * TBookmarkType + */ + enum TBookmarkType + { + EFavBookmark, + EMCSBookmark + }; + +public: + + /** + * Part of the two phased constuction + */ + static CMCSPluginSettingsBkmList* NewL(); + + /** + * Destructor + */ + virtual ~CMCSPluginSettingsBkmList(); + + // from base class MDesCArray + + /** + * From MDesCArray + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * From MDesCArray + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within a descriptor + * array. + * @return A 16 bit non-modifiable pointer descriptor representing the + * descriptor element located at position aIndex within a descriptor + * array. + */ + TPtrC MdcaPoint(TInt aIndex) const; + + /** + * Gets the bookmark list. + * + * @since S60 v3.2 + */ + void GetBookmarkListL(); + + /** + * + * + * @since S60 + * @param aIndex Setting item to find + * @return MCS menu item + */ + CMenuItem& ItemL( TInt aIndex ); + + /** + * Returns target bookmark data from the given index + * + * @since S60 v3.2 + * @param aIndex Index of the bookmark in the list + * @param aParams On return, the bookmark parameters + * @param aCaption On return, the bookmark caption + * @return KErrNotFound if the bookmark cannot be found, KErrNone otherwise + */ + //TInt GetDataByIndex(TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const; + + TSettingItem FindItemL( + RPointerArray& aProperties ); + + /** + * Remove menu item + * + * @param aIndex + */ + void RemoveMenuItemL( TInt aIndex ); + +protected: + +private: + + /** + * Constructor + */ + CMCSPluginSettingsBkmList(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + /** + * Adds an bookmark to the list + * + * @since S60 v3.2 + * @param aBkmInfo Bookmark information object + */ + void AddBookmarkL( const TDesC& aUid, const TDesC& aCaption, + const TDesC& aUrl, TBookmarkType aType ); + + /** + * Updates the bookmark list + * + * @since S60 v3.2 + */ + void UpdateBkmListL(); + + /** + * Get bookmarks from favourites + */ + void GetBookmarksFromFavouritesL(); + + /** + * Get bookmarks from MCS + */ + void GetBookmarksFromMCSL(); + + /** + * Create menu item + * + * @param aUid + * @param aName + * @param aUrl + * @return pointer to the created CMenuItem object + */ + CMenuItem* CreateMenuItemL( const TDesC& aUid,const TDesC& aName, + const TDesC& aUrl ); + + /** + * MCSMenuItemL + * + * @param aUid + * @param aName + * @param aUrl + * @return pointer to the CMenuItem object + */ + CMenuItem* MCSMenuItemL( const TDesC& aUid,const TDesC& aName, + const TDesC& aUrl ); + + /** + * GetMCSPluginFolderIdL + * + * @return TInt + */ + TInt GetMCSPluginFolderIdL(); + + /** + * UpdateMenuItemsRefCountL + * + * @param aItem + * @param aValueToAdd + * @return TInt + */ + TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd ); + + +private: + + /** + * Nested class to store individual bookmark list items + * + * @since S60 v3.2 + */ + class CBkmListItem : public CBase + { + public: + + /** + * Part of the two phased constuction + * + * @param aUid + * @param aCaption + */ + static CBkmListItem* NewLC( const TDesC& aUid, const TDesC& aCaption); + + /** + * Destructor + */ + ~CBkmListItem(); + + /** + * Compare method used to add the items to the list in sorted order + * + * @since S60 v3.2 + * @param aFirst The first item to be compared + * @param aSecond The second item to be compared + * @return Negative if first comes before second, zero if equal and + * positive if first comes after second + */ + static TInt CompareCaption(const CBkmListItem& aFirst, + const CBkmListItem& aSecond); + + /** + * Returns the item target bookmark uid + * + * @since S60 v3.2 + * @return Target bookmark uid + */ + //TUid Uid() const; + + /** + * Returns the item target bookmark caption + * + * @since S60 v3.2 + * @return Target bookmark caption + */ + TPtrC Caption() const; + + /** + * iType + */ + TBookmarkType iType; + + /** + * Target bookmark uid + */ + HBufC* iUid; + + /** + * Target bookmark caption + */ + HBufC* iCaption; + + /** + * Target bookmark parameters + */ + HBufC* iUrl; + + private: + + /** + * Constructor + */ + CBkmListItem(); + + /** + * Second-phase constructor. + * + * @param aUid + * @param aCaption + */ + void ConstructL( const TDesC& aUid, const TDesC& aCaption); + + private: // data + + + }; + +private: // data + + /** + * List of bookmark items + * Own. + */ + RPointerArray iListItems; + + // Runtime created CMenuItems must be stored, because those are refered + RPointerArray iMenuItems; + + /** + * A flag indicating if the bookmark list should observe changes + */ + TBool iObserving; + + /** + * Bookmark database session. + * Own. + */ + RFavouritesSession iBookmarkSess; + + /** + * Bookmark database. + * Own. + */ + RFavouritesDb iBookmarkDb; + + /** + * iMenu + */ + RMenu iMenu; + + /** + * Save watcher + */ + + CMCSPluginWatcher* iSaveWatcher; + + /** + * Update watcher + */ + CMCSPluginWatcher* iUpdateWatcher; + + /** + * Remove watcher + */ + CMCSPluginWatcher* iRemoveWatcher; + + /** + * MCS plugin folder ID + */ + TInt iMCSPluginFolderId; + +}; + +#endif // CMCSPLUGINSETTINGSBKMLIST_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,267 @@ +/* +* Copyright (c) 2009 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: MCS settings plug-in container. +* +*/ + + +#ifndef CMCSPLUGINSETTINGSCONTAINER_H +#define CMCSPLUGINSETTINGSCONTAINER_H + +// External includes +#include +#include +#include +#include // For MFavouritesDbObserver +#include // For RFavouritesDb +#include // For MMsvSessionObserver + +// Internal includes +#include "mcspluginwatcher.h" + +// Forward declaration +class CAknRadioButtonSettingPage; +class CMCSPluginSettingsModel; +class CActiveFavouritesDbNotifier; +class CMCSPluginWatcher; + +/** + * @ingroup group_mcsplugin + * + * Shortcut settings plug-in container + * + * @lib mcspluginsettings.lib + * @since S60 v3.2 + */ +class CMCSPluginSettingsContainer : public CGSBaseContainer, + public MFavouritesDbObserver, public MMsvSessionObserver, + public MMCSPluginWatcherObserver +{ + +public: + /** + * Public constructor + */ + CMCSPluginSettingsContainer(); + + /* + * Descructor + */ + virtual ~CMCSPluginSettingsContainer(); + + /** + * Sets pointer to settings plug-in model. + * + * @since S60 v3.2 + * @param aModel Pointer to settings plug-in model + */ + void SetModel(CMCSPluginSettingsModel* aModel); + + /** + * Handles a setting change command + * + * @since S60 v3.2 + */ + void HandleChangeCommandL(); + + /** + * Handles a help command + * + * @since S60 v9.1 + */ + void HandleHelpCommandL(); + + /** + * Dialog showing changed + * + * @since S60 v3.2 + */ + TBool IsChangeDialogShowing(); + + /** + * Close change dialog + * + * @since S60 v3.2 + */ + void CloseChangeDialog(); + + /** + * Reset current list + * + * @since S60 v3.2 + */ + void ResetCurrentListL(TInt aIndex); + + // from base class MMsvSessionObserver + + /** + * Handles an event from the message server. + * Not used, but must be defined to be able to use the messaging server. + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, + TAny* aArg2, TAny* aArg3 ); + + // from base class MMCSPluginWatcherObserver + + /** + * Hanle notify + */ + void HandleNotifyL(); + +private: + + /* + * Leaving constructor + * + * @param aRect + */ + void ConstructL(const TRect& aRect); + + /** + * Tells the settings container to start observing for changes in favorites + * database and mailbox db. + * + */ + void StartObservingL(); + + /** + * Tells the settings container to stop observing for changes in favorites + * database and mailbox db. + * + */ + void StopObserving(); + + // from base class CGSBaseContainer + + /** + * From CGSBaseContainer + * Constructs the settings listbox + * + * @since S60 v3.2 + * @param aResLbxId Listbox resource id + */ + void ConstructListBoxL(TInt aResLbxId); + + /** + * Chandles a setting change command to select application from a list + * + * @since S60 v3.2 + * @param aItem Applist item to modify + * @param aNew ETrue if selecting an application for first time, + * EFalse if not + * @return ETrue if shortcut was changed. EFalse if not + */ + TBool HandleAppListChangeCommandL( const TInt& aIndex, + const TInt& aSettingIndex ); + + /** + * Chandles a setting change command to select bookmark from a list + * + * @since S60 v3.2 + * @param aItem Applist item to modify + * @param aNew ETrue if selecting an application for first time, + * EFalse if not + * @return ETrue if shortcut was changed. EFalse if not + */ + TBool HandleBookmarkChangeCommandL( const TInt& aIndex, + const TInt& aSettingIndex ); + + /** + * Creates Help Context for launching Shortcuts Help page. + */ + TCoeHelpContext GetHelpContext() const; + + /** + * Offer key event + * + * @param aKeyEvent + * @param aType + */ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + + /** + * Checks if there is a need to update the middle softkey label. + */ + void CheckMiddleSoftkeyLabelL(); + + // From MFavouritesDbObserver + /** + * Handles database event. + * @param aEvent Database event. + */ + void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); + +private: // data + + /** + * Settings plug-in model. + * Not own. + */ + CMCSPluginSettingsModel* iModel; + + /** + * Application selection list page. + * Own. + */ + CAknRadioButtonSettingPage* iAppListDialog; + + /** + * Bookmark selection list page. + * Own. + */ + CAknRadioButtonSettingPage* iBkmListDialog; + + /** + * Bookmark database change observer. + * Own. + */ + CActiveFavouritesDbNotifier* iBookmarkDbObserver; + + /** + * Bookmark database. + */ + RFavouritesDb iBookmarkDb; + + /** + * Bookmark database session. + */ + RFavouritesSession iBookmarkSession; + + /** + * Message server session + * Own. + */ + CMsvSession* iMsvSession; + + // MCS resource + RMenu iMenu; + + // MCS change notifier + RMenuNotifier iNotifier; + + /* MCS change notifier watcher + * Own + */ + CMCSPluginWatcher* iNotifyWatcher; +}; + +#endif // CMCSPLUGINSETTINGSCONTAINER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,301 @@ +/* +* Copyright (c) 2009 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: MCS settings plug-in model. +* +*/ + + +#ifndef CMCSPLUGINSETTINGSMODEL_H +#define CMCSPLUGINSETTINGSMODEL_H + +// External includes +#include +#include // For MDesCArray +#include +#include +#include +#include + +// Internal includes +#include "mcspluginsettingsapplist.h" +#include "mcspluginsettingsbkmlist.h" + +// Forward declaration +class CCoeEnv; +class CMCSPluginSettingsContainer; +class CMCSPluginSettings; +class HSPluginSettingsIf::CItemMap; + +/** + * TSettingType + */ +enum TSettingType + { + EApplication, + EBookmark + }; + +/** + * TSettingItem + */ +struct TSettingItem + { + TInt id; + TSettingType type; + TBool locked; + }; + +/** + * @ingroup group_mcsplugin + * + * MCS settings plug-in model + * + * @lib mcspluginsettings.lib + * @since S60 9.1 + */ +class CMCSPluginSettingsModel : public CBase + , public MDesCArray + , public HSPluginSettingsIf::MHomeScreenSettingsObserver +{ + +public: + + /** + * Two phase constructor + * + * @param aPlugin + * @param aEnv + */ + static CMCSPluginSettingsModel* NewL( CMCSPluginSettings& aPlugin, + CCoeEnv* aEnv); + + /** + * Descructor + */ + virtual ~CMCSPluginSettingsModel(); + +public: // from MDesCArray + + /** + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within + * a descriptor array. + * @return A 16 bit non-modifiable pointer descriptor representing the + * descriptor element located at position aIndex within a descriptor + * array. + */ + TPtrC MdcaPoint(TInt aIndex) const; + +public: + + /** + * Returns an ID of a setting item for the given index + * + * @since S60 v3.2 + * @param aIndex Index of the setting item + * @return ID of a setting item + */ + TInt ItemId( TInt aIndex ) const; + + /** + * Returns a pointer to setting item for the given index + * + * @since S60 v9.1 + * @param aIndex Index of the setting item + * @return setting item + */ + const TSettingItem Item( TInt aIndex ) const; + + /** + * + */ + TBool ReplaceItemL( const TInt& aItemIndex, TInt aValue, + TSettingType aType ); + + /** + * Sets pointer to settings plug-in container. + * + * @since S60 v3.2 + * @param aContainer Pointer to settings plug-in container. + */ + void SetContainer(CMCSPluginSettingsContainer* aContainer); + + + /** + * Get application list + */ + CMCSPluginSettingsAppList* AppList(); + + /** + * Get bookmark list + */ + CMCSPluginSettingsBkmList* BkmList(); + + /** + * Update application list + */ + void UpdateAppListL(); + + /** + * Update bookmark list + */ + void UpdateBkmListL(); + + /** + * Update settings container + * + * @param aPluginId + */ + void UpdateSettingsContainerL( const TDesC8& aPluginId ); + + // From MHomeScreenSettingsObserver + /** + * Settings changed + * + * @param aEvent + * @param aPluginName + * @param aPluginUid + * @param aPluginId + * @return TInt + */ + TInt SettingsChangedL( const TDesC8& aEvent, const TDesC8& aPluginName, + const TDesC8& aPluginUid, const TDesC8& aPluginId ); + +private: + + /** + * Private constructor + * + * @param aPlugin + * @param aEnv + */ + CMCSPluginSettingsModel(CMCSPluginSettings& aPlugin, CCoeEnv* aEnv); + + /** + * Leaving constructor + */ + void ConstructL(); + + /** + * ListBoxLineL + * + * @param aCaption + * @param aIndex + * @return TPtrC + */ + TPtrC ListBoxLineL( const TDesC& aCaption, TInt aIndex ) const; + + /** + * ItemL + * + * @param aProperties + * @return TSettingItem + */ + TSettingItem ItemL( + RPointerArray& aProperties ); + + /** + * Setting type + * + * @param aProperties + * @return TSettingType + */ + TSettingType SettingTypeL( + RPointerArray& aProperties ); + + /** + * Setting locked + * + * @param aProperties + * @return TBool + */ + TBool SettingLockedL( + RPointerArray& aProperties ); + + /** + * Update settings + * + * @param aPluginId + */ + void UpdateSettingsL( const TDesC8& aPluginId ); + + /** + * Save settings + * + * @param aIndex + * @param aMenuItem + */ + void SaveSettingsL( const TInt& aIndex, CMenuItem& aMenuItem ); + +private: // data + + /** + * Array of setting items. + * Own. + */ + RArray iSettings; + + // Homescreen settings API + HSPluginSettingsIf::CHomescreenSettings* iPluginSettings; + + HBufC8* iPluginId; + + // Stores the text which is drawn by listbox + // Listbox takes only reference + mutable HBufC* iListBoxLine; + + /** + * Settings plugin + * Not own. + */ + CMCSPluginSettings& iPlugin; + + /** + * Coe environment. + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Application list. + * Own. + */ + CMCSPluginSettingsAppList* iAppList; + + /** + * Bookmark list. + * Own. + */ + CMCSPluginSettingsBkmList* iBkmList; + + /** + * Settings plugin container. + * Not own. + */ + CMCSPluginSettingsContainer* iContainer; +}; + +#endif // CMCSPLUGINSETTINGSMODEL_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettings.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,307 @@ +/* +* Copyright (c) 2009 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: MCS settings plug-in main class. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For RProperty +#include // For KPSUidActiveIdle2 + +#include +#include +#include + +#include "mcspluginsettings.hrh" +#include "mcspluginsettings.h" +#include "mcspluginsettingscontainer.h" +#include "mcspluginsettingsmodel.h" +#include "mcspluginuids.hrh" + +const TUid KUidScutSettingsPlugin = +{ + AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN +}; + +const TUid KUidAiFwCommon = +{ + AI_UID3_AIFW_COMMON +}; + +_LIT(KMCSSettingsResourceFileName, "mcspluginsettingsres.rsc"); + +/** Implementation table for MCS settings plug-in */ +const TImplementationProxy KMCSPluginSettingsImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY( + AI_UID_ECOM_IMPLEMENTATION_SETTINGS_MCSPLUGIN, CMCSPluginSettings::NewL) +}; + + +// --------------------------------------------------------------------------- +// Gate/factory function. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = + sizeof(KMCSPluginSettingsImplementationTable) / + sizeof(TImplementationProxy); + return KMCSPluginSettingsImplementationTable; +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// First phase construction +// --------------------------------------------------------------------------- +// +CMCSPluginSettings::CMCSPluginSettings() +{ +} + +// --------------------------------------------------------------------------- +// Second phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettings::ConstructL() +{ + FeatureManager::InitializeLibL(); + + TParsePtrC driveParse(PathInfo::RomRootPath()); + TFileName resourceName(driveParse.Drive()); + // Find the resource file. + TParse parse; + parse.Set(KMCSSettingsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + resourceName.Append(parse.FullName()); + // Open resource file. + iResourceLoader.OpenL(resourceName); + + iModel = CMCSPluginSettingsModel::NewL(*this, iCoeEnv); + + BaseConstructL(R_AI_MCS_SETTINGS_VIEW); +} + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettings* CMCSPluginSettings::NewL( TAny* /*aInitParams*/ ) +{ + CMCSPluginSettings* self = new (ELeave) CMCSPluginSettings; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettings::~CMCSPluginSettings() +{ + FeatureManager::UnInitializeLib(); + iResourceLoader.Close(); + delete iModel; +} + +// --------------------------------------------------------------------------- +// From CAknView +// Returns view id. +// --------------------------------------------------------------------------- +// +TUid CMCSPluginSettings::Id() const +{ + return KUidScutSettingsPlugin; +} + +// --------------------------------------------------------------------------- +// From CAknView +// Handles commands. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettings::HandleCommandL(TInt aCommand) +{ + switch (aCommand) + { + case EAiScutSettingsCmdChange: + Container()->HandleChangeCommandL(); + break; + + case EAknCmdHelp: + Container()->HandleHelpCommandL(); + break; + + case EAknSoftkeyBack: + if (iAppUi->View(KGSMainViewUid)) + { + // if we are in GS activate parent plugin view (standby view)... + iAppUi->ActivateLocalViewL(KGSPrslnPluginUid); + } + else + { + iAppUi->ActivateLocalViewL(iPrevViewId.iViewUid); + } + break; + + case EAknSoftkeyExit: + iAppUi->HandleCommandL(EAknCmdExit); + break; + + default: + iAppUi->HandleCommandL(aCommand); + break; + } +} + +// ---------------------------------------------------------------------------- +// From CAknView +// First method called by the Avkon framwork +// ---------------------------------------------------------------------------- +// +void CMCSPluginSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) +{ + CEikButtonGroupContainer* cba = Cba(); + + if (cba) + { + if (aCustomMessageId == KUidAiFwCommon) + { + cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_EXIT_CHANGE); + } + else + { + cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_BACK_CHANGE); + } + cba->DrawDeferred(); + } + + CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); + + iModel->UpdateSettingsContainerL( aCustomMessage ); +} + +// ---------------------------------------------------------------------------- +// From CAknView +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CMCSPluginSettings::DoDeactivate() +{ + CGSBaseView::DoDeactivate(); + + iModel->SetContainer(Container()); +} + +// ---------------------------------------------------------------------------- +// From MEikMenuObserver +// ---------------------------------------------------------------------------- +// +void CMCSPluginSettings::DynInitMenuPaneL( + TInt aResourceId, CEikMenuPane* aMenuPane) +{ + if (aMenuPane && aResourceId == R_AI_MCS_SETTINGS_MENUPANE) + { + if (!FeatureManager::FeatureSupported(KFeatureIdHelp)) + { + // Disable help if not supported + aMenuPane->SetItemDimmed(EAknCmdHelp, ETrue); + } + if (iModel->MdcaCount() == 0) + { + aMenuPane->SetItemDimmed(EAiScutSettingsCmdChange, ETrue); + } + } +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface. 256 +// --------------------------------------------------------------------------- +// +void CMCSPluginSettings::GetCaptionL(TDes& aCaption) const +{ + iCoeEnv->ReadResourceL(aCaption, R_AI_MCS_SETTINGS_VIEW_CAPTION); +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettings::PluginProviderCategory() const +{ + return KGSPluginProviderInternal; +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettings::Visible() const +{ + return EFalse; +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// Returns view id. +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsContainer* CMCSPluginSettings::Container() +{ + return static_cast(iContainer); +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// --------------------------------------------------------------------------- +// +void CMCSPluginSettings::NewContainerL() +{ + delete iContainer; + iContainer = NULL; + + iContainer = new (ELeave) CMCSPluginSettingsContainer(); + Container()->SetModel(iModel); + iModel->SetContainer(Container()); +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// --------------------------------------------------------------------------- +// +void CMCSPluginSettings::HandleListBoxSelectionL() +{ + Container()->HandleChangeCommandL(); +} + +// --------------------------------------------------------------------------- +// Returns if container exists or not +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettings::Activated() const + { + return iContainer ? ETrue : EFalse; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsapplist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,633 @@ +/* +* Copyright (c) 2009 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: Application list for settings listbox +* +*/ + + +#include +#include // For KMsvRootIndexEntryIdValue +#include +#include +#include +#include +#include +#include + +#include "mcspluginsettingsapplist.h" +#include "mcspluginsettingsmodel.h" +#include "mcspluginwatcher.h" + +_LIT( KMyMenuData, "matrixmenudata" ); +_LIT( KMenuTypeShortcut, "menu:shortcut" ); +_LIT( KMenuAttrRefcount, "ref_count" ); +_LIT( KMenuParamMailbox, "mailbox:" ); +_LIT( KMenuAttrParameter, "param" ); +_LIT( KMenuAttrLocked, "locked" ); +_LIT( KMenuIconFile, "aimcsplugin.mif" ); +_LIT( KMenuIconId, "16388" ); +_LIT( KMenuMaskId, "16389" ); +_LIT( KMailboxUid, "0x100058c5" ); +_LIT( KInitialRefCount, "1" ); +_LIT( KMCSFolder, "mcsplugin_folder" ); +_LIT( KSuiteName, "suite_name" ); +_LIT8( KItemLocked, "locked"); +_LIT8( KProperValueFolder, "folder" ); +_LIT8( KProperValueSuite, "suite" ); + + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// First-phase construction +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsAppList::CMCSPluginSettingsAppList() + { + iMCSPluginFolderId = 0; + } + +// --------------------------------------------------------------------------- +// Second-phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::ConstructL() + { + iMsvSession = CMsvSession::OpenAsObserverL(*this); + + iMenu.OpenL( KMyMenuData ); + iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + } + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsAppList* CMCSPluginSettingsAppList::NewL() + { + CMCSPluginSettingsAppList* self = new (ELeave) CMCSPluginSettingsAppList(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsAppList::~CMCSPluginSettingsAppList() + { + delete iMsvSession; + + iListItems.ResetAndDestroy(); + iMenu.Close(); + delete iSaveWatcher; + delete iUpdateWatcher; + delete iRemoveWatcher; + + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsAppList::MdcaCount() const + { + return iListItems.Count(); + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CMCSPluginSettingsAppList::MdcaPoint( TInt aIndex ) const + { + if (aIndex < 0 || aIndex >= iListItems.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + CMenuItem* item = iListItems[aIndex]; + TBool attrExists; + TPtrC itm; + TRAP_IGNORE( + itm.Set( item->GetAttributeL( KMenuAttrLongName, attrExists ) ); + ) + return itm; + } + +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::HandleSessionEventL( + TMsvSessionEvent /*aEvent*/, + TAny* /*aArg1*/, + TAny* /*aArg2*/, + TAny* /*aArg3*/ ) + { + + } + +// --------------------------------------------------------------------------- +// Starts the asynchronous application list initialization. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::StartL() + { + iListItems.ResetAndDestroy(); + AddMailboxesL(); + AddStaticItemsL(); + } + +// --------------------------------------------------------------------------- +// Iterates thru the application list and tries to find a menuitem which +// matches given property map from HSPS +// --------------------------------------------------------------------------- +// +TSettingItem CMCSPluginSettingsAppList::FindItemL( + RPointerArray& aProperties ) + { + TBool attrExists( EFalse ); + TSettingItem settingItem = { KErrNotFound, EApplication, EFalse }; + TBool isFolder = EFalse; + TBool isSuite = EFalse; + + // check if the item is folder or suite + for ( TInt j = 0; j < aProperties.Count(); j++ ) + { + if( aProperties[j]->Name() == KType ) + { + + if ( aProperties[j]->Value() == KProperValueFolder ) + { + isFolder = ETrue; + } + + if ( aProperties[j]->Value() == KProperValueSuite ) + { + isSuite = ETrue; + } + break; + } + } + + TBool itemFound( EFalse ); + + // compare name/value pairs with every menu item in the list + for ( TInt i = 0; i < iListItems.Count() && !itemFound; i++ ) + { + TBool match( ETrue ); + CMenuItem* item = iListItems[ i ]; + + for ( TInt j = 0; j < aProperties.Count() && match; j++ ) + { + // type and locked properties skipped + if ( aProperties[j]->Name() != KType && + aProperties[j]->Name() != KItemLocked ) + { + HBufC* attrName( NULL ); + attrName = AiUtility::CopyToBufferL( attrName, + aProperties[j]->Name()); + CleanupStack::PushL( attrName ); + TPtrC attr = item->GetAttributeL( *attrName, attrExists ); + + HBufC* attrValue( NULL ); + attrValue = AiUtility::CopyToBufferL( attrValue, + aProperties[j]->Value()); + CleanupStack::PushL( attrValue ); + + // in case of folder, we just have to compare id + // which is stored in param attribute + if ( isFolder && *attrName == KMenuAttrParameter ) + { + // convert id to integer + TInt id; + TLex16 lextmp( attrValue->Ptr() ); + lextmp.Val( id ); + + if ( item->Id() != id ) + { + match = EFalse; + } + CleanupStack::PopAndDestroy( attrValue ); + CleanupStack::PopAndDestroy( attrName ); + break; + } + + // in case of suite, we just have to compare suite_name + // which is stored in param attribute + if ( isSuite && *attrName == KMenuAttrParameter ) + { + TBool exists; + TPtrC suitename = item->GetAttributeL( KSuiteName, exists ); + + if ( !exists || suitename != *attrValue ) + { + match = EFalse; + } + CleanupStack::PopAndDestroy( attrValue ); + CleanupStack::PopAndDestroy( attrName ); + break; + } + + // otherwise, compare attributes from HSPS and from menuitem + // if there is no match, move to the next item in the list + if ( attr != *attrValue ) + { + match = EFalse; + } + CleanupStack::PopAndDestroy( attrValue ); + CleanupStack::PopAndDestroy( attrName ); + } + } + + if ( match ) + { + settingItem.id = i; + settingItem.type = EApplication; + itemFound = ETrue; + } + } + return settingItem; + } + + +// --------------------------------------------------------------------------- +// Returns menuitems at given index. Since this method is called during +// adding the item to the Desktop widget, we also have to increment +// ref_count attribute if the item is run-time generated (i.e. Mailbox) +// --------------------------------------------------------------------------- +// +CMenuItem& CMCSPluginSettingsAppList::ItemL( const TInt& aIndex ) + { + + CMenuItem* menuItem( NULL ); + + // check if index in within the list boundaries + if ( aIndex >= 0 && aIndex < iListItems.Count() ) + { + + menuItem = iListItems[ aIndex ]; + + TBool hasParam = EFalse; + CleanupStack::PushL( menuItem ); + TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam ); + CleanupStack::Pop( menuItem ); + + // if item is a mailbox, add it to MCS + // (if it is not already there) + if ( hasParam && param.Find( KMenuParamMailbox ) != KErrNotFound ) + { + + // set up a filter for finding the mailbox + // with given ID in MCS + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + filter->SetType( KMenuTypeShortcut ); + filter->HaveAttributeL( KMenuAttrParameter, param ); + + // search menu from the Root folder with the filter + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + + // save the number of findings + TInt count( itemArray.Count() ); + + // if MenuItem does not exist in MCS + if ( count == 0 ) + { + // save the item into Matrixmenudata.xml + // the "op" variable is cleaned up by iSaveWatcher when asynchronous + // operation finishes + CleanupStack::PushL( menuItem ); + CMenuOperation* op = menuItem->SaveL( iSaveWatcher->iStatus ); + CleanupStack::Pop( menuItem ); + iSaveWatcher->Watch( op ); + } + else + { + // Item already exists in MCS + // If it has reference counter, increment it before returning. + CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); + + TInt newRefCount = UpdateMenuItemsRefCountL( itm, 1 ); + if ( newRefCount > -1 ) + { + CleanupStack::PushL( itm ); + CMenuOperation* op = itm->SaveL( iSaveWatcher->iStatus ); + CleanupStack::PopAndDestroy( itm ); + iSaveWatcher->Watch( op ); + } + } + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + } + } + return *menuItem; + } + +// --------------------------------------------------------------------------- +// Helper method for comparing names of two menuitems. Used to sort the list +// of items. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsAppList::CompareNameL( const CMenuItem& aFirst, + const CMenuItem& aSecond ) + { + TBool exists( EFalse ); + CMenuItem& first = const_cast(aFirst); + CMenuItem& second = const_cast(aSecond); + + TPtrC name1 = first.GetAttributeL( KMenuAttrLongName, exists ); + TPtrC name2 = second.GetAttributeL( KMenuAttrLongName, exists ); + + return name1.CompareC( name2 ); + } + +// --------------------------------------------------------------------------- +// Adds the static list items to the application list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::AddStaticItemsL() + { + TLinearOrder sortMethod( CMCSPluginSettingsAppList::CompareNameL ); + + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + // skip run-time generated items + filter->DoNotHaveAttributeL( KMenuAttrRefcount ); + filter->DoNotHaveAttributeL( KMenuAttrLocked ); + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + + TInt count( itemArray.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + TPtrC type = itemArray[ i ].Type(); + + // we add applications, shortcuts, folders and suites to the list + if ( type == KMenuTypeApp || type == KMenuTypeShortcut || + type == KMenuTypeFolder || type == KMenuTypeSuite ) + { + CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemArray[ i ] ); + CleanupStack::PushL( menuItem ); + + // only non-hidden and non-missing items should be offered to the user + if ( ( menuItem->Flags() & TMenuItem::EHidden ) == EFalse && + ( menuItem->Flags() & TMenuItem::EMissing ) == EFalse ) + { + User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( menuItem, sortMethod ) ); + CleanupStack::Pop( menuItem ); + } + else + { + CleanupStack::PopAndDestroy( menuItem ); + } + menuItem = NULL; + } + } + + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + } + + +// --------------------------------------------------------------------------- +// Returns the root entry containing mailboxes. +// --------------------------------------------------------------------------- +// +CMsvEntry* CMCSPluginSettingsAppList::GetRootEntryL() + { + return iMsvSession->GetEntryL(KMsvRootIndexEntryIdValue); + } + +// --------------------------------------------------------------------------- +// Adds remote mailboxes to the application list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::AddMailboxesL() + { + + iListItems.ResetAndDestroy(); + CMsvEntry* rootEntry = GetRootEntryL(); + CleanupStack::PushL(rootEntry); + TBuf<255> mailboxId; + + for ( TInt i = rootEntry->Count() - 1; i >= 0; --i ) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) + { + mailboxId.Num( tentry.Id() ); + AddMailboxL( tentry.iDetails, mailboxId ); + } + } + CleanupStack::PopAndDestroy(rootEntry); + } + +// --------------------------------------------------------------------------- +// Adds a mailbox to the list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::AddMailboxL( const TDesC& aMailbox, + const TDesC& aMailboxId ) + { + // prepare param value + HBufC* params = HBufC::NewLC( KMenuParamMailbox().Length() + aMailboxId.Length() ); + params->Des().Copy( KMenuParamMailbox ); + params->Des().Append( aMailboxId ); + TPtrC paramValue( params->Des() ); + + TLinearOrder sortMethod( CMCSPluginSettingsAppList::CompareNameL ); + CMenuItem* newItem = CMenuItem::CreateL( iMenu, + KMenuTypeShortcut, + GetMCSPluginFolderIdL(), + 0 ); + CleanupStack::PushL( newItem ); + + // mailbox is a shortcut item with "mailbox:mailboxID" parameter + newItem->SetAttributeL( KMenuAttrUid, KMailboxUid ); + newItem->SetAttributeL( KMenuAttrLongName, aMailbox ); + newItem->SetAttributeL( KMenuAttrParameter, paramValue ); + newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount ); + + // setting icon for the shortcut + newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); + newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId ); + newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId ); + + // append the item into iListItems lists + User::LeaveIfError( iListItems.InsertInOrderAllowRepeats( newItem, sortMethod ) ); + CleanupStack::Pop( newItem ); + CleanupStack::PopAndDestroy( params ); + } + +// --------------------------------------------------------------------------- +// Removes run-time generated menuitem (i.e. Mailbox) from MCS +// If the item at given index is not run-time generated, return +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsAppList::RemoveMenuItemL( TInt aIndex ) + { + + if ( aIndex < 0 || aIndex > iListItems.Count() - 1 ) + { + return; + } + + CMenuItem* menuItem = iListItems[ aIndex ]; + + TBool hasParam = ETrue; + TPtrC param = menuItem->GetAttributeL( KMenuAttrParameter, hasParam ); + + if ( !hasParam ) + { + // nothing to do + return; + } + + // set up a filter for finding the mailbox + // with given ID in MCS + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + filter->SetType( KMenuTypeShortcut ); + filter->HaveAttributeL( KMenuAttrParameter, param ); + + // search menu from the Root folder with the filter + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + + // save the number of findings + TInt count( itemArray.Count() ); + + if ( count > 0 ) + { + // Item already exists in MCS + // If it has reference counter, increment it before returning. + CMenuItem* itm = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); + + // decrement ref_count attribute + TInt newRefCount = UpdateMenuItemsRefCountL( itm, -1 ); + if ( newRefCount > 0 ) + { + CleanupStack::PushL( itm ); + CMenuOperation* op = itm->SaveL( iUpdateWatcher->iStatus ); + CleanupStack::Pop( itm ); + iUpdateWatcher->Watch( op ); + } + else if ( newRefCount == 0 ) + { + // counter reached 0 -> item is not referenced by any shortcut + // so remove it from MCS + if ( iRemoveWatcher->IsActive() ) + { + return; + } + CMenuOperation* op = iMenu.RemoveL( itm->Id(), iRemoveWatcher->iStatus ); + iRemoveWatcher->Watch( op ); + } + delete itm; + } + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + } + +// --------------------------------------------------------------------------- +// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used +// for storing run-time generated menuitems +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsAppList::GetMCSPluginFolderIdL() + { + + if ( iMCSPluginFolderId == 0 ) + { + CMenuItem* item( NULL ); + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + filter->SetType( KMenuTypeFolder ); + filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder ); + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + if ( itemArray.Count() > 0 ) + { + item = CMenuItem::OpenL( iMenu, itemArray[ 0 ] ); + iMCSPluginFolderId = item->Id(); + } + else + { + iMCSPluginFolderId = iMenu.RootFolderL(); + } + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + delete item; + } + return iMCSPluginFolderId; + + } + +// --------------------------------------------------------------------------- +// Helper method for updating ref_count attribute of run-time generated +// menuitems +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsAppList::UpdateMenuItemsRefCountL( CMenuItem* aItem, + TInt aValueToAdd ) + { + + TBool exists = EFalse; + CleanupStack::PushL( aItem ); + TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); + CleanupStack::Pop( aItem ); + if ( exists ) + { + TInt references; + TLex16 lextmp( param ); + lextmp.Val( references ); + references += aValueToAdd; + TBuf<128> buf; + buf.NumUC( references ); + // set new ref_count + CleanupStack::PushL( aItem ); + aItem->SetAttributeL( KMenuAttrRefcount, buf ); + CleanupStack::Pop( aItem ); + // return new ref_count + return references; + } + return -1; + } + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsbkmlist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,555 @@ +/* +* Copyright (c) 2009 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: Bookmark list for settings listbox +* +*/ + + +#include +#include // For CActiveFavouritesDbNotifier +#include +#include +#include +#include +#include + +#include "mcspluginsettingsmodel.h" +#include "mcspluginsettingsapplist.h" +#include "mcspluginsettingsbkmlist.h" +#include "mcspluginwatcher.h" +#include "debug.h" + +_LIT( KMyMenuData, "matrixmenudata" ); +_LIT( KMenuUrl, "menu:url" ); +_LIT( KMenuIconFile, "aimcsplugin.mif" ); +_LIT( KMenuIconId, "16386" ); +_LIT( KMenuMaskId, "16387" ); +_LIT( KUrl, "url" ); +_LIT8( KUid, "uid" ); +_LIT( KMenuAttrRefcount, "ref_count" ); +_LIT( KInitialRefCount, "1" ); +_LIT( KMCSFolder, "mcsplugin_folder" ); + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// First-phase construction +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList::CMCSPluginSettingsBkmList() + { + iMCSPluginFolderId = 0; + } + +// --------------------------------------------------------------------------- +// Second-phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::ConstructL() + { + User::LeaveIfError(iBookmarkSess.Connect()); + User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); + iMenu.OpenL( KMyMenuData ); + GetBookmarkListL(); + + iSaveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + iUpdateWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + iRemoveWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::EOperation ); + } + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList* CMCSPluginSettingsBkmList::NewL() + { + CMCSPluginSettingsBkmList* self = new (ELeave) CMCSPluginSettingsBkmList(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList::~CMCSPluginSettingsBkmList() + { + iListItems.ResetAndDestroy(); + iMenuItems.ResetAndDestroy(); + iBookmarkDb.Close(); + iBookmarkSess.Close(); + iMenu.Close(); + delete iSaveWatcher; + delete iUpdateWatcher; + delete iRemoveWatcher; + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsBkmList::MdcaCount() const + { + return iListItems.Count(); + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CMCSPluginSettingsBkmList::MdcaPoint(TInt aIndex) const + { + if (aIndex < 0 || aIndex >= iListItems.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + return iListItems[aIndex]->Caption(); + } + +// --------------------------------------------------------------------------- +// Iterates thru the bookmark list and tries to find a menuitem which +// matches given property map from HSPS +// --------------------------------------------------------------------------- +// +TSettingItem CMCSPluginSettingsBkmList::FindItemL( RPointerArray& aProperties ) + { + TInt index( KErrNotFound ); + TSettingItem settingItem = { KErrNotFound, EBookmark }; + for( TInt i= 0; i < aProperties.Count(); i++ ) + { + if( aProperties[i]->Name() == KUid ) + { + HBufC* value( NULL ); + value = AiUtility::CopyToBufferL( value, aProperties[i]->Value()); + for( TInt j = 0; j < iListItems.Count(); j++ ) + { + TPtrC uid = *iListItems[j]->iUid; + if( uid.Compare( *value ) == 0 ) + { + index = j; + break; + } + } + delete value; + } + if( index != KErrNotFound ) + { + settingItem.id = index; + settingItem.type = EBookmark; + break; + } + } + return settingItem; + } + +// --------------------------------------------------------------------------- +// Gets bookmark list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::GetBookmarkListL() + { + iListItems.ResetAndDestroy(); + + GetBookmarksFromFavouritesL(); + GetBookmarksFromMCSL(); + } + +// --------------------------------------------------------------------------- +// Gets bookmarks from Favourites server's bookmark database. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::GetBookmarksFromFavouritesL() + { + CFavouritesItemList* favItems = new (ELeave) CFavouritesItemList(); + CleanupStack::PushL( favItems ); + TInt err = iBookmarkDb.GetAll( *favItems, KFavouritesNullUid, CFavouritesItem::EItem); + if( err != KErrNone ) + { + ASSERT(0); + } + TInt count = favItems->Count(); + for ( TInt i = count - 1; i >= 0; i-- ) // newest on top + { + TUid uid = TUid::Uid(favItems->At(i)->Uid()); + TPtrC name = favItems->At(i)->Name(); + TPtrC url = favItems->At(i)->Url(); + AddBookmarkL( uid.Name(), name, url, EFavBookmark ); + } + CleanupStack::PopAndDestroy( favItems ); + } + +// --------------------------------------------------------------------------- +// Gets bookmarks from Menu Content Service. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::GetBookmarksFromMCSL() + { + TBool exists( EFalse ); + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + filter->SetType( KMenuUrl ); + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + TInt count( itemArray.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + CMenuItem* menuItem = CMenuItem::OpenL( iMenu, itemArray[i] ); + CleanupStack::PushL( menuItem ); + TPtrC uid = menuItem->GetAttributeL( KMenuAttrUid, exists ); + TPtrC name = menuItem->GetAttributeL( KMenuAttrLongName, exists ); + TPtrC url = menuItem->GetAttributeL( KUrl, exists ); + + // Check if bookmark is already present in Bookmark list. + // This may happen in case of Favourite Bookmarks that were + // previously added to MCS. + // If it is, do not add it to Bookmark list anymore. + + TBool isRuntimeGenerated = EFalse; + menuItem->GetAttributeL( KMenuAttrRefcount, isRuntimeGenerated ); + + // if is not runtime generated and url exists, add it + if ( !isRuntimeGenerated && exists ) + { + AddBookmarkL( uid, name, url, EMCSBookmark ); + } + + CleanupStack::PopAndDestroy( menuItem ); + } + + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + + } + +// --------------------------------------------------------------------------- +// If bookmark was selected amongst Favourites, new menu item is created into MCS. +// If predefined bookmark was selected, MCS menu item is retrieved +// --------------------------------------------------------------------------- +// +CMenuItem& CMCSPluginSettingsBkmList::ItemL( TInt aIndex ) + { + CMenuItem* menuItem( NULL ); + CBkmListItem* listItem = iListItems[aIndex]; + if ( listItem->iType == EFavBookmark ) + { + TPtrC uid = *listItem->iUid; + TPtrC name = *listItem->iCaption; + TPtrC url = *listItem->iUrl; + menuItem = CreateMenuItemL( uid, name, url ); + } + else + { + menuItem = MCSMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl ); + } + return *menuItem; + } + +// --------------------------------------------------------------------------- +// Removes the menu item from MCS if it was created in runtime i.e. type is EFavBookmark. +// Favourite bookmarks have ref_count attribute, which is decremented everytime +// the bookmark is removed from some shortcut. When this counter reaches 0, +// its MenuItem is removed from MCS. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::RemoveMenuItemL( TInt aIndex ) + { + + if ( aIndex < 0 || aIndex > iListItems.Count() - 1 ) + { + return; + } + + CBkmListItem* listItem = iListItems[aIndex]; + if( listItem->iType == EFavBookmark ) + { + CMenuItem* menuItem = MCSMenuItemL( *listItem->iUid, *listItem->iCaption, *listItem->iUrl ); + if ( !menuItem ) + { + return; + } + // decrement ref_count attribute + TInt newRefCount = UpdateMenuItemsRefCountL( menuItem, -1 ); + if ( newRefCount > 0 ) + { + CleanupStack::PushL( menuItem ); + CMenuOperation* op = menuItem->SaveL( iUpdateWatcher->iStatus ); + CleanupStack::Pop( menuItem ); + iUpdateWatcher->Watch( op ); + } + else if ( newRefCount == 0 ) + { + // counter reached 0 -> item is not referenced by any shortcut + // so remove it from MCS + if ( iRemoveWatcher->IsActive() ) + { + return; + } + CMenuOperation* op = iMenu.RemoveL( menuItem->Id(), iRemoveWatcher->iStatus ); + iRemoveWatcher->Watch( op ); + } + } + } + +// --------------------------------------------------------------------------- +// Tries to find menuitem with given UID, Name and Url in MCS, +// If it does not exist, it is created and saved there. +// If it exists already, ref_count attribute is incremented. +// --------------------------------------------------------------------------- +// +CMenuItem* CMCSPluginSettingsBkmList::CreateMenuItemL( const TDesC& aUid, + const TDesC& aName, + const TDesC& aUrl ) + { + // try to search item in MCS + CMenuItem* item = MCSMenuItemL( aUid, aName, aUrl ); + + if ( item == NULL ) + { + // Item does not exist in MCS yet. + // We will add a new one with reference counter set to 1. + CMenuItem* newItem = CMenuItem::CreateL( iMenu, + KMenuTypeUrl, + GetMCSPluginFolderIdL(), 0 ); + CleanupStack::PushL( newItem ); + + newItem->SetAttributeL( KMenuAttrUid, aUid ); + newItem->SetAttributeL( KMenuAttrLongName, aName ); + newItem->SetAttributeL( KMenuAttrIconFile, KMenuIconFile ); + newItem->SetAttributeL( KMenuAttrIconId, KMenuIconId ); + newItem->SetAttributeL( KMenuAttrMaskId, KMenuMaskId ); + newItem->SetAttributeL( KMenuAttrRefcount, KInitialRefCount ); + newItem->SetAttributeL( KUrl , aUrl ); + + CMenuOperation* op = newItem->SaveL( iSaveWatcher->iStatus ); + iSaveWatcher->Watch( op ); + iMenuItems.AppendL( newItem ); + CleanupStack::Pop( newItem ); + return newItem; + } + else + { + // Item already exists in MCS + // If it has reference counter, increment it before returning. + TInt newRefCount = UpdateMenuItemsRefCountL( item, 1 ); + if ( newRefCount > -1 ) + { + CleanupStack::PushL( item ); + CMenuOperation* op = item->SaveL( iSaveWatcher->iStatus ); + CleanupStack::Pop( item ); + iSaveWatcher->Watch( op ); + } + } + return item; + } + +// --------------------------------------------------------------------------- +// Finds menuitem with given UID, Name and URL in MCS and returns it +// --------------------------------------------------------------------------- +// +CMenuItem* CMCSPluginSettingsBkmList::MCSMenuItemL( const TDesC& aUid, + const TDesC& aName, + const TDesC& aUrl ) + { + CMenuItem* item( NULL ); + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + + filter->SetType( KMenuUrl ); + filter->HaveAttributeL( KMenuAttrUid, aUid ); + filter->HaveAttributeL( KMenuAttrLongName, aName ); + filter->HaveAttributeL( KUrl , aUrl ); + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + if( itemArray.Count() > 0 ) + { + item = CMenuItem::OpenL( iMenu, itemArray[0] ); + CleanupStack::PushL( item ); + iMenuItems.AppendL( item ); + CleanupStack::Pop( item ); + } + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + return item; + } + +// --------------------------------------------------------------------------- +// Adds an bookmark to the list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::AddBookmarkL( const TDesC& aUid, + const TDesC& aCaption, + const TDesC& aUrl, + TBookmarkType aType ) + { + CBkmListItem* listItem = CBkmListItem::NewLC(aUid, aCaption); + + listItem->iType = aType; + if( aUrl.Length() > 0 ) + { + listItem->iUrl = aUrl.AllocL(); + } + TLinearOrder sortMethod(CBkmListItem::CompareCaption); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + } + +// --------------------------------------------------------------------------- +// Updates the bookmark list. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::UpdateBkmListL() + { + GetBookmarkListL(); + } + +// --------------------------------------------------------------------------- +//Nested class to store individual bookmark list items +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList::CBkmListItem::CBkmListItem() + { + } + +// --------------------------------------------------------------------------- +// Second-phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsBkmList::CBkmListItem::ConstructL( const TDesC& aUid, + const TDesC& aCaption ) + { + iUid = aUid.AllocL(); + iCaption = aCaption.AllocL(); + } + +// --------------------------------------------------------------------------- +// Two-phased constructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList::CBkmListItem* CMCSPluginSettingsBkmList::CBkmListItem::NewLC( + const TDesC& aUid, const TDesC& aCaption ) + { + CBkmListItem* self = new (ELeave) CBkmListItem(); + CleanupStack::PushL(self); + self->ConstructL( aUid, aCaption ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList::CBkmListItem::~CBkmListItem() + { + delete iUid; + delete iCaption; + delete iUrl; + } + +// --------------------------------------------------------------------------- +// Compare method used to add the items to the list in sorted order. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsBkmList::CBkmListItem::CompareCaption( const CBkmListItem& aFirst, + const CBkmListItem& aSecond ) +{ + return aFirst.iCaption->Des().CompareC(*aSecond.iCaption); +} + +// --------------------------------------------------------------------------- +// Returns the item target bookmark caption. +// --------------------------------------------------------------------------- +// +TPtrC CMCSPluginSettingsBkmList::CBkmListItem::Caption() const +{ + return TPtrC(*iCaption); +} + +// --------------------------------------------------------------------------- +// Gets MCS Plugin folder ID. This hidden folder in matrixmenudata.xml is used +// for storing run-time generated menuitems +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsBkmList::GetMCSPluginFolderIdL() + { + if ( iMCSPluginFolderId == 0 ) + { + CMenuItem* item( NULL ); + CMenuFilter* filter = CMenuFilter::NewL(); + CleanupStack::PushL( filter ); + filter->SetType( KMenuTypeFolder ); + filter->HaveAttributeL( KMenuAttrLongName, KMCSFolder ); + const TInt rootId = iMenu.RootFolderL(); + RArray itemArray; + CleanupClosePushL( itemArray ); + iMenu.GetItemsL( itemArray, rootId, filter, ETrue ); + if ( itemArray.Count() > 0 ) + { + item = CMenuItem::OpenL( iMenu, itemArray[0] ); + iMCSPluginFolderId = item->Id(); + } + else + { + iMCSPluginFolderId = iMenu.RootFolderL(); + } + CleanupStack::PopAndDestroy( &itemArray ); + CleanupStack::PopAndDestroy( filter ); + delete item; + } + return iMCSPluginFolderId; + } + +// --------------------------------------------------------------------------- +// Helper method for updating ref_count attribute of run-time generated +// menuitems +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsBkmList::UpdateMenuItemsRefCountL( CMenuItem* aItem, + TInt aValueToAdd ) + { + + TBool exists = EFalse; + CleanupStack::PushL( aItem ); + TPtrC param = aItem->GetAttributeL( KMenuAttrRefcount, exists ); + CleanupStack::Pop( aItem ); + if ( exists ) + { + TInt references; + TLex16 lextmp( param ); + lextmp.Val( references ); + references += aValueToAdd; + TBuf<128> buf; + buf.NumUC( references ); + + // set new ref_count + CleanupStack::PushL( aItem ); + aItem->SetAttributeL( KMenuAttrRefcount, buf ); + CleanupStack::Pop( aItem ); + // return new ref_count + return references; + } + return -1; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingscontainer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,503 @@ +/* +* Copyright (c) 2009 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: Shortcut settings plug-in container. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// For CActiveFavouritesDbNotifier +#include +#include + +#include "mcspluginsettingscontainer.h" +#include "mcspluginsettingsmodel.h" +#include "mcspluginsettingsbkmlist.h" +#include "mcspluginsettings.hrh" + +const TUid KUidAI = { 0x102750FB }; // Active Standby Shortcuts help uid + +_LIT(KSET_HLP_HOME_SCREEN_SHORTCUTS, "SET_HLP_HOME_SCREEN_SHORTCUTS"); +_LIT( KMyMenuData, "matrixmenudata" ); + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// First-phase construction +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsContainer::CMCSPluginSettingsContainer() +{ +} + +// --------------------------------------------------------------------------- +// Second-phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::ConstructL( const TRect& aRect ) + { + iListBox = new (ELeave) CAknSettingStyleListBox; + BaseConstructL(aRect, R_AI_MCS_SETTINGS_VIEW_TITLE, NULL); + StartObservingL(); + CheckMiddleSoftkeyLabelL(); + } + +// --------------------------------------------------------------------------- +// Tells the settings container to start observing for changes +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::StartObservingL() + { + // registering to bookmarks db. changes observing + User::LeaveIfError( iBookmarkSession.Connect() ); + User::LeaveIfError( iBookmarkDb.Open( iBookmarkSession, KBrowserBookmarks ) ); + + iBookmarkDbObserver = new (ELeave) CActiveFavouritesDbNotifier( + iBookmarkDb, *this ); + iBookmarkDbObserver->Start(); + + // registering to mailbox db. changes observing + iMsvSession = CMsvSession::OpenAsObserverL( *this ); + + // registering to matrix menu events observing + iMenu.OpenL( KMyMenuData ); + TInt err = iNotifier.Open( iMenu ); + if ( err == KErrNone ) + { + iNotifyWatcher = CMCSPluginWatcher::NewL( CMCSPluginWatcher::ENotify ); + iNotifier.Notify( 0, + RMenuNotifier::EItemsAddedRemoved | RMenuNotifier::EItemsReordered, + iNotifyWatcher->iStatus ); + iNotifyWatcher->WatchNotify( this ); + } + } + +// --------------------------------------------------------------------------- +// Tells the settings container to stop observing for changes +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::StopObserving() + { + if( iBookmarkDbObserver ) + { + delete iBookmarkDbObserver; + iBookmarkDbObserver = NULL; + } + iBookmarkDb.Close(); + iBookmarkSession.Close(); + + if( iMsvSession ) + { + delete iMsvSession; + iMsvSession = NULL; + } + + iNotifier.Close(); + iMenu.Close(); + + if ( iNotifyWatcher ) + { + if ( iNotifyWatcher->IsActive() ) + { + iNotifyWatcher->Cancel(); + } + delete iNotifyWatcher; + iNotifyWatcher = NULL; + } + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsContainer::~CMCSPluginSettingsContainer() + { + StopObserving(); + } + +// --------------------------------------------------------------------------- +// Sets pointer to settings plug-in model. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::SetModel( CMCSPluginSettingsModel* aModel ) +{ + iModel = aModel; +} + +// --------------------------------------------------------------------------- +// Handles a setting change command. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::HandleChangeCommandL() +{ + TInt current = iListBox->CurrentItemIndex(); + TInt appListIndex = iModel->ItemId( current ); + if ( appListIndex < -1 ) + { + appListIndex = -1; + } + + if ( iModel->Item( current ).locked ) + { + HBufC* text = iCoeEnv->AllocReadResourceLC( R_AI_MCS_SETTINGS_TXT_FIXED_ITEM ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *text ); + CleanupStack::PopAndDestroy( text ); + } + else + { + TInt selection( KErrNotFound ); + TBool changed( EFalse ); + CDesCArrayFlat* array = iCoeEnv->ReadDesC16ArrayResourceL( + R_AI_MCS_CHANGE_TO_PAGE_LBX ); + CleanupStack::PushL( array ); + + CAknListQueryDialog* dialog = new ( ELeave ) CAknListQueryDialog( &selection ); + CleanupStack::PushL( dialog ); + dialog->PrepareLC( R_AI_MCS_LISTQUERY_CHANGE_TO_PAGE ); + CleanupStack::Pop( dialog ); + dialog->SetItemTextArray( array ); + dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); + if ( dialog->RunLD() ) + { + + TSettingItem itm = iModel->Item( current ); + + // user wants to select bookmark + if ( selection == 1 ) + { + + // if the last selected item was application, set selected item to -1 + if ( itm.type == EApplication ) + { + appListIndex = -1; + } + + changed = HandleBookmarkChangeCommandL( appListIndex, current ); + + } + // user wants to select application + else if ( selection == 0 ) + { + + // if the last selected item was bookmark, set selected item to -1 + if ( itm.type == EBookmark ) + { + appListIndex = -1; + } + + changed = HandleAppListChangeCommandL( appListIndex, current ); + + } + if ( changed ) + { + ResetCurrentListL( current ); + } + + } + CleanupStack::PopAndDestroy( array ); + } + } + +// --------------------------------------------------------------------------- +// Handles a help command. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::HandleHelpCommandL() +{ + CArrayFixFlat* array = + new ( ELeave ) CArrayFixFlat( 1 ); + CleanupStack::PushL( array ); + array->AppendL( GetHelpContext() ); + HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession(), array ); + CleanupStack::Pop( array ); +} + +// --------------------------------------------------------------------------- +// Helper method which indicates if the Applist or Bkmlist is showing +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsContainer::IsChangeDialogShowing() +{ + return ( iAppListDialog || iBkmListDialog ); +} + +// --------------------------------------------------------------------------- +// Method for closing change dialog (app or bkm) if it is beeing shown +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::CloseChangeDialog() +{ + TKeyEvent keyEvent; + + keyEvent.iCode = EKeyEscape; + keyEvent.iScanCode = EStdKeyEscape; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + + CCoeControl* dialog = NULL; + + if ( iAppListDialog ) + { + dialog = static_cast< CCoeControl* >( iAppListDialog ); + } + else if ( iBkmListDialog ) + { + dialog = static_cast< CCoeControl* >( iBkmListDialog ); + } + + if ( dialog ) + { + TRAP_IGNORE( dialog->OfferKeyEventL( keyEvent, EEventKey ) ); + } +} + +// --------------------------------------------------------------------------- +// Refreshes current list.. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::ResetCurrentListL( TInt aIndex ) +{ + if (iModel->MdcaCount() == 0) + { + iListBox->HandleItemRemovalL(); + } + else + { + iListBox->HandleItemAdditionL(); + } + + iListBox->SetCurrentItemIndex( aIndex ); + CheckMiddleSoftkeyLabelL(); +} + +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::HandleSessionEventL( + TMsvSessionEvent aEvent, + TAny* /*aArg1*/, + TAny* /*aArg2*/, + TAny* /*aArg3*/ ) + { + switch ( aEvent ) + { + case EMsvEntriesCreated: + // fall-through intended here + case EMsvEntriesDeleted: + // fall-through intended here + case EMsvEntriesChanged: + { + if ( IsChangeDialogShowing() ) + { + CloseChangeDialog(); + } + iModel->UpdateAppListL(); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// From CGSBaseContainer +// Constructs the settings listbox. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::ConstructListBoxL(TInt /*aResLbxId*/) +{ + iListBox->ConstructL(this, EAknListBoxSelectionList); + + // Set empty listbox's text. + HBufC* text = iCoeEnv->AllocReadResourceLC(R_AI_MCS_SETTINGS_TXT_ALL_FIXED); + iListBox->View()->SetListEmptyTextL(*text); + CleanupStack::PopAndDestroy(text); + + iListBox->Model()->SetItemTextArray(iModel); + iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command to select application from a list. +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsContainer::HandleAppListChangeCommandL( const TInt& aIndex, + const TInt& aSettingIndex ) +{ + + TBool changed = EFalse; + + TInt index = aIndex; + TInt oldIndex = index; + + iAppListDialog = new (ELeave) CAknRadioButtonSettingPage( + R_AI_MCS_SETTINGS_APPLIST_PAGE, index, iModel->AppList()); + + HBufC* title = StringLoader::LoadLC( R_AI_MCS_SETTINGS_TXT_LINKN, aSettingIndex + 1, iCoeEnv ); + iAppListDialog->SetSettingTextL( title->Des() ); + iAppListDialog->ConstructL(); + + if (iAppListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && + index != oldIndex) + { + changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EApplication ); + } + + CleanupStack::PopAndDestroy( title ); + iAppListDialog = NULL; + + return changed; +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command to select bookmark from a list. +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsContainer::HandleBookmarkChangeCommandL( const TInt& aIndex, + const TInt& aSettingIndex ) + { + TBool changed = EFalse; + + TInt index = aIndex; + TInt oldIndex = index; + + iBkmListDialog = new (ELeave) CAknRadioButtonSettingPage( + R_AI_MCS_SETTINGS_APPLIST_PAGE, index, iModel->BkmList()); + + HBufC* title = StringLoader::LoadLC( R_AI_MCS_SETTINGS_TXT_LINKN, aSettingIndex + 1, iCoeEnv ); + iBkmListDialog->SetSettingTextL( title->Des() ); + iBkmListDialog->ConstructL(); + + if (iBkmListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && + index != oldIndex) + { + changed = iModel->ReplaceItemL( iListBox->CurrentItemIndex(), index , EBookmark ); + } + + CleanupStack::PopAndDestroy( title ); + iBkmListDialog = NULL; + return changed; + } + +// --------------------------------------------------------------------------- +// Gets Help +// --------------------------------------------------------------------------- +// +TCoeHelpContext CMCSPluginSettingsContainer::GetHelpContext() const +{ + TCoeContextName helpString; + + helpString.Copy( KSET_HLP_HOME_SCREEN_SHORTCUTS ); + + // set UID and topic of Help to display + return TCoeHelpContext( KUidAI, helpString ); +} + +// --------------------------------------------------------------------------- +// Offers a key event. +// --------------------------------------------------------------------------- +// +TKeyResponse CMCSPluginSettingsContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) +{ + switch (aKeyEvent.iCode) + { + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all event even if it doesn't use them: + return EKeyWasNotConsumed; + + default: + break; + } + // Now it's iListBox's job to process the key event + return iListBox->OfferKeyEventL(aKeyEvent, aType); +} + +// --------------------------------------------------------------------------- +// Checks if there is a need to update the middle softkey label. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::CheckMiddleSoftkeyLabelL() +{ + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba) + { + cba->MakeCommandVisible(EAiScutSettingsCmdChange, (iModel->MdcaCount() != 0)); + } +} + +// ----------------------------------------------------------------------------- +// From class MFavouritesDbObserver. +// Handles database event. +// ----------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent) + { + switch ( aEvent ) + { + case RDbNotifier::ECommit : + // fall-through intended here + case RDbNotifier::ERecover : + // fall-through intended here + case RDbNotifier::ERollback : + { + if ( IsChangeDialogShowing() ) + { + CloseChangeDialog(); + } + iModel->UpdateBkmListL(); + } + break; + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// From class MMCSPluginWatcherObserver. +// Handles matrix menu event. +// ----------------------------------------------------------------------------- +// +void CMCSPluginSettingsContainer::HandleNotifyL() + { + if ( IsChangeDialogShowing() ) + { + CloseChangeDialog(); + } + iModel->UpdateAppListL(); + + // Notification must be activated again + iNotifyWatcher->Cancel(); + iNotifier.Notify( 0, + RMenuNotifier::EItemsAddedRemoved | RMenuNotifier::EItemsReordered, + iNotifyWatcher->iStatus ); + iNotifyWatcher->WatchNotify( this ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,614 @@ +/* +* Copyright (c) 2009 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: MCS settings plug-in model. +* +*/ + +#include +#include +#include + +#include +#include +#include +#include + + +#include "mcspluginsettings.h" +#include "mcspluginsettingsmodel.h" +#include "mcspluginsettingscontainer.h" + + +#include "debug.h" + +#include + +/** + * Line format for the settings list box + */ +_LIT(KSettingListboxLineFormat, " \t%S\t\t%S"); +_LIT( KMenuAttrParam, "param"); +_LIT( KMenuAttrLocked, "locked"); +_LIT8( KTrue, "true" ); +_LIT8( KAppUid, "271012080" ); +_LIT8( KProperNameType, "type" ); +_LIT8( KProperNameParam, "param" ); +_LIT8( KProperNameUid, "uid" ); +_LIT8( KProperNameView, "view" ); +_LIT8( KProperNameLocked, "locked" ); +_LIT8( KProperValueFolder, "folder" ); +_LIT8( KProperValueSuite, "suite" ); +_LIT8( KProperValueBookmark, "bookmark" ); +_LIT8( KProperValueAppl, "application" ); +_LIT( KSuiteName, "suite_name" ); + + +using namespace HSPluginSettingsIf; + +// ----------------------------------------------------------------------------- +// Creates a formatted listbox line. +// ----------------------------------------------------------------------------- +// +TPtrC CMCSPluginSettingsModel::ListBoxLineL( const TDesC& aCaption, TInt aIndex ) const +{ + HBufC* title = StringLoader::LoadLC( + R_AI_MCS_SETTINGS_TXT_LINKN, aIndex + 1, iEnv ); + + TPtrC caption; + caption.Set(aCaption); + + TUriParser parser; + TInt err = parser.Parse(aCaption); + if (err == KErrNone) + { + // Remove scheme from the url. + const TDesC& host = parser.Extract(EUriHost); + if (host.Length()) + { + caption.Set(host); + } + } + + // Format (" \t%S\t\t%S") without %S characters. + TInt formatLength = KSettingListboxLineFormat().Length(); + + HBufC* listBoxLine = + HBufC::NewLC(title->Length() + caption.Length() + formatLength); + + TPtr ptr = listBoxLine->Des(); + ptr.Format(KSettingListboxLineFormat, title, &caption); + + delete iListBoxLine; + iListBoxLine = NULL; + iListBoxLine = listBoxLine; + CleanupStack::Pop(listBoxLine); + CleanupStack::PopAndDestroy(title); + return *iListBoxLine; +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Two phased constructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsModel* CMCSPluginSettingsModel::NewL( CMCSPluginSettings& aPlugin, + CCoeEnv* aEnv) +{ + CMCSPluginSettingsModel* self = new (ELeave) CMCSPluginSettingsModel(aPlugin, aEnv); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; +} + +// --------------------------------------------------------------------------- +// First phase construction +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsModel::CMCSPluginSettingsModel( CMCSPluginSettings& aPlugin, + CCoeEnv* aEnv ) + : iPlugin( aPlugin ), + iEnv( aEnv ) +{ +} + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsModel::~CMCSPluginSettingsModel() +{ + delete iAppList; + delete iBkmList; + iSettings.Reset(); + delete iPluginSettings; + delete iPluginId; + delete iListBoxLine; +} + +// --------------------------------------------------------------------------- +// Second phase construction +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::ConstructL() +{ + iAppList = CMCSPluginSettingsAppList::NewL(); + iAppList->StartL(); + iBkmList = CMCSPluginSettingsBkmList::NewL(); +} + + +// --------------------------------------------------------------------------- +// Gets the latest settings from HSPS and updates +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::UpdateSettingsL( const TDesC8& aPluginId ) + { + if( !iPlugin.Activated() ) + { + return; + } + if( !iPluginSettings ) + { + // AILaunch uid in decimal format + iPluginSettings = CHomescreenSettings::NewL( KAppUid, aPluginId, this ); + iPluginId = aPluginId.AllocL(); + } + + iSettings.Reset(); + RPointerArray settingItems; + CleanupClosePushL( settingItems ); + + iPluginSettings->GetSettingsL( *iPluginId, settingItems ); + + TInt count = settingItems.Count(); + for ( TInt i = 0; i < count; i++ ) + { + CItemMap* itemMap = settingItems[i]; + RPointerArray properties; + properties = itemMap->Properties(); + TSettingItem item = ItemL( properties ); + iSettings.AppendL( item ); + } + CleanupStack::Pop( &settingItems ); + settingItems.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// Tries to find menuitem which matches given HSPS entry +// --------------------------------------------------------------------------- +// +TSettingItem CMCSPluginSettingsModel::ItemL( + RPointerArray& aProperties ) + { + TSettingItem setting = { KErrNotFound, EApplication , EFalse }; + + TSettingType type = SettingTypeL( aProperties ); + if( type == EApplication ) + { + setting = iAppList->FindItemL( aProperties ); + } + else if( type == EBookmark ) + { + setting = iBkmList->FindItemL( aProperties ); + } + + setting.locked = SettingLockedL( aProperties ); + + return setting; + } + +// --------------------------------------------------------------------------- +// Gets Type (application or bookmark) of given HSPS entry +// --------------------------------------------------------------------------- +// +TSettingType CMCSPluginSettingsModel::SettingTypeL( + RPointerArray& aProperties ) + { + TSettingType type( EApplication ); + + for( TInt i = 0; i < aProperties.Count(); i++ ) + { + TPtrC8 name = aProperties[i]->Name(); + if( name == KProperNameType ) + { + TPtrC8 value = aProperties[i]->Value(); + if( value == KProperValueBookmark ) + { + type = EBookmark; + } + else + { + type = EApplication; + } + } + } + + return type; + } + +// --------------------------------------------------------------------------- +// Gets locking status of given HSPS entry +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsModel::SettingLockedL( + RPointerArray& aProperties ) + { + + for( TInt i = 0; i Name(); + if( name == KProperNameLocked ) + { + TPtrC8 value = aProperties[i]->Value(); + if( value == KTrue ) + { + return ETrue; + } + } + } + + return EFalse; + } + + +// --------------------------------------------------------------------------- +// Saves menuitem to HSPS to the given shortcut index +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::SaveSettingsL( const TInt& aIndex, + CMenuItem& aMenuItem ) + { + + if ( !iPluginSettings ) + { + return; + } + RPointerArray settingItems; + CleanupClosePushL( settingItems ); + iPluginSettings->GetSettingsL( *iPluginId, settingItems ); + if ( aIndex >= 0 && aIndex < settingItems.Count() ) + { + TBool exists( EFalse ); + CItemMap* itemMap = settingItems[ aIndex ]; + RPointerArray properties; + properties = itemMap->Properties(); + for ( TInt i = 0; i < properties.Count(); i++ ) + { + if ( properties[ i ]->Name() == KProperNameType ) + { + TPtrC type = aMenuItem.Type(); + if ( type == KMenuTypeUrl ) + { + properties[ i ]->SetValueL( KProperValueBookmark ); + } + else if ( type == KMenuTypeFolder ) + { + properties[ i ]->SetValueL( KProperValueFolder ); + } + else if ( type == KMenuTypeSuite ) + { + properties[ i ]->SetValueL( KProperValueSuite ); + } + else + { + properties[ i ]->SetValueL( KProperValueAppl ); + } + } + else if ( properties[ i ]->Name() == KProperNameUid ) + { + TPtrC uid = aMenuItem.GetAttributeL( KMenuAttrUid, exists ); + if ( exists ) + { + HBufC8* uid8( NULL ); + uid8 = AiUtility::CopyToBufferL( uid8, uid ); + CleanupStack::PushL( uid8 ); + properties[ i ]->SetValueL( *uid8 ); + CleanupStack::PopAndDestroy( uid8 ); + } + else + { + properties[ i ]->SetValueL( KNullDesC8 ); + } + } + else if ( properties[ i ]->Name() == KProperNameView ) + { + TPtrC view = aMenuItem.GetAttributeL( KMenuAttrView, exists ); + if( exists ) + { + HBufC8* view8( NULL ); + view8 = AiUtility::CopyToBufferL( view8, view ); + CleanupStack::PushL( view8 ); + properties[i]->SetValueL( *view8 ); + CleanupStack::PopAndDestroy( view8 ); + } + else + { + properties[ i ]->SetValueL( KNullDesC8 ); + } + } + else if ( properties[ i ]->Name() == KProperNameParam ) + { + TPtrC param = aMenuItem.GetAttributeL( KMenuAttrParam, exists ); + TBool isFolder = EFalse; + TBool isSuite = EFalse; + TPtrC type = aMenuItem.Type(); + + // is the item folder or suite? + + if ( type == KMenuTypeFolder ) + { + isFolder = ETrue; + } + + if ( type == KMenuTypeSuite ) + { + isSuite = ETrue; + } + + if ( exists || isFolder || isSuite ) + { + // the folder id is stored + // in param attribute in HSPS + if ( isFolder ) + { + TBuf<8> number; + number.Num( aMenuItem.Id() ); + param.Set( number ); + } + + // the suite_name is stored + // in param attribute in HSPS + if ( isSuite ) + { + TBool suiteNameExists = EFalse; + TPtrC suiteName = aMenuItem.GetAttributeL( KSuiteName, suiteNameExists ); + if ( suiteNameExists ) + { + param.Set( suiteName ); + } + } + + HBufC8* param8( NULL ); + param8 = AiUtility::CopyToBufferL( param8, param ); + CleanupStack::PushL( param8 ); + properties[ i ]->SetValueL( *param8 ); + CleanupStack::PopAndDestroy( param8 ); + } + else + { + properties[ i ]->SetValueL( KNullDesC8 ); + } + } + else if ( properties[ i ]->Name() == KProperNameLocked ) + { + TPtrC locked = aMenuItem.GetAttributeL( KMenuAttrLocked, exists ); + if ( exists ) + { + HBufC8* locked8( NULL ); + locked8 = AiUtility::CopyToBufferL( locked8, locked ); + CleanupStack::PushL( locked8 ); + properties[ i ]->SetValueL( *locked8 ); + CleanupStack::PopAndDestroy( locked8 ); + } + else + { + properties[i]->SetValueL( KNullDesC8 ); + } + } + } + } + // ETrue tells that modified settings are stored also to plugin reference + iPluginSettings->SetSettingsL( *iPluginId, settingItems, ETrue ); + CleanupStack::Pop( &settingItems ); + settingItems.ResetAndDestroy(); + + } + +// --------------------------------------------------------------------------- +// Updates settings container. +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::UpdateSettingsContainerL( const TDesC8& aPluginId ) +{ + if (iContainer) + { + if (iContainer->IsChangeDialogShowing()) + { + iContainer->CloseChangeDialog(); + } + } + + UpdateSettingsL( aPluginId ); + + if (iContainer) + { + iContainer->ResetCurrentListL(0); + } +} + +// --------------------------------------------------------------------------- +// From MHomeScreenSettingsObserver - handler for HSPS setting change +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsModel::SettingsChangedL( const TDesC8& /*aEvent*/, + const TDesC8& /*aPluginName*/, + const TDesC8& /*aPluginUid*/, + const TDesC8& /*aPluginId*/ ) + { + return KErrNone; + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsModel::MdcaCount() const +{ + return iSettings.Count(); +} + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CMCSPluginSettingsModel::MdcaPoint( TInt aIndex ) const +{ + if (aIndex < 0 || aIndex >= iSettings.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + if ( iSettings[aIndex].type == EApplication ) + { + const TDesC& caption = iAppList->MdcaPoint( iSettings[aIndex].id ); + TPtrC line; + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + return line; + } + else + { + const TDesC& caption = iBkmList->MdcaPoint( iSettings[aIndex].id ); + TPtrC line; + TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) ) + return line; + } +} + +// --------------------------------------------------------------------------- +// Returns a setting ID for the given index. +// --------------------------------------------------------------------------- +// +TInt CMCSPluginSettingsModel::ItemId( TInt aIndex ) const +{ + if ( aIndex >= 0 && aIndex < iSettings.Count() ) + { + return iSettings[ aIndex ].id; + } + + return KErrNotFound; +} + +// --------------------------------------------------------------------------- +// Returns a pointer to setting item for the given index +// --------------------------------------------------------------------------- +// +const TSettingItem CMCSPluginSettingsModel::Item( TInt aIndex ) const + { + TSettingItem setting = { KErrNotFound, EApplication, EFalse }; + + if ( aIndex >= 0 && aIndex < iSettings.Count() ) + { + setting = iSettings[ aIndex ]; + } + + return setting; + } + +// --------------------------------------------------------------------------- +// Replaces shortcut item at given index by a new one. +// --------------------------------------------------------------------------- +// +TBool CMCSPluginSettingsModel::ReplaceItemL( const TInt& aSettingIndex, + TInt aId, + TSettingType aType ) + { + if (aSettingIndex >= 0 && aSettingIndex < iSettings.Count()) + { + // Old setting type is bookmark. Remove bookmark item from MCS + // if it was created in runtime. + if( iSettings[aSettingIndex].type == EBookmark ) + { + iBkmList->RemoveMenuItemL( iSettings[aSettingIndex].id ); + } + + // Old setting type is application. + // Remove app item from MCS if it was created in runtime (mailbox). + if ( iSettings[ aSettingIndex ].type == EApplication ) + { + iAppList->RemoveMenuItemL( iSettings[ aSettingIndex ].id ); + } + + iSettings[aSettingIndex].id = aId; + iSettings[aSettingIndex].type = aType; + + if ( aType == EApplication ) + { + CMenuItem& item = iAppList->ItemL( aId ); + SaveSettingsL( aSettingIndex, item ); + } + else + { + CMenuItem& item = iBkmList->ItemL( aId ); + SaveSettingsL( aSettingIndex, item ); + } + + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// Sets a container +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::SetContainer(CMCSPluginSettingsContainer* aContainer) +{ + iContainer = aContainer; +} + +// --------------------------------------------------------------------------- +// Returns application list +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsAppList* CMCSPluginSettingsModel::AppList() +{ + return iAppList; +} + +// --------------------------------------------------------------------------- +// Returns bookmarklist +// --------------------------------------------------------------------------- +// +CMCSPluginSettingsBkmList* CMCSPluginSettingsModel::BkmList() +{ + return iBkmList; +} + +// --------------------------------------------------------------------------- +// Updates application list +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::UpdateAppListL() +{ + iAppList->StartL(); +} + +// --------------------------------------------------------------------------- +// Updates bookmark list +// --------------------------------------------------------------------------- +// +void CMCSPluginSettingsModel::UpdateBkmListL() +{ + delete iBkmList; + iBkmList = NULL; + iBkmList = CMCSPluginSettingsBkmList::NewL(); +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/mcsplugin/todo.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/mcsplugin/todo.txt Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +TODO +publisher: +-HSPS settings API is in use, but TInt CMCSPluginData::SettingsChangedL callback is never called. BUG? + -Listen setting changes in plug-in, and publish changed items. +-Plug-ins' state machine will change in 9.1, check that plug-in's Resume-function handles all the states properly +-Prevent item launching in backup state. Some apps except that we handle it. +-Check if there is a need to publish to secondary observer. Plugin does not publish currently. + +settings: +-All the resources use shortcut naming, because copied from shortcut settings, must be changed +-Clean resources, there is some unused stuff. +-Icon resource must be renamed also +-Help in options menu (CMCSPluginSettings::HandleCommandL) +-Leaks memory (for sure, other components might also leak) +-HandleBookmarkChangeCommandL aIndex is not handled, is used to highlight previously selected item in listbox +-HSPS setting must be able to tell if item is locked ( see CMCSPluginSettingsContainer::HandleChangeCommandL) +-Mailboxes are not supported, some old implementation exists +-Check if runtime observing of changes in MCS, bookmarks, or mailboxes is needed. +-Hardcoded default icon for bookmark + +widget: +-Must be finalized, other variants. + +Common: +-Hardcoded literals +-Obsolete header cleanup +-Obsolete library cleanup +-Test cases missing +-@since +-Comments in headers +-SaveSettingsL is in two classes, move to common? Make common dll? +-Compile warnings + +Missing feature +-Add folders and suites, problem in current design is that it relies on uid, which is not assigned for folder and suites +-Launch folders and suites, handler improvement +-Launch files based on mimetype, handler improvement + +FOR SOME REASON +Our settings plug-in is GeneralSettings ECOM plug-in. For some reason when we launch (ShowSettingsL) +our plugin General Settings fw loads all the plugins and in addition it reloads our plugin. That has +to be resolved with settings team. Settings is nowadays part of MyPex. +Main contact Lakshmeshwar Shreekanth.P (Nokia-D-MSW/Bangalore) + +Matrixmenudata.xml contains desktop widget specific additions. In order to get those into use you have to +copy file into X:\epoc32\release\winscw\udeb\z\private\200113DD\content and replace existing. +Also you need to delete runtime generated file from X:\epoc32\winscw\c\private\200113dd\content and launch the emulator. \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/data/aiprofileplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/data/aiprofileplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 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: Registry info + * +*/ + + +// INCLUDES +#include +#include + + +// ----------------------------------------------------------------------------- +// +// registry_info +// Registry information required for identifying the ECOM component +// +// ----------------------------------------------------------------------------- +// + +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = AI_UID_ECOM_DLL_CONTENTPUBLISHER_PROFILEPLUGIN; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; + version_no = 1; + display_name = "Profile plug-in"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; +} + + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/data/aiprofilepluginres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/data/aiprofilepluginres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,96 @@ +/* +* 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: Resource file for ProfilePlugin. +* +*/ + + +// ========== RESOURCE IDENTIFIER ============================================= + +NAME AIPP // 4 letter ID + +// ========== INCLUDE FILES =================================================== + + +#include +#include +#include +#include +#include +#include + +#include + + +// ========== CONSTANTS ======================================================= + +// ========== RESOURCE DEFINITIONS ============================================ + +RESOURCE RSS_SIGNATURE + { + } + +RESOURCE TBUF + { + buf = ""; + } + +// ---------------------------------------------------------------------------- +// +// "Activate: %U" +// +// ---------------------------------------------------------------------------- +// +RESOURCE TBUF r_ai_pers_prof_toggle + { + buf = qtn_ai_pers_prof_toggle; + } + +// ----------------------------------------------------------------------------- +// +// "Insert SIM card" +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_su_note_insert_sim + { + buf = qtn_su_note_insert_sim; + } + +// ----------------------------------------------------------------------------- +// +// "Are you sure that you want to switch GSM network on?" +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_ai_leave_offline_mode_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_leave_offline_mode_query; + }; + } + }; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/group/aiprofileplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/group/aiprofileplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2005-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: Project definition file for project ProfilePlugin +* +*/ + +#include +#include + +#include + +TARGET aiprofileplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_CONTENTPUBLISHER_PROFILEPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE caiprofileplugin.cpp +SOURCE caiprofileengine.cpp + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE aiprofileplugin.rss +TARGET aiprofileplugin.rsc +END + +START RESOURCE aiprofilepluginres.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY aiutils.lib +LIBRARY sssettings.lib +LIBRARY profileeng.lib +LIBRARY bafl.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY efsrv.lib +LIBRARY commonengine.lib +LIBRARY ws32.lib +LIBRARY apgrfx.lib + +// End of File + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 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: The build information file of Profile Plugin +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../loc/ai3profileplugin.loc MW_LAYER_LOC_EXPORT_PATH(ai3profileplugin.loc) + +../rom/aiprofileplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(aiprofileplugin_resources.iby) +../rom/aiprofileplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiprofileplugin.iby) + + +PRJ_MMPFILES +aiprofileplugin.mmp + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/inc/caiprofileengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/inc/caiprofileengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,201 @@ +/* +* Copyright (c) 2005-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: Header file for the CAiProfileEngine class +* +*/ + + +#ifndef CAIPROFILEENGINE_H +#define CAIPROFILEENGINE_H + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "maiprofilepluginnotifier.h" + +class MProfileEngine; +class CProfileChangeNotifyHandler; +class MProfilesNamesArray; +class RSSSettings; + +/** + * @ingroup group_profileplugin + * + * CAiProfileEngine + * + * @since S60 v3.2 + */ +class CAiProfileEngine : public CBase, + public MSSSettingsObserver, + public MProfileChangeObserver +{ + +public: // Constructors and destructor + + /** + * Constructor to use in the object creation. Initializes the necessary data. + * + * @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier + (the object ordering a notification of the content status change) + * @return none + */ + CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier ); + + /** + * Part of the two phased constuction + * + * @param MAiProfilePluginNotifier* aNotifier a pointer to a object implementing MAiProfilePluginNotifier + (the object ordering a notification of the content status change) + * @return Pointer to the created CAiProfileEngine object + */ + static CAiProfileEngine* NewL( MAiProfilePluginNotifier* aProfilePluginNotifier ); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CAiProfileEngine(); + + /** + * Resumes the engine + * + * @param void + * @return void + */ + void ResumeL(); + + /** + * Suspends the engine + * + * @param void + * @return void + */ + void Suspend(); + +public: + + const TDesC& ActiveProfileName() const; + + const TDesC& SwapProfileName() const; + + TInt NumberOfProfiles(); + + const TDesC& ProfileNameByIndex( TInt aIndex ) const; + + void HandleAiEventL( TInt aEvent, const TDesC& aParam ); + + void SetActiveProfileL( const TInt aProfileId ); + + TBool IsActiveProfileSilentL(); + + TBool IsActiveProfileTimedL(); + + void UpdateProfileNamesL(); + + TBool IsOffline(); + +private: + + void ConstructL(); + + void SetActiveProfileNameL( const TDesC& aName ); + + void SetSwapProfileNameL( const TDesC& aName ); + + void SetProfileNameListL( const MProfilesNamesArray& aArray ); + + void HandleSwitchByNameL( const TDesC& aParam ); + + void HandleSwitchByIndexL( const TDesC& aParam ); + + void HandleSwapL( const TDesC& aParam ); + + void HandleEditActiveProfileL(); + + TBool ShowOfflineMessageL(); + + +protected: + +// from base class MSSSettingsObserver + + /** + * Called when SS Settings changes. + */ + void PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue ); + + +// from base class MProfileChangeObserver + + /** + * Called when active profile changes. + */ + void HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId ); + +private: + /** + * Pointer to the class implementing the MAiProfilePluginNotifier interface + */ + MAiProfilePluginNotifier* iProfilePluginNotifier; + + /** + * Client to listen SS setting changes. + */ + RSSSettings iSSSettings; + + /** + * Profile engine. + * Own. + */ + MProfileEngine* iProfileEngine; + + /** + * Profile change notifier. + * Own + */ + CProfileChangeNotifyHandler* iProfileNotifier; + + /* + * Active profile name + * Own + */ + HBufC* iActiveProfileName; + + /* + * Swap profile name + * Own + */ + HBufC* iSwapProfileName; + + /** + * Array of Profile Name Pointer. + * Own. + */ + RPointerArray iProfileNamePointerArray; + + /** + * Resource loader for own resources. + */ + RConeResourceLoader iResourceLoader; + +}; + +#endif // CAIPROFILEENGINE_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/inc/caiprofileplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/inc/caiprofileplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,283 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef CAIPROFILEPLUGIN_H +#define CAIPROFILEPLUGIN_H + +#include +#include +#include +#include +#include "maiprofilepluginnotifier.h" + +class MAiContentObserver; +class MAiContentItemIterator; +class CAiProfileEngine; + +/** + * @ingroup group_profileplugin + * + * Plug-in main class + * + * @since S60 v3.2 + */ +class CAiProfilePlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiProfilePluginNotifier, + public MAiEventHandlerExtension + + + { + +public: + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CAiProfilePlugin* NewL(); + + /** + * Constructor + * + * @param none + * @return none + */ + CAiProfilePlugin(); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CAiProfilePlugin(); + + /** + * Publishes profile names + * + * @param void + * @return void + */ + void PublishL(); + +// from base class CAiContentPublisher + + /** + * From CAiContentPublisher + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, e.g. the plug-in + * should unload its engines due backup operation. The method transits the + * plug-in to "Idle" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Stop( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * allowed to consume CPU resources, e.g plug-in is able to run timers, + * perform asynchronous operations, etc. The method transits the plug-in + * to "Alive" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Resume( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timers, cancel outstanding asynchronous operations, etc. The method + * transits the plug-in to "Suspendend" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Suspend( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @return void + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plugin shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @param aSettings setting items defined in the UI definition. + * @return void + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension( TUid aUid ); + +// from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + */ + TAny* GetPropertyL( TInt aProperty ); + + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + void SetPropertyL( TInt aProperty, TAny* aValue ); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + +// from base class MAiProfilePluginNotifier + + /** + * Receives a notification of the content update event + * + * @param void + * @return void + */ + void NotifyContentUpdate(); + +protected: + +private: + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * Resume the plug-in. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void DoResumeL(TAiTransitionReason aReason); + + /** + * Free the engine + * + * @param void + * @return void + */ + void FreeEngine(); + + /** + * Clean profile names from published content + * + * @param void + * @return void + */ + void CleanPublishedProfileNames(); + +private: // data + + // Iterator for plugin content + // Own + MAiContentItemIterator* iContent; + + // Iterator for plugin events + // Own + MAiContentItemIterator* iEvents; + + // Iterator for plug-in resources. + // Own + MAiContentItemIterator* iResources; + + // Plugin engine + // Own + CAiProfileEngine* iEngine; + + // Array of content observers + // Own + RPointerArray iObservers; + + // Information about the content publisher (this plug-in) + TAiPublisherInfo iInfo; + + // Current profile count + TInt iCurrentCount; + + // Profile count that is used as reference when profile list is updated + TInt iPreviousCount; + + //Plug-in state, suspended or alive. + TBool iAlive; + + // Boolean, which expresses whether the content has been updated + TBool iIsUpdated; + + HBufC *iActiveProfileAndChar; + + HBufC *iPreviousProfileNameAndChar; + }; + +#endif // CAIPROFILEPLUGIN_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/inc/maiprofilepluginnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/inc/maiprofilepluginnotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2005-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: Profile plugin private interface +* +*/ + + +#ifndef MAIPROFILEPLUGINNOTIFIER_H +#define MAIPROFILEPLUGINNOTIFIER_H + +// CLASS DECLARATION +/** +* @ingroup group_profileplugin +* +* It defines interface for the plugin, contains virtual method which offers plugin +* a way to notify the client e.g. P&S data changes +* +* @since S60 v3.2 +*/ +class MAiProfilePluginNotifier + { + public: + + /** + * Virtual method, which the plugin class has to implement. + * Method is used to send notification of P&S data's change event + * from engine to plugin. + * + */ + inline virtual void NotifyContentUpdate() = 0; + }; + +#endif //MAIPROFILEPLUGINNOTIFIER_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/loc/ai3profileplugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/loc/ai3profileplugin.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 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: Localization strings for project Active Idle +* +*/ + + +// d: Activate profile shortcut +// l: list_ai2_gene_pane_t1/opt1 +// w: +// r: 3.2 +// +#define qtn_ai_pers_prof_toggle "Activate %U" diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/rom/aiprofileplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/rom/aiprofileplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 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: IBY file for Profile plug-in +* +*/ + + +#ifndef AIPROFILEPLUGIN_IBY +#define AIPROFILEPLUGIN_IBY +#include + +#ifdef RD_CUSTOMIZABLE_AI + +ECOM_PLUGIN(aiprofileplugin.dll, aiprofileplugin.rsc) + +#endif // RD_CUSTOMIZABLE_AI + +#endif // AIPROFILEPLUGIN_IBY + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/rom/aiprofileplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/rom/aiprofileplugin_resources.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: IBY file for Profile plug-in +* +*/ + + +#ifndef AIPROFILEPLUGIN_RESOURCES_IBY +#define AIPROFILEPLUGIN_RESOURCES_IBY + +#include + +#ifdef RD_CUSTOMIZABLE_AI + +// AI profile plug-in localizable resources +data=DATAZ_\RESOURCE_FILES_DIR\aiprofilepluginres.rsc RESOURCE_FILES_DIR\aiprofilepluginres.rsc + +#endif // RD_CUSTOMIZABLE_AI + +#endif // AIPROFILEPLUGIN_RESOURCES_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/src/caiprofileengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,580 @@ +/* +* Copyright (c) 2005-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: The engine class of profile plugin. +* +*/ + + +// INCLUDE FILES +#include "caiprofileengine.h" +#include "maiprofilepluginnotifier.h" +#include "aiprofileplugincontentmodel.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include + +const TInt KMaxProfileNameLength( 64 ); +const TInt KGeneralProfileId( 0 ); +const TInt KSilentProfileId( 1 ); +const TInt KOfflineProfileId( 5 ); + +const TInt KMaxActiveProfileLength( 64 ); +const TUid KUidProfileApp = { 0x100058F8 }; +const TUid KProfileAppSettingViewId = { 2 }; + +_LIT( KAiProfilePluginResourceFileName, "z:aiprofilepluginres.rsc"); + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------- +// Default constructor +// --------------------------------------------------------- +// +CAiProfileEngine::CAiProfileEngine( MAiProfilePluginNotifier* aProfilePluginNotifier ) : + iProfilePluginNotifier ( aProfilePluginNotifier ), + iResourceLoader( *CCoeEnv::Static() ) + { + } + +// --------------------------------------------------------- +// Two-phased constructor. +// Create instance of concrete ECOM interface implementation +// --------------------------------------------------------- +// +CAiProfileEngine* CAiProfileEngine::NewL( MAiProfilePluginNotifier* aProfilePluginNotifier ) + { + CAiProfileEngine* self = new( ELeave ) CAiProfileEngine( aProfilePluginNotifier ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------- +// +void CAiProfileEngine::ConstructL() + { + TParse parse; + parse.Set( KAiProfilePluginResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL ); + TFileName fileName( parse.FullName() ); + + // Get language of resource file. + BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), fileName ); + + // Open resource file. + TRAP_IGNORE( iResourceLoader.OpenL( fileName ) ); + + User::LeaveIfError( iSSSettings.Open() ); + + iProfileEngine = CreateProfileEngineL(); + } + + +// --------------------------------------------------------- +// Destructor. +// --------------------------------------------------------- +// +CAiProfileEngine::~CAiProfileEngine() + { + iSSSettings.CancelAll( *this ); + iSSSettings.Close(); + delete iProfileNotifier; + delete iActiveProfileName; + delete iSwapProfileName; + + if( iProfileNamePointerArray.Count() ) + { + iProfileNamePointerArray.ResetAndDestroy(); + } + + if( iProfileEngine ) + { + iProfileEngine->Release(); + } + + iResourceLoader.Close(); + } + +// --------------------------------------------------------- +// Updates profiles +// --------------------------------------------------------- +// +void CAiProfileEngine::UpdateProfileNamesL() + { + //update active profile name + HBufC* activeProfileName = NULL; + + MProfile* profile = iProfileEngine->ActiveProfileLC(); + const MProfileName& name = profile->ProfileName(); + activeProfileName = name.Name().AllocLC(); + + SetActiveProfileNameL( *activeProfileName ); + + //update profile name list + MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + + SetProfileNameListL( *profileNamesArray ); + + //update swap profile name + HBufC* swapProfileName = NULL; + + TInt activeProfileId = iProfileEngine->ActiveProfileId(); + + if( activeProfileId == KSilentProfileId ) + { + const MProfileName* generalProfileName = profileNamesArray->ProfileName( KGeneralProfileId ); + swapProfileName = generalProfileName->Name().AllocLC(); + } + else + { + const MProfileName* silentProfileName = profileNamesArray->ProfileName( KSilentProfileId ); + swapProfileName = silentProfileName->Name().AllocLC(); + } + + TPtrC swapProfileNamePtr( *swapProfileName ); + HBufC* activateProfileString = NULL; + activateProfileString = StringLoader::LoadLC( R_AI_PERS_PROF_TOGGLE, swapProfileNamePtr ); + + SetSwapProfileNameL( *activateProfileString ); + + CleanupStack::PopAndDestroy( 5 ); //profile, profileName, profileNamesArray, swapProfileName, activateProfileString + } + +// --------------------------------------------------------- +// Checks SIM card status +// --------------------------------------------------------- +// +TBool CAiProfileEngine::ShowOfflineMessageL() + { + TInt result = ETrue; + + TInt simCardStatus( ESimNotPresent ); + + RProperty simStatus; + User::LeaveIfError( simStatus.Attach( KPSUidStartup, KPSSimStatus ) ); + User::LeaveIfError( simStatus.Get( simCardStatus ) ); + simStatus.Close(); + + if( simCardStatus == ESimNotPresent ) + { + // SIM card does not exist. + HBufC* infoNoteText = StringLoader::LoadLC( R_SU_NOTE_INSERT_SIM ); + CAknInformationNote* note = new( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( *infoNoteText ); + CleanupStack::PopAndDestroy( infoNoteText ); + result = EFalse; + } + else + { + CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + result = dlg->ExecuteLD( R_AI_LEAVE_OFFLINE_MODE_QUERY ); + } + + return result; + } + + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CAiProfileEngine::SetActiveProfileNameL( const TDesC& aName ) + { + HBufC* temp = aName.AllocL(); + delete iActiveProfileName; + iActiveProfileName = NULL; + TPtr profileNamePtr = temp->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + iActiveProfileName = temp; + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +const TDesC& CAiProfileEngine::ActiveProfileName() const + { + if( iActiveProfileName ) + { + return *iActiveProfileName; + } + + return KNullDesC(); + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CAiProfileEngine::SetSwapProfileNameL( const TDesC& aName ) + { + HBufC* temp = aName.AllocL(); + delete iSwapProfileName; + iSwapProfileName = NULL; + TPtr profileNamePtr = temp->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + iSwapProfileName = temp; + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +const TDesC& CAiProfileEngine::SwapProfileName() const + { + if( iSwapProfileName ) + { + return *iSwapProfileName; + } + + return KNullDesC(); + } + + +// --------------------------------------------------------- +// Set profile names +// --------------------------------------------------------- +// +void CAiProfileEngine::SetProfileNameListL( const MProfilesNamesArray& aArray ) + { + if( iProfileNamePointerArray.Count() ) + { + iProfileNamePointerArray.ResetAndDestroy(); + } + + const TInt count = aArray.MdcaCount(); + TBufC profileName; + + for( TInt i = 0; i < count; i++ ) + { + profileName = aArray.MdcaPoint( i ); + TPtr profileNamePtr = profileName.Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( profileNamePtr ); + HBufC* profile = profileNamePtr.AllocLC(); + User::LeaveIfError( iProfileNamePointerArray.Append( profile )); + CleanupStack::Pop( profile ); + } + } + + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +const TDesC& CAiProfileEngine::ProfileNameByIndex( TInt aIndex ) const + { + if( iProfileNamePointerArray.Count() ) + { + return *iProfileNamePointerArray[aIndex]; + } + + return KNullDesC(); + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +TBool CAiProfileEngine::IsActiveProfileSilentL() + { + TBool isSilent = EFalse; + MProfile* profile = iProfileEngine->ActiveProfileLC(); + isSilent = profile->IsSilent(); + CleanupStack::PopAndDestroy(); + return isSilent; + } + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +TBool CAiProfileEngine::IsActiveProfileTimedL() + { + return iProfileEngine->IsActiveProfileTimedL(); + } + +// --------------------------------------------------------- +// Number of profiles +// --------------------------------------------------------- +// +TInt CAiProfileEngine::NumberOfProfiles() + { + return iProfileNamePointerArray.Count(); + } + + +// --------------------------------------------------------- +// +// --------------------------------------------------------- +// +void CAiProfileEngine::HandleAiEventL( TInt aEvent, const TDesC& aParam ) + { + switch ( aEvent ) + { + case EAiProfileEventSwitchByIndex: + HandleSwitchByIndexL( aParam ); + break; + + case EAiProfileEventSwitchByName: + HandleSwitchByNameL( aParam ); + break; + + case EAiProfileEventSwap: + HandleSwapL( aParam ); + break; + + case EAiProfileEditActive: + HandleEditActiveProfileL(); + break; + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// Handles profile switch by index event +// ----------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleSwitchByIndexL( const TDesC& aParam ) + { + if ( aParam.Length() > 0 ) + { + TInt profileId = KErrNotFound; + TPtrC ptr( aParam ); + TLex lexer( ptr ); + + TInt err = lexer.Val( profileId ); + if ( err == KErrNone ) + { + MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + const MProfileName* profileName = profileNamesArray->ProfileName( profileId ); + + if( profileName ) + { + profileId = profileName->Id(); + SetActiveProfileL( profileId ); + } + + CleanupStack::PopAndDestroy(); + } + } + } + +// ----------------------------------------------------------------------------- +// Handles profile switch by name event +// ----------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleSwitchByNameL( const TDesC& aParam ) + { + if ( aParam.Length() > 0 ) + { + TInt profileId = KErrNotFound; + MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + profileId = profileNamesArray->FindByName( aParam ); + if( profileId != KErrNotFound ) + { + SetActiveProfileL( profileId ); + } + + CleanupStack::PopAndDestroy(); + } + } + +// ----------------------------------------------------------------------------- +// Handles profile swap event +// ----------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleSwapL( const TDesC& aParam ) + { + if ( aParam.Length() > 0 ) + { + TInt profileId = KErrNotFound; + TPtrC ptr( aParam ); + TLex lexer( ptr ); + + TInt err = lexer.Val( profileId ); + if ( err == KErrNone ) + { + TInt activeProfile = iProfileEngine->ActiveProfileId(); + + if( activeProfile != profileId ) + { + MProfilesNamesArray* profileNamesArray = iProfileEngine->ProfilesNamesArrayLC(); + profileId = profileNamesArray->FindById( profileId ); + + if( profileId != KErrNotFound ) + { + TRAP_IGNORE( SetActiveProfileL( profileId ) ); + } + + CleanupStack::PopAndDestroy(); + } + else + { + SetActiveProfileL( KGeneralProfileId ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// Handles edit active profile event +// ----------------------------------------------------------------------------- +// +void CAiProfileEngine::HandleEditActiveProfileL() + { + RWsSession ws; + User::LeaveIfError(ws.Connect()); + CleanupClosePushL(ws); + + // Find the task with uid + TApaTaskList taskList(ws); + TApaTask task = taskList.FindApp( KUidProfileApp ); + + if ( task.Exists() ) + { + task.EndTask(); + User::After( 500000 ); + } + CleanupStack::PopAndDestroy(&ws); + + TVwsViewId viewid( KUidProfileApp, KProfileAppSettingViewId ); + TInt profileId = iProfileEngine->ActiveProfileId(); + TBuf8 buf; + buf.AppendNum(profileId); + CEikonEnv::Static()->AppUi()->ActivateViewL( viewid ,KProfileAppSettingViewId,buf); + + + } + +// ----------------------------------------------------------------------------- +// Set active profile +// ----------------------------------------------------------------------------- +// +void CAiProfileEngine::SetActiveProfileL( const TInt aProfileId ) + { + TInt activeProfileId = iProfileEngine->ActiveProfileId(); + + if ( activeProfileId == KOfflineProfileId && aProfileId != KOfflineProfileId ) + { + if( !ShowOfflineMessageL() ) + { + // User doesn't want to activate RF or + // SIM card does not exist. + return; + } + } + + iProfileEngine->SetActiveProfileL( aProfileId ); + } + +// --------------------------------------------------------------------------- +// Resumes the engine +// --------------------------------------------------------------------------- +// +void CAiProfileEngine::ResumeL() + { + User::LeaveIfError( iSSSettings.Open() ); + + //Register to listen ALS activation, if ALS status changes, + //profile must be republished. + TInt err = iSSSettings.Register( ESSSettingsAls, *this ); + + if( err == KErrNotSupported || err == KErrAlreadyExists ) + { + //ALS not supported or already registered, that's fine + err = KErrNone; + } + + User::LeaveIfError( err ); + + //Start to listen profile changes. + delete iProfileNotifier; + iProfileNotifier = NULL; + + iProfileNotifier = CProfileChangeNotifyHandler::NewL( this ); + } + +// --------------------------------------------------------------------------- +// Suspends the engine +// --------------------------------------------------------------------------- +// +void CAiProfileEngine::Suspend() + { + iSSSettings.CancelAll( *this ); + iSSSettings.Close(); + delete iProfileNotifier; + iProfileNotifier = NULL; + } + +// --------------------------------------------------------------------------- +// From class MProfileChangeObserver +// --------------------------------------------------------------------------- +// + +void CAiProfileEngine::HandleActiveProfileEventL( + TProfileEvent aProfileEvent, + TInt /*aProfileId*/ ) + { + //Profile activated or modified. + if( ( aProfileEvent == EProfileNewActiveProfile ) || + ( aProfileEvent == EProfileActiveProfileModified ) ) + { + UpdateProfileNamesL(); + iProfilePluginNotifier->NotifyContentUpdate(); + } + } + +// --------------------------------------------------------------------------- +// From class MSSSettingsObserver. +// --------------------------------------------------------------------------- +// +void CAiProfileEngine::PhoneSettingChanged( + TSSSettingsSetting aSetting, + TInt /*aNewValue*/ ) + { + if( aSetting == ESSSettingsAls ) + { + TRAP_IGNORE( UpdateProfileNamesL() ); + iProfilePluginNotifier->NotifyContentUpdate(); + } + } + + +TBool CAiProfileEngine::IsOffline() + { + return iProfileEngine->ActiveProfileId() == KOfflineProfileId; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/profileplugin/src/caiprofileplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/profileplugin/src/caiprofileplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,509 @@ +/* +* Copyright (c) 2005-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: Profile plug-in publisher +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include "aiprofileplugincontentmodel.h" +#include +#include "caiprofileplugin.h" +#include "caiprofileengine.h" +#include "aipluginsettings.h" + +// PUA code for the timed profile, missing from PUAcodes.hrh +#define KAiTimedProfilePUA 0xF815 +#define KAiRTL 0x200F + +// CONST CLASS VARIABLES +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidProfilePlugin, CAiProfilePlugin::NewL ) + }; + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CAiProfilePlugin* CAiProfilePlugin::NewL() + { + CAiProfilePlugin* self = new (ELeave) CAiProfilePlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CAiProfilePlugin::CAiProfilePlugin() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::ConstructL() + { + iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN; + + iContent = AiUtility::CreateContentItemArrayIteratorL( KAiProfileContent ); + iEvents = AiUtility::CreateContentItemArrayIteratorL( KAiProfileEvents ); + iResources = AiUtility::CreateContentItemArrayIteratorL( KAiProfileResources ); + + iIsUpdated = ETrue; + iAlive = EFalse; + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CAiProfilePlugin::~CAiProfilePlugin() + { + CleanPublishedProfileNames(); + Release( iContent ); + Release( iEvents ); + Release( iResources ); + delete iActiveProfileAndChar; + delete iPreviousProfileNameAndChar; + delete iEngine; + iObservers.Close(); + } + +// --------------------------------------------------------------------------- +// Publishes the profiles +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::PublishL() + { + TInt err( KErrNone ); + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + iCurrentCount = iEngine->NumberOfProfiles(); + for ( int i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = iObservers[i]; + err = observer->StartTransaction( transactionId ); + + if ( err == KErrNotSupported ) + { + // The observer does not support transactions, check for real errors. + return; + } + + //Active Profile name + if ( observer->CanPublish( *this, EAiProfileContentActiveProfileName, EAiProfileContentActiveProfileName ) ) + { + observer->Publish( *this, EAiProfileContentActiveProfileName, iEngine->ActiveProfileName(), EAiProfileContentActiveProfileName ); + } + + if ( observer->CanPublish( *this, EAiProfileActiveProfileNameAndIconChar, 0 ) ) + { + delete iActiveProfileAndChar; + iActiveProfileAndChar = NULL; + // silent/non-silent icon + timed icon + space + possible RTL*2 = 5 + TInt maxChars = iEngine->ActiveProfileName().Length() + 5; + + iActiveProfileAndChar = HBufC::NewL( maxChars ); + TPtr profileNamePtr = iActiveProfileAndChar->Des(); + + if( AknLayoutUtils::LayoutMirrored() ) + { + profileNamePtr.Append( KAiRTL ); + } + + if ( iEngine->IsActiveProfileTimedL() ) + { + profileNamePtr.Append( KAiTimedProfilePUA ); + } + if( iEngine->IsActiveProfileSilentL() ) + { + profileNamePtr.Append( KPuaCodeSilentSymbol ); + } + else + { + profileNamePtr.Append( KPuaCodeAprofSound ); + } + _LIT( KSpace, " " ); + profileNamePtr.Append( KSpace ); + + if( AknLayoutUtils::LayoutMirrored() ) + { + profileNamePtr.Append( KAiRTL ); + } + + profileNamePtr.Append( iEngine->ActiveProfileName() ); + + if ( !iPreviousProfileNameAndChar || + iPreviousProfileNameAndChar->CompareC( *iActiveProfileAndChar ) != 0 ) + { + delete iPreviousProfileNameAndChar; + iPreviousProfileNameAndChar = NULL; + observer->Publish( *this, EAiProfileActiveProfileNameAndIconChar, profileNamePtr, 0 ); + + iPreviousProfileNameAndChar = iActiveProfileAndChar->AllocL(); + } + } + + //Swap Profile name ( 1.phase: General or Silent ) + if ( observer->CanPublish( *this, EAiProfileContentSwapProfileName, EAiProfileContentSwapProfileName ) ) + { + observer->Publish( *this, EAiProfileContentSwapProfileName, iEngine->SwapProfileName(), EAiProfileContentSwapProfileName ); + } + + //All profile names + // clean profiles that are already deleted. + // Cleans the array blindly from the end, because in the next + // step all the profiles are republished + if( iPreviousCount > iCurrentCount ) + { + for( TInt k = iCurrentCount; k < iPreviousCount; k++ ) + { + observer->Clean( *this, EAiProfileContentProfileName, k + 1 ); + } + } + for ( TInt j = 0; j < iCurrentCount; j++ ) + { + if ( observer->CanPublish( *this, EAiProfileContentProfileName, j + 1 ) ) + { + observer->Publish(*this, EAiProfileContentProfileName, iEngine->ProfileNameByIndex( j ), j + 1 ); + } + } + + //Active Profile silent indicator char + if ( observer->CanPublish( *this, EAiProfileActiveProfileSilentChar, EAiProfileActiveProfileSilentChar ) ) + { + if ( iEngine->IsActiveProfileSilentL() ) + { + TBuf<1> silent; // one character + silent.Append( KPuaCodeSilentSymbol ); + observer->Publish( *this, EAiProfileActiveProfileSilentChar, silent, EAiProfileActiveProfileSilentChar ); + } + else + { + observer->Clean( *this, EAiProfileActiveProfileSilentChar, EAiProfileActiveProfileSilentChar ); + } + } + + //Active Profile silent indicator resource + if ( observer->CanPublish( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileIcon ) ) + { + observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileSilentIconResource ); + observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileGeneralIconResource ); + observer->Clean( *this, EAiProfileActiveProfileIcon, EAiProfileActiveProfileTimedIconResource ); + if ( iEngine->IsActiveProfileTimedL() ) + { + observer->Publish( *this, + EAiProfileActiveProfileIcon, + EAiProfileActiveProfileTimedIconResource, + EAiProfileActiveProfileTimedIconResource ); + } + else if ( iEngine->IsActiveProfileSilentL() ) + { + observer->Publish( *this, + EAiProfileActiveProfileIcon, + EAiProfileActiveProfileSilentIconResource, + EAiProfileActiveProfileSilentIconResource ); + } + else + { + observer->Publish( *this, + EAiProfileActiveProfileIcon, + EAiProfileActiveProfileGeneralIconResource, + EAiProfileActiveProfileGeneralIconResource ); + } + } + + // in case of Offline profile profile indicator is not shown + if ( observer->CanPublish( *this, EAiProfileContentActiveProfileName, EAiProfileContentActiveProfileName ) && + iEngine->IsOffline() ) + { + observer->Clean( *this, EAiProfileActiveProfileSilentChar, EAiProfileActiveProfileSilentChar ); + observer->Clean( *this, EAiProfileActiveProfileIcon, 1 ); + observer->Clean( *this, EAiProfileActiveProfileIcon, 2 ); + // uncomment also this and respective policy lines in profiles.xml if whole widget needs to be hidden in AI3 + //observer->Clean( *this, EAiProfileContentActiveProfileName, EAiProfileContentActiveProfileName ); + } + if ( err == KErrNone ) + { + err = observer->Commit( transactionId ); + + if ( err == KErrNotSupported) + { + return; + } + } + + iIsUpdated = EFalse; + } + iPreviousCount = iCurrentCount; + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is requested to unload its engines due backup operation +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::Stop( TAiTransitionReason /*aReason*/ ) + { + FreeEngine(); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::Resume( TAiTransitionReason aReason ) + { + TRAP_IGNORE( DoResumeL( aReason ) ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is not allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::Suspend( TAiTransitionReason /*aReason*/ ) + { + if ( iEngine && iAlive ) + { + iEngine->Suspend(); + } + + iAlive = EFalse; + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// The plug-in MUST maintain a registry of subscribers and send +// notification to all of them whenever the state changes or new content +// is available +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::SubscribeL( MAiContentObserver& aObserver ) + { + iObservers.AppendL( &aObserver ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-ins take ownership of the settings array, so it must either +// store it in a member or free it. +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::ConfigureL( RAiSettingsItemArray& aSettings ) + { + aSettings.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Returns the extension interface. Actual type depends on the passed +// aUid argument. +// --------------------------------------------------------------------------- +// +TAny* CAiProfilePlugin::Extension( TUid aUid ) + { + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast(this); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Read property of publisher plug-in. +// --------------------------------------------------------------------------- +// +TAny* CAiProfilePlugin::GetPropertyL( TInt aProperty ) + { + TAny* property = NULL; + + switch ( aProperty ) + { + case EAiPublisherInfo: + { + property = static_cast( &iInfo ); + break; + } + + case EAiPublisherContent: + { + property = static_cast( iContent ); + break; + } + + case EAiPublisherEvents: + { + property = static_cast( iEvents ); + break; + } + + case EAiPublisherResources: + property = static_cast( iResources ); + break; + + default: + break; + } + + return property; + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Write property value to optimize the content model. +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::SetPropertyL( TInt aProperty, TAny* aValue ) + { + if( aProperty == EAiPublisherInfo ) + { + ASSERT( aValue ); + + const TAiPublisherInfo* info( + static_cast( aValue ) ); + + iInfo = *info; + } + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::HandleEvent(TInt aEvent, const TDesC& aParam) + { + if ( iEngine ) + { + // We have no way of reporting errors to framework so just ignore them. + TRAP_IGNORE( iEngine->HandleAiEventL( aEvent, aParam ) ); + } + } + +// --------------------------------------------------------- +// This method is called from the engine, when the profile +// data content has been changed. Method call is made through +// the MAiProfilePluginNotifier interface. +// --------------------------------------------------------- +// +void CAiProfilePlugin::NotifyContentUpdate() + { + iIsUpdated = ETrue; + + TRAP_IGNORE( PublishL() ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// framework instructs plug-in that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::DoResumeL( TAiTransitionReason aReason ) + { + if ( !iEngine ) + { + iEngine = CAiProfileEngine::NewL( this ); + } + + //update in startup phase and idle is on foreground. + if( aReason != EAiBacklightOff && aReason != EAiIdleBackground ) + { + // force republish in case layout has changed + if ( aReason == EAiScreenLayoutChanged ) + { + delete iPreviousProfileNameAndChar; + iPreviousProfileNameAndChar = NULL; + } + + if ( !iAlive ) + { + iEngine->ResumeL(); + } + + iEngine->UpdateProfileNamesL(); + + PublishL(); + iAlive = ETrue; + } + } + +// --------------------------------------------------------------------------- +// Frees engine resources +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::FreeEngine() + { + delete iEngine; + iEngine = NULL; + iAlive = EFalse; + } + +// --------------------------------------------------------------------------- +// Clean profile names from content +// --------------------------------------------------------------------------- +// +void CAiProfilePlugin::CleanPublishedProfileNames() + { + TInt obsCount( iObservers.Count() ); + for ( TInt i( 0 ); i < obsCount; i++ ) + { + MAiContentObserver* observer = iObservers[i]; + for( TInt j( 0 ); j < iCurrentCount && observer; j++ ) + { + observer->Clean( *this, EAiProfileContentProfileName, j + 1 ); + } + } + } + +// ======== GLOBAL FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Constructs and returns an application object. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / + sizeof( TImplementationProxy ); + return KImplementationTable; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidleplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidleplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2005-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: ECOM plugin resource file for Active Idle Skinning plugin. +* +*/ + + +#include +#include "pslnactiveidlepluginuids.h" + +RESOURCE REGISTRY_INFO theInfo +{ + dll_uid = KPslnActiveIdlePluginDllUID3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KPslnPluginInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KPslnActiveIdlePluginImplementationUID; + version_no = 1; + display_name = "Psln AI Plugin"; + default_data = "0"; + opaque_data = "0"; + } + }; + } + , + INTERFACE_INFO + { + interface_uid = KGSPluginInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KGSActiveIdlePluginImplementationUID; + version_no = 1; + display_name = "GS AI Plugin"; + default_data = "0x1020743F"; // parent uid: Standby plugin + opaque_data = "11"; // Order number + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidlepluginrsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/data/pslnactiveidlepluginrsc.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2005-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: Resource file for PslnActiveIdlePlugin. +* +*/ + + +// ========== RESOURCE IDENTIFIER ============================================= + +NAME PSAI // 4 letter ID + +#include // Avkon localized strings +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// ========== RESOURCE DEFINITIONS ============================================ + +RESOURCE RSS_SIGNATURE +{ +} + +RESOURCE TBUF +{ + buf = ""; +} + +// ---------------------------------------------------------------------------- +// +// Active Idle application specific view. +// +// ---------------------------------------------------------------------------- +// +RESOURCE AVKON_VIEW r_psln_active_idle_view +{ + menubar = r_psln_ai_view_menubar; + //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + cba = r_softkeys_options_back_empty; +} + +// ---------------------------------------------------------------------------- +// +// Options menu with 'Download', 'Activate', 'Help' and 'Exit' items. +// +// ---------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_psln_ai_view_menubar +{ + titles = + { + MENU_TITLE { menu_pane = r_psln_ai_basic_menupane; }, + MENU_TITLE { menu_pane = R_PSLN_GEN_VIEW_MENUPANE; } + }; +} + +// ---------------------------------------------------------------------------- +// +// Menu pane for view. +// +// ---------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_psln_ai_basic_menupane +{ + items = + { +#ifdef __SERIES60_HELP + MENU_ITEM + { + command = EPslnCmdAppHelp; + txt = qtn_options_help; + }, +#endif // __SERIES60_HELP + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; +} + +// ---------------------------------------------------------------------------- +// +// Shortcuts view caption for plugin. max 128 +// +// ---------------------------------------------------------------------------- +// +RESOURCE TBUF r_psln_ai_list_view_caption +{ + buf = qtn_apps_idle_skin_gs; +} + +// ---------------------------------------------------------------------------- +// +// Active Idle specific skin tab title. max 128 +// +// ---------------------------------------------------------------------------- +// +RESOURCE TBUF r_psln_ai_tab_name +{ + buf = qtn_skins_tabs_activeidle; +} + +// ---------------------------------------------------------------------------- +// +// View title for GS Active Idle plugin. +// +// ---------------------------------------------------------------------------- +// +RESOURCE TITLE_PANE r_psln_gs_list_view_title +{ + txt = qtn_apps_idle_skin_gs; +} + +// ---------------------------------------------------------------------------- +// +// View caption for GS Active Idle plugin. max 256 +// +// ---------------------------------------------------------------------------- +// +RESOURCE TBUF r_psln_gs_list_view_caption +{ + buf = qtn_apps_idle_skin_gs; +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +RESOURCE CBA r_softkeys_options_back_empty +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON {id = EPslnCmdAppActivate; txt = ""; } + }; +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +RESOURCE CBA r_softkeys_options_exit_empty +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyExit; txt = text_softkey_exit; }, + CBA_BUTTON {id = EPslnCmdAppActivate; txt = ""; } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 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: This file provides the information required for building +* PslnActiveIdlePlugin. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +#include +../loc/pslnactiveidle3plugin.loc MW_LAYER_LOC_EXPORT_PATH(pslnactiveidle3plugin.loc) + +//../rom/pslnactiveidleplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(pslnactiveidleplugin_resources.iby) +//../rom/pslnactiveidleplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(pslnactiveidleplugin.iby) + + + + +PRJ_MMPFILES +pslnactiveidleplugin.mmp + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE pslnactiveidleplugin.mif +OPTION HEADERFILE pslnactiveidleplugin.mbg +OPTION SOURCES \ + -c8,8 qgn_prop_psln_ai_sub +END + +PRJ_TESTMMPFILES + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidleplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidleplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 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: Project specification file. +* +*/ + + +#include +#include // For RESOURCE_FILES_DIR +#include "../inc/pslnactiveidlepluginuids.h" + +//MACRO MY_DEBUG + +TARGET pslnactiveidleplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KPslnActiveIdlePluginDllUID3 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE pslnactiveidlepluginimplementationtable.cpp +SOURCE pslnactiveidleplugincontainer.cpp +SOURCE pslnactiveidlepluginengine.cpp +SOURCE pslnactiveidleplugin.cpp +SOURCE gsactiveidleplugincontainer.cpp +SOURCE gsactiveidleplugin.cpp + +USERINCLUDE ../inc +USERINCLUDE ../loc +USERINCLUDE ../data // For *.rh + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +SOURCEPATH ../data + +START RESOURCE pslnactiveidleplugin.rss +TARGET pslnactiveidleplugin.rsc +END + +START RESOURCE pslnactiveidlepluginrsc.rss +DEPENDS pslncommon.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +LIBRARY apgrfx.lib +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY centralrepository.lib + +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY aknskins.lib // For enhanced skinning +LIBRARY aknnotify.lib // Global note +LIBRARY featmgr.lib // For feature manager + +LIBRARY pslnframework.lib // For Psln FW base classes +LIBRARY xn3odt.lib // For XUIKON + +LIBRARY gsframework.lib // For GS FW base classes +LIBRARY gsecomplugin.lib + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidlepluginicons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/group/pslnactiveidlepluginicons.mk Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,66 @@ +# +# Copyright (c) 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: +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\pslnactiveidleplugin.mif +HEADERFILENAME=$(HEADERDIR)\pslnactiveidleplugin.mbg + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# +# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by +# MifConv if the mask detph is defined. +# +# NOTE 2: Usually, source paths should not be included in the bitmap +# definitions. MifConv searches for the icons in all icon directories in a +# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps. +# The directory \s60\icons is included in the search only if the feature flag +# __SCALABLE_ICONS is defined. +# ---------------------------------------------------------------------------- + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ + /c8,8 qgn_prop_psln_ai_sub.svg + + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2005-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: Psln Active Idle settings plugin. +* +*/ + + +#ifndef C_GSACTIVEIDLEPLUGIN_H +#define C_GSACTIVEIDLEPLUGIN_H + +#include +#include + +class CGSActiveIdlePluginContainer; +class CPslnFWPluginInterface; +class CPslnFWPluginHandler; + + +/** + * CGSActiveIdlePlugin view class for Psln Active Idle settings. + * @since S60 3.2 + * + */ +class CGSActiveIdlePlugin : public CGSPluginInterface +{ + +public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * + * @param aInitParams param not used. + * @return GS connection view. + */ + static CGSActiveIdlePlugin* NewL(TAny* aInitParams); + + /** + * Destructor + */ + ~CGSActiveIdlePlugin(); + +// From CGSPluginInterface + + /** + * @see CGSPluginInterface header file. + */ + void GetCaptionL(TDes& aCaption) const; + + /** + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + +// from base classes + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + * + */ + void HandleCommandL(TInt aCommand); + +protected: // From CAknView + + /** + * @see CAknView. + */ + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * @see CAknView. + */ + void DoDeactivate(); + +// Construction + + /** + * C++ default constructor. + */ + CGSActiveIdlePlugin(); + + /** + * Symbian OS default constructor. + * + */ + void ConstructL(); + +private: // data + + /// Resource loader. + RConeResourceLoader iResourceLoader; + + /// Container. Owned. + CGSActiveIdlePluginContainer* iContainer; + + /// Previous view id. + TVwsViewId iPrevViewId; + + /// Plugin loader. Owned. + CPslnFWPluginHandler* iPluginLoader; + +}; + +#endif // C_GSACTIVEIDLEPLUGIN_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugincontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/gsactiveidleplugincontainer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2005-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: Psln Active Idle settings plugin. +* +*/ + + +#ifndef C_GSACTIVEIDLEPLUGINCONTAINER_H +#define C_GSACTIVEIDLEPLUGINCONTAINER_H + +#include + +/** + * CGSActiveIdlePluginContainer container class + * + * @since S60 3.2 + */ +class CGSActiveIdlePluginContainer : public CCoeControl +{ +public: // Constructors and destructor + + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + * + */ + void ConstructL(const TRect& aRect); + + ~CGSActiveIdlePluginContainer(); + + CGSActiveIdlePluginContainer(); + +// From CCoeControl + + TInt CountComponentControls() const; + + CCoeControl* ComponentControl(TInt aIndex) const; + + void SizeChanged(); + +}; + +#endif // C_GSACTIVEIDLEPLUGINCONTAINER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2005-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: View for Active Idle skinning. +* +*/ + + +#ifndef C_PSLNACTIVEIDLEPLUGIN_H +#define C_PSLNACTIVEIDLEPLUGIN_H + +#include +#include +#include +#include +#include + + +class CAknViewAppUi; +class CPslnActiveIdlePluginContainer; +class CPslnActiveIdlePluginEngine; + +enum TAiUIControllers +{ + EAiUICUnknown = -1, + EAiUICNative = 0, + EAiUICXML +}; + +// View item text length +const TInt KPslnItemMaxTextLength = 128; + + +/** + * CPslnActiveIdlePlugin view class for Active Idle Theme settings + * + * @since S60 3.2 + */ +class CPslnActiveIdlePlugin : + public CPslnFWBaseView, + public MPslnFWMSKObserver +{ +public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * + * @param aAppUi pointer to app ui, TAny static cast'd. + * @return Psln AI skinning view. + */ + static CPslnActiveIdlePlugin* NewL(TAny* aAppUi); + + /** + * Destructor + */ + ~CPslnActiveIdlePlugin(); + +// From CPslnFWnInterface + + /** + * @see CPslnFWPluginInterface. + */ + void GetCaptionL(TDes& aCaption) const; + + + /** + * @see CPslnFWPluginInterface. + */ + void GetTabTextL(TDes& aCaption) const; + + /** + * @see CPslnFWPluginInterface. + */ + CGulIcon* CreateIconL(); + + /** + * @see CPslnFWPluginInterface. + */ + void GetLocationTypeAndIndex(TPslnFWLocationType& aType, TInt& aIndex) const; + +// from AknView + + /** + * Returns view id. + * @return TUid + */ + TUid Id() const; + + /** + * Handles commands. + * @param aCommand Command to be handled. + */ + void HandleCommandL(TInt aCommand); + +// new methods + + /** + * Get CPslnActiveIdlePlugin's ccontainer. + * @return pointer to container. + */ + CPslnActiveIdlePluginContainer* Container(); + + /** + * From MPslnFWMSKObserver. + * Checks if the MSK label needs to be adjusted. + */ + void CheckMiddleSoftkeyLabelL(); + + /** + * Return engine instance. + */ + CPslnActiveIdlePluginEngine* Engine(); + +protected: // From CAknView + + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + void DoDeactivate(); + +// Construction + + CPslnActiveIdlePlugin(CAknViewAppUi* aAppUi); + + void ConstructL(); + +private: // From MEikMenuObserver + + /** + * Changes MenuPane dynamically + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + +// from CPslnFWBaseView + + void NewContainerL(); + + void HandleListBoxSelectionL(); + + /** + * Remove command and label from MSK + */ + void RemoveCommandFromMSK(); + + /** + * @see CPslnFWBaseView. + */ + void SetTitlePaneL( TInt& aResourceId ); + +private: // data + + /// Resource loader for own resources. + RConeResourceLoader iResourceLoader; + + /// Resource loader for common psln resources. + RConeResourceLoader iResourceLoaderCommon; + + /// Resource loader for Psln app resources. + RConeResourceLoader iResourceLoaderPsln; + + /// Application UI pointer. Not owned. + CAknViewAppUi* iAppUi; + + /// Navi pane. Not owned. + CAknNavigationDecorator* iNaviPaneContext; + + /// Ai2 perso engine + CPslnActiveIdlePluginEngine* iEngine; + +}; + +#endif // C_PSLNACTIVEIDLEPLUGIN_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugin.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2005-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: Contains common definitions for menu id:s. +* +*/ + + +#ifndef INC_PSLNACTIVEIDLEPLUGIN_HRH +#define INC_PSLNACTIVEIDLEPLUGIN_HRH + +// commands +enum TPslnAIMenuCommands + { + EPslnAICmdAppOpen = 1, + EPslnAICmdAppHelp, + EPslnAICmdAppChange, + EPslnAIAppCmdChange + }; + +#endif // INC_PSLNACTIVEIDLEPLUGIN_HRH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugincontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidleplugincontainer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,138 @@ +/* +* 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: Container for Application shell theme view. +* +*/ + + +#ifndef C_PSLNACTIVEIDLEPLUGINCONTAINER_H +#define C_PSLNACTIVEIDLEPLUGINCONTAINER_H + +// INCLUDES +#include + +// CONSTANTS +// Download item index +const TInt KPslnDownloadItemIndex = 0; +// View item text length +const TInt KPslnAsItemMaxTextLength = 128; + +// FORWARD DECLARATION +class CXnODT; +class CPslnActiveIdlePlugin; + +// CLASS DECLARATION + +/** +* CPslnActiveIdlePluginContainer container class +* @since S60 v3.1 +*/ +NONSHARABLE_CLASS( CPslnActiveIdlePluginContainer ) : + public CPslnFWBaseContainer + { + public: + + CPslnActiveIdlePluginContainer( + TBool aGSCalling, + CPslnActiveIdlePlugin* aPlugin); + /** + * Symbian OS constructor. + * @param aRect Listbox's rect. + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CPslnActiveIdlePluginContainer(); + + /** + * Return currently active selection from list. + * @return currently selected skin index from list view. + */ + TInt GetCurrentlySelectedIndex() const; + + /** + * Adds new item to the listbox. + * @param aItemIndex index to add. + * @param ODT of the theme to add. + * @since 3.2 + */ + void AddNewItemToListL( + const TInt aItemIndex, + CXnODT* aSkinODT, TInt aUiController ); + + /* + * Removes number of themes from listbox. + * @param aDeleteFrom start point index where to start deleting. + * All themes from this on are deleted. + * @since 3.2 + */ + void RemoveThemes( const TInt aDeleteFrom ); + + /** + * Method for telling to update the listing. + */ + void RefreshList(); + + private: + + /* From CPslnFWBaseContainer. */ + void ConstructListBoxL( TInt aResLbxId ); + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + /** + * Adds icons to setting item list. + */ + void AddIconsToListL(); + + private: // data + + /** + * Listbox array for items. + * Not own. + */ + CDesCArray* iItemArray; + + /** + * List of items from resources. + * Own. + */ + CDesCArrayFlat* iItems; + + /** + * Index of currently selected item. + */ + TInt iCurrentlySelected; + + /** + * Pointer to psln plugin. + * Not own. + */ + CPslnActiveIdlePlugin* iPlugin; + + /** + * Indicate if gs started us + */ + TBool iGSCalling; + + }; + +#endif //C_PSLNACTIVEIDLEPLUGINCONTAINER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2005-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: Container for Psln Active Idle settings view. +* +*/ + +#ifndef C_PSLNACTIVEIDLEPLUGINENGINE_H +#define C_PSLNACTIVEIDLEPLUGINENGINE_H + +#include +#include + +// UID of Active Idle. +const TUid KUidActiveIdle = { 0x102750F0 }; + + +class CPslnFWAppThemeHandler; +class CXnODT; +class CPslnActiveIdlePlugin; // for notifying MSK chech need +class CPeriodic; + + +/** + * CPslnActiveIdlePluginEngine container class + * + * @since S60 3.2 + */ +class CPslnActiveIdlePluginEngine : + public CBase, + public MPslnFWAppThemeObserver +{ +public: // Constructors and destructor + + void ConstructL(const TRect& aRect); + + CPslnActiveIdlePluginEngine(CPslnActiveIdlePlugin* aPlugin); + + ~CPslnActiveIdlePluginEngine(); + +// new methods + + /** + * Activates currently highlighted theme. + */ + void ActivateThemeL(); + +// from MPslnFWAppThemeObserver + + void HandleMessage(TXnServiceCompletedMessage aMessage); + + void HandleMessage( + TXnServiceCompletedMessage aMessage, + CArrayPtrFlat& aAppThemeList); + + TInt CurrentUIController() + { + return iCurrentUIController; + }; + + void AddThemesToContainerL(); + + void ManualGetSkinsRestartL(TBool aForceStart = EFalse); + +private: // new methods + + /** + * Adds new theme(s) to the listbox. Multiple themes are + * only added when list updation is required (icons need + * to be updated). Otherwise latest theme info is inquired + * from XUIKON. + */ + void AddNewThemeL(TXnServiceCompletedMessage aMessage); + TInt GetExtStandbyScreenState(TInt& aValue); + + /** + * Add HS items to list. + */ + void AddHomeScreenThemesL(); + + void CheckCurrentUIControllerL(); + + void CheckCurrentAi1PluginL(); + + void UpdateUIControllersInCenrepL(TInt aControllerId); + + void UpdateStatusPaneVisibilityCenrepL(TBool aPaneHidden); + + void UpdateAi1PluginLoadCenrepL(TInt aNewUid); + + TInt RestartAifw(); + + TBool IsAiRunning(); + + void UiTimerRestart(); + +private: + + static TInt RestartTimerCallback( TAny* aSelf ); + + static TInt UiRefreshTimerCallback( TAny* aSelf ); + +private: // data + + /** + * Application specific skin handler. + * Own. + */ + CPslnFWAppThemeHandler* iPslnFWThemeHandler; + + /** + * List of themes. Each theme is described within an ODT. + * Own. + */ + CArrayPtrFlat* iMySkinList; + + /** + * Indicates that skin list should be updated. + */ + TBool iThemeListUpdated; + + /** + * HomeScreen items start index in iMySkinList. + */ + TInt iHSStartIndex; + + /** + * HomeScreen items end index in iMySkinList. + */ + TInt iHSEndIndex; + + /** + * Flag to indicate if we are avaiting the first restart event. + */ + TBool iFirstUpdateRound; + + /** + * Flag to indicate if we have injected first round data. + */ + TBool iFirstUpdateRoundInjected; + + /** + * Current AI2 UI Controller id. + */ + TInt iCurrentUIController; + + /** + * Current AI1 plugin id. + */ + TInt iCurrentAi1Plugin; + + /** + * Flag to indicate if we have injected first round data. + * Not owned. + */ + CPslnActiveIdlePlugin* iPlugin; + + /** + * Restart timer. To restart AI2. + * Own. + */ + CPeriodic* iRestartTimer; + + /** + * UI Refresh timer. + * Own. + */ + CPeriodic* iUiRefreshTimer; + + /** + * Restart timer. To restart AI2. + * Own. + */ + TInt iRestartRetryCount; + + /** + * Kepp track what has been added to list. + * Own. + */ + TInt iAddIndex; + +}; + +#endif // C_PSLNACTIVEIDLEPLUGINENGINE_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginuids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginuids.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2005-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: Uid's of Psln Active Idle settings. +* +*/ + + +#ifndef INC_PSLNACTIVEIDLEPLUGINUIDS_H +#define INC_PSLNACTIVEIDLEPLUGINUIDS_H + +// ======================= +// Psln Active Idle plugin +// ======================= + +// PslnActiveIdlePlugin DLL UID +#define KPslnActiveIdlePluginDllUID3 0x102750A4 + +// PslnActiveIdlePlugin Interface UID +#define KPslnPluginInterfaceUID 0x102750A9 + +// PslnActiveIdlePlugin Implementation UID +#define KPslnActiveIdlePluginImplementationUID 0x102750A7 + +// ============================== +// GS Active Idle Settings plugin +// ============================== + +// GS Plugin interface uid +#define KGSPluginInterfaceUID 0x10207236 + +// GSActiveIdlePlugin Implementation UID +#define KGSActiveIdlePluginImplementationUID 0x102750F5 + +#endif // INC_PSLNACTIVEIDLEPLUGINUIDS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/inc/pslnconst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/inc/pslnconst.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005-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: Constants for psln plugin. +* +*/ + +#ifndef INC_PSLNCONST_H +#define INC_PSLNCONST_H + +// (from psln\inc\pslnconst.h, required by pslnmodel.h) +// Maximum number of characters in Screen saver txt. +const TInt KPslnMaxNumberOfScreenSaverText = 15; + +#endif // INC_PSLNCONST_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/loc/pslnactiveidle3plugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/loc/pslnactiveidle3plugin.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 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: Localization strings for PslnActiveIdlePlugin. +* +*/ + + +// LOCALISATION STRINGS + +// d:Text of a list item in home screens settings list +// d:Item opens home screen theme settings +// l:list_single_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_gs "Change Idle theme" + +// d:Text of a list item for home screen app in Themes selection list +// d:Item opens home screen theme settings +// l:list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_hs "Change Idle theme" + +// d:Title of home screen theme settings view. +// d: +// l:title_pane_t2/opt9 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_title "Change Idle theme" + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 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: Image description file for project pslnactiveidleplugin +* +*/ + + +#ifndef PSLNACTIVEIDLEPLUGIN_IBY +#define PSLNACTIVEIDLEPLUGIN_IBY + +#include + +// Psln ActiveIdle plugin +data=DATAZ_\BITMAP_DIR\pslnactiveidleplugin.mif BITMAP_DIR\pslnactiveidleplugin.mif +ECOM_PLUGIN( pslnactiveidleplugin.dll, pslnactiveidleplugin.rsc ) + +// Central repository file, temporarily here +//data=\S60\ActiveIdle2\plugins\shortcutplugin\src\10275104.txt "private\10202BE9\10275104.txt" + +#endif // PSLNACTIVEIDLEPLUGIN_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/rom/pslnactiveidleplugin_resources.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 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: Image description file for project pslnactiveidleplugin localizable resources +* +*/ + + +#ifndef PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY +#define PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY + +#include + +// Psln ActiveIdle settings plugin localizable resources +data=DATAZ_\RESOURCE_FILES_DIR\pslnactiveidlepluginrsc.rsc RESOURCE_FILES_DIR\pslnactiveidlepluginrsc.rsc + +#endif // PSLNACTIVEIDLEPLUGIN_RESOURCES_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2005-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: Psln Active Idle settings plugin. +* +*/ + + +#include "gsactiveidleplugin.h" +#include "gsactiveidleplugincontainer.h" + +#include +#include +#include +#include "pslnactiveidlepluginuids.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +// GS Active Idle Plugin impl. UID +const TUid KGSActiveIdlePluginUid = { KGSActiveIdlePluginImplementationUID }; + +// Psln Active Idle Plugin impl. UID +const TUid KPslnAIPluginUid = { KPslnActiveIdlePluginImplementationUID }; + +_LIT(KGSActiveIdlePluginResourceFileName, "z:pslnactiveidlepluginrsc.rsc"); + + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::CGSActiveIdlePlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CGSActiveIdlePlugin::CGSActiveIdlePlugin() : iResourceLoader(*iCoeEnv), iPrevViewId() +{ +} + +// --------------------------------------------------------------------------- +// CGSActiveIdlePlugin::NewL() +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CGSActiveIdlePlugin* CGSActiveIdlePlugin::NewL(TAny* /*aInitParams*/) +{ + CGSActiveIdlePlugin* self = new (ELeave) CGSActiveIdlePlugin(); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; +} + +// --------------------------------------------------------------------------- +// CGSActiveIdlePlugin::ConstructL() +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CGSActiveIdlePlugin::ConstructL() +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CGSActiveIdlePlugin::ConstructL")); +#endif + + // Find the resource file. + TParse parse; + parse.Set(KGSActiveIdlePluginResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + TFileName fileName(parse.FullName()); + + // Open resource file. + iResourceLoader.OpenL(fileName); + + BaseConstructL(); + + // Psln first finds and loads all plugins that implement Psln plugin interface. + iPluginLoader = CPslnFWPluginHandler::NewL(AppUi()); + CPslnFWPluginInterface* plugin = iPluginLoader->LoadPluginL(KPslnAIPluginUid); + if (plugin) + { + // Add Psln Active Idle plugin to appui views. Plugin is deleted + // when appui is destroyed. + if (plugin->Id() == KPslnAIPluginUid) + { + CAknView* view = static_cast(plugin); + AppUi()->AddViewL(view); + } + } +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::~CGSActiveIdlePlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CGSActiveIdlePlugin::~CGSActiveIdlePlugin() +{ + if (iContainer) + { + AppUi()->RemoveFromStack(iContainer); + delete iContainer; + iContainer = NULL; + } + + iResourceLoader.Close(); + + delete iPluginLoader; +} + +// --------------------------------------------------------------------------- +// TUid CGSActiveIdlePlugin::Id() +// +// Returns view's ID. +// --------------------------------------------------------------------------- +TUid CGSActiveIdlePlugin::Id() const +{ + return KGSActiveIdlePluginUid; +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::GetCaption +// +// Return application/view caption. 256 +// ---------------------------------------------------------------------------- +// +void CGSActiveIdlePlugin::GetCaptionL(TDes& aCaption) const +{ + iCoeEnv->ReadResourceL(aCaption, R_PSLN_GS_LIST_VIEW_CAPTION); +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::PluginProviderCategory +// +// A means to identify the location of this plug-in in the framework. +// ---------------------------------------------------------------------------- +// +TInt CGSActiveIdlePlugin::PluginProviderCategory() const +{ + // To identify internal plug-ins. + return KGSPluginProviderInternal; +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::Visible +// +// Provides the visibility status of self to framework. +// ---------------------------------------------------------------------------- +// +TBool CGSActiveIdlePlugin::Visible() const +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CGSActiveIdlePlugin::Visible")); +#endif + + return ETrue; +} + +// --------------------------------------------------------------------------- +// CGSActiveIdlePlugin::HandleCommandL(TInt aCommand) +// +// Handles commands directed to this class. +// --------------------------------------------------------------------------- +void CGSActiveIdlePlugin::HandleCommandL(TInt aCommand) +{ + // shouldn't get any commands to handle, but forward them to appui anyway... + AppUi()->HandleCommandL(aCommand); +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::DoActivateL +// +// First method called by the Avkon framwork to invoke a view. +// ---------------------------------------------------------------------------- +// +void CGSActiveIdlePlugin::DoActivateL( + const TVwsViewId& aPrevViewId, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CGSActiveIdlePlugin::DoActivateL")); +#endif + + if (!iContainer) + { + iContainer = new (ELeave) CGSActiveIdlePluginContainer(); + iContainer->SetMopParent(this); + iContainer->ConstructL(ClientRect()); + } + + AppUi()->AddToStackL(*this, iContainer); + + if (iPrevViewId.iViewUid.iUid == 0) + { + iPrevViewId = aPrevViewId; + } + + iContainer->MakeVisible(ETrue); + AppUi()->ActivateLocalViewL(KPslnAIPluginUid); +} + +// ---------------------------------------------------------------------------- +// CGSActiveIdlePlugin::DoDeactivate +// +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CGSActiveIdlePlugin::DoDeactivate() +{ + AppUi()->RemoveFromStack(iContainer); + iContainer->MakeVisible(EFalse); + iPrevViewId.iViewUid.iUid = 0; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugincontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/gsactiveidleplugincontainer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2005-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: Psln Active Idle settings plugin. +* +*/ + + +#include "gsactiveidleplugincontainer.h" + +// --------------------------------------------------------------------------- +// CGSActiveIdlePluginContainer::ConstructL() +// +// Symbian OS two phased constructor. +// --------------------------------------------------------------------------- +// +void CGSActiveIdlePluginContainer::ConstructL(const TRect& aRect) +{ + CreateWindowL(); // Makes the control a window-owning control + SetRect(aRect); + ActivateL(); +} + +// --------------------------------------------------------------------------- +// CGSActiveIdlePluginContainer::~CGSActiveIdlePluginContainer() +// +// Destructor. +// --------------------------------------------------------------------------- +// +CGSActiveIdlePluginContainer::~CGSActiveIdlePluginContainer() +{ +} + +CGSActiveIdlePluginContainer::CGSActiveIdlePluginContainer() +{ +} + +void CGSActiveIdlePluginContainer::SizeChanged() +{ +} + +TInt CGSActiveIdlePluginContainer::CountComponentControls() const +{ + return 0; +} + +CCoeControl* CGSActiveIdlePluginContainer::ComponentControl(TInt /*aIndex*/ ) const +{ + return NULL; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,497 @@ +/* +* Copyright (c) 2005-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: View for Active Idle skinning. +* +*/ + + +// This plugin specific. +#include +#include +#include "pslnactiveidleplugin.h" +#include "pslnactiveidleplugincontainer.h" +#include "pslnactiveidlepluginengine.h" +#include "pslnactiveidlepluginuids.h" + +// General services. +#include +#include +#include + +// Psln Framework specific. +#include +#include +#include +#include + + +// Path to mbm file. +_LIT(KPslnActiveIdleIconFileName, "pslnactiveidleplugin.mbm"); + +// Path to compiled resource file. +_LIT(KPslnActiveIdlePluginResourceFileName, "z:pslnactiveidlepluginrsc.rsc"); + +// Path to common personalization resources. This resource file is meant for +// shared resources between application and plugins. +_LIT(KPslnCommonResourceFileName, "z:pslncommon.rsc"); + +// Path to Psln application resource file. Plugin uses some localized texts +// from Psln's resources. +_LIT(KPslnApplicationResourceFileName, "z:psln.rsc"); + +// Location of this plugin view within Psln's tab group. +const TInt KPslnActiveIdlePluginLocation = 2; + +const TUid KPslnActiveIdlePluginUid = { KPslnActiveIdlePluginImplementationUID }; + +// Middle Softkey control ID. +const TInt KPslnMSKControlId = 3; + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::CPslnActiveIdlePlugin() +// +// Constructor +// ---------------------------------------------------------------------------- +// +CPslnActiveIdlePlugin::CPslnActiveIdlePlugin(CAknViewAppUi* aAppUi) + : + iResourceLoader(*iCoeEnv), + iResourceLoaderCommon(*iCoeEnv), + iResourceLoaderPsln(*iCoeEnv), + iAppUi(aAppUi) +{ +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::NewL +// +// Symbian OS default constructor +// --------------------------------------------------------------------------- +CPslnActiveIdlePlugin* CPslnActiveIdlePlugin::NewL(TAny* aAppUi) +{ + CAknViewAppUi* appUi = reinterpret_cast(aAppUi); + CPslnActiveIdlePlugin* self = new(ELeave) CPslnActiveIdlePlugin (appUi); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::ConstructL +// +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +void CPslnActiveIdlePlugin::ConstructL() +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::ConstructL")); +#endif + + // Find the resource file: + TParse* parse = new (ELeave) TParse; + CleanupStack::PushL(parse); + parse->Set(KPslnCommonResourceFileName, &KDC_APP_RESOURCE_DIR, NULL); + TFileName* fileName = new (ELeave) TFileName(parse->FullName()); + CleanupStack::PushL(fileName); + + // Open resource file: + iResourceLoaderCommon.OpenL(*fileName); + CleanupStack::PopAndDestroy(fileName); + + // Find the resource file: + parse->Set(KPslnApplicationResourceFileName, &KDC_APP_RESOURCE_DIR, NULL); + fileName = new (ELeave) TFileName(parse->FullName()); + CleanupStack::PushL(fileName); + + // Open resource file: + iResourceLoaderPsln.OpenL(*fileName); + CleanupStack::PopAndDestroy(fileName); + CleanupStack::PopAndDestroy(parse); + + // Open own resources for reading. + OpenLocalizedResourceFileL( + KPslnActiveIdlePluginResourceFileName, + iResourceLoader); + + BaseConstructL(R_PSLN_ACTIVE_IDLE_VIEW); + + iEngine = new (ELeave) CPslnActiveIdlePluginEngine(this); + iEngine->ConstructL( TRect() ); + iEngine->ManualGetSkinsRestartL(ETrue); // Force start + +} + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::~CPslnActiveIdlePlugin +// +// Destructor +// ---------------------------------------------------------------------------- +CPslnActiveIdlePlugin::~CPslnActiveIdlePlugin() +{ + iResourceLoaderCommon.Close(); + iResourceLoaderPsln.Close(); + iResourceLoader.Close(); + delete iEngine; +} + +// --------------------------------------------------------------------------- +// TUid CPslnActiveIdlePlugin::Id() +// +// Returns view's ID. +// --------------------------------------------------------------------------- +TUid CPslnActiveIdlePlugin::Id() const +{ + return KPslnActiveIdlePluginUid; +} + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::GetCaption +// +// Return application/view caption. 128 +// ---------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::GetCaptionL(TDes& aCaption) const +{ + // the resource file is already opened. + HBufC* result = StringLoader::LoadL(R_PSLN_AI_LIST_VIEW_CAPTION); + if (aCaption.MaxLength() >= result->Length()) + { + aCaption.Copy(*result); + } + delete result; + } + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::GetTabTextL +// +// Return tab text. 128 +// ---------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::GetTabTextL(TDes& aCaption) const +{ + // the resource file is already opened. + HBufC* result = StringLoader::LoadL(R_PSLN_AI_TAB_NAME); + if (aCaption.MaxLength() >= result->Length()) + { + aCaption.Copy(*result); + } + delete result; + } + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::CreateIconL +// +// Creates Main view icon. +// ---------------------------------------------------------------------------- +// +CGulIcon* CPslnActiveIdlePlugin::CreateIconL() +{ + // Find the resource file: + TParse* parse = new (ELeave) TParse; + CleanupStack::PushL(parse); + parse->Set(KPslnActiveIdleIconFileName, &KDC_APP_BITMAP_DIR, NULL); + HBufC* fileName = parse->FullName().AllocLC(); + TPtr fileNamePtr = fileName->Des(); + + CGulIcon* icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropPslnAiSub, + fileNamePtr, + EMbmPslnactiveidlepluginQgn_prop_psln_ai_sub, + EMbmPslnactiveidlepluginQgn_prop_psln_ai_sub_mask); + + CleanupStack::PopAndDestroy(2, parse); // fileName, parse + + return icon; +} + +// ----------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::GetLocationTypeAndIndex() +// +// +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::GetLocationTypeAndIndex( + TPslnFWLocationType& aType, + TInt& aIndex) const +{ + aType = CPslnFWPluginInterface::EPslnFWSpecified; + aIndex = KPslnActiveIdlePluginLocation; +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::HandleCommandL(TInt aCommand) +// +// Handles commands directed to this class. +// --------------------------------------------------------------------------- +void CPslnActiveIdlePlugin::HandleCommandL(TInt aCommand) +{ + switch (aCommand) + { + case EPslnCmdAppActivate: + iEngine->ActivateThemeL(); + break; + + case EAknSoftkeyBack: + RemoveCommandFromMSK(); + if (iAppUi->View(KPslnMainViewUid)) + { + // if we are in Psln activate Psln main view... + iAppUi->ActivateLocalViewL(KPslnMainViewUid); + } + else if (iAppUi->View(KGSMainViewUid)) + { + // ... else if we are in GS activate parent plugin view (standby view)... + iAppUi->ActivateLocalViewL(KGSStandbyPluginUid); + } + else + { + iAppUi->HandleCommandL(aCommand); + } + break; + + case EAknSoftkeyExit: + // This is here because we use different softkey setups + iAppUi->HandleCommandL(EAknCmdExit); + break; + + case EPslnCmdAppHelp: + case EAknCmdHelp:// Fall trough + CPslnFWBaseView::HandleCommandL(aCommand); + break; + + default: + iAppUi->HandleCommandL(aCommand); + break; + } +} + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::Container +// +// Return handle to container class. +// ---------------------------------------------------------------------------- +// +CPslnActiveIdlePluginContainer* CPslnActiveIdlePlugin::Container() +{ + return static_cast(iContainer); +} + +// ----------------------------------------------------------------------------- +// Checks is there a need to update the middle softkey label. +// This method should do nothing but MSK issues, since it is still called +// if the framework does not support MSK. +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::CheckMiddleSoftkeyLabelL() +{ + CPslnActiveIdlePluginContainer* container = Container(); + TInt highlightedItem = iContainer->iListBox->CurrentItemIndex(); + +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::CheckMiddleSoftkeyLabelL highl = %d, curr = %d"), highlightedItem, container->GetCurrentlySelectedIndex()); +#endif + + // First remove any previous commands. + RemoveCommandFromMSK(); + + if (highlightedItem >= 0 && + highlightedItem != container->GetCurrentlySelectedIndex()) + { + // Activate: + CPslnFWBaseView::SetMiddleSoftKeyLabelL( + R_PSLN_MSK_ACTIVATE, + EPslnCmdAppActivate); + } + else + { + CPslnFWBaseView::SetMiddleSoftKeyLabelL( + R_PSLN_MSK_DUMMY, + EPslnCmdEmptyCommand ); + } +} + +// ----------------------------------------------------------------------------- +// Return engine instance. +// ----------------------------------------------------------------------------- +// +CPslnActiveIdlePluginEngine* CPslnActiveIdlePlugin::Engine() + { + return iEngine; + } + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::DoActivateL +// +// First method called by the Avkon framwork to invoke a view. +// ---------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage) +{ +#ifdef MY_DEBUG + RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::DoActivateL")); + RDebug::Print(_L("XAI: aCustomMessageId = 0x%08x"), aCustomMessageId.iUid); + RDebug::Print(_L("XAI: aPrevViewId = 0x%08x"), aPrevViewId.iAppUid.iUid); +#endif + + // If called from Psln - set tab group location. + if (iAppUi->View(KPslnMainViewUid)) + { + CPslnFWBaseView::SetNaviPaneL(KPslnActiveIdlePluginLocation); + } + + CEikButtonGroupContainer* cba = Cba(); + + if (cba) + { + if (aCustomMessageId == KUidActiveIdle) + { + cba->SetCommandSetL(R_SOFTKEYS_OPTIONS_EXIT_EMPTY); + } + else + { + cba->SetCommandSetL(R_SOFTKEYS_OPTIONS_BACK_EMPTY); + } + cba->DrawDeferred(); + } + + CPslnFWBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); + + CheckMiddleSoftkeyLabelL(); + + iEngine->ManualGetSkinsRestartL(); +} + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::DoDeactivate +// +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::DoDeactivate() +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CPslnActiveIdlePlugin::DoDeactivate")); +#endif + CPslnFWBaseView::DoDeactivate(); + RemoveCommandFromMSK(); +} + +// ---------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::DynInitMenuPaneL +// +// +// ---------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::DynInitMenuPaneL( + TInt aResourceId, CEikMenuPane* aMenuPane) +{ + if (aResourceId == R_PSLN_GEN_VIEW_MENUPANE && + aMenuPane) + { + // Since this is common resource it contains download, + // set it off. + aMenuPane->SetItemDimmed(EPslnCmdAppDownload, ETrue); + + CPslnActiveIdlePluginContainer* container = Container(); + TInt highlightedItem = iContainer->iListBox->CurrentItemIndex(); + // Remove Activate command, if highlighted item is already active. + if (highlightedItem == container->GetCurrentlySelectedIndex()) + { + aMenuPane->SetItemDimmed(EPslnCmdAppActivate, ETrue); + } + } + else if (aResourceId == R_PSLN_AI_BASIC_MENUPANE && + aMenuPane) + { + if (!FeatureManager::FeatureSupported(KFeatureIdHelp)) + { + // Disable help if not supported + aMenuPane->SetItemDimmed(EPslnCmdAppHelp, ETrue); + } + } +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::NewContainerL() +// +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::NewContainerL() +{ + if( !iContainer ) + { + TBool isGSCalling = (NULL != iAppUi->View(KGSMainViewUid)); + iContainer = new (ELeave) CPslnActiveIdlePluginContainer(isGSCalling, this); + iContainer->SetMiddleSoftkeyObserver(this); + } + + RemoveCommandFromMSK(); +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::HandleListBoxSelectionL() +// +// Handles events raised through a rocker key. +// --------------------------------------------------------------------------- +void CPslnActiveIdlePlugin::HandleListBoxSelectionL() +{ + TInt currentItem = iContainer->iListBox->CurrentItemIndex(); + CPslnFWBaseView::SetCurrentItem(currentItem); + + CPslnActiveIdlePluginContainer* container = Container(); + + if (currentItem != container->GetCurrentlySelectedIndex()) + { + HandleCommandL(EPslnCmdAppActivate); + } +} + +// ----------------------------------------------------------------------------- +// Remove MSK command mappings. +// This method should do nothing but MSK issues. +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::RemoveCommandFromMSK() +{ + CEikButtonGroupContainer* cba = Cba(); + + if (cba && iContainer) + { + cba->RemoveCommandFromStack(KPslnMSKControlId, EPslnCmdEmptyCommand); + cba->RemoveCommandFromStack(KPslnMSKControlId, EPslnCmdAppActivate); + } +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePlugin::SetTitlePaneL() +// +// Gives resource ID to be used as plugin view title. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePlugin::SetTitlePaneL( TInt& aResourceId ) + { +#ifdef RD_CONTROL_PANEL + aResourceId = R_PSLN_AI_LIST_VIEW_CAPTION; +#endif // RD_CONTROL_PANEL + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugincontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidleplugincontainer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,210 @@ +/* +* 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: Container for the Application Shell plugin +* +*/ + + +// INCLUDE FILES + +// From this plugin. +#include "pslnactiveidleplugincontainer.h" +#include "pslnactiveidlepluginengine.h" +#include "pslnactiveidleplugin.h" + +// From Psln application. +#include + +// From PSLN framework +#include +#include + +// Resources +#include +#include + +// General services +#include + +// XUIKON +#include + +// CONSTANTS +// UID of Personlisation application +const TUid KPslnAppUid = { 0x10005A32 }; + +// ========================= MEMBER FUNCTIONS ================================ + +CPslnActiveIdlePluginContainer::CPslnActiveIdlePluginContainer( + TBool aGSCalling, + CPslnActiveIdlePlugin* aPlugin ) + : + iPlugin( aPlugin ), + iGSCalling( aGSCalling ) + { + } +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::ConstructL( const TRect& aRect ) + { + iListBox = new( ELeave ) CAknSingleGraphicStyleListBox; + TInt titleResId = 0; + + if (iGSCalling) + { + titleResId = R_PSLN_GS_LIST_VIEW_TITLE; + } + BaseConstructL(aRect, titleResId, R_PSLN_PLUGIN_DEFAULT_VIEW_LBX); + // Do not show container immediately - to avoid seeing "No Data" first. + iListBox->MakeVisible( EFalse ); + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CPslnActiveIdlePluginContainer::~CPslnActiveIdlePluginContainer() + { + if( iItemArray ) + { + TInt count = iItemArray->Count(); + iItemArray->Delete(0, count); + } + + delete iItems; + } + +// ----------------------------------------------------------------------------- +// CPslnActiveIdlePluginContainer::GetCurrentlySelectedIndex +// ----------------------------------------------------------------------------- +// +TInt CPslnActiveIdlePluginContainer::GetCurrentlySelectedIndex() const + { + return iCurrentlySelected; + } + +// --------------------------------------------------------------------------- +// Adds new item to the listbox. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::AddNewItemToListL( + const TInt aItemIndex, CXnODT* aSkinODT, TInt aUiController ) + { + HBufC* item = HBufC::NewLC( KPslnItemMaxTextLength ); + TPtr itemPtr = item->Des(); + TBool newActiveItem = EFalse; + + // Get theme ODT and full name. + // Index aItemIndex has been verified in view. + itemPtr = aSkinODT->ThemeFullName(); + if ( aSkinODT->Flags() & EXnThemeStatusActive && + iPlugin->Engine()->CurrentUIController() == aUiController ) + { + itemPtr.Insert( 0, KPslnFWActiveListItemFormat ); + + // Set selected active. + iCurrentlySelected = aItemIndex; + newActiveItem = ETrue; + } + else + { + itemPtr.Insert( 0, KPslnFWNonActiveListItemFormat ); + } + iItemArray->AppendL( itemPtr ); + CleanupStack::PopAndDestroy( item ); + + if ( newActiveItem ) + { + // Set highlight. + iListBox->SetCurrentItemIndex( iCurrentlySelected ); + // Since we now have content, show container. + iListBox->MakeVisible( ETrue ); + if ( iPlugin ) + { + iPlugin->CheckMiddleSoftkeyLabelL(); + } + } + } + +// --------------------------------------------------------------------------- +// Removes themes from listbox. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::RemoveThemes( const TInt aDeleteFrom ) + { + // Validate parameter first. + if ( iItemArray && + ( aDeleteFrom >= 0 ) && + ( aDeleteFrom < iItemArray->Count() ) ) + { + iItemArray->Delete( aDeleteFrom, iItemArray->Count() - aDeleteFrom ); + } + } + +// --------------------------------------------------------------------------- +// Construct the listbox from resource array. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iItemArray = static_cast + ( iListBox->Model()->ItemTextArray() ); + + iItems = iCoeEnv->ReadDesC16ArrayResourceL( aResLbxId ); + + // Create pre- and post-text icons. + AddIconsToListL(); + } + +// --------------------------------------------------------------------------- +// Gets Help context. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { + aContext.iMajor = KPslnAppUid; + aContext.iContext = KSKINS_HLP_APPSKINS_LIST; + } + +// --------------------------------------------------------------------------- +// Adds icons to setting list items. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginContainer::AddIconsToListL() + { + CPslnFWIconHelper* iconHelper = CPslnFWIconHelper::NewL(); + CleanupStack::PushL( iconHelper ); + iconHelper->AddIconsToSettingItemsL( + ETrue, + KErrNotFound, // none, selected + iListBox ); + CleanupStack::PopAndDestroy( iconHelper ); + } + +void CPslnActiveIdlePluginContainer::RefreshList() + { + TRAP_IGNORE(iListBox->HandleItemAdditionL()); + iListBox->SetCurrentItemIndex(iCurrentlySelected); + TRAP_IGNORE(iPlugin->CheckMiddleSoftkeyLabelL()); + DrawDeferred(); + // Since we now have content, show container. + iListBox->MakeVisible( ETrue ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,724 @@ +/* +* Copyright (c) 2005-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: Container for the Active Idle plugin. +* +*/ + + +// From this plugin. +#include + +#include "pslnactiveidlepluginengine.h" +#include "pslnactiveidleplugincontainer.h" +#include "pslnactiveidleplugin.h" +#include "activeidle2domainpskeys.h" +#include "activeidle2internalpskeys.h" + +// from plugin side +#include // for KExtrStandbyScrFullScreenMode + +// From PSLN framework. +#include +#include + +// General services. +#include +#include +#include + +// Application specific skins. +#include + +// XUIKON. +#include + +// ECOM. +#include +#include + +#include +#include + +#include + +// Granularity of plugin array. +const TInt KPslnPluginArrayGranularity = 4; + +// ActiveIdle1 plugin ECOM interface uid +const TInt KAI1PluginInterfaceUid = 0x101F8700; +const TInt KAIThemeStatusPaneHidden = 0x00000001; + +// AI1 cenrep +const TInt KCRUidActiveIdle = 0x10207467; +const TInt KCRPluginCountKey = 0x00000002; +const TInt KCRFirstPluginKey = 0x00000003; + +const TInt KPSLNOneSecondInMicroSeconds = 1000*1000; + +// ========== LOCAL FUNCTIONS ================================================= + +template +void CleanupResetAndDestroy(TAny* aObj) +{ + if(aObj) + { + static_cast(aObj)->ResetAndDestroy(); + } +} + +template +void CleanupResetAndDestroyPushL(Array& aPointerArray) +{ + CleanupStack::PushL(TCleanupItem(&CleanupResetAndDestroy, &aPointerArray)); +} + +// ========== MEMBER FUNCTIONS ================================================ + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::ConstructL() +// +// Symbian OS two phased constructor +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::ConstructL(const TRect& /*aRect*/) +{ +#ifdef _MY_DEBUG + RDebug::Print(_L("XAI: CPslnActiveIdlePluginEngine::ConstructL")); +#endif + + // Create application theme handler and list for application themes. + iMySkinList = new (ELeave) + CArrayPtrFlat(KPslnPluginArrayGranularity); + iPslnFWThemeHandler = CPslnFWAppThemeHandler::NewL( + *this, + *iMySkinList); + + CheckCurrentUIControllerL(); + CheckCurrentAi1PluginL(); + iRestartTimer = CPeriodic::NewL(EPriorityNormal); + iUiRefreshTimer = CPeriodic::NewL(EPriorityNormal); +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::CPslnActiveIdlePluginEngine +// +// Constructor +// --------------------------------------------------------------------------- +// +CPslnActiveIdlePluginEngine::CPslnActiveIdlePluginEngine( + CPslnActiveIdlePlugin* aPlugin) + : + iFirstUpdateRound(ETrue), + iFirstUpdateRoundInjected(EFalse), + iCurrentUIController(EAiUICUnknown), + iPlugin(aPlugin) +{ +} + +// --------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::~CPslnActiveIdlePluginEngine() +// +// Destructor +// --------------------------------------------------------------------------- +// +CPslnActiveIdlePluginEngine::~CPslnActiveIdlePluginEngine() +{ + if (iRestartTimer) + { + iRestartTimer->Cancel(); + } + delete iRestartTimer; + if (iUiRefreshTimer) + { + iUiRefreshTimer->Cancel(); + } + delete iUiRefreshTimer; + + if (iMySkinList) + { + iMySkinList->ResetAndDestroy(); + } + delete iMySkinList; + delete iPslnFWThemeHandler; +} + +// ----------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::ActivateThemeL +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::ActivateThemeL() +{ + TInt skinIndex = 0; + if( iPlugin->Container() ) + { + skinIndex = iPlugin->Container()->iListBox->CurrentItemIndex(); + } + else + { + // No selection possible yet + return; + } + + if (skinIndex >= 0 && skinIndex < iMySkinList->Count() && + !iRestartTimer->IsActive()) + { + if (skinIndex >= iHSStartIndex && + skinIndex < iHSEndIndex) + { + CXnODT* selectedSkinODT = iMySkinList->At(skinIndex); + UpdateStatusPaneVisibilityCenrepL( + selectedSkinODT->Flags() & KAIThemeStatusPaneHidden); + + if (iCurrentAi1Plugin != selectedSkinODT->ThemeUid()) + { + UpdateAi1PluginLoadCenrepL(selectedSkinODT->ThemeUid()); + CheckCurrentAi1PluginL(); + } + if (iCurrentUIController == EAiUICXML) + { + UpdateUIControllersInCenrepL(EAiUICNative); + CheckCurrentUIControllerL(); + + iRestartTimer->Cancel(); + iRestartRetryCount = 0; + iRestartTimer->Start( + KPSLNOneSecondInMicroSeconds, + KPSLNOneSecondInMicroSeconds, + TCallBack(RestartTimerCallback, this)); + } + else + { + if( IsAiRunning() ) + { + // Recycle this method to bring to foreground + RestartTimerCallback( this ); + } + } + ManualGetSkinsRestartL(); + } + else + { + if (iCurrentUIController == EAiUICNative) + { + UpdateStatusPaneVisibilityCenrepL(EFalse); // Always visible status pane + UpdateUIControllersInCenrepL(EAiUICXML); + CheckCurrentUIControllerL(); + } + + RProperty::Set( KPSUidAiInformation, KActiveIdleRestartAI2, KActiveIdleRestartCode ); + iRestartTimer->Cancel(); + iRestartRetryCount = 0; + iRestartTimer->Start( + KPSLNOneSecondInMicroSeconds, + KPSLNOneSecondInMicroSeconds, + TCallBack(RestartTimerCallback, this)); + CXnODT* selectedSkinODT = iMySkinList->At(skinIndex); + TXnServiceCompletedMessage ret; + + ret = iPslnFWThemeHandler->SetApplicationSkinL( + *selectedSkinODT ); + + if (ret == EXnSetActiveThemeFailed) + { + // Show error note. + HBufC* errorBuf = StringLoader::LoadLC( + R_PSLN_QTN_SKINS_ERROR_CORRUPTED); + // Display global note. + CAknGlobalNote* errorNote = CAknGlobalNote::NewLC(); + errorNote->ShowNoteL(EAknGlobalErrorNote, *errorBuf); + CleanupStack::PopAndDestroy(2, errorBuf); // errorNote also + } + else + { + iRestartTimer->Cancel(); + iRestartRetryCount = 0; + iRestartTimer->Start( + KPSLNOneSecondInMicroSeconds, + KPSLNOneSecondInMicroSeconds, + TCallBack(RestartTimerCallback, this)); + } + } + } +} + +// ----------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::HandleMessage +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::HandleMessage( + TXnServiceCompletedMessage aMessage) +{ + switch (aMessage) + { + case EXnGetListHeadersEmpty: + // Just destroy everything and use default items only. + case EXnGetListHeadersFailed: // fallthrough + if (iMySkinList) + { + iMySkinList->ResetAndDestroy(); + } + break; + case EXnServiceRequestCanceled: // fallthrough + case EXnServiceRequestError: // fallthrough + { + TRAP_IGNORE(ManualGetSkinsRestartL();) + } + break; + default: + break; + } +} + +// ----------------------------------------------------------------------------- +// CPslnActiveIdlePluginEngine::HandleMessage +// ----------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::HandleMessage( + TXnServiceCompletedMessage aMessage, + CArrayPtrFlat& /*aAppThemeList*/) +{ + switch (aMessage) + { + case EXnGetListHeadersRestart: + case EXnGetListHeadersUpdate: // fallthrough + { + TRAP_IGNORE(AddNewThemeL(aMessage)); + break; + } + default: + { + break; + } + } +} + +// --------------------------------------------------------------------------- +// Adds new theme to the container / listbox. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::AddThemesToContainerL() + { + TInt value = 0; + + GetExtStandbyScreenState(value); + + /* value == 0 Only AI2 themes + value != 0 + bit 31 AI2 themes + bit 30-0 External themes + */ + value |= 0x80000000; // Force AI2 themes on + if ((value == 0) || ((value & 0x80000000) != 0)) + { + if( iPlugin->Container() && iMySkinList ) + { + // Remove themes. All. + iPlugin->Container()->RemoveThemes( 0 ); + for ( TInt i = 0; i < iMySkinList->Count(); ++i ) + { + if( i >= iHSStartIndex && + i < iHSEndIndex ) + { + iPlugin->Container()->AddNewItemToListL( i, + iMySkinList->At(i), + EAiUICNative ); + } + else + { + iPlugin->Container()->AddNewItemToListL( i, + iMySkinList->At(i), + EAiUICXML ); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// Adds new theme to the listbox. +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::AddNewThemeL( + TXnServiceCompletedMessage aMessage) +{ + // No themes available - do not add anything. + if (!iMySkinList) + { + return; + } + + // Theme activation causes restart of theme headers list. + if (aMessage == EXnGetListHeadersRestart) + { + iFirstUpdateRound = EFalse; + } + + TInt value = 0; + + GetExtStandbyScreenState(value); + + /* value == 0 Only AI2 themes + value != 0 + bit 31 AI2 themes + bit 30-0 External themes + */ + value |= 0x80000000; // Force AI2 themes on + + if ((value & 0x7FFFFFFF) > 0) + { + if ((iFirstUpdateRound && !iFirstUpdateRoundInjected) || + aMessage == EXnGetListHeadersRestart) + { + iFirstUpdateRoundInjected = ETrue; + AddHomeScreenThemesL(); + } + } + + UiTimerRestart(); +} + +// +// Get external Standby Screen state from Cenrep +// +TInt CPslnActiveIdlePluginEngine::GetExtStandbyScreenState(TInt& aValue ) + { + TInt ret = 0; + TUid uid = { KCRUidActiveIdleLV }; // {0x10275102}; // + + //TRAP_IGNORE: leaving function called in non-leaving function + TRAP_IGNORE + ( + CRepository* cenRep = CRepository::NewLC( uid ); + + ret = cenRep->Get(KAIExternalStatusScreen, aValue ); + + CleanupStack::PopAndDestroy( cenRep ); + ) + + return ret; + } + +// --------------------------------------------------------------------------- +// Add EXT HS themes to listing +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::AddHomeScreenThemesL() +{ + iHSStartIndex = iHSEndIndex = iMySkinList->Count(); + // Resolve AI1 plugins in ECOM + RImplInfoPtrArray eComPlugins; + CleanupResetAndDestroyPushL(eComPlugins); + + REComSession::ListImplementationsL(TUid::Uid(KAI1PluginInterfaceUid), eComPlugins); + for (TInt i = 0; i < eComPlugins.Count(); ++i) + { + CXnODT* skinODT = CXnODT::NewL(); + skinODT->SetThemeUid(eComPlugins[i]->ImplementationUid().iUid); + if (eComPlugins[i]->OpaqueData() == KExtrStandbyScrFullScreenMode) + { + skinODT->SetFlags(KAIThemeStatusPaneHidden); + } + else + { + skinODT->SetFlags(0); + } + CleanupStack::PushL(skinODT); + iMySkinList->AppendL(skinODT); + CleanupStack::Pop(skinODT); + + HBufC* item = HBufC::NewLC(KPslnItemMaxTextLength); + TPtr itemPtr = item->Des(); + if (eComPlugins[i]->DisplayName().Length()) + { + itemPtr = eComPlugins[i]->DisplayName(); + } + else + { + itemPtr = _L("OperatorHomeScreen1"); + } + skinODT->SetThemeFullNameL( itemPtr ); + if (iCurrentAi1Plugin == eComPlugins[i]->ImplementationUid().iUid && + iCurrentUIController == EAiUICNative) + { + itemPtr.Insert(0, KPslnFWActiveListItemFormat); + TInt flags = skinODT->Flags(); + skinODT->SetFlags(flags | EXnThemeStatusActive ); + } + else + { + itemPtr.Insert(0, KPslnFWNonActiveListItemFormat); + } + CleanupStack::PopAndDestroy(item); + ++iHSEndIndex; + } + CleanupStack::PopAndDestroy(); +} + +// --------------------------------------------------------------------------- +// Check active AI2 UI Controller in cenrep keys +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::CheckCurrentUIControllerL() +{ + CRepository* cenRep = CRepository::NewL(TUid::Uid(KCRUidActiveIdleLV)); // KCRUidActiveIdleLV AI2 Cenrep! + TInt value = 0; + if (cenRep->Get(KAiMainUIController, value) == KErrNone) + { + if ((value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE) + || (value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE)) + { + iCurrentUIController = EAiUICNative; + } + else if ((value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML) + || (value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML)) + { + iCurrentUIController = EAiUICXML; + } + } + delete cenRep; +} + +// --------------------------------------------------------------------------- +// Update active AI2 UI Controller in cenrep keys +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::UpdateUIControllersInCenrepL(TInt aControllerId) +{ + if (iCurrentUIController != aControllerId) + { + TUid uid = { KCRUidActiveIdleLV }; // KCRUidActiveIdleLV AI2 Cenrep! + CRepository* cenRep = CRepository::NewL(uid); + if (aControllerId == EAiUICNative) + { + cenRep->Delete(KAiFirstUIController); + cenRep->Delete(KAiFirstUIController + 1); + cenRep->Set(KAiMainUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); + } + else if (aControllerId == EAiUICXML) + { + cenRep->Create(KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); + cenRep->Set(KAiFirstUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE); + cenRep->Delete(KAiFirstUIController + 1); + cenRep->Set(KAiMainUIController, AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML); + } + delete cenRep; + } +} + +// --------------------------------------------------------------------------- +// Update status pane visibility for status pane cenrep key +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::UpdateStatusPaneVisibilityCenrepL( + TBool aPaneHidden) +{ + TInt value = EAiStatusPaneLayoutIdleNormal; + if (aPaneHidden) + { + value = EAiStatusPaneLayoutIdleHidden; + } + TUid uid = { KCRUidActiveIdleLV }; // KCRUidActiveIdleLV AI2 Cenrep! + CRepository* cenRep = CRepository::NewL(uid); + cenRep->Set(KAiStatusPaneLayout, value); + delete cenRep; +} + +// --------------------------------------------------------------------------- +// Update active AI1 plugin in cenrep +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::UpdateAi1PluginLoadCenrepL(TInt aNewUid) +{ + TUid uid = { KCRUidActiveIdle }; // KCRUidActiveIdle AI1 Cenrep! + CRepository* cenRep = CRepository::NewL(uid); + TInt currentCount = 0; + cenRep->Get(KCRPluginCountKey, currentCount); + + // Delete old keys if any + for (TInt i = 0; i < currentCount; ++i) + { + cenRep->Delete(KCRFirstPluginKey+i); + } + + cenRep->Delete(KCRPluginCountKey); + cenRep->Create(KCRPluginCountKey, 1); + // Set only 1 new key, the selected one + cenRep->Create(KCRFirstPluginKey, aNewUid); + + delete cenRep; +} + +// --------------------------------------------------------------------------- +// Check the current AI1 plugin (ref. External opretor homescreen feature) +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::CheckCurrentAi1PluginL() +{ + TUid uid = { KCRUidActiveIdle }; // KCRUidActiveIdle AI1 Cenrep! + TInt value = 0; + TInt currentCount = 0; + + CRepository* cenRep = CRepository::NewL(uid); + cenRep->Get(KCRPluginCountKey, currentCount); + + if (currentCount) // count must be set + { + cenRep->Get(KCRFirstPluginKey, value); + } + delete cenRep; + + if (value != 0) + { + iCurrentAi1Plugin = value; + } +} + +// --------------------------------------------------------------------------- +// Manually start updating theme/skin listing +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::ManualGetSkinsRestartL(TBool aForceStart) +{ + if( !aForceStart && iMySkinList->Count() > 0 && + iUiRefreshTimer->IsActive() ) + { + return; + } + + // Restart get skins manually! + if( iPlugin->Container() ) + { + iPlugin->Container()->RemoveThemes(0); + } + iMySkinList->ResetAndDestroy(); + iFirstUpdateRound = ETrue; + iFirstUpdateRoundInjected = EFalse; + iPslnFWThemeHandler->CancelGetApplicationSkins(); + iAddIndex = 0; + iPslnFWThemeHandler->GetApplicationSkinsL(KUidActiveIdle); +} + +// --------------------------------------------------------------------------- +// Restart AI2 process +// --------------------------------------------------------------------------- +// +TInt CPslnActiveIdlePluginEngine::RestartAifw() +{ + if (!IsAiRunning()) + { + _LIT(KAiExeName, "z:\\sys\\bin\\ailaunch.exe"); + RProcess process; + TInt ret = process.Create(KAiExeName, KNullDesC); + process.Resume(); + process.Close(); + return ret; + } + return KErrNone; +} + +// --------------------------------------------------------------------------- +// Checks if AI2 process is running +// --------------------------------------------------------------------------- +// +TBool CPslnActiveIdlePluginEngine::IsAiRunning() +{ + TApaTaskList taskList(CCoeEnv::Static()->WsSession()); + TApaTask startTask = taskList.FindApp(TUid::Uid(0x100058f4)); + + if (!startTask.Exists()) // if first boot queries are done continue bringing ai2 to foreground. + { + TApaTask aiTask = taskList.FindApp(TUid::Uid(AI_UID3_AIFW_EXE)); + if (aiTask.Exists()) // App open + { + return ETrue; + } + } + return EFalse; +} + +// --------------------------------------------------------------------------- +// start ui refresh timer +// --------------------------------------------------------------------------- +// +void CPslnActiveIdlePluginEngine::UiTimerRestart() + { + iUiRefreshTimer->Cancel(); + iUiRefreshTimer->Start( + KPSLNOneSecondInMicroSeconds/4, // quarter second delay + KPSLNOneSecondInMicroSeconds/4, + TCallBack(UiRefreshTimerCallback, this)); + } + +// --------------------------------------------------------------------------- +// Call back for restart timer +// --------------------------------------------------------------------------- +// +TInt CPslnActiveIdlePluginEngine::RestartTimerCallback(TAny* aSelf) +{ + CPslnActiveIdlePluginEngine* self = + static_cast(aSelf); + + if (self) + { + ++(self->iRestartRetryCount); + if ( self->RestartAifw() == KErrNone) + { + self->iRestartTimer->Cancel(); + TApaTaskList taskList(CCoeEnv::Static()->WsSession()); + TApaTask startTask = taskList.FindApp(TUid::Uid(0x100058f4)); + + if (!startTask.Exists()) // if first boot queries are done continue bringing ai2 to foreground. + { + TApaTask aiTask = taskList.FindApp(TUid::Uid(AI_UID3_AIFW_EXE)); + if (aiTask.Exists()) // App open + { + //aiTask.BringToForeground(); + CAknSgcClient::MoveApp(aiTask.WgId(), ESgcMoveAppToForeground); + } + } + CAknEnv::RunAppShutter(); + return 0; + } + if (self->iRestartRetryCount > 3) + { + self->iRestartTimer->Cancel(); + TRAP_IGNORE(self->ManualGetSkinsRestartL()); + return 0; + } + } + return 1; +} + +// --------------------------------------------------------------------------- +// Call back for UI refresh timer timer +// --------------------------------------------------------------------------- +// +TInt CPslnActiveIdlePluginEngine::UiRefreshTimerCallback(TAny* aSelf) +{ + CPslnActiveIdlePluginEngine* self = + static_cast(aSelf); + + if (self) + { + self->iUiRefreshTimer->Cancel(); + TRAP_IGNORE(self->AddThemesToContainerL()); + if( self->iPlugin->Container() ) + { + self->iPlugin->Container()->RefreshList(); + } + } + return 0; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginimplementationtable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/pslnactiveidleplugin/src/pslnactiveidlepluginimplementationtable.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2005-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: ECOM proxy table for PslnActiveIdlePlugin. +* +*/ + +#include +#include + +#include "pslnactiveidleplugin.h" +#include "gsactiveidleplugin.h" +#include "pslnactiveidlepluginuids.h" + +const TImplementationProxy KPslnActiveIdlePluginImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(KPslnActiveIdlePluginImplementationUID, CPslnActiveIdlePlugin::NewL) + , + IMPLEMENTATION_PROXY_ENTRY(KGSActiveIdlePluginImplementationUID, CGSActiveIdlePlugin::NewL) +}; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(KPslnActiveIdlePluginImplementationTable) / sizeof(TImplementationProxy); + return KPslnActiveIdlePluginImplementationTable; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/data/sapidataplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/data/sapidataplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 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: Registry info + * +*/ + + +// INCLUDES +#include +#include "sapidatapluginuids.hrh" + + + +// ----------------------------------------------------------------------------- +// +// registry_info +// Registry information required for identifying the ECOM component +// +// ----------------------------------------------------------------------------- +// + +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = SAPIDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; + version_no = 1; + display_name = "Data plug-in"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; +} + + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 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: The build information file of Data Plugin +* +*/ + + +#ifdef RD_CUSTOMIZABLE_AI + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +../rom/sapidataplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sapidataplugin.iby) + +PRJ_MMPFILES +sapidataplugin.mmp + +//#include "../internal/testpublisher/group/bld.inf" +//#include "../internal/templatedwidget/group/bld.inf" + +#endif // RD_CUSTOMIZABLE_AI + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/group/sapidataplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/group/sapidataplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2005-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: Project definition file for project sapidataplugin +* +*/ + +#include +#include + +#include "../inc/sapidatapluginuids.hrh" + +TARGET sapidataplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D SAPIDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + + +USERINCLUDE ../inc + + +APP_LAYER_SYSTEMINCLUDE + + +SOURCEPATH ../data +START RESOURCE sapidataplugin.rss +TARGET sapidataplugin.rsc +END + + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY liwservicehandler.lib +LIBRARY ecom.lib +LIBRARY aiutils.lib +LIBRARY cone.lib +LIBRARY avkon.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY aknskins.lib +LIBRARY charconv.lib +// End of File +SOURCEPATH ../src + +SOURCE sapidataplugin.cpp +SOURCE sapidata.cpp +SOURCE sapidataobserver.cpp diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/inc/sapidata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/inc/sapidata.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef SAPIDATA_H +#define SAPIDATA_H + +// INCLUDE FILES +#include +#include +#include +#include "sapidatapluginconst.h" +#include "aicontentpublisher.h" + +class MLiwInterface; +class CLiwServiceHandler; +class CSapiDataObserver; +class CSapiDataPlugin; + + +class CContentItem : public CBase + { + public : + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CContentItem* NewL(); + + + /* + * Destructor + */ + ~CContentItem(); + + private : + + /* + * Constructor + */ + CContentItem(); + + /** + * Part of the two phased construction + * + * @param none + * @return void + */ + void ConstructL(); + + public : + + TInt iId; + /* item id */ + HBufC* iName; + /* type (image/text) */ + HBufC* iType; + + HBufC* iContentType; + }; + +/** + * @ingroup group_sapidataplugin + * + * Sapi data + * + * @since S60 v3.2 + */ +class CSapiData : public CBase + { + public: + + /** + * Part of the two phased construction + * + * @param aPlugin refrence of the plugin + * @return none + */ + static CSapiData* NewL(CSapiDataPlugin* aPlugin); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CSapiData(); + + private : + + + /** + * Constructor + * + * @param none + * @return none + */ + CSapiData(); + + + /** + * Part of the two phased construction + * + * @param aPlugin reference of the plugin + * @return void + */ + void ConstructL(CSapiDataPlugin* aPlugin); + + /** + * Change the publisher status + * + * @param aStatus new status of the publisher + * @return void + */ + void ChangePublisherStatusL(const TDesC& aStatus); + + /** + * Gets the menu item from the publisher + * + * @param none + * @return void + */ + void GetMenuItemsL(); + + public : + + /** + * Configures the subscriber and data to subscribe. + * + * @param aConfigurations Information about the subscriber + * and the data to subscribe. + * @return void + */ + void ConfigureL(RAiSettingsItemArray& aConfigurations); + + void SetContentIdL(const TDesC8& aId); + + /** + * Execute the command to get the data from CPS + * + * @param aRegistry type of registry (publisher/cp_data) + * @param aInFilter input filter for the command + * @param outParamList output data map + * @return void + */ + void ExecuteCommandL(const TDesC& aRegistry , + CLiwDefaultMap* aInFilter, CLiwGenericParamList* outParamList ); + + /** + * Checks Can Update for this publisher + * + * @param aPublisher publisher. + * @param aContentType content type. + * @param aContentId content Id. + * @return bool + */ + TBool CanUpdate( TDesC& aPublisher, TDesC& aContentType, TDesC& aContentId ); + + /** + * Removes all the data from the widget which matches to + * this publisher, contentype, contentid values + * + * @param aObserver to publish data + * @param aContentType content type + * @return void + */ + void RemoveL( MAiContentObserver* aObserver, TDesC& aContentType ); + + /** + * Checks is this menu item is supported by the publisher + * + * @param aMenuItem menu item name. + * @return boolean (ETrue/EFalse) + */ + TBool HasMenuItem(const TDesC& aMenuItem ); + + /** + * Publish the data to widget. + * + * @param aObserver to publish data + * @param aContentType content type + * @return void + */ + void PublishL( MAiContentObserver* aObserver, const TDesC& aContentType ); + + /** + * Publish the updated data to widget. + * + * @param aObserver to publish data + * @param aDataMap data map with updated data + * @return void + */ + void PublishDataL(MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ); + + /** + * Tigger for execution of a action for a specific content id. + * + * @param aObjectId object Id. + * @param aTrigger name of the trigger. + * @return void + */ + void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); + + /** + * Register to publisher registry for all (update) action + * + * @param none + * @return void + */ + void RegisterPublisherObserverL(); + + /** + * Register to content registry for all (add/delete/update) action + * + * @param none + * @return void + */ + void RegisterContentObserverL(); + + /** + * Called by the observer to refresh the changed content + * + * @param aPublisher publisher. + * @param aContentType content type. + * @param aContentId content Id. + * @param aOperation operation (add/delete/update/execute). + * @return void + */ + void RefreshL( TDesC& aPublisher, TDesC& aContentType, + TDesC& aContentId, TDesC& aOperation ); + + /** + * Createts the filter map and push it in the stack + * + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC(); + + /** + * Createts the filter map and push it in the stack + * + * @param aConType content type + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC(const TDesC& aConType); + + /** + * Createts the filter map and push it in the stack + * + * @param aConType content type + * @param aContentId cotent Id + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC(const TDesC& aContentType, + const TDesC& aContentId); + + /** + * Is the pugin is active to publish the data. + * + * @param None + * @return boolean (ETrue/EFalse). + */ + TBool IsPluginActive(); + + /** + * Resume the publisher + * + * @param None + * @return void + */ + void ResumeL(); + + /** + * Suspend the publisher + * + * @param None + * @return void + */ + void SuspendL(); + + /** + * Activate the publisher + * + * @param None + * @return void + */ + void ActivateL(); + + /** + * Deactivate the publisher + * + * @param None + * @return void + */ + void DeActivateL(); + + /** + * OnLineL + * + * @param None + * @return void + */ + void OnLineL(); + + /** + * OffLineL + * + * @param None + * @return void + */ + void OffLineL(); + + /** + * InActiveL + * + * @param None + * @return void + */ + void InActiveL(); + + /** + * Update the publisher status + * + * @param aPublisher publisher name + * @return void + */ + void UpdatePublisherStatusL(TDesC& aPublisher); + + /** + * Resolves skin item id and Mif id from pattern + * skin( () + * mif( ) + * + * @param aPath skin pattern / mif pattern value + * @param aItemId skin item id + * @param aMifId mif id + * @param aMaskId mask id + * @param aFilename mif file name + * @return boolean (ETrue/EFalse) + */ + TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& aMifId, TInt& aMaskId, TDes& aFilename ); + + /** + * Sets the on resume update needed status + * + * @param aStatus update needed status (ETrue/EFalse) + * @return void + */ + void SetUpdateNeeded(TBool aStatus); + + private : + + // Subscriber interface + // own + MLiwInterface* iInterface; + + // Data Observer to CPS content registry + // Own // iConObserver; + CSapiDataObserver* iContentObserver; + + // Data Observer to CPS publisher registry + // Own // iConObserver; + CSapiDataObserver* iPubObserver; + + // Service handler + // Own + CLiwServiceHandler* iServiceHandler; + + // Array of configurations + // Own + RPointerArray iItemList; + + // Number of configurations + TInt iItemCount; + + // Command name in configuration Array + HBufC8* iCommandName; + /* publisher id */ + HBufC* iPublisher; + /* content type */ + HBufC* iContentType; + /* content id */ + HBufC* iContentId; + + // Reference of the sapi data plugin + // Not owned + CSapiDataPlugin* iPlugin; + + // Menu item names + // Own + RPointerArray iMenuItems; + + // Trigger names for the menu items + // Own + RPointerArray iMenuTriggers; + + // Store the status of update needed on resume + TBool iUpdateNeeded; + }; + +#endif /*SAPIDATA_H*/ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/inc/sapidataobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef SAPIDATAOBSERVER_H +#define SAPIDATAOBSERVER_H + +// INCLUDE FILES +#include + +class CSapiData; + +class CSapiDataObserver : public CBase, public MLiwNotifyCallback + { +public: + + /** + * Part of the two phased constuction + * + * @param aInterface reference of the interface + * @param aData reference of the sapi data object + * @return none + */ + static CSapiDataObserver* NewL( MLiwInterface* aInterface, CSapiData* aData ); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CSapiDataObserver(); + +private : + + /** + * Constructor + * + * @param none + * @return none + */ + CSapiDataObserver(); + + /** + * Part of the two phased construction + * + * @param aInterface reference of the interface + * @param aData reference of the sapi data object + * @return void + */ + void ConstructL( MLiwInterface* aInterface, CSapiData* aData ); + +public: //from MLiwNotifyCallbackc + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId occurred event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the call back. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/); + +public: + + /** + * Registers to CPS for add, delete , update and execute notifications + * @aFilter - filter for input parameter list + * @return void. + */ + void RegisterL( CLiwDefaultMap* aFilter, const TDesC& aRegistry ); + + /** + * Cancel all the registered notifications. + * @return void. + */ + void ReleaseL(); + +private: + + // Reference of + // Not owned + MLiwInterface* iInterface; + + // Reference of the sapi data + // Not owned + CSapiData* iData; + + // Call back error code + TInt iError; + + }; + +#endif /*SAPIDATAOBSERVER_H*/ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/inc/sapidataplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,397 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef SAPIDATAPLUGIN_H +#define SAPIDATAPLUGIN_H + +#include +#include +#include +#include + +class MAiContentObserver; +class MAiContentItemIterator; +class MAiPSPropertyObserver; +class CSapiData; +class CDesC16Array; +class CGulIcon; + +/** + * @ingroup group_sapidataplugin + * + * Plug-in main class + * + * @since S60 v3.2 + */ +class CSapiDataPlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension + + { + +public : + /** + * Plugin's network state. + */ + enum TPluginNetworkStatus + { + EUnknown, + EOffline, + EOnline + }; + + /** + * Plugin's state. + */ + enum TPluginStates + { + ENone, + EResume, + ESuspend, + EInActive, + }; +public: + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CSapiDataPlugin* NewL(); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CSapiDataPlugin(); + +private: + + /** + * Constructor + * + * @param none + * @return none + */ + CSapiDataPlugin(); + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * Resume the plug-in. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void DoResumeL(TAiTransitionReason aReason); + +public: // from base class CAiContentPublisher + + /** + * From CAiContentPublisher + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, e.g. the plug-in + * should unload its engines due backup operation. The method transits the + * plug-in to "Idle" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Stop( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * allowed to consume CPU resources, e.g plug-in is able to run timers, + * perform asynchronous operations, etc. The method transits the plug-in + * to "Alive" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Resume( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timers, cancel outstanding asynchronous operations, etc. The method + * transits the plug-in to "Suspendend" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Suspend( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @return void + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plugin shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @param aSettings setting items defined in the UI definition. + * @return void + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension( TUid aUid ); + +// from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + */ + TAny* GetPropertyL( TInt aProperty ); + + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + void SetPropertyL( TInt aProperty, TAny* aValue ); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provided to plug-in as-is in the descriptor. + */ + void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + + /** + * Invoked by the framework for querying if plugin has menu item + * + * @param aMenuItem menu item name. + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + TBool HasMenuItem(const TDesC16& aMenuItem); + +public : // new functions + + /** + * Publishes widget's texts and images + * + * @param void + * @return void + */ + void PublishL(); + + /** + * Gets the id of a content + * + * @param aObjectId image or text id + * @return id of the content + */ + TInt GetIdL(TDesC& aObjectId); + + /** + * Gets the type of a specific content + * + * @param aObjectId image or text id + * @return void + */ + const TDesC& GetTypeL( TDesC& aObjectId ); + + /** + * RefereshL a specific image of text in the widget + * + * @param aContentType content type + * @param aOperation operation performed + * @return void + */ + void RefreshL(TDesC& aContentType, TDesC& aOperation); + + /** + * Is plugin active to publish the data + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsActive(); + + /** + * Publish a specific text of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aContentValue content value + * @return void + */ + void PublishTextL(MAiContentObserver* aObserver, + TInt& aContentId, TDesC& aContentValue); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aHandle image handle + * @param aMaskHandle handle of the mask image + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TInt& aContentId, TInt aHandle, TInt aMaskHandle); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aPath image path / skin id pattern / mif id Pattern + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TInt aContentId, TDesC& aPath ); + + /** + * Cleans a data from the widget + * + * @param aObserver observer + * @param aContentId content model id + * @return void + */ + void Clean(MAiContentObserver* aObserver, + TInt& aContentId ); + + /** + * CSapiData getter + * @return Pointer to CSapiData + */ + inline CSapiData* Data() const + { + return iData; + } + + /* + * Plugin's network status getter + * @return Pointer to Harvester status observer + */ + inline TPluginNetworkStatus NetworkStatus() const + { + return iNetworkStatus; + } + +private: // data + + // Iterator for plugin content + // Own + MAiContentItemIterator* iContent; + + // Array of content observers + // Own + RPointerArray iObservers; + + // Information about the content publisher (this plug-in) + TAiPublisherInfo iInfo; + + // Number of data in the content model. + TInt iDataCount; + + // Dynamic content model + // Own + TAiContentItem* iContentModel; + + // Reference array for Published text + // Own + RPointerArray iDataArray; + + // Service API Data Subscriber. + // Own + CSapiData* iData; + + // References array for published images + // Own + RArray iIconArray; + + // File Server + // Reference + RFs iRfs; + + // Plugin's network status + TPluginNetworkStatus iNetworkStatus; + + // Is Homescreen foreground. + TBool iHSForeGround; + + // Plugin state + TPluginStates iPluginState; + }; + +#endif // SAPIDATAPLUGIN_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* 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: Content model for data plug-in. +* +*/ + + +#ifndef SAPIDATAPLUGINCONST_H +#define SAPIDATAPLUGINCONST_H + +#include +#include "sapidatapluginuids.hrh" + +// AI Data Plug-in ECOM implementation UID. +const TInt KImplUidDataPlugin = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; +const TUid KUidDataPlugin = { KImplUidDataPlugin }; + +// ================================= CONTENT =================================== + +/** + * Content Model type identifier + */ +_LIT(KText ,"text"); +_LIT(KImage, "image"); +_LIT(KPlugin, "plugin"); + +_LIT(KNewsTicker ,"newsticker"); + + +// CPS Constants +_LIT(KService, "service"); +_LIT(KInterface, "interface"); +_LIT(KCommand, "command"); +_LIT8( KType, "type"); +_LIT( KCpData, "cp_data"); +_LIT( KPubData, "publisher" ); +_LIT( KCpData_PubData, "cp_data:publisher"); + +_LIT8( KFilter, "filter" ); +_LIT8( KDataMap, "data_map"); +_LIT8( KActionTrigger, "action_trigger" ); +_LIT8( KGetList , "GetList" ); +_LIT8( KExecuteAction, "ExecuteAction" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KChangeInfo, "change_info" ); +_LIT8( KListMap, "list_map" ); +_LIT8( KPublisherId, "publisher" ); +_LIT ( KPublisher16, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT ( KContentType16, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KResults, "results"); + +_LIT( KDataKey, "data_key"); +_LIT8( KMenuItems, "menuitems"); +_LIT( KMenuItem16, "menuitem"); +_LIT( KAll, "all"); +_LIT8( KOperation, "operation" ); +_LIT8( KFLAG, "flag"); + +_LIT( KOperationAdd, "add" ); +_LIT( KOperationUpdate, "update" ); +_LIT( KOperationDelete, "delete" ); +_LIT( KOperationExecute, "execute" ); +_LIT( KAddUpdateDelete, "add:update:delete" ); +_LIT( KUpdate, "update" ); + +_LIT(KWidget, "hswidget"); +_LIT( KDeActive, "deactive"); +_LIT( KActive, "active"); +_LIT( KSuspend , "suspend"); +_LIT( KResume, "resume"); +_LIT( KOnLine, "online"); +_LIT( KOffLine, "offline"); +_LIT( KInActive, "inactive"); +// reserved extension for retrieving mask handle +_LIT8( KMask, "_mask"); + +_LIT( KSkin, "skin" ); +_LIT( KMif, "mif" ); +_LIT( KMIFExtension, ".mif" ); +_LIT( KColon, ":"); + +const TUint KLeftParenthesis = '('; + + +// Sapi Data Plugin Constants +const TUint KPluginNameSeprator = '/'; + +/** + * Maximum length for the content name + */ +const TInt KMaxTypeLength = 8; + +/** + * Maximum length for the content name + */ +const TInt KSAPIContentNameMaxLength = 255; + +/** + * Maximum length for the content value + */ +const TInt KSAPIContentValueMaxLength = 255; + +/** + * Maximum length for the plugin name + */ +const TInt KAiPluginNameMaxLength = 255; + + +#endif /* SAPIDATAPLUGINCONST_H */ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/inc/sapidatapluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005-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: UIDs for the Active Idle subsystem components. +* +*/ + + +#ifndef SAPIDATAPLUGINUIDS_HRH +#define SAPIDATAPLUGINUIDS_HRH + +#include + +/** + * Ecom dll uid for AI Data plug-in. + */ +#define SAPIDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN 0x20019593 + +/** + * Ecom implementation uid for AI Data plug-in. + */ +#define SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN 0x20019594 + +#endif //SAPIDATAPLUGINUIDS_HRH diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/rom/sapidataplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/rom/sapidataplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 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: IBY file for Data plug-in +* +*/ + + +#ifndef SAPIDATAPLUGIN_IBY +#define SAPIDATAPLUGIN_IBY +#include + +#ifdef RD_CUSTOMIZABLE_AI + +ECOM_PLUGIN(sapidataplugin.dll, sapidataplugin.rsc) + +#endif // RD_CUSTOMIZABLE_AI + +#endif // SAPIDATAPLUGIN_IBY + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/src/sapidata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/src/sapidata.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,900 @@ +/* +* Copyright (c) 2005-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: Homescreen Data plug-in publisher +* +*/ + +#include +#include +#include +#include + +#include "sapidata.h" +#include "sapidatapluginconst.h" +#include "sapidataobserver.h" +#include "sapidataplugin.h" +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CContentItem* CContentItem::NewL() + { + CContentItem* self = new (ELeave) CContentItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CContentItem::CContentItem() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CContentItem::ConstructL() + { + iId = KErrNotFound; + iName = NULL; + iContentType = NULL; + iType = NULL; + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CContentItem::~CContentItem() + { + delete iName; + delete iContentType; + delete iType; + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CSapiData* CSapiData::NewL(CSapiDataPlugin* aPlugin) + { + CSapiData* self = new (ELeave) CSapiData(); + CleanupStack::PushL( self ); + self->ConstructL(aPlugin); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CSapiData::CSapiData() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CSapiData::ConstructL(CSapiDataPlugin* aPlugin) + { + iPlugin = aPlugin; + iCommandName = NULL; + iContentId = NULL; + iContentType = NULL; + iUpdateNeeded = EFalse; + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CSapiData::~CSapiData() + { + delete iCommandName; + delete iPublisher; + delete iContentType; + delete iContentId; + + + if(iPubObserver) + { + TRAP_IGNORE(iPubObserver->ReleaseL() ); + delete iPubObserver; + iPubObserver = NULL; + } + if(iContentObserver) + { + TRAP_IGNORE(iContentObserver->ReleaseL() ); + delete iContentObserver; + iContentObserver = NULL; + } + if( iInterface ) + { + iInterface->Close(); + iInterface = NULL; + } + if( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + iServiceHandler = NULL; + } + iMenuItems.ResetAndDestroy(); + iMenuTriggers.ResetAndDestroy(); + iItemList.ResetAndDestroy(); + // not owned + iPlugin = NULL; + } + +// --------------------------------------------------------------------------- +// ConfigureL +// --------------------------------------------------------------------------- +// +void CSapiData::ConfigureL(RAiSettingsItemArray& aConfigurations ) + { + HBufC8* serviceName = NULL; + HBufC8* interfaceName = NULL; + + TInt count = aConfigurations.Count(); + + for(TInt i = 0;iAiPluginConfigurationItem(); + // if owner is plugin then it (key,value) is for plugin configurations items + if(confItem.Owner() == KPlugin()) + { + if(confItem.Name() == KService()) + { + serviceName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); + } + else if( confItem.Name() == KInterface() ) + { + interfaceName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); + } + else if( confItem.Name() == KCommand() ) + { + iCommandName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(confItem.Value()); + } + else if( confItem.Name() == KPublisher16() ) + { + iPublisher = confItem.Value().AllocL(); + } + } + else if ( confItem.Name() == KContentType16() ) + { + HBufC* objectId = confItem.Owner().AllocLC(); + objectId->Des().Delete(0, objectId->LocateReverse(KPluginNameSeprator) + 1); + + CContentItem *conItem = CContentItem::NewL(); + conItem->iName = objectId->AllocL(); + conItem->iContentType = confItem.Value().AllocL(); + conItem->iType = iPlugin->GetTypeL( *objectId ).AllocL(); + conItem->iId = iPlugin->GetIdL(*objectId ); + iItemList.AppendL( conItem ); + + CleanupStack::PopAndDestroy(objectId); + } + } + + iItemCount = iItemList.Count(); + + if( !serviceName || !interfaceName || !iCommandName + || !iContentId || !iPublisher || !iItemCount ) + { + // No service to offer without plugin configurations + User::Leave( KErrNotSupported ); + } + iServiceHandler = CLiwServiceHandler::NewL(); + + // for convenience keep pointers to Service Handler param lists + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + CLiwCriteriaItem* criteriaItem = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, *interfaceName , *serviceName ); + criteriaItem->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + // Interface name + RCriteriaArray criteriaArray; + criteriaArray.AppendL( criteriaItem ); + // attach Liw criteria + iServiceHandler->AttachL( criteriaArray ); + iServiceHandler->ExecuteServiceCmdL( *criteriaItem, *inParamList, *outParamList ); + + CleanupStack::PopAndDestroy(criteriaItem); + criteriaArray.Reset(); + + // extract CPS interface from output params + TInt pos( 0 ); + outParamList->FindFirst( pos, *interfaceName ); + if( pos != KErrNotFound ) + { + //iInterface is MLiwInterface* + iInterface = (*outParamList)[pos].Value().AsInterface(); + User::LeaveIfNull( iInterface ); + } + else + { + User::Leave( KErrNotFound ); + } + inParamList->Reset(); + outParamList->Reset(); + delete interfaceName; + delete serviceName; + + //Gets the menu items from the publisher registry + GetMenuItemsL(); + + iContentObserver = CSapiDataObserver::NewL( iInterface, this ); + iPubObserver = CSapiDataObserver::NewL( iInterface, this ); + } + +void CSapiData::SetContentIdL(const TDesC8& aId) + { + iContentId = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aId); + } +// --------------------------------------------------------------------------- +// GetMenuItemsL +// --------------------------------------------------------------------------- +// +void CSapiData::GetMenuItemsL() + { + if(iInterface && iItemCount > 0) + { + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant(iPublisher )); + //append filter to input param + ExecuteCommandL( KPubData, filter, outParamList ); + CleanupStack::PopAndDestroy( filter ); + //extracts data map + TInt pos = 0; + outParamList->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present + { + //extract iterator on results list + TLiwVariant variant = (*outParamList)[pos].Value(); + variant.PushL(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + //considering publisher is unique reading only first entry + if( iterable->NextL( variant ) ) + { + //extract content map + variant.Get( *map ); + if( map->FindL( KDataMap, variant) ) + { + variant.Get( *map ); + } + } + iterable->Reset(); + variant.Reset(); + if ( map->FindL( KMenuItems, variant ) ) + { + CLiwDefaultMap *menuMap = CLiwDefaultMap::NewLC(); + variant.Get( *menuMap ); + for ( TInt i = 0; i < menuMap->Count(); i++) + { + menuMap->FindL(menuMap->AtL(i), variant ); + HBufC8* menuItem = variant.AsData().AllocLC(); + if ( menuItem->Length()> 0 ) + { + iMenuTriggers.AppendL( menuItem ); + CleanupStack::Pop( menuItem ); + HBufC* triggerName = CnvUtfConverter::ConvertToUnicodeFromUtf8L(menuMap->AtL(i)); + CleanupStack::PushL( triggerName ); + iMenuItems.AppendL( triggerName ); + CleanupStack::Pop( triggerName ); + } + else + { + CleanupStack::PopAndDestroy( menuItem ); + } + variant.Reset(); + } + CleanupStack::PopAndDestroy( menuMap ); + } + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( &variant ); + } + outParamList->Reset(); + } + } + +// --------------------------------------------------------------------------- +// CreateFilterL +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CSapiData::CreateFilterLC(const TDesC& aContentType, + const TDesC& aContentId) + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant(iPublisher )); + filter->InsertL( KContentId, TLiwVariant(aContentId )); + filter->InsertL( KContentType, TLiwVariant(aContentType )); + return filter; + } + +// --------------------------------------------------------------------------- +// CreateFilterL +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CSapiData::CreateFilterLC(const TDesC& aContentType) + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant(iPublisher )); + filter->InsertL( KContentId, TLiwVariant(iContentId )); + filter->InsertL( KContentType, TLiwVariant(aContentType )); + return filter; + } + +// --------------------------------------------------------------------------- +// CreateFilterL +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CSapiData::CreateFilterLC() + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant(iPublisher )); + filter->InsertL( KContentId, TLiwVariant(iContentId )); + filter->InsertL( KContentType, TLiwVariant(KAll)); + return filter; + } + + +// --------------------------------------------------------------------------- +// Update +// --------------------------------------------------------------------------- +// +TBool CSapiData::CanUpdate( TDesC& aPublisher, TDesC& aContentType, + TDesC& aContentId) + { + TBool res = EFalse; + if( aPublisher == *iPublisher + && aContentId == *iContentId ) + { + if ( aContentType != KAll ) + { + for (TInt i = 0; i < iItemCount ; i++) + { + if ( aContentType == iItemList[i]->iContentType ) + { + res = ETrue; + break; + } + } + } + else + { + res = ETrue; + } + } + else + { + res = EFalse; + } + return res; + } + +// --------------------------------------------------------------------------- +// RemoveL +// --------------------------------------------------------------------------- +// +void CSapiData::RemoveL( MAiContentObserver* aObserver, TDesC& aContentType ) + { + for(TInt index = 0; index < iItemCount; index++) + { + if ( aContentType == iItemList[index]->iContentType ) + { + iPlugin->Clean( aObserver, iItemList[index]->iId ); + } + } + } + + +// --------------------------------------------------------------------------- +// HasMenuItem +// --------------------------------------------------------------------------- +// +TBool CSapiData::HasMenuItem(const TDesC& aMenuItem ) + { + TBool found = EFalse; + for (TInt i = 0; i < iMenuItems.Count(); i++ ) + { + if( aMenuItem == iMenuItems[i] ) + { + found = ETrue; + break; + } + } + return found; + } + +// --------------------------------------------------------------------------- +// PublishL +// --------------------------------------------------------------------------- +// +void CSapiData::PublishL( MAiContentObserver* aObserver, const TDesC& aContentType ) + { + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + //Create filter criteria for requested entries in form of LIW map: + CLiwDefaultMap* filter = CreateFilterLC( aContentType ); + ExecuteCommandL( KCpData, filter, outParamList ); + CleanupStack::PopAndDestroy( filter ); + + TInt pos = 0; + outParamList->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present + { + //extract iterator on results list + TLiwVariant variant = (*outParamList)[pos].Value(); + variant.PushL(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + + while( iterable->NextL( variant ) ) + { + //extract content map + if( variant.Get( *map ) && + // Find the data map + map->FindL( KDataMap, variant) ) + { + CLiwDefaultMap *datamap = CLiwDefaultMap::NewLC(); + if ( variant.Get( *datamap ) ) + { + PublishDataL(aObserver, datamap); + } + CleanupStack::PopAndDestroy( datamap ); + } + } + CleanupStack::PopAndDestroy( map ); + CleanupStack::PopAndDestroy( &variant ); + } + outParamList->Reset(); + } + +void CSapiData::PublishDataL(MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap ) + { + for(TInt pIndex = 0; pIndex < iItemCount; pIndex++) + { + // result name to find + TLiwVariant variant; + HBufC8* itemName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(*iItemList[pIndex]->iName); + CleanupStack::PushL( itemName ); + if ( aDataMap->FindL( *itemName, variant ) ) + { + TPtrC valPtr; + if( iItemList[pIndex]->iType->Des() == KText ) + { + valPtr.Set( variant.AsDes() ); + iPlugin->PublishTextL( aObserver, iItemList[pIndex]->iId, valPtr ); + } + else if( iItemList[pIndex]->iType->Des() == KImage ) + { + TInt handle = KErrBadHandle; + // read as a image handle + if( ! variant.Get( handle ) ) + { + // no handle, so read as image path + variant.Get( valPtr ); + iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, valPtr ); + } + else + { + TInt maskHandle = KErrBadHandle; + //Look for image mask + HBufC8* maskKey = HBufC8::NewLC( itemName->Length() + KMask().Length() ); + TPtr8 maskKeyPtr = maskKey->Des(); + maskKeyPtr.Append( *itemName ); + maskKeyPtr.Append( KMask ); + if ( aDataMap->FindL( maskKeyPtr, variant ) ) + { + variant.Get( maskHandle ); + } + CleanupStack::PopAndDestroy( maskKey ); + iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, handle, maskHandle ); + } + } + } + variant.Reset(); + CleanupStack::PopAndDestroy( itemName ); + } + } +// --------------------------------------------------------------------------- +// ExecuteCommandL +// --------------------------------------------------------------------------- +// +void CSapiData::ExecuteCommandL(const TDesC& aRegistry, CLiwDefaultMap* aInFilter, + CLiwGenericParamList* aOutParamList) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); + inParamList->AppendL( type ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); + inParamList->AppendL( item ); + + // execute service.It is assumed that iInterface is already initiated + if(iInterface) + { + iInterface->ExecuteCmdL( *iCommandName, *inParamList, *aOutParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + type.Reset(); + item.Reset(); + inParamList->Reset(); + } + +// --------------------------------------------------------------------------- +// ExecuteActionL +// --------------------------------------------------------------------------- +// +void CSapiData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger ) + { + HBufC8* triggerName = HBufC8::NewLC( KSAPIContentNameMaxLength ); + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + CLiwDefaultMap* filter = NULL; + + triggerName->Des().Copy(aTrigger); + if ( aObjectId == KPubData ) + { + // this trigger belongs to publisher registery. + // in such case it is assumed that all the items in the widgets + // belongs to same publisher, type and id. + TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + // use the first item configuration to create the filter + filter = CreateFilterLC( KWidget() ); + } + else + { + if ( aObjectId == KMenuItem16 ) + { + TInt pos = KErrNotFound; + for (TInt i = 0; i < iMenuItems.Count(); i++) + { + if ( aTrigger == iMenuItems[i] ) + { + pos = i; + break; + } + } + if( pos == KErrNotFound ) + { + // No such menu items + CleanupStack::PopAndDestroy( triggerName ); + return; + } + triggerName->Des().Copy( iMenuTriggers[pos]->Des() ); + filter = CreateFilterLC( KWidget() ); + } + else + { + //Create filter criteria for requested entries in form of LIW map: + filter = CreateFilterLC( aObjectId ); + } + //append type to inparam list + TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + } + + filter->InsertL( KActionTrigger, TLiwVariant( triggerName->Des() ) ); + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( filter ) ); + inParamList->AppendL( item ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( triggerName ); + item.Reset(); + + inParamList->Reset(); + outParamList->Reset(); + + } + +// --------------------------------------------------------------------------- +// RegisterPublisherObserverL +// --------------------------------------------------------------------------- +// +void CSapiData::RegisterPublisherObserverL() + { + if ( iItemCount > 0) + { + CLiwDefaultMap* pubRegFilter = CreateFilterLC( KAll(), KAll() ); + pubRegFilter->InsertL( KOperation, TLiwVariant( KUpdate ) ); + iPubObserver->RegisterL( pubRegFilter, KPubData() ); + CleanupStack::PopAndDestroy( pubRegFilter ); + } + } + +// --------------------------------------------------------------------------- +// RegisterContentObserverL +// --------------------------------------------------------------------------- +// +void CSapiData::RegisterContentObserverL() + { + if ( iItemCount > 0) + { + CLiwDefaultMap* conRegFilter = CreateFilterLC(); + conRegFilter->InsertL( KOperation, TLiwVariant( KAddUpdateDelete ) ); + iContentObserver->RegisterL( conRegFilter, KCpData() ); + CleanupStack::PopAndDestroy( conRegFilter ); + } + } + +// --------------------------------------------------------------------------- +// RefreshL +// --------------------------------------------------------------------------- +// +void CSapiData::RefreshL( TDesC& aPublisher, TDesC& aContentType, + TDesC& aContentId, TDesC& aOperation ) + { + if ( CanUpdate( aPublisher, aContentType, aContentId ) ) + { + iPlugin->RefreshL( aContentType, aOperation); + } + } + +// --------------------------------------------------------------------------- +// IsPluginActive +// --------------------------------------------------------------------------- +// +TBool CSapiData::IsPluginActive() + { + return iPlugin->IsActive(); + } + +// --------------------------------------------------------------------------- +// PublisherStatusL +// --------------------------------------------------------------------------- +// +void CSapiData::ChangePublisherStatusL(const TDesC& aStatus) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + HBufC8* triggerName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aStatus); + CleanupStack::PushL( triggerName ); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC( KWidget() ); + filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); + + if(iInterface) + { + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( triggerName ); + inParamList->Reset(); + outParamList->Reset(); + } + +// --------------------------------------------------------------------------- +// ResumeL +// --------------------------------------------------------------------------- +// +void CSapiData::ResumeL() + { + if ( iUpdateNeeded ) + { + iPlugin->PublishL(); + iUpdateNeeded = EFalse; + } + ChangePublisherStatusL( KResume ); + } + +// --------------------------------------------------------------------------- +// SuspendL +// --------------------------------------------------------------------------- +// +void CSapiData::SuspendL() + { + ChangePublisherStatusL( KSuspend ); + } + +// --------------------------------------------------------------------------- +// ActivateL +// --------------------------------------------------------------------------- +// +void CSapiData::ActivateL() + { + ChangePublisherStatusL( KActive ); + } + +// --------------------------------------------------------------------------- +// DeActivateL +// --------------------------------------------------------------------------- +// +void CSapiData::DeActivateL() + { + ChangePublisherStatusL( KDeActive ); + } + +// --------------------------------------------------------------------------- +// OnLineL +// --------------------------------------------------------------------------- +// +void CSapiData::OnLineL() + { + ChangePublisherStatusL( KOnLine ); + } + +// --------------------------------------------------------------------------- +// offLineL +// --------------------------------------------------------------------------- +// +void CSapiData::OffLineL() + { + ChangePublisherStatusL( KOffLine ); + } + +// --------------------------------------------------------------------------- +// InActiveL +// --------------------------------------------------------------------------- +// +void CSapiData::InActiveL() + { + ChangePublisherStatusL( KInActive ); + } + +// --------------------------------------------------------------------------- +// UpdatePublisherStatusL +// --------------------------------------------------------------------------- +// +void CSapiData::UpdatePublisherStatusL( TDesC& aPublisher ) + { + if ( aPublisher == iPublisher ) + { + // Resend the plugin status to publisher + ActivateL(); + if ( iPlugin->IsActive() ) + { + ResumeL(); + } + else + { + SuspendL(); + } + // forward the network status if it uses. + if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOnline ) + { + OnLineL(); + } + else if ( iPlugin->NetworkStatus() == CSapiDataPlugin::EOffline ) + { + OffLineL(); + } + } + } + +// --------------------------------------------------------------------------- +// ResolveSkinItemId +// --------------------------------------------------------------------------- +// +TBool CSapiData::ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& abitmapId, TInt& aMaskId, TDes& aFilename ) + { + // Syntax: skin( ):mif(filename bimapId maskId) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KSkin ); + if( pos != KErrNotFound ) + { + // Skip skin token + pos += KSkin().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + //lex.SkipSpace(); + + TInt majorId( 0 ); + TInt minorId( 0 ); + + // Resolve major id + error = lex.Val( majorId ); + + // Resolve minor id + lex.SkipSpace(); + error |= lex.Val( minorId ); + + // initilize skin item id object + aItemId.Set( majorId, minorId ); + } + } + + if( (error == KErrNone && aPath.FindF( KColon ) != KErrNotFound ) + || ( error == KErrNotFound ) ) + { + error = KErrNotFound; + pos = aPath.FindF( KMif ); + if ( pos != KErrNotFound ) + { + pos += KMif().Length(); + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + // Resolve MifFile name + aFilename.Copy(lex.MarkedToken()); + if( aFilename.Length()!= 0) + { + // Resolve major id + lex.SkipSpace(); + error = lex.Val( abitmapId ); + + // Resolve minor id + lex.SkipSpace(); + error |= lex.Val( aMaskId ); + } + else + { + error = KErrNotFound; + } + } + } + } + return (error == KErrNone ); + } + +// --------------------------------------------------------------------------- +// SetUpdateNeeded +// --------------------------------------------------------------------------- +// +void CSapiData::SetUpdateNeeded(TBool aStatus) + { + iUpdateNeeded = aStatus; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/src/sapidataobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#include +#include +#include +#include "sapidata.h" +#include "sapidataobserver.h" +#include "sapidatapluginconst.h" +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CSapiDataObserver::CSapiDataObserver () + { + + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CSapiDataObserver ::~CSapiDataObserver () + { + iInterface = NULL; + iData = NULL; + } + +// --------------------------------------------------------------------------- +// Register for notifications +// --------------------------------------------------------------------------- +// +void CSapiDataObserver::RegisterL( CLiwDefaultMap* aFilter, const TDesC& aRegistry ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + // Fill in input list for RequestNotification command + inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant(aRegistry))); + inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant(aFilter))); + + iError = KErrNone; + TRAP( iError, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + 0, + this ) ); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + +// --------------------------------------------------------------------------- +// Sing off to notification +// --------------------------------------------------------------------------- +// +void CSapiDataObserver ::ReleaseL() + { + if( iInterface ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + TInt err(KErrNone); + TRAP(err, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + KLiwOptCancel, + this )); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + } + +// --------------------------------------------------------------------------- +// Factory method construction +// --------------------------------------------------------------------------- +// +CSapiDataObserver * CSapiDataObserver::NewL( MLiwInterface* aInterface, CSapiData* aData ) + { + CSapiDataObserver * self = new (ELeave) CSapiDataObserver(); + CleanupStack::PushL( self ); + self->ConstructL( aInterface, aData ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// 2n phase constructor +// --------------------------------------------------------------------------- +// +void CSapiDataObserver::ConstructL( MLiwInterface* aInterface, CSapiData* aData ) + { + iData = aData; + iInterface = aInterface; + } + +// --------------------------------------------------------------------------- +// Handles Published content notification +// --------------------------------------------------------------------------- +// +TInt CSapiDataObserver::HandleNotifyL( + TInt aErrorCode, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + + // Is plugin active to refresh the published data + iError = aErrorCode; + TInt count(0); + TInt pos(0); + const TLiwGenericParam* param(NULL); + CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC(); + param = aEventParamList.FindFirst(pos,KChangeInfo); + if( param ) + { + User::LeaveIfError( param->Value().Get( *listOfMaps ) ); + count = listOfMaps->Count(); + } + TLiwVariant variant; + // Extract the data from the map + for(TInt i = 0;i < count; i++) + { + listOfMaps->AtL(i,variant); + HBufC* operation = NULL; + + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + TBool found; + found = map->FindL( KOperation, variant ); + if (found) + { + operation = variant.AsDes().AllocLC(); + } + variant.Reset(); + if( operation->Des() != KOperationExecute ) + { + // Nothing to update for execute action + HBufC* publisher = NULL; + HBufC* contentType = NULL; + HBufC* contentId = NULL; + found = map->FindL( KPublisherId, variant ); + if (found) + { + publisher = variant.AsDes().AllocLC(); + } + variant.Reset(); + found = map->FindL( KFLAG, variant ); + if ( found) + { + // notification from publisher registry + if ( operation->Des() != KOperationDelete ) + { + iData->UpdatePublisherStatusL( *publisher ); + } + } + else if ( iData->IsPluginActive() ) + { + // notification from content registry + found = map->FindL( KContentType, variant ); + if (found) + { + contentType = variant.AsDes().AllocLC(); + } + variant.Reset(); + found = map->FindL( KContentId, variant ); + if (found) + { + contentId = variant.AsDes().AllocLC(); + } + variant.Reset(); + iData->RefreshL( *publisher, *contentType, *contentId, *operation ); + + if ( contentId ) + { + CleanupStack::PopAndDestroy( contentId ); + } + if ( contentType ) + { + CleanupStack::PopAndDestroy( contentType ); + } + } + else + { + // remember update if plugin is in suspend mode + iData->SetUpdateNeeded( ETrue ); + } + variant.Reset(); + if ( publisher ) + { + CleanupStack::PopAndDestroy( publisher ); + } + } + if ( operation ) + { + CleanupStack::PopAndDestroy( operation ); + } + CleanupStack::PopAndDestroy( map ); + } + CleanupStack::PopAndDestroy( listOfMaps ); + + return aErrorCode; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,749 @@ +/* +* Copyright (c) 2005-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: Profile plug-in publisher +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "sapidatapluginconst.h" +#include "sapidatapluginuids.hrh" +#include "sapidataplugin.h" +#include "sapidata.h" + +// CONST CLASS VARIABLES +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidDataPlugin, CSapiDataPlugin::NewL ) + }; + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Constructs and returns an application object. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / + sizeof( TImplementationProxy ); + return KImplementationTable; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CSapiDataPlugin* CSapiDataPlugin::NewL() + { + CSapiDataPlugin* self = new (ELeave) CSapiDataPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CSapiDataPlugin::CSapiDataPlugin() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::ConstructL() + { + iInfo.iUid.iUid = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; + iPluginState = ENone; + iHSForeGround = EFalse; + iNetworkStatus = EUnknown; + iData = CSapiData::NewL(this); + + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CSapiDataPlugin::~CSapiDataPlugin() + { + // deactivate the publishers + if( iData ) + { + TRAP_IGNORE(iData->DeActivateL()); + delete iData; + } + iObservers.Close(); + Release( iContent ); + iDataArray.ResetAndDestroy(); + + if( iContentModel) + { + for( TInt i = iDataCount-1;i>=0 ; i-- ) + { + User::Free((TAny*)iContentModel[i].cid); + } + delete []iContentModel; + } + iIconArray.Reset(); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-ins take ownership of the settings array, so it must either +// store it in a member or free it. +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) + { + if( iDataCount > 0 ) + { + // We own the array so destroy it + aSettings.ResetAndDestroy(); + return; + } + + RAiSettingsItemArray contentItemsArr; + RAiSettingsItemArray configurationItemsArr; + + TInt count = aSettings.Count(); + for(TInt i = 0; i < count; i++ ) + { + MAiPluginSettings* pluginSetting = aSettings[i]; + if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) + { + contentItemsArr.Append(pluginSetting); + } + else if( pluginSetting->AiPluginItemType() == EAiPluginConfigurationItem ) + { + configurationItemsArr.Append(pluginSetting); + } + } + iDataCount = contentItemsArr.Count(); + if(iDataCount > 0 ) + { + // Create the content Model + HBufC* contentId = HBufC::NewLC( KAiContentIdMaxLength + KAiPluginNameMaxLength ); + iContentModel = new TAiContentItem[iDataCount]; + for(TInt i = 0; i < iDataCount; i++) + { + MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); + iContentModel[i].id = i; + if( contentItem.Type() == KText() || contentItem.Type() == KNewsTicker() ) + { + // text + iContentModel[i].type = KAiContentTypeText; + } + if( contentItem.Type() == KImage() ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + + contentId->Des().Copy(contentItem.Name()); + contentId->Des().Delete(0, contentId->Des().LocateReverse(KPluginNameSeprator) +1); + + TInt sizeOfContentId = contentId->Des().Size()+sizeof(wchar_t); + iContentModel[i].cid = static_cast( User::Alloc( sizeOfContentId ) ); + Mem::Copy((TAny*)iContentModel[i].cid, contentId->Des().PtrZ(), sizeOfContentId); + + contentId->Des().Delete( 0, contentId->Des().Length()); + } + + CleanupStack::PopAndDestroy( contentId ); + iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); + // Configurations + iData->ConfigureL(configurationItemsArr); + + // Activate the publisher + iData->ActivateL(); + + // Register for notifications + iData->RegisterPublisherObserverL(); + + PublishL(); + + iPluginState = ESuspend; + iData->RegisterContentObserverL(); + } + contentItemsArr.Reset(); + configurationItemsArr.Reset(); + // We own the array so destroy it + aSettings.ResetAndDestroy(); + // publish the initial data + } + +// --------------------------------------------------------------------------- +// Publishes widget's texts and images +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::PublishL() + { + TInt err( KErrNone ); + User::LeaveIfError( iRfs.Connect() ); + + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( int i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = iObservers[i]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + { + // Publish all the data + iData->PublishL(observer, KAll ); + observer->Commit( transactionId ); + } + + // Release memory of the published text + iDataArray.ResetAndDestroy(); + // Release memory of the published icons + iIconArray.Reset(); + + } + iRfs.Close(); + } + +// --------------------------------------------------------------------------- +// Publish a specific text of the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::PublishTextL(MAiContentObserver* aObserver, + TInt& aContentId, TDesC& aContentValue) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aContentValue.Length() > 0 ) + { + HBufC* contentText = HBufC::NewLC(aContentValue.Size()); + TPtr cDes = contentText->Des(); + cDes.Copy(aContentValue); + aObserver->Publish( *this, aContentId, cDes, aContentId ); + iDataArray.AppendL( contentText ); + CleanupStack::Pop( contentText ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + } + } + +// --------------------------------------------------------------------------- +// Publish a specific image of the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TInt aContentId, TDesC& aPath ) + { + TInt err = KErrNone; + TAknsItemID iconId; + iconId.iMajor=0; + iconId.iMinor=0; + TInt bitmapId(0); + TInt maskId(0); + TFileName fileName; + CGulIcon* icon = NULL; + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + TBool inSkin = iData->ResolveSkinIdAndMifId( aPath, iconId, bitmapId, maskId, fileName ); + if ( inSkin ) + { + // Load from skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ( iconId.iMajor != 0 && iconId.iMajor!=0 ) + { + // Create icon with fall back + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + mask, + fileName, /* backup filename */ + bitmapId, /* backup bit map id */ + maskId)); /* backup mask id */ + } + else if( bitmapId !=0 ) + { + if ( maskId!=0 ) + { + // Create icon from Mif filename , bitmap id and mask id + TRAP_IGNORE(icon = AknsUtils::CreateGulIconL( + skin, + iconId, + fileName, + bitmapId, + maskId) ); + } + else + { + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + fileName, /* backup filename */ + bitmapId)); /* backup bit map id */ + } + } + + if ( icon == NULL && bitmap != NULL ) + { + icon = CGulIcon::NewL( bitmap, mask ); + } + + if ( icon != NULL ) // Syntax correct but icon not found + { + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + err = KErrNotFound; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + else // Interpret as File path + { + RFile* iconFile = new (ELeave) RFile(); + err = iconFile->Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); + if( err == KErrNone ) + { + aObserver->Publish( *this, aContentId, *iconFile, aContentId ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + iconFile->Close(); + delete iconFile; + iconFile = NULL; + } + } + } + +// --------------------------------------------------------------------------- +// Publish a image of the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TInt& aContentId, TInt aHandle, TInt aMaskHandle ) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aHandle != KErrBadHandle ) + { + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + if( KErrNone == bitmap->Duplicate( aHandle) ) + { + // Take the ownership + CGulIcon* icon = CGulIcon::NewL(bitmap); + if( aMaskHandle != KErrBadHandle ) + { + CFbsBitmap* mask = new (ELeave) CFbsBitmap(); + if (KErrNone == mask->Duplicate( aMaskHandle) ) + { + icon->SetMask( mask ); + } + } + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + delete bitmap; + bitmap = NULL; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + } + } + +// --------------------------------------------------------------------------- +// Gets the id of a content +// --------------------------------------------------------------------------- +// +TInt CSapiDataPlugin::GetIdL( TDesC& aObjectId) + { + TInt id = KErrNotFound; + for( TInt i = 0;i< iDataCount; i++ ) + { + if( aObjectId == ContentCid(iContentModel[i] ) ) + { + id = iContentModel[i].id; + break; + } + } + return id; + } + + +// --------------------------------------------------------------------------- +// Gets type of a content +// --------------------------------------------------------------------------- +// +const TDesC& CSapiDataPlugin::GetTypeL(TDesC& aObjectId ) + { + for( TInt i = 0;i< iDataCount; i++ ) + { + if( aObjectId == ContentCid(iContentModel[i]) ) + { + if( iContentModel[i].type == KAiContentTypeText) + { + return KText(); + } + else if( iContentModel[i].type == KAiContentTypeBitmap) + { + return KImage(); + } + } + } + + return KNullDesC(); + } + +// --------------------------------------------------------------------------- +//Refresh a specific image of text in the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::RefreshL(TDesC& aContentType, TDesC& aOperation) + { + TInt err( KErrNone ); + User::LeaveIfError( iRfs.Connect() ); + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ ) + { + MAiContentObserver* observer = iObservers[obsIndex]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + { + if ( aOperation != KOperationDelete ) + { + iData->PublishL( observer, aContentType ); + } + else + { + iData->RemoveL( observer, aContentType ); + } + + observer->Commit( transactionId ); + } + + // Relese memory of the published text + iDataArray.ResetAndDestroy(); + iIconArray.Reset(); + } + iRfs.Close(); + } + +// --------------------------------------------------------------------------- +// Cleans a data from the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::Clean(MAiContentObserver* aObserver, + TInt& aContentId ) + { + if ( aObserver->CanPublish( *this, aContentId, aContentId ) ) + { + aObserver->Clean( *this, aContentId, aContentId ); + } + + } +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is requested to unload its engines due backup operation +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::Stop( TAiTransitionReason aReason ) + { + if( iPluginState == EResume ) + { + Suspend( aReason ); + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::Resume( TAiTransitionReason aReason ) + { + TRAP_IGNORE( DoResumeL( aReason ) ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is not allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::Suspend( TAiTransitionReason aReason ) + { + switch( aReason ) + { + case EAiKeylockDisabled: + case EAiKeylockEnabled: + { + // handled in resume + break; + } + default : + { + iPluginState = ESuspend; + TRAP_IGNORE ( iData->SuspendL() ); + } + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// The plug-in MUST maintain a registry of subscribers and send +// notification to all of them whenever the state changes or new content +// is available +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::SubscribeL( MAiContentObserver& aObserver ) + { + iObservers.AppendL( &aObserver ); + } + + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Returns the extension interface. Actual type depends on the passed +// aUid argument. +// --------------------------------------------------------------------------- +// +TAny* CSapiDataPlugin::Extension( TUid aUid ) + { + if ( aUid == KExtensionUidProperty ) + { + return static_cast( this ); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast( this ); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Read property of publisher plug-in. +// --------------------------------------------------------------------------- +// +TAny* CSapiDataPlugin::GetPropertyL( TInt aProperty ) + { + TAny* property = NULL; + + switch ( aProperty ) + { + case EAiPublisherInfo: + { + property = static_cast( &iInfo ); + break; + } + + case EAiPublisherContent: + { + property = static_cast( iContent ); + break; + } + default: + break; + } + + return property; + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Write property value to optimize the content model. +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) + { + if( aProperty == EAiPublisherInfo ) + { + ASSERT( aValue ); + + const TAiPublisherInfo* info( + static_cast( aValue ) ); + + iInfo = *info; + + iData->SetContentIdL( info->iNamespace ); + } + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) + { + // This is not as there is no event id to retrieve in this dynamic plugin. + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) + { + // We have no way of reporting errors to framework so just ignore them. + TRAP_IGNORE(iData->ExecuteActionL( aEventName , aParam ) ); + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Invoked by the framework for querying if plugin has menu item +// --------------------------------------------------------------------------- +// +TBool CSapiDataPlugin::HasMenuItem( const TDesC& aMenuItem ) + { + return iData->HasMenuItem ( aMenuItem ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// framework instructs plug-in that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::DoResumeL( TAiTransitionReason aReason ) + { + //update in startup phase and idle is on foreground. + switch ( aReason ) + { + case EAiIdleOnLine: + { + iNetworkStatus = EOnline; + iData->OnLineL(); + break; + } + case EAiIdleOffLine: + { + iNetworkStatus = EOffline; + iData->OffLineL(); + break; + } + case EAiIdlePageSwitch: + { + if ( iPluginState == EResume ) + { + iData->SuspendL(); + } + iPluginState = EInActive; + iData->InActiveL(); + } + break; + case EAiSystemStartup: + case EAiIdleForeground: + { + iHSForeGround = ETrue; + } + case EAiBacklightOn: + { + if ( iPluginState == ESuspend ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockDisabled: + { + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == ESuspend ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockEnabled: + { + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == EResume ) + { + iPluginState = ESuspend ; + iData->SuspendL(); + } + break; + } + case EAiScreenLayoutChanged: + { + // ignore events + break; + } + case EAiGeneralThemeChanged: + { + // ignore event + break; + } + case EAiIdleBackground: + { + iHSForeGround = EFalse; + } + default : + { + if ( iPluginState == EResume ) + { + iPluginState = ESuspend; + iData->SuspendL(); + } + break; + } + } + } + +// --------------------------------------------------------------------------- +// Is plugin active to publish the data +// --------------------------------------------------------------------------- +// +TBool CSapiDataPlugin::IsActive() + { + return (iPluginState == EResume ); + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/BWINS/aiscutextservu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/BWINS/aiscutextservu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,11 @@ +EXPORTS + ?Connect@RAiScutExtServ@@QAEHXZ @ 1 NONAME ; int RAiScutExtServ::Connect(void) + ?IsInShortcuts@RAiScutExtServ@@QBEHAAH@Z @ 2 NONAME ; int RAiScutExtServ::IsInShortcuts(int &) const + ?IssuePutInShortcuts@RAiScutExtServ@@QAEHXZ @ 3 NONAME ; int RAiScutExtServ::IssuePutInShortcuts(void) + ?ResetIcon@RAiScutExtServ@@QAEHXZ @ 4 NONAME ; int RAiScutExtServ::ResetIcon(void) + ?ResetPopupText@RAiScutExtServ@@QAEHXZ @ 5 NONAME ; int RAiScutExtServ::ResetPopupText(void) + ?UpdateIconL@RAiScutExtServ@@QAEHABVCGulIcon@@@Z @ 6 NONAME ; int RAiScutExtServ::UpdateIconL(class CGulIcon const &) + ?UpdatePopupTextL@RAiScutExtServ@@QAEHABVMDesC16Array@@@Z @ 7 NONAME ; int RAiScutExtServ::UpdatePopupTextL(class MDesC16Array const &) + ?Version@RAiScutExtServ@@QBE?AVTVersion@@XZ @ 8 NONAME ; class TVersion RAiScutExtServ::Version(void) const + ?Connect@RAiScutExtServ@@QAEHABVTDesC16@@@Z @ 9 NONAME ; int RAiScutExtServ::Connect(class TDesC16 const &) + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/EABI/aiscutextservu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/EABI/aiscutextservu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,11 @@ +EXPORTS + _ZN14RAiScutExtServ11UpdateIconLERK8CGulIcon @ 1 NONAME + _ZN14RAiScutExtServ14ResetPopupTextEv @ 2 NONAME + _ZN14RAiScutExtServ16UpdatePopupTextLERK12MDesC16Array @ 3 NONAME + _ZN14RAiScutExtServ19IssuePutInShortcutsEv @ 4 NONAME + _ZN14RAiScutExtServ7ConnectEv @ 5 NONAME + _ZN14RAiScutExtServ9ResetIconEv @ 6 NONAME + _ZNK14RAiScutExtServ13IsInShortcutsERi @ 7 NONAME + _ZNK14RAiScutExtServ7VersionEv @ 8 NONAME + _ZN14RAiScutExtServ7ConnectERK7TDesC16 @ 9 NONAME + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/cenrep/keys_scutplugin.xls Binary file idlefw/plugins/shortcutplugin/cenrep/keys_scutplugin.xls has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/conf/scutplugin.confml Binary file idlefw/plugins/shortcutplugin/conf/scutplugin.confml has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/conf/scutplugin_10275104.crml Binary file idlefw/plugins/shortcutplugin/conf/scutplugin_10275104.crml has changed diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/group/aiscutextserv.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/group/aiscutextserv.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: Project definition file for AI Shortcut xSP Extension API +* +*/ + +#include + +TARGET aiscutextserv.dll +TARGETTYPE DLL +UID 0x1000008D 0x10282CDD + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE aiscutextserv.cpp + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY egul.lib +LIBRARY fbscli.lib + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/group/aiscutplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/group/aiscutplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Project definition file for project ShortcutPlugin +* +*/ + +#include +#include +#include + +//MACRO MY_DEBUG + +//#include "../../../inc/common/debug.h" +//#define AI_ENABLE_RD_LOGGING +#define AI_RD_LOG_TO_DEBUG_OUTPUT + +// Master flag for enabling xSP extensions +#define AI_SCUTPLUGIN_XSP_EXTENSIONS + +TARGET aiscutplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +// xSP extension +#ifdef AI_SCUTPLUGIN_XSP_EXTENSIONS +SOURCE caiscutengineext.cpp +SOURCE caiscutextserver.cpp +SOURCE caiscutextsession.cpp +SOURCE caiscutshortcutext.cpp +SOURCE PopupFSM.cpp +SOURCE cpopupeventhandler.cpp +SOURCE caiscutextdata.cpp +SOURCE caiscutextdatamodel.cpp +SOURCE aiscutfactoryext.cpp +USERINCLUDE . +LIBRARY estor.lib +#else +SOURCE aiscutfactory.cpp +#endif + +SOURCE caiscutplugin.cpp +SOURCE caiscutengine.cpp +SOURCE caiscutshortcut.cpp +SOURCE caiscutshortcutinfo.cpp +SOURCE caiscuttarget.cpp +SOURCE caiscuttargetapp.cpp +SOURCE caiscuttargetbkm.cpp +SOURCE caiscuttargethttp.cpp +SOURCE caiscuttargetkeylock.cpp +SOURCE caiscuttargetmessagingview.cpp +SOURCE caiscuttargetnewmsg.cpp +SOURCE caiscuttargetempty.cpp +SOURCE aiscuttargetshutter.cpp + +SOURCE taiscutparser.cpp +SOURCE aidefaultshortcut.cpp +SOURCE aiscutappuidparser.cpp +SOURCE aiscutrepositorywatcher.cpp + +START RESOURCE aiscutplugin.rss +TARGET aiscutplugin.rsc +END + +START RESOURCE aiscutpluginres.rss +HEADER +TARGET aiscutpluginres.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +START RESOURCE aiscuttexts.rss +HEADER +TARGET aiscuttexts.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +USERINCLUDE ../../../inc/common +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY apparc.lib // TApaTask +LIBRARY apgrfx.lib // CApaAppListNotifier +LIBRARY viewcli.lib // CVwsSessionWrapper +LIBRARY ws32.lib // RWsSession +LIBRARY inetprotutil.lib // TUriParser +LIBRARY centralrepository.lib // CRepository +LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler +LIBRARY msgs.lib // Message Server +LIBRARY muiu.lib // MsvUiServiceUtilities +LIBRARY sendui.lib // Send UI +LIBRARY egul.lib // CGulIcon +LIBRARY aknskins.lib // AknsUtils +LIBRARY charconv.lib // CnvUtfConverter +LIBRARY avkon.lib +LIBRARY aknnotify.lib +LIBRARY featmgr.lib +LIBRARY aiutils.lib +LIBRARY fbscli.lib +LIBRARY aknicon.lib +LIBRARY favouritesengine.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY platformenv.lib // For PathInfo +LIBRARY efsrv.lib +LIBRARY bafl.lib +LIBRARY imcm.lib +LIBRARY akncapserverclient.lib // Fastswap +#ifdef __WEB_WIDGETS +LIBRARY widgetregistryclient.lib +#endif +LIBRARY keylockpolicyapi.lib +LIBRARY gfxtrans.lib +LIBRARY akntransitionutils.lib +LIBRARY gslauncher.lib + +// Debugging dependencies +LIBRARY flogger.lib + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/group/aiscutsettings.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/group/aiscutsettings.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Project definition file for project ShortcutPlugin settings +* +*/ + + +#include + +#include + +#include + +//#include "../../../inc/common/debug.h" +//#define AI_ENABLE_RD_LOGGING +#define AI_RD_LOG_TO_DEBUG_OUTPUT + +//MACRO MY_DEBUG + +TARGET aiscutsettings.dll +TARGETTYPE PLUGIN +UID 0x10009D8D AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE caiscutsettings.cpp +SOURCE caiscutsettingsimplementationtable.cpp +SOURCE caiscutsettingscontainer.cpp +SOURCE caiscutsettingsmodel.cpp +SOURCE caiscutsettingsitem.cpp +SOURCE caiscutsettingsapplist.cpp +SOURCE caiscutsettingsbkmlist.cpp + +SOURCE taiscutparser.cpp +SOURCE aidefaultshortcut.cpp +SOURCE aiscutappuidparser.cpp +SOURCE aiscutrepositorywatcher.cpp + +START RESOURCE aiscutsettings.rss +TARGET aiscutsettings.rsc +END + +START RESOURCE aiscutsettingsres.rss +HEADER +TARGET aiscutsettingsres.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +USERINCLUDE ../../../inc/common +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY cdlengine.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib // CCenRepNotifyHandler +LIBRARY gsframework.lib // For base classes +LIBRARY gslistbox.lib // For CGSListBoxItemTextArray +LIBRARY gsecomplugin.lib +LIBRARY commonengine.lib // For RConeResourceLoader +LIBRARY inetprotutil.lib // For TUriParser +LIBRARY apgrfx.lib // For RApaLsSession +LIBRARY apparc.lib // For TApaAppInfo +LIBRARY msgs.lib // For Message Server +LIBRARY platformenv.lib // For PathInfo +LIBRARY hlplch.lib // for HlpLauncher +LIBRARY featmgr.lib // For feature manager +LIBRARY favouritesengine.lib +LIBRARY javaregistryclient.lib // For JavaRegistry +#ifdef __WEB_WIDGETS +LIBRARY widgetregistryclient.lib +#endif + +// Debugging dependencies +LIBRARY flogger.lib + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/group/backup_registration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: Bld.inf for Shortcut Plugin. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../loc/ai3scutsettings.loc MW_LAYER_LOC_EXPORT_PATH(ai3scutsettings.loc) +../loc/ai3scutplugin.loc MW_LAYER_LOC_EXPORT_PATH(ai3scutplugin.loc) + +../rom/aiscutplugin_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(aiscutplugin_resources.iby) +../rom/aiscutplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aiscutplugin.iby) + + +// Backup registration +backup_registration.xml /epoc32/data/z/private/102750f9/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/udeb/z/private/102750f9/backup_registration.xml +backup_registration.xml /epoc32/release/winscw/urel/z/private/102750f9/backup_registration.xml + +// Generic configuration interface for component cenrep settings +../conf/scutplugin.confml APP_LAYER_CONFML(scutplugin.confml) +../conf/scutplugin_10275104.crml APP_LAYER_CRML(scutplugin_10275104.crml) + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE aiscutplugin.mif +OPTION HEADERFILE aiscutplugin.mbg +OPTION SOURCES -c8,8 qgn_prop_ai_shortcut -c8,8 qgn_menu_url \ + -c8,8 qgn_menu_mce_sel_mes -c8,8 qgn_menu_mce_syncmail \ + -c8,8 qgn_menu_am -c8,8 qgn_prop_cp_conn_shortcut \ + -c8,8 qgn_prop_psln_ai_sub +END + +PRJ_MMPFILES +aiscutsettings.mmp +aiscutplugin.mmp +aiscutextserv.mmp + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aidefaultshortcut.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aidefaultshortcut.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: Platform default shortcuts. +* +*/ + + +#ifndef AIDEFAULTSHORTCUT_H +#define AIDEFAULTSHORTCUT_H + +#include // for TInt +#include // for TUid, TDes + + +class TAiDefaultShortcut +{ +public: + /** + * Get S60 platform default shortcut uid and definition for index aIndex. + * + */ + static void GetDefaultShortcut(TInt aIndex, TUid& aUid, TDes& aDefinition); + +}; + +#endif diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutapptitle.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutapptitle.rh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,39 @@ +/* +* 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: Shortcut plug-in app title structs. +* +*/ + + +#ifndef AISCUTAPPTITLE_RH +#define AISCUTAPPTITLE_RH + +STRUCT AI_APP_TITLE_ITEM +{ + LONG appuid; + LONG viewid = -1; + LTEXT longtitle = ""; + LTEXT shorttitle = ""; + LTEXT skeytitle = ""; + LTEXT msktitle = ""; +} + +STRUCT AI_APP_TITLE_LIST +{ + STRUCT items[]; // AI_APP_TITLE_ITEM items. +} + +#endif // AISCUTAPPTITLE_RH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutappuidparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutappuidparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Shortcut definition parser. +* +*/ + + +#ifndef AISCUTAPPUIDPARSER_H +#define AISCUTAPPUIDPARSER_H + +// INCLUDES +#include + +// CLASS DECLARATIONS + +/** + * Parser class that interpretes the given text as a description of + * application position data. + */ +class TAiScutAppUidParser +{ +public: // Construction + + /** + * Standard C++ constructor. + * @param aData Data which will be parsed + * @param aAppPositions This array will be filled with parsed + * application positions. + */ + TAiScutAppUidParser(const TDesC& aData, RArray& aAppPositions); + +public: // Interface + + /** + * Parses the data that was given in constructor and fills the + * application position array with parsed data. + */ + void ParseL(); + +private: // Implementation + /** + * Skips the given char. + * Skipping can be done conditionally or unconditionally. + * If conditional skipping is used, next character in data will be + * skipped only if it is the same as given character. + * If unconditional skipping is used the next character in data must + * be the given character, otherwise the data is invalid and parsing + * will be stopped. + * @param aChar Character that will be skipped. + * @param aConditionalSkip If ETrue, use conditional skipping, + * otherwise unconditional skipping will be + * used. + */ + void SkipChar(TChar aChar, TBool aConditionalSkip); + + /** + * Reads app UID from data. If data doesn't contain app UID in the + * point in which this function is called, data is considered invalid. + * @return App UID that was read from data. + */ + TUid ReadAppUid(); + +private: + + /// Ref: Application positions array that will be filled when parsing + RArray& iUidArray; + + /// Lexer for data + TLex iLex; + + /// Is the data that has been read so far valid. + TBool iLexIsValid; +}; + +#endif // AISCUTAPPUIDPARSER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,61 @@ +/* +* 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: Shortcut plug-in factory class. +* +*/ + + +#ifndef AISCUTENGINEFACTORY_H +#define AISCUTENGINEFACTORY_H + +#include + +class CAiScutEngine; +class CAiScutPlugin; +class CAiScutShortcut; + +/** + * AiScutEngineFactory + * + * Creates various classes used in AiScutPlugin. + * + * @since S60 v3.2 + */ +class AiScutFactory + { + public: + /** + * Creates CAiScutEngine + * @since S60 v3.2 + */ + static CAiScutEngine* CreateAiScutEngineL( CAiScutPlugin& aPlugin ); + + /** + * Creates CAiScutShortcut + * @since S60 v3.2 + */ + static CAiScutShortcut* CreateAiScutShortcutL( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ); + + /** + * Creates CAiScutShortcut + * @since S60 v3.2 + */ + static CAiScutShortcut* CreateAiScutShortcutLC( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ); + }; + +#endif // AISCUTENGINEFACTORY_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutpluginprivatecrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutpluginprivatecrkeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* 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: Shortcut Plug-in private CenRep keys. +* +*/ + + +#ifndef AISCUTPLUGINPRIVATECRKEYS_H +#define AISCUTPLUGINPRIVATECRKEYS_H + +#include + +#endif // AISCUTPLUGINPRIVATECRKEYS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutrepositorywatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutrepositorywatcher.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Shortcut definition parser. +* +*/ + + +#ifndef AISCUTREPOSITORYWATCHER_H +#define AISCUTREPOSITORYWATCHER_H + +// INCLUDES +#include +#include // For CCenRepNotifyHandler + +// CLASS DECLARATIONS + +class CAiScutRepositoryWatcher : public CBase, public MCenRepNotifyHandlerCallback +{ +public: + static CAiScutRepositoryWatcher* NewL( + const TUid aUid, + const TUint32 aKey, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, + TCallBack aCallBack, + CRepository* aRepository); + + static CAiScutRepositoryWatcher* NewL( + const TUid aUid, + TCallBack aCallBack, + CRepository* aRepository); + + ~CAiScutRepositoryWatcher(); + + void StartListeningL(); + + void StopListening(); + + TUint32 ChangedKey(); + +public: // from MCenRepNotifyHandlerCallback + void HandleNotifyInt (TUint32 aKey, TInt aNewValue); + void HandleNotifyString (TUint32 aKey, const TDesC16& aNewValue); + void HandleNotifyGeneric(TUint32 aKey); + void HandleNotifyError (TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler); + +private: + CAiScutRepositoryWatcher( + const TUid aUid, + const TUint32 aKey, + TCallBack aCallBack, + CRepository* aRepository); + + void ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType); + + void ConstructL(); + +private: + TUid iUid; + TUint32 iKey; + TUint32 iChangedKey; + TCallBack iCallBack; + CRepository* iRepository; + CCenRepNotifyHandler* iNotifyHandler; + +}; + +#endif // AISCUTREPOSITORYWATCHER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscutsettings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscutsettings.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,48 @@ +/* +* 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: Resource headers for Shortcut plug-in +* +*/ + + +#ifndef AISCUTSETTINGS_HRH +#define AISCUTSETTINGS_HRH + +/** + * Menu command ids for the Shortcut plug-in Settings + */ +enum TAiScutSettingsMenuCommands +{ + EAiScutSettingsCmdChange = 0x6000, + + EAiScutSettingsCmdChangeToApps, + EAiScutSettingsCmdChangeToUrl, + EAiScutSettingsCmdChangeToBookmark, + EAiScutSettingsCmdChangeShortcutType +}; + +/** + * Shortcut setting types + */ +enum TAiScutSettingType +{ + EAiScutSettingTypeUndefined = -1, + EAiScutSettingTypeApplication, + EAiScutSettingTypeBookmark, + EAiScutSettingTypeUrl +}; + +#endif // AISCUTSETTINGS_HRH + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/aiscuttargetshutter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/aiscuttargetshutter.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,135 @@ +/* +* 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: +* +*/ + + +#ifndef CAISCUTTARGET_H +#define CAISCUTTARGET_H + +#include +#include + +class TApaTask; +class CPeriodic; + +/** + * Base class for shortcut targets + * + * @since S60 v3.2 + */ +class CAiScutTargetShutter : public CActive +{ + +public: + + static CAiScutTargetShutter* NewL( CCoeEnv* aEnv, TUid aAppUid, TBool aIsRunning, TBool aIsDialog ); + + virtual ~CAiScutTargetShutter(); + + void StartL(); + +private: + + CAiScutTargetShutter( CCoeEnv* aEnv, TUid aAppUid ); + + void ConstructL( TBool aIsRunning, TBool aIsDialog ); + + // from base class CActive + + /** + * From CActive + * + * @since S60 v3.2 + */ + void DoCancel(); + + /** + * From CActive + * + * @since S60 v3.2 + */ + void RunL(); + + /** + * From CActive + * Handles an error situation + * + * @since S60 v3.2 + * @param aError Error code received from system + * @return Error code after error handling + */ + TInt RunError( TInt aError ); + + static TInt TaskExistsCallback( TAny* aPtr ); + + static TInt TaskNotExistsCallback( TAny* aPtr ); + + void Run(); + +private: //data + + /** + * Pointer to the control environment + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Target application uid + */ + TUid iAppUid; + + /** + * Window Server session + */ + RWsSession iWsSession; + + /** + * Task exsit or not + */ + TBool iTaskExists; + + /** + * Periodic timer + * Own + */ + CPeriodic* iPeriodic; + + /** + * Count retry times + */ + TInt iCounter; + + /** + * Target application is running + */ + TBool iIsRunning; + + /** + * Target app is dialog + */ + TBool iIsDialog; + + + /** + * + */ + TBool iTaskKilled; +}; + +#endif // CAISCUTTARGET_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutengine.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,667 @@ +/* +* 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: Shortcut plug-in engine class. +* +*/ + + +#ifndef CAISCUTENGINE_H +#define CAISCUTENGINE_H + +#include // For MApaAppListServObserver +#include // For MMsvSessionObserver +#include // For RFavouritesDb +#include // For MFavouritesDbObserver +#include +#ifdef __WEB_WIDGETS +#include +#endif + +#include + +#include "aiscutdefs.h" +#include "taiscutparser.h" +#include "aicontentpublisher.h" + +class CCoeEnv; +class CVwsSessionWrapper; +class CActiveFavouritesDbNotifier; +class CAiScutPlugin; +class CAiScutShortcut; +class CRepository; +class CAiScutRepositoryWatcher; +class CAiScutTargetShutter; +class CKeyLockPolicyApi; + +/** + * Defines the different scenarios of shortcut access checking. + */ +enum TScutAccessCheckType +{ + EScutCheckMailbox, + EScutCheckApp, + EScutCheckBkm, + EScutCheckAll +}; + +/** + * Defines which default can be used, when daulting is needed (uninstall/mem card removed) + */ +enum TScutDefault +{ + EScutUserDefined = 0, + EScutDefaultToPlatform, + EScutDefaultToTheme +}; + +enum TScutLockKey + { + EScutFirstLockKey, + EScutSecondLockKey +}; + +/** + * Shortcut plug-in engine class. + * + * Handles most of plug-in activity. + * + * @since S60 v3.2 + */ +class CAiScutEngine : public CBase + , public MMsvSessionObserver + , public MApaAppListServObserver + , public MFavouritesDbObserver +{ + +public: + + /** + * First phase contructor. + * + * @since S60 v3.2 + * @param aPlugin Reference to the main plug-in class + */ + static CAiScutEngine* NewL(CAiScutPlugin& aPlugin); + + virtual ~CAiScutEngine(); + + // from base class MMsvSessionObserver + + /** + * Handles an event from the message server + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( + TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); + + // from base class MApaAppListServObserver + + /** + * From MApaAppListServObserver. + * Handles a change in the application list + * + * @since S60 v3.2 + * @param aEvent Event id + */ + void HandleAppListEvent(TInt aEvent); + + /** + * Resumes the engine + * + * @since S60 v3.2 + */ + virtual void ResumeL(TBool aPublishAll, TAiTransitionReason aReason); + + /** + * Suspends the engine + * + * @since S60 v3.2 + */ + void Suspend(); + + /** + * + */ + static TInt HandleShortcutsChanged(TAny* aPtr); + + /** + * + */ + static TInt HandleHiddenAppsChanged(TAny* aPtr); + + /** + * + */ + TBool IsHidden(const TUid& aAppUid) const; + + /** + * Handles an event sent by the AI framework + * + * @since S60 v3.2 + * @param aEvent Event (service) id + * @param aParam Event parameter(s) + */ + virtual void HandleAiEventL(TInt aEvent, const TDesC& aParam); + + /** + * Called by the timer. Retries the access check for shortcuts. + * + * @since S60 v3.2 + */ + void RetryAccessCheck(); + + /** + * Checks if application is midlet or widget. + * @param aUid Application uid + * @since S60 v3.2 + */ + TBool IsNonNative(const TUid& aUid); + + TBool IsHiddenFromFSW( const TUid& aAppUid ); +#ifdef __WEB_WIDGETS + /** + * Ask client session if given UID is widget. + */ + TBool IsWidget(const TUid& aUid); +#endif + + /** + * Handles call state changes (non-static version). + * + * @since S60 v3.2 + */ + void HandleCallStateChange(); + + /** + * Merges the user defined shortcuts with the defaults. + * @param aType shortcut type + * @param aRecreateAll forces the recreation of shortcuts + * @since S60 v3.2 + */ + void MergeShortcuts(TShortcutType aType, TBool aRecreateAll); + + /** + *Get Application title + */ + TBool GetAppTitle( + const TUid& aAppUid, + const TUid& aViewId, + TDes& aTitle, + TAiScutAppTitleType aType); + + /** + * Returns the application architecture server session owned by the engine + * + * @since S60 v3.2 + * @return Reference to RApaLsSession + */ + inline RApaLsSession& ApaSession(); + + /** + * Returns reference to the bookmark database owned by the engine + * + * @since S60 v3.2 + * @return Reference to RFavouritesDb + */ + inline RFavouritesDb& FavouritesDb(); + + /** + * Returns the message server session owned by the engine + * + * @since S60 v3.2 + * @return Pointer to CMsvSession + */ + inline CMsvSession* MsvSession(); + + /** + * Returns a pointer to view server session wrapper. + * + * @since S60 v3.2 + * @return Pointer to view server session wrapper + */ + inline CVwsSessionWrapper* VwsSession(); + + /** + * Returns a pointer to the coe environment + * + * @since S60 v3.2 + * @return Pointer to coe environment + */ + inline CCoeEnv* Env(); + + /** + * Creates the shortcuts merging the defaults with user defined ones. + * + * @since S60 v3.2 + */ + void CreateShortcutsL(); + +protected: + + + /** + * C++ constructor + * + * @since S60 v3.2 + * @param aPlugin Reference to the main plug-in class + */ + CAiScutEngine(CAiScutPlugin& aPlugin); + + void ConstructL(); + +protected: + + /** + * Merges the user defined shortcuts with the defaults. + * Leaving version + * @param aType shortcut type + * @param aRecreateAll forces the recreation of shortcuts + * @since S60 v3.2 + */ + void MergeShortcutsL(TShortcutType aType, TBool aRecreateAll); + + /** + * Checks shortcut accessibility. If the AppArc server or message server + * respond that they are not ready, a timer is launched to check later. + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @param aPublishAll All shortcuts are published + */ + void CheckAccessAndPublish(TInt aCheckType, TBool aPublishAll); + + /** + * Tells each shortcut to check whether or not its target is accessible. + * Shortcuts will revert to the default setting if the user setting is + * not accessible. + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @param aPublishAll All shortcuts are published + */ + void CheckAccessAndPublishL(TInt aCheckType, TBool aPublishAll); + + /** + * Finds the shortcut object with the given id + * + * @since S60 v3.2 + * @param aId Shortcut id + * @return Shortcut index or KErrNotFound + */ + TInt FindShortcutIndex(TInt32 aId); + + /** + * Handles the shortcut launch by index. + * + * @since S60 v3.2 + * @param aParam Index of the shortcut to launch + */ + void HandleLaunchByIndexL(const TDesC& aParam); + + /** + * Handles the special launching of a shortcut. The + * launching can be done based on the location of + * the shortcut (sk, toolbar item etc) or based on the + * application it points to. Currently when this function is + * called to a shortcut that points to appshell the fastswap + * window is opened + * + * @since s60 v5.0 + * @param aParam Index of the shortcut to perform the special launch + */ + void HandleLaunchByIndexAlternateL(const TDesC& aParam); + /** + * Handles the shortcut launch by value + * + * @since S60 v3.2 + * @param aParam Value of the shortcut to launch + */ + void HandleLaunchByValueL(const TDesC& aParam); + + /** + * Shows the plug-in settings dialog. + * + * @since S60 v3.2 + */ + void ShowSettingsL(const TDesC& aParam); + + /** + * Shows the plug-in setting. + * + * @since S60 v5.0 + */ + void ShowSettingL(const TDesC& aParam); + + /** + * Opens the fast swap window + * + * @since S60 v5.0 + */ + void OpenFastSwap(); + /** + * Handles PS commands from WSPlugin. + * + * @since S60 v3.2 + */ + static TInt HandlePSCommand(TAny* aAny); + + /** + * Handles call state changes. + * + * @since S60 v3.2 + */ + static TInt CallStateChangeCallback(TAny* aPtr); + + /** + * Callback for delay timer + */ + static TInt DelayTimerCallBack(TAny *aSelf ); + + + /** + * Get soft key uid + * + * @since S60 v3.2 + * @param aSoftkeyId shortcut index + */ + TUid SoftkeyUid(TUint32 aSoftkeyId); + + /** + *Check softkey delay is required + * + * @since S60 v3.2 + * @param AppUid application uid + */ + TBool IsDelayRequired(TUid aAppUid); + + /** + * Handles PS commands from WSPlugin (leaving version). + * + * @since S60 v3.2 + */ + void DoHandlePSCommandL(); + + /** + * Activates phone/video call application + * + * @since S60 v3.2 + */ + void ActivateTopMostApp(); + + /** + * Check MsvSession is Needed + */ + TBool IsMsvSessionNeeded(); + + /** + * Check Bookmark Observer is Needed + */ + TBool IsBookmarkObserverNeeded(); + + /** + * Load application titles list + */ + void LoadAppTitleListL(); + + /** + * Get hidden applications + */ + void GetHiddenAppsL(); + + void CheckForThemeDefaultReinstalledL(); + + TBool IsLockKey( TInt aScanCode, TScutLockKey aLockKey ) const; + + TInt AddOverrideIcon( TAiScutIcon &aIcon ); + + /** + * Starts a delay timer that calls HandleLaunchByIndexL() after + * a short delay. Delay is read from cenrep with the key KAIKeyLockTimeout + * + * @param aParam The parameter to pass to HandleLaunchByIndexL() + * + */ + void DelayedLaunchByIndexL( const TDesC &aParam ); +private: // From MFavouritesDbObserver + + /** + * Handles database event. + * @param aEvent Database event. + */ + void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); + +protected: // data + + /** + * Shortcut objects. + * Own. + */ + RAiShortcutArray iShortcuts; + + /** + * Shortcut objects for storing theme default scuts. + * Own. + */ + RAiShortcutInfoArray iThemeShortcuts; + + /** + * Flags for shortcuts to indicate whether platform or theme default is used. + */ + RArray iDefaultUsed; + + /** + * Central Repository session. + * Own. + */ + CRepository* iRepository; + + /** + * Notifier for changes in the application list + * (installations / uninstallations). + * Own. + */ + CApaAppListNotifier* iAppNotifier; + + /** + * Notifier for changes in the shortcut settings. + * Own. + */ + CAiScutRepositoryWatcher* iSettingsNotifier; + + /** + * Message server session. + * Own. + */ + CMsvSession* iMsvSession; + + /** + * Timer that performs the availability check after a given delay. + * Own + */ + CPeriodic* iTimer; + + /** + * Reference to the plug-in. + * Not own. + */ + CAiScutPlugin& iPlugin; + + /** + * Application architecture server session. + */ + RApaLsSession iApaSession; + + /** + * Bookmark database session. + * Own. + */ + RFavouritesSession iBookmarkSess; + + /** + * Bookmark database. + * Own. + */ + RFavouritesDb iBookmarkDb; + + /** + * Bookmark database change observer. + * Own. + */ + CActiveFavouritesDbNotifier* iBookmarkDbObserver; + + /** + * View server session wrapper. + * Own + */ + CVwsSessionWrapper* iVwsSession; + + /** + * Flag to indicate that all shortcus are to be published. Used when resuming. + */ + TBool iPublishAll; + + /** + *Call key event observer + * Own + */ + MAiPSPropertyObserver* iKeyEventObserver; + + /** + * Call state PS observer. + * Own. + */ + MAiPSPropertyObserver* iCallStateObserver; + + /** + * Call state + */ + TBool iActiveCall; + + /** + * First keylock key + */ + TInt iFirstLockKey; + + /** + * First keylock key pressed flag to ensure first lock has been + * pressed when skipping key lock. Enabling the correct response to + * skip command. + */ + TBool iFirstLockKeyPressed; + + /** + * Second keylock key + */ + TInt iSecondLockKey; + + /** + * Resource loader for common text resources. + */ + RConeResourceLoader iResourceLoaderTexts; + + /** + * Resource loader for sendui text resources. + */ + RConeResourceLoader iResourceLoaderSendUi; + + /** + * Coe environment. + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Array of UIDs which are hidden from the TARM + */ + RArray iHiddenApps; + + /** + * Central repository object for Hidden Apps + * Own + */ + CRepository* iHiddenAppsRepository; + + /** + * Central repository change handler for Hidden Apps + * Own + */ + CAiScutRepositoryWatcher* iHiddenAppsNotifier; + + /** + * Application titles list + */ + RArray iAppTitleList; + + /** + * Own + */ + CAiScutTargetShutter* iScutShutter; + + /** + * + */ + TBool iSoftkeyAppRunning; + +#ifdef __WEB_WIDGETS + /** + * Widget registry client session to check if UID means widget. + */ + RWidgetRegistryClientSession iWidgetRegistry; + TBool iWidgetRegistryConnected; +#endif + /** + * for parsing the icon overrides and softkeys + */ + TAiScutParser iParser; + + /** + * Override icons and softkeyicons are held here + */ + RArray iIcons; + + /** + * For checking keylock buttons + * Own + */ + CKeyLockPolicyApi *iKeylockApi; + /** + * Timer user to delay the launching + * of specific shortcuts. + * Own + */ + CPeriodic *iDelayTimer; + + /** + * Command passed to HandleLaunchByIndexL() + * when delayed launching is used + * Own + */ + HBufC *iDelayedLaunchCmd; + + /** + * Delayed launching delay. Read from cenrep + */ + TInt iDelayTimerDelay; +}; + +#include "caiscutengine.inl" + +#endif // CAISCUTENGINE_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutengine.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutengine.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,64 @@ +/* +* 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: Inline functions for the shortcut plug-in engine +* +*/ + + +// --------------------------------------------------------------------------- +// Returns the application architecture server session owned by the engine. +// --------------------------------------------------------------------------- +// +inline RApaLsSession& CAiScutEngine::ApaSession() +{ + return iApaSession; +} + +// --------------------------------------------------------------------------- +// Returns reference to the bookmark database owned by the engine. +// --------------------------------------------------------------------------- +// +inline RFavouritesDb& CAiScutEngine::FavouritesDb() +{ + return iBookmarkDb; +} + +// --------------------------------------------------------------------------- +// Returns the message server session owned by the engine. +// --------------------------------------------------------------------------- +// +inline CMsvSession* CAiScutEngine::MsvSession() +{ + return iMsvSession; +} + +// --------------------------------------------------------------------------- +// Returns a pointer to view server session wrapper. +// --------------------------------------------------------------------------- +// +inline CVwsSessionWrapper* CAiScutEngine::VwsSession() +{ + return iVwsSession; +} + +// --------------------------------------------------------------------------- +// Returns a pointer to the coe environment +// --------------------------------------------------------------------------- +// +inline CCoeEnv* CAiScutEngine::Env() +{ + return iEnv; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutengineext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutengineext.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,118 @@ +/* +* 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: Shortcut plug-in engine extension +* +*/ + + +#ifndef CAISCUTENGINEEXT_H +#define CAISCUTENGINEEXT_H + +#include + +#include "caiscutengine.h" +#include "maiscutextmessagehandler.h" +#include "caiscutshortcutext.h" + +class CAiScutPlugin; +class CAiScutExtServer; +class CAiScutExtDataModel; + +/** + * The class extends CAiScutEngine by handling events from + * xSP extension server. + * + * @since S60 v3.2 + */ +class CAiScutEngineExt : public CAiScutEngine, + public MAiScutExtMessageHandler + { + public: + /** + * Factory function + * @see CAiScutEngine + * @since S60 v3.2 + */ + static CAiScutEngineExt* NewL( CAiScutPlugin& aPlugin ); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutEngineExt(); + + private: + /** + * Constructor + * @see CAiScutEngine + * @since S60 v3.2 + */ + CAiScutEngineExt( CAiScutPlugin& aPlugin ); + + void ConstructL(); + + public: // New functions + /** + * Publishes specific shortcut + * @since S60 v3.2 + */ + void CheckAccessAndPublish( CAiScutShortcut& aShortcut ); + + private: // From CAiScutEngine + void HandleAiEventL( TInt aEvent, const TDesC& aParam ); + void ResumeL( TBool aPublishAll, TAiTransitionReason aReason ); + + private: // From MAiScutExtMessageHandler + void HandleSetPopupLineArrayL( const TDesC& aDefinition, CDesCArray* aLineArray ); + void HandleResetPopupLineArrayL( const TDesC& aDefinition ); + void HandleSetIconL( const TDesC& aDefinition, CGulIcon* aIcon ); + void HandleResetIconL( const TDesC& aDefinition ); + TBool HandleIsInShortcutsL( const TDesC& aDefinition ) const; + void HandleIssuePutInShortcutsL( const TDesC& aDefinition ); + + private: // New functions + /** + * Finds a shortcut of which id matches with given. + * @param aId Target id in hexadecimal string format + * @return Pointer to shortcut or NULL if not found + */ + CAiScutShortcutExt* FindShortcutById( const TDesC& aId ) const; + + /** + * Iterates shortcuts and sets new extension data to matching + * ones. + * @param aDefinition Definition + * @param aAiScutExtData Pointer to extension data or NULL + * @return ETrue if matching shortcut(s) found + */ + TBool PopulateExtData( const TDesC& aDefinition, + const MAiScutExtData* aAiScutExtData ); + + private: // data + /** + * xSP extension server instance + * Own. + */ + CAiScutExtServer* iAiScutExtServer; + + /** + * Extension data model + * Own. + */ + CAiScutExtDataModel* iExtDataModel; + }; + +#endif // CAISCUTENGINEEXT_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutextdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutextdata.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* 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: +* +*/ + + +#ifndef CAISCUTEXTDATA_H +#define CAISCUTEXTDATA_H + +#include +#include + +#include "maiscutextdata.h" + +class CGulIcon; + +/** + * @since S60 v3.2 + */ +class CAiScutExtData : public CBase, + public MAiScutExtData + { + public: + /** + * Factory function + * @since S60 v3.2 + */ + static CAiScutExtData* NewL( const TDesC& aTargetDefinition ); + + + /** + * Factory function + * @since S60 v3.2 + */ + static CAiScutExtData* NewLC( const TDesC& aTargetDefinition ); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutExtData(); + + private: + /** + * Constructor + * @see CAiScutEngine + * @since S60 v3.2 + */ + CAiScutExtData(); + + void ConstructL( const TDesC& aTargetDefinition ); + + public: // New functions + /** + * @since S60 v3.2 + */ + const TDesC& TargetDefinition() const; + + /** + * Deletes old and stores new popup line array + * @param aPopupLineArray Popup line array. Ownership is transferred. + * @since S60 v3.2 + */ + void SwitchPopupLineArray( CDesCArray* aPopupLineArray ); + + /** + * @since S60 v3.2 + */ + void ResetPopupLineArray(); + + /** + * Deletes old and stores new icon + * @param aIcon Icon. Ownership is transferred. + * @since S60 v3.2 + */ + void SwitchIcon( CGulIcon* aIcon ); + + /** + * @since S60 v3.2 + */ + void ResetIcon(); + + public: //From MAiScutExtData + const MDesCArray* PopupLineArray() const; + const CGulIcon* Icon() const; + + private: // data + + /** + * Definition string of the target shortcut + * Own. + */ + HBufC* iTargetDefinition; + + /** + * Popup line array + * Own. + */ + CDesCArray* iPopupLineArray; + + /** + * Icon + * Own. + */ + CGulIcon* iIcon; + }; + +#endif // CAISCUTEXTDATA_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutextdatamodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutextdatamodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,134 @@ +/* +* 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: Shortcut plug-in extension data model +* +*/ + + +#ifndef CAISCUTEXTDATAMODEL_H +#define CAISCUTEXTDATAMODEL_H + +#include +#include + +class CGulIcon; +class CAiScutExtData; + +/** + * This class owns an array of CAiScutExtData items and provides an API to + * update popup line array and icon data for different targets. + * @since S60 v3.2 + */ +class CAiScutExtDataModel : public CBase + { + private: + friend class T_CAiScutExtDataModel; + + public: + /** + * Factory function + * @since S60 v3.2 + */ + static CAiScutExtDataModel* NewL(); + + + /** + * Factory function + * @since S60 v3.2 + */ + static CAiScutExtDataModel* NewLC(); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutExtDataModel(); + + private: + /** + * Constructor + * @see CAiScutEngine + * @since S60 v3.2 + */ + CAiScutExtDataModel(); + + void ConstructL(); + + public: // New functions + /** + * Sets the new popup line array for target. The old one is deleted. If + * matching target definition is not found new CAiScutExtData object is + * created. + * @param aDefinition Target definition string + * @param aLineArray Pointer to line array. Ownership is transferred + * @return Pointer to new or existing CAiScutExtData object + * @since S60 v3.2 + */ + CAiScutExtData* SetPopupLineArrayL( const TDesC& aDefinition, CDesCArray* aLineArray ); + + /** + * Resets popup line array. If also the icon is not set the CAiScutExtData + * item is deleted and removed from the array. + * @param aDefinition Target definition string + * @since S60 v3.2 + */ + CAiScutExtData* ResetPopupLineArray( const TDesC& aDefinition ); + + /** + * Sets the new icon for target. The old one is deleted. If + * matching target definition is not found new CAiScutExtData object is + * created. + * @param aDefinition Target definition string + * @param aIcon Pointer to icon. Ownership is transferred + * @return Pointer to new or existing CAiScutExtData object + * @since S60 v3.2 + */ + CAiScutExtData* SetIconL( const TDesC& aDefinition, CGulIcon* aIcon ); + + /** + * Resets icon. If also the popup line array is not set the CAiScutExtData + * item is deleted and removed from the array. + * @param aDefinition Target definition string + * @since S60 v3.2 + */ + CAiScutExtData* ResetIcon( const TDesC& aDefinition ); + + /** + * @return Array of CAiScutExtData objects + * @since S60 v3.2 + */ + TArray AiScutExtDataArray() const; + + /** + * Deletes CAiScutExtData object and removes it from the array. + * @param aDefinition Target definition string + * @since S60 v3.2 + */ + void RemoveAiScutExtData( const TDesC& aDefinition ); + + private: // New functions + TInt FindAiScutExtData( const TDesC& aDefinition ) const; + CAiScutExtData* CreateAiScutExtDataL( const TDesC& aDefinition ); + + private: // data + /** + * Shortcut extension data items + * Own. + */ + RPointerArray iAiScutExtDataArray; + }; + +#endif // CAISCUTEXTDATAMODEL_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutextserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutextserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,177 @@ +/* +* 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: Shortcut plug-in xSP extension server class. +* +*/ + + +#ifndef CAISCUTEXTSERVER_H +#define CAISCUTEXTSERVER_H + +#include +#include + +#include "maiscutextmessagehandler.h" +#include "aicontentpublisher.h" + +class CAiScutExtServer; +class CAknMessageQueryDialog; + +/** + * + * Helper class for passing parameters to the callback function. + * + * @since S60 v3.2 + */ +class CLinkParams : public CBase + { + public: + + CLinkParams(CAiScutExtServer& aServer, HBufC* aTargetDefinition); + + ~CLinkParams(); + + public: + + /** + * Reference to the server object. + * Ref. + */ + CAiScutExtServer& iServer; + + /** + * Application identifier. + * Own. + */ + HBufC* iTargetDefinition; + + /** + * The dialog that owns the link.. + * Ref. + */ + CAknMessageQueryDialog* iNote; + }; + +/** + * Server class for xSP extensions. + * + * Handles sessions. + * + * @since S60 v3.2 + */ +class CAiScutExtServer : public CServer2 + { + public: + /** + * Constructor + * @param aObserver Reference to observer + * @since S60 v3.2 + */ + CAiScutExtServer( MAiScutExtMessageHandler& aObserver, RWsSession& aWsSession ); + + /** + * 2nd-phase constructor + * @since S60 v3.2 + */ + void ConstructL(); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutExtServer(); + + private: // From CServer2 + + CSession2* NewSessionL( + const TVersion& aVersion, const RMessage2& aMessage ) const; + + private: // New methods + + void ReadAppListL(); + + void WriteAppListL(); + + static TInt LinkCallBack(TAny* aParam); + + static TInt IdleCallBack(TAny* aParam); + + void DoShowTipMessageL(); + + public: + + TBool HasConnectedBefore( TUid& aUid, const RMessage2& aMessage ); + + void ShowTipMessage( TUid aUid ); + + void ResumeL( TAiTransitionReason aReason ); + + private: // data + + /** + * Reference to observer + * Ref. + */ + MAiScutExtMessageHandler& iObserver; + + /** + * Reference to Window Server session + * Ref. + */ + RWsSession& iWsSession; + + /** + * List of applications we are not going to + * show the tip dialog. + * Own. + */ + RArray iUids; + + /** + * List of applications to show the dialog. + * + * Own. + */ + RArray iShowUids; + + /** + * Resource offset for releasing the resoruce on destruction. + * + * Own. + */ + TInt iResourceOffset; + + /** + * CIdle for the tip dialog + * + * Own. + */ + CIdle* iIdle; + + /** + * Foreground/background indication + * + */ + TBool iIsForeground; + + /** + * Tip message visible indication + * + */ + TBool iIsTipMessageVisible; + }; + +#endif // CAISCUTEXTSERVER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutextsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutextsession.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,82 @@ +/* +* 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: Shortcut plug-in xSP extension session class. +* +*/ + + +#ifndef CAISCUTEXTSESSION_H +#define CAISCUTEXTSESSION_H + +#include + +class MAiScutExtMessageHandler; + +/** + * Server session class for xSP extensions. + * + * Handles IPC between server and client. Commands and data are passed to + * observer. + * + * @since S60 v3.2 + */ +class CAiScutExtSession : public CSession2 + { + public: + /** + * Constructor + * @param aObserver Reference to observer + * @since S60 v3.2 + */ + CAiScutExtSession( MAiScutExtMessageHandler& aObserver ); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutExtSession(); + + private: // From CSession2 + void ServiceL( const RMessage2& aMessage ); + void DispatchMessageL( const RMessage2& aMessage ); + + private: // New functions + void SetTargetDefinitionL( const RMessage2& aMessage ); + void SetPopupTextL( const RMessage2& aMessage ); + void ResetPopupTextL( const RMessage2& aMessage ); + void SetIconL( const RMessage2& aMessage ); + void ResetIconL( const RMessage2& aMessage ); + void IsInShortcutsL( const RMessage2& aMessage ); + void IssuePutInShortcutsL( const RMessage2& aMessage ); + + void PanicClient( const RMessage2& aMessage, TInt aPanicCode ) const; + + private: // data + + /** + * Reference to observer + * Ref. + */ + MAiScutExtMessageHandler& iObserver; + + /** + * Target definition + * Own. + */ + HBufC* iTargetDefinition; + }; + +#endif // CAISCUTEXTSESSION_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,231 @@ +/* +* 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: Plug-in main class +* +*/ + + +#ifndef CAISCUTPLUGIN_H +#define CAISCUTPLUGIN_H + +#include +#include +#include +#include + +class CAiScutEngine; +class MAiContentObserver; +class MAiContentItemIterator; +class CAiScutShortcut; + +/** + * Plug-in main class + * + * @since S60 v3.2 + */ +class CAiScutPlugin : public CAiContentPublisher + , public MAiPropertyExtension + , public MAiEventHandlerExtension +{ + +public: // factory methods and destructor. + + static CAiScutPlugin* NewL(); + + virtual ~CAiScutPlugin(); + +public: // new methods + + /** + * Publishes the given shortcut + * + * @since S60 v3.2 + * @return Reference to a shortcut to publish + */ + void PublishShortcutsL(RAiShortcutArray& aShortcuts); + + /** + * + */ + TBool IsAlive() const; + + /** + * @return Resume reason + */ + TAiTransitionReason ResumeReason() const; + +public: // methods from base classes + + // from base class CAiContentPublisher + + void Resume(TAiTransitionReason aReason); + + void Suspend(TAiTransitionReason aReason); + + void Stop(TAiTransitionReason aReason); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @since S60 3.2 + * @param aObserver content observer to register. + */ + void SubscribeL(MAiContentObserver& aObserver); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plug-in shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @since S60 3.2 + * @param aSettings setting items defined in the UI definition. + */ + void ConfigureL(RAiSettingsItemArray& aSettings); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @since S60 3.2 + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension(TUid aUid); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + + /** + * Invoked by the framework for querying if plugin has menu item + * + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + +// Online/Offline - web widgets + TBool HasMenuItem(const TDesC16& aMenuItem); + + // from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + * @since S60 3.2 + */ + TAny* GetPropertyL(TInt aProperty); + + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + * @since S60 3.2 + */ + void SetPropertyL(TInt aProperty, TAny* aValue); + +protected: + +private: + + CAiScutPlugin(); + + void ConstructL(); + + void DoResumeL(TAiTransitionReason aReason); + + void FreeEngine(); + + void DeleteDefaultShortcutsL(); + + +private: // data + + /** + * Iterator for plug-in content. + * Own. + */ + MAiContentItemIterator* iContent; + + /** + * Iterator for plug-in resources. + * Own. + */ + MAiContentItemIterator* iResources; + + /** + * Iterator for plug-in events. + * Own. + */ + MAiContentItemIterator* iEvents; + + /** + * Plug-in engine + * Own. + */ + CAiScutEngine* iEngine; + + /** + * Array of content observers + * Not own. + */ + RPointerArray iObservers; + + /** + * Information about the content publisher ( this plug-in ). + */ + TAiPublisherInfo iInfo; + + /** + * Plug-in state, suspended or alive. + */ + TBool iAlive; + + /** + * Resume reason + */ + TAiTransitionReason iResumeReason; + + TBool iForcePublishAll; +}; + +#endif // CAISCUTPLUGIN_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettings.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,178 @@ +/* +* 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: Shortcut settings plug-in main class. +* +*/ + + +#ifndef CAISCUTSETTINGS_H +#define CAISCUTSETTINGS_H + +#include + +class CAiScutSettingsContainer; +class CAiScutSettingsModel; + +/** + * Shortcut settings plug-in main class + * + * @lib aiscutsettings.lib + * @since S60 v3.2 + */ +class CAiScutSettings : public CGSBaseView +{ + +public: + + static CAiScutSettings* NewL(TAny* aInitParams); + + virtual ~CAiScutSettings(); + + // from base class CAknView + + /** + * From CAknView + * Returns view id. + * + * @since S60 3.2 + * @return TUid + */ + TUid Id() const; + + /** + * From CAknView + * Handles commands. + * + * @since S60 3.2 + * @param aCommand Command to be handled. + */ + void HandleCommandL(TInt aCommand); + + /** + * See base class in AknView.h + */ + void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage); + + /** + * See base class. + */ + void DoDeactivate(); + + // from base class CGSPluginInterface + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + */ + void GetCaptionL(TDes& aCaption) const; + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + */ + TInt PluginProviderCategory() const; + + /** + * From CGSPluginInterface + * + * @since S60 3.2 + * @see CGSPluginInterface header file. + */ + TBool Visible() const; + + // from base class CGSBaseView + + /** + * From CGSBaseView + * + * @since S60 3.2 + * Returns the container this view has. + * @return pointer to container, does not transfer ownership. + */ + CAiScutSettingsContainer* Container(); + + /** + * See base class + */ + void HandleForegroundEventL(TBool aForeground); + + /** + * Check if view is activate + * @since S60 5.1 + * @return ETrue if activated, EFalse otherwise + */ + TBool Activated() const; + +protected: + +private: // From MEikMenuObserver + + /** + * Changes MenuPane dynamically + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + +private: + + CAiScutSettings(); + + void ConstructL(); + + + // from base class CGSBaseView + + /** + * From CGSBaseView + * Functionality for creating a container. Called by DoActivateL(). + */ + void NewContainerL(); + + /** + * From CGSBaseView + * Handles listbox selection. Called by HandleListBoxEventL. + * Implement by sub-class. + */ + void HandleListBoxSelectionL(); + + static TInt DoHandleListBoxSelectionL( TAny* aAny ); + + +private: // data + + /** + * Settings plug-in model. + * Own. + */ + CAiScutSettingsModel* iModel; + + /** + * Resource loader for common text resources. + */ + RConeResourceLoader iResourceLoaderTexts; + + /*** + * Idle timer to delay event handling + * Own. + */ + CIdle* iListBoxTimer; + +}; + +#endif // CAISCUTSETTINGS_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingsapplist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingsapplist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,553 @@ +/* +* 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: Application list for settings listbox. +* +*/ + + +#ifndef CAISCUTSETTINGSAPPLIST_H +#define CAISCUTSETTINGSAPPLIST_H + +#include +#include // For MDesCArray +#include // For RApaLsSession +#include // For MMsvSessionObserver +#include // For MApaAppListServObserver +#include "aiscutsettings.hrh" // For TAiScutSettingType + +class CAiScutSettingsItem; +class CCoeEnv; + +/** + * Shortcut definition parameter for theme change shortcut. + */ +_LIT( KScutParamChangeTheme, "view=0x102750A7" ); + +/** + * Shortcut definition parameter for messaging. New message + */ +_LIT( KScutParamNewMsg, "new=msg" ); + +/** + * Shortcut definition parameter for messaging. New email + */ +_LIT( KScutParamNewEmail, "new=email" ); + +/** + * Shortcut definition parameter for messaging. New syncml mail + */ +_LIT( KScutParamNewSyncMLMail, "new=syncmlmail" ); + +/** + * Shortcut definition parameter for messaging. New postcard + */ +_LIT( KScutParamNewPostcard, "new=postcard" ); + +/** + * Shortcut definition parameter for messaging. New audio message + */ +_LIT( KScutParamNewAudioMsg, "new=audiomsg" ); + +/** + * Shortcut definition parameter for messaging. Select message type + */ +_LIT( KScutParamSelectMsgType, "new" ); + +/** + * Shortcut definition parameter for messaging. Remote mailbox + */ +_LIT( KScutParamMailbox, "mailbox=" ); + +/** + * Shortcut definition parameter for general settings. Connectivity view + */ +_LIT( KScutParamConnectivityView, "view=0x10207250" ); + +/** + * Shortcut definition parameter for general settings. Installations view + */ +_LIT( KScutParamInstallationsView, "view=0x10283321" ); + + +/** + * Observer interface for application list events + * + * @since S60 v3.2 + */ +class MAiScutListObserver +{ +public: + + /** + * AppList event codes + */ + enum TScutListEvent + { + EAppListReady, + EAppListUpdated, + EBkmListUpdated + }; + + /** + * Callback for application list events + * + * @since S60 v3.2 + * @param aEvent AppList event code + * @param aAdded ETrue if applications were added, EFalse if removed + */ + virtual void HandleScutListEventL( TScutListEvent aEvent, TBool aAdded ) = 0; + + virtual TBool IsHidden(const TUid& aAppUid) const = 0; + +}; + + +/** + * Application list for settings listbox + * + * @since S60 v3.2 + */ +class CAiScutSettingsAppList : public CActive + , public MDesCArray + , public MMsvSessionObserver + , public MApaAppListServObserver +{ + +public: + + static CAiScutSettingsAppList* NewL( CCoeEnv* aEnv, MAiScutListObserver& aObserver ); + + virtual ~CAiScutSettingsAppList(); + + // from base class MDesCArray + + /** + * From MDesCArray + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * From MDesCArray + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within a descriptor array. + * @return A 16 bit non-modifiable pointer descriptor representing the descriptor + * element located at position aIndex within a descriptor array. + */ + TPtrC MdcaPoint( TInt aIndex ) const; + + // from base class MMsvSessionObserver + + /** + * Handles an event from the message server. + * Not used, but must be defined to be able to use the messaging server. + * + * @since S60 v3.2 + * @param aEvent Indicates the event type. + * @param aArg1 Event type-specific argument value + * @param aArg2 Event type-specific argument value + * @param aArg3 Event type-specific argument value + */ + void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); + + // from base class MApaAppListServObserver + + /** + * From MApaAppListServObserver + * Handles a change in the application list + * + * @since S60 v3.2 + * @param aEvent Event id + */ + void HandleAppListEvent( TInt aEvent ); + + /** + * Starts the asynchronous appliation list initialization + * + * @since S60 v3.2 + */ + void StartL(); + + /** + * Checks if the application list is ready to be shown + * + * @since S60 v3.2 + * @return ETrue if ready, EFalse if not + */ + TBool IsReady() const; + + /** + * Tells the application list to start or stop observing for changes + * + * @since S60 v3.2 + * @param aObserving ETrue if changes should be observed, EFalse if not + */ + void SetObservingL( TBool aObserving ); + + /** + * Finds the index of the given settings item in the application list + * + * @since S60 v3.2 + * @param aItem Setting item to find + * @return Index of the setting item in the application list + */ + TInt FindIndex( CAiScutSettingsItem& aItem ); + + /** + * Returns target application data from the given index + * + * @since S60 v3.2 + * @param aIndex Index of the application in the list + * @param aUid On return, the application uid + * @param aParams On return, the application parameters + * @param aCaption On return, the application caption + * @param aType On return, the application type (app or url) + * @return KErrNotFound if the application cannot be found, KErrNone otherwise + */ + TInt GetDataByIndex( TInt aIndex, TUid& aUid, TPtrC& aParams, TPtrC& aCaption, TAiScutSettingType& aType ) const; + + /** + * Adds extra list items to the application list. + * For example "No Effect" item is added here. + * + * @since S60 v3.2 + */ + void AddExtraItemsL(); + + /** + * Removes extra list items from the application list. + * + * @since S60 v3.2 + */ + void RemoveExtraItemsL(); + +protected: + +private: + + CAiScutSettingsAppList( CCoeEnv* aEnv, MAiScutListObserver& aObserver ); + + void ConstructL(); + + // from base class CActive + + /** + * From CActive + * Implements cancellation of an outstanding request. + * + * @since S60 v3.2 + */ + void DoCancel(); + + /** + * From CActive + * Performs one step of the app list initialization + * + * @since S60 v3.2 + */ + void RunL(); + + /** + * From CActive + * Handles an error situation + * + * @since S60 v3.2 + * @param aError Error code received from system + * @return Error code after error handling + */ + TInt RunError( TInt aError ); + + /** + * Completes own request status to make sure active scheduler + * calls RunL again. + * + * @since S60 v3.2 + */ + void CompleteSelf(); + + /** + * Adds an application to the list + * + * @since S60 v3.2 + * @param aAppInfo Application information object + */ + void AddApplicationL( TApaAppInfo& aAppInfo ); + + /** + * Adds the static list items to the application list. + * For example "New Message" and "New Email" items are added here. + * + * @since S60 v3.2 + */ + void AddStaticItemsL(); + + /** + * Finds all mailboxes defined in the device + */ + CMsvEntry* GetRootEntryL(); + + /** + * Adds remote mailboxes to the application list. + * + * @since S60 v3.2 + */ + void AddMailboxesL(); + + /** + * Adds a mailbox to the list + * + * @since S60 v3.2 + * @param aMailbox Name of the mailbox to add + */ + void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId ); + + /** + * Removes a mailbox from the list + * + * @since S60 v3.2 + * @param aMailboxParam Parameter string of the mailbox to remove + */ + void RemoveMailboxL( const TDesC& aMailboxParam ); + + /** + * Adds extra application to applist from central repository + * + * @since S60 v3.2 + */ + void AddExtraItemsFromCRL(); + + TBool IsBannedUid(TUid aUid); + + /** + * Gets the next valid application from application architecture server. + * Valid applications are non-hidden ones + * + * @since S60 v3.2 + * @param aAppInfo Application information of the next valid application + * @return Error code from RApaLsSession or one of system wide errors + */ + TInt GetNextValidApp( TApaAppInfo& aAppInfo ); + + /** + * Updates the application list + * + * @since S60 v3.2 + */ + void UpdateAppListL(); + + /** + * Figures out which application is missing from the list and adds it + * + * @since S60 v3.2 + * @param aCount Amount of applications to add + */ + void AddInstalledAppToListL( TInt aCount ); + + /** + * Figures out which application should not be in the list and removes it + * + * @since S60 v3.2 + * @param aCount Amount of applications to remove + */ + void RemoveUninstalledAppFromListL( TInt aCount ); + + /** + * Checks if application is midlet. + * @param aUid Application uid + * @since S60 v3.2 + */ + TBool IsNonNative(const TUid& aUid); + + /** + * Checks if application is located in ROM. + * @param aUid Application uid + * @since S60 v5.0 + */ + TBool IsInRom( const TUid& aUid ); + + +private: + + /** + * Nested class to store individual application list items + * + * @since S60 v3.2 + */ + class CAppListItem : public CBase + { + public: + + static CAppListItem* NewLC( TUid aUid, const TDesC& aCaption ); + + ~CAppListItem(); + + /** + * Compare method used to add the items to the list in sorted order + * + * @since S60 v3.2 + * @param aFirst The first item to be compared + * @param aSecond The second item to be compared + * @return Negative if first comes before second, zero if equal and + * positive if first comes after second + */ + static TInt CompareCaption( const CAppListItem& aFirst, + const CAppListItem& aSecond ); + + /** + * Returns the item target application uid + * + * @since S60 v3.2 + * @return Target application uid + */ + TUid Uid() const; + + /** + * Returns the item target application caption + * + * @since S60 v3.2 + * @return Target application caption + */ + TPtrC Caption() const; + + /** + * Returns the possible parameters for item target + * + * @since S60 v3.2 + * @return Item target parameters + */ + TPtrC Params() const; + + /** + * Sets the parameters for the item target + * + * @since S60 v3.2 + * @param aParams Parameters for item target + */ + void SetParamsL( const TDesC& aParams ); + + /** + * Sets the type for the item target + * + * @since S60 v3.2 + * @param aType The item target type + */ + void SetType( TAiScutSettingType aType ); + + /** + * Returns the type of this item target + * + * @since S60 v3.2 + * @return Item type + */ + TAiScutSettingType Type() const; + private: + + CAppListItem( TUid aUid ); + + void ConstructL( const TDesC& aCaption ); + + private: // data + + /** + * Target application uid + */ + TUid iUid; + + /** + * Target application caption + */ + HBufC* iCaption; + + /** + * Target application parameters + */ + HBufC* iParams; + /** + * Is this setting a application or URL. + * Needed for URLs added from cenrep + */ + TAiScutSettingType iType; + + }; + +private: // data + + /** + * List of application items + * Own. + */ + RPointerArray iListItems; + + /** + * Application architecture server session + * Own. + */ + RApaLsSession iApaSession; + + /** + * Message server session + * Own. + */ + CMsvSession* iMsvSession; + + /** + * Notifier for changes in the application list + * ( installations / uninstallations ) + * Own. + */ + CApaAppListNotifier* iAppNotifier; + + /** + * Amount of all applications in the device + */ + TInt iTotalAppCount; + + /** + * List of mailbox items. Points to iListItems. + * DO NOT DELETE THROUGH THIS! + * Own. + */ + RPointerArray iMailboxes; + + /** + * Flag indicating if the asynchronous application list generation is ready + */ + TBool iReady; + + /** + * Pointer to the control environment + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Registered observer for application list events + */ + MAiScutListObserver& iObserver; + + /** + * A flag indicating if the app list should observe changes + */ + TBool iObserving; + +}; + +#endif // CAISCUTSETTINGSAPPLIST_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingsbkmlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingsbkmlist.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,269 @@ +/* +* 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: Bookmark list for settings listbox. +* +*/ + + +#ifndef CAISCUTSETTINGSBKMLIST_H +#define CAISCUTSETTINGSBKMLIST_H + +#include +#include // For MDesCArray +#include // For MFavouritesDbObserver + +class CCoeEnv; +class CActiveFavouritesDbNotifier; +class CAiScutSettingsItem; +class CAiScutSettingsModel; + +/** + * Bookmark list for settings listbox + * + * @since S60 v3.2 + */ +class CAiScutSettingsBkmList : public CBase + , public MDesCArray + , public MFavouritesDbObserver +{ + +public: + + static CAiScutSettingsBkmList* NewL( + CCoeEnv* aEnv, + CAiScutSettingsModel* aModel, + MAiScutListObserver& aObserver); + + virtual ~CAiScutSettingsBkmList(); + + // from base class MDesCArray + + /** + * From MDesCArray + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * From MDesCArray + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within a descriptor array. + * @return A 16 bit non-modifiable pointer descriptor representing the descriptor + * element located at position aIndex within a descriptor array. + */ + TPtrC MdcaPoint(TInt aIndex) const; + + /** + * Gets the bookmark list. + * + * @since S60 v3.2 + */ + void GetBookmarkListL(); + + /** + * Tells the bookmark list to start or stop observing for changes + * + * @since S60 v3.2 + * @param aObserving ETrue if changes should be observed, EFalse if not + */ + void SetObservingL(TBool aObserving); + + /** + * Finds the index of the given settings item in the bookmark list + * + * @since S60 v3.2 + * @param aItem Setting item to find + * @return Index of the setting item in the bookmark list + */ + TInt FindIndex(CAiScutSettingsItem& aItem); + + /** + * Returns target bookmark data from the given index + * + * @since S60 v3.2 + * @param aIndex Index of the bookmark in the list + * @param aParams On return, the bookmark parameters + * @param aCaption On return, the bookmark caption + * @return KErrNotFound if the bookmark cannot be found, KErrNone otherwise + */ + TInt GetDataByIndex(TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const; + +protected: + +private: + + CAiScutSettingsBkmList( + CCoeEnv* aEnv, + CAiScutSettingsModel* aModel, + MAiScutListObserver& aObserver); + + void ConstructL(); + + /** + * Adds an bookmark to the list + * + * @since S60 v3.2 + * @param aBkmInfo Bookmark information object + */ + void AddBookmarkL(TUid aUid, const TDesC& aCaption); + + /** + * Updates the bookmark list + * + * @since S60 v3.2 + */ + void UpdateBkmListL(); + + // From MFavouritesDbObserver + /** + * Handles database event. + * @param aEvent Database event. + */ + void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent); + +private: + + /** + * Nested class to store individual bookmark list items + * + * @since S60 v3.2 + */ + class CBkmListItem : public CBase + { + public: + + static CBkmListItem* NewLC(TUid aUid, const TDesC& aCaption); + + ~CBkmListItem(); + + /** + * Compare method used to add the items to the list in sorted order + * + * @since S60 v3.2 + * @param aFirst The first item to be compared + * @param aSecond The second item to be compared + * @return Negative if first comes before second, zero if equal and + * positive if first comes after second + */ + static TInt CompareCaption(const CBkmListItem& aFirst, + const CBkmListItem& aSecond); + + /** + * Returns the item target bookmark uid + * + * @since S60 v3.2 + * @return Target bookmark uid + */ + TUid Uid() const; + + /** + * Returns the item target bookmark caption + * + * @since S60 v3.2 + * @return Target bookmark caption + */ + TPtrC Caption() const; + + /** + * Returns the possible parameters for item target + * + * @since S60 v3.2 + * @return Item target parameters + */ + TPtrC Params() const; + + /** + * Sets the parameters for the item target + * + * @since S60 v3.2 + * @param aParams Parameters for item target + */ + void SetParamsL(const TDesC& aParams); + + private: + + CBkmListItem(TUid aUid); + + void ConstructL(const TDesC& aCaption); + + private: // data + + /** + * Target bookmark uid + */ + TUid iUid; + + /** + * Target bookmark caption + */ + HBufC* iCaption; + + /** + * Target bookmark parameters + */ + HBufC* iParams; + + }; + +private: // data + + /** + * List of bookmark items + * Own. + */ + RPointerArray iListItems; + + /** + * Amount of all bookmarks in the device + */ + TInt iTotalAppCount; + + /** + * Pointer to the control environment + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Settings plug-in model. + * Not own. + */ + CAiScutSettingsModel* iModel; + + /** + * Registered observer for list events + */ + MAiScutListObserver& iObserver; + + /** + * A flag indicating if the bookmark list should observe changes + */ + TBool iObserving; + + /** + * Bookmark database change observer. + * Own. + */ + CActiveFavouritesDbNotifier* iBookmarkDbObserver; + +}; + +#endif // CAISCUTSETTINGSBKMLIST_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingscontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingscontainer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,235 @@ +/* +* 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: Shortcut settings plug-in container. +* +*/ + + +#ifndef CAISCUTSETTINGSCONTAINER_H +#define CAISCUTSETTINGSCONTAINER_H + +#include + +#include "aiscutsettings.hrh" + +class CAknRadioButtonSettingPage; +class CAknSettingPage; +class CAknWaitDialog; +class CAiScutSettingsModel; +class CAiScutSettingsBkmList; +class CAiScutSettingsItem; + +/** + * Shortcut settings plug-in container + * + * @lib aiscutsettings.lib + * @since S60 v3.2 + */ +class CAiScutSettingsContainer : public CGSBaseContainer +{ + +public: + + CAiScutSettingsContainer(); + + virtual ~CAiScutSettingsContainer(); + + /** + * Sets pointer to settings plug-in model. + * + * @since S60 v3.2 + * @param aModel Pointer to settings plug-in model + */ + void SetModel(CAiScutSettingsModel* aModel); + + /** + * Chandles a setting change command + * + * @since S60 v3.2 + */ + void HandleChangeCommandL(); + + /** + * Chandles a setting type change command + * + * @since S60 v3.2 + */ + void HandleChangeShortcutTypeCommandL(TAiScutSettingType aType); + + /** + * Dialog showing changed + * + * @since S60 v3.2 + */ + TBool IsChangeDialogShowing(); + + /** + * Close change dialog + * + * @since S60 v3.2 + */ + void CloseChangeDialog(); + + /** + * Reset current list + * + * @since S60 v3.2 + */ + void ResetCurrentListL(TInt aIndex); + + /** + * Hides the wait note dialog. + * + * @since S60 v3.2 + */ + void HideWaitNoteDialog(); + + /** + * Dismisses the wait note dialog and possible + * other dialogs and stops the change process. + * + * @since S60 v3.2 + */ + void StopShortcutChangeProcess(); + +private: + + void ConstructL(const TRect& aRect); + + // from base class CGSBaseContainer + + /** + * From CGSBaseContainer + * Constructs the settings listbox + * + * @since S60 v3.2 + * @param aResLbxId Listbox resource id + */ + void ConstructListBoxL(TInt aResLbxId); + + /** + * Chandles a setting change command to select application from a list + * + * @since S60 v3.2 + * @param aItem Applist item to modify + * @param aNew ETrue if selecting an application for first time, EFalse if not + * @return ETrue if shortcut was changed. EFalse if not + */ + TBool HandleAppListChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); + + /** + * Chandles a setting change command to select bookmark from a list + * + * @since S60 v3.2 + * @param aItem Applist item to modify + * @param aNew ETrue if selecting an application for first time, EFalse if not + * @return ETrue if shortcut was changed. EFalse if not + */ + TBool HandleBookmarkChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); + + /** + * Chandles a setting change command to edit an URL + * + * @since S60 v3.2 + * @param aItem Applist item to modify + * @param aNew ETrue if typing a new url, EFalse if editing an existing one + * @return ETrue if shortcut was changed. EFalse if not + */ + TBool HandleUrlChangeCommandL(CAiScutSettingsItem& aItem, TBool aNew = EFalse); + + /** + * Handles text editing in an CAknTextSettingPage + * + * @since S60 v3.2 + * @param aResId Resource id for the text setting page + * @param aDes The text to edit + * @return ETrue if user pressed OK, ETrue if user pressed Cancel + */ + TBool EditTextL(TInt aResId, TDes& aDes); + + /** + * Shows the wait note dialog. + * + * @since S60 v3.2 + */ + void ShowWaitNoteDialogL(); + + /** + * Required for help. + * + */ + void GetHelpContext(TCoeHelpContext& aContext) const; + + /** + * + */ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + + /** + * Checks if there is a need to update the middle softkey label. + */ + void CheckMiddleSoftkeyLabelL(); + +private: // data + + /** + * Settings plug-in model. + * Not own. + */ + CAiScutSettingsModel* iModel; + + /** + * Application selection list page. + * Own. + */ + CAknRadioButtonSettingPage* iAppListDialog; + + /** + * Bookmark selection list page. + * Own. + */ + CAknRadioButtonSettingPage* iBkmListDialog; + + /** + * Text setting page. + * Own. + */ + CAknSettingPage* iEditDialog; + + /** + * Wait dialog that is shown when the application list is not ready. + * Own. + */ + CAknWaitDialog* iWaitDialog; + + /** + * + */ + TAiScutSettingType iOldType; + + /** + * Is the change process stopped by outside "forces" + */ + TBool iChangeProcessStopped; + + /** + * Is the change process in progress + */ + TBool iChangeProcessInProgress; + +}; + +#endif // CAISCUTSETTINGSCONTAINER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,266 @@ +/* +* 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: Class for shortcut setting items. +* +*/ + + +#ifndef CAISCUTSETTINGSITEM_H +#define CAISCUTSETTINGSITEM_H + +#include +#include "aiscutsettings.hrh" + +class CAiScutSettingsModel; +class CRepository; + +/** + * Line format for the settings list box + */ +_LIT(KSettingListboxLineFormat, " \t%S\t\t%S"); + +/** + * Implements a shortcut setting item + * + * @since S60 v3.2 + */ +class CAiScutSettingsItem : public CBase +{ + +public: + + /** + * Constructs a new settings item leaving it on the cleanup stack + * + * @since S60 v3.2 + * @param aModel Reference to the plug-in model + * @param aIndex Index of the setting in the setting list + * @param aKey Setting item key + * @param aValue Setting item value + */ + static CAiScutSettingsItem* NewLC( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey); + + static CAiScutSettingsItem* NewLC( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey, + const TDesC& aValue); + + /** + * Get item value from CRepository + */ + void ReadL(CRepository* aRepository); + + /** + * set item value into CRepository + */ + TInt Save(CRepository* aRepository); + + /** + * + */ + virtual ~CAiScutSettingsItem(); + + /** + * Returns the setting item key + * + * @since S60 v3.2 + * @return Setting item key + */ + inline TUint32 Key() const; + + /** + * Returns the target shortcut uid + * + * @since S60 v3.2 + * @return Target shortcut uid + */ + inline TUid Uid() const; + + /** + * Returns the setting item type + * + * @since S60 v3.2 + * @return Setting item type + */ + inline TAiScutSettingType Type() const; + + /** + * Returns the setting item value + * + * @since S60 v3.2 + * @return Setting item value + */ + TPtrC Value() const; + + /** + * Returns the formatted listbox line descriptor + * + * @since S60 v3.2 + * @return Listbox line descriptor + */ + TPtrC ListBoxLine() const; + + /** + * Returns the setting item title + * + * @since S60 v3.2 + * @return setting item title + */ + inline TPtrC Title() const; + + /** + * Changes the setting item target application. + * Can be used to change the setting item type to application setting + * + * @since S60 v3.2 + * @param aUid Target application uid + * @param aParams Target application parameters, if any + * @param aCaption Target application caption + */ + void ChangeApplicationL(TUid aUid, const TDesC& aParams, const TDesC& aCaption); + + /** + * Changes the setting item target bookmark. + * Can be used to change the setting item type to bookmark setting + * + * @since S60 v3.2 + * @param aParams Target bookmark parameters + * @param aCaption Target bookmark caption + */ + void ChangeBookmarkL(const TDesC& aParams, const TDesC& aCaption); + + /** + * Changes the setting item target url + * Can be used to change the setting item type to an url setting + * + * @since S60 v3.2 + * @param aUrl Target url + */ + void ChangeUrlL(const TDesC& aUrl); + +private: + + /** + * + */ + CAiScutSettingsItem( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey); + + /** + * + */ + void ConstructL(); + + /** + * + */ + void ConstructL(const TDesC& aValue); + + /** + * + */ + TInt ParseValueL(const TDesC& aValue); + + /** + * Creates a formatted listbox line + * + * @since S60 v3.2 + * @param aCaption Caption to use in the listbox line + */ + void CreateListBoxLineL(const TDesC& aCaption); + + /** + * Creates a setting item title + * Leaves the created descriptor on cleanup stack + * + * @since S60 v3.2 + * @return Key title + */ + HBufC* CreateItemTitleLC(); + + /** + * Creates a key title for an optionally visible shortcut. + * Leaves the created descriptor on cleanup stack + * + * @since S60 v3.2 + * @return Key title + */ + HBufC* CreateOptionallyVisibleKeyTitleLC(); + + /** + * Creates a key title for a non-visible shortcut. + * Leaves the created descriptor on cleanup stack + * + * @since S60 v3.2 + * @return Key title + */ + // HBufC* CreateNonVisibleKeyTitleLC(); + +protected: // data + + /** + * Reference to the plug-in model + */ + CAiScutSettingsModel& iModel; + + /** + * Setting item index in the setting list + */ + TInt iIndex; + + /** + * Setting item key + */ + TUint32 iKey; + + /** + * Setting item value + * Own. + */ + HBufC* iValue; + + /** + * Target application uid + */ + TUid iUid; + + /** + * Setting item type + */ + TAiScutSettingType iType; + + /** + * Formatted listbox line + * Own. + */ + HBufC* iListBoxLine; + + /** + * Setting item title. Points to the iListBoxLine buffer + */ + TPtrC iTitle; + +}; + +#include "caiscutsettingsitem.inl" + +#endif // CAISCUTSETTINGSITEM_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingsitem.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: Inline functions for the shortcut settings item. +* +*/ + + +// --------------------------------------------------------------------------- +// Returns the setting item key. +// --------------------------------------------------------------------------- +// +inline TUint32 CAiScutSettingsItem::Key() const +{ + return iKey; +} + +// --------------------------------------------------------------------------- +// Returns the target shortcut uid. +// --------------------------------------------------------------------------- +// +inline TUid CAiScutSettingsItem::Uid() const +{ + return iUid; +} + +// --------------------------------------------------------------------------- +// Returns the setting item type. +// --------------------------------------------------------------------------- +// +inline TAiScutSettingType CAiScutSettingsItem::Type() const +{ + return iType; +} + + + +// --------------------------------------------------------------------------- +// Returns the setting item title. +// --------------------------------------------------------------------------- +// +inline TPtrC CAiScutSettingsItem::Title() const +{ + return iTitle; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutsettingsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutsettingsmodel.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,325 @@ +/* +* 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: Shrortcut settings plug-in model. +* +*/ + + +#ifndef CAISCUTSETTINGSMODEL_H +#define CAISCUTSETTINGSMODEL_H + +#include +#include // For MDesCArray +#include // For RApaLsSession +#include // For RFavouritesDb +#include // For CFavouritesItemList + +#include "caiscutsettingsapplist.h" +#include "caiscutsettingsbkmlist.h" + +class CCoeEnv; +class CRepository; +class CAiScutSettingsItem; +class CAiScutSettingsContainer; +class CAiScutRepositoryWatcher; +class CAiScutSettings; + +/** + * Shrortcut settings plug-in model + * + * @lib aiscutsettings.lib + * @since S60 v3.2 + */ +class CAiScutSettingsModel : public CBase + , public MDesCArray + , public MAiScutListObserver +{ + +public: + + /** + * + */ + static CAiScutSettingsModel* NewL(CAiScutSettings& aPlugin, CCoeEnv* aEnv); + + /** + * + */ + virtual ~CAiScutSettingsModel(); + +public: // from MDesCArray + + /** + * Returns the number of descriptor elements in a descriptor array. + * + * @since S60 v3.2 + * @return The number of descriptor elements in a descriptor array. + */ + TInt MdcaCount() const; + + /** + * Indexes into a descriptor array. + * + * @since S60 v3.2 + * @param aIndex The position of the descriptor element within a descriptor array. + * @return A 16 bit non-modifiable pointer descriptor representing the descriptor + * element located at position aIndex within a descriptor array. + */ + TPtrC MdcaPoint(TInt aIndex) const; + + /** + * Handle Shortcuts changed + */ + static TInt HandleShortcutsChanged(TAny* aPtr); + + /** + * Handle hidden Applications changed + */ + static TInt HandleHiddenAppsChanged(TAny* aPtr); + +public: // from MAiScutListObserver + + /** + * From MAiScutListObserver + * Callback for application list events + * + * @since S60 v3.2 + * @param aEvent AppList event code + * @param aAdded ETrue if applications were added, EFalse if removed + */ + void HandleScutListEventL(TScutListEvent aEvent, TBool aAdded); + + /** + * Find application is hidden using Uid + */ + TBool IsHidden(const TUid& aAppUid) const; + +public: + + /** + * Tells the application list and bookmark list to start or stop observing for changes + */ + void ActivateObservers(TBool aActivate); + + /** + * Returns a setting item for the given index + * + * @since S60 v3.2 + * @param aIndex Index of the setting item + * @return Pointer to a setting item + */ + CAiScutSettingsItem* Item(TInt aIndex) const; + + /** + * Utility function to retrieve an appliation caption from an uid + * + * @since S60 v3.2 + * @param aUid Application uid + * @return Pointer descriptor to the application caption + */ + TInt GetAppCaption(const TUid aUid, TDes& aCaption); + + /** + * Utility function to retrieve a bookmark caption from an uid + * + * @since S60 v3.2 + * @param aUid Bookmark uid + * @return Pointer descriptor to the bookmark caption + */ + TInt GetBkmCaptionL(const TUid aUid, TDes& aCaption); + + /** + * Returns a pointer to the coe environment + * + * @since S60 v3.2 + * @return Pointer to coe environment + */ + CCoeEnv* Env(); + + /** + * Handles saving a setting item to central repository + * + * @since S60 v3.2 + * @param aItem Item to save + */ + void SaveItemL(CAiScutSettingsItem& aItem); + + /** + * Sets pointer to settings plug-in container. + * + * @since S60 v3.2 + * @param aContainer Pointer to settings plug-in container. + */ + void SetContainer(CAiScutSettingsContainer* aContainer); + + /** + * Read bookmarks from favourites engine. + * + */ + void ReadBookmarksL(); + + /** + * Return bookmark count. + */ + TInt BookmarkCount() const; + + /** + * Get bookmark from index aIndex. + */ + CFavouritesItem* GetBookmark(TInt aIndex); + + /** + * Returns reference to the bookmark database owned by the engine + * + * @return Reference to RFavouritesDb + */ + RFavouritesDb& FavouritesDb(); + + /** + * + */ + CAiScutSettingsAppList* AppList(); + + /** + * + */ + CAiScutSettingsBkmList* BkmList(); + + /** + * + */ + void SetSettingsKeys(RArray& aKeys); + + /** + * + */ + void UpdateSettingsL(); + + /** + * + */ + void UpdateSettingsContainerL(); + +private: + + /** + * + */ + CAiScutSettingsModel(CAiScutSettings& aPlugin, CCoeEnv* aEnv); + + /** + * + */ + void ConstructL(); + + + /** + * + */ + void GetHiddenAppsL(); + +private: // data + + /** + * Array of setting items. + * Own. + */ + RPointerArray iSettings; + + /** + * Array of keys for settings items + * Own. + */ + RArray iKeys; + + /** + * Central repository handler. + * Own. + */ + CRepository* iRepository; + + /** + * Application architecture server session. + * Own. + */ + RApaLsSession iApaSession; + + /** + * Bookmark database session. + * Own. + */ + RFavouritesSession iBookmarkSess; + + /** + * Bookmark database. + * Own. + */ + RFavouritesDb iBookmarkDb; + + /** + * Bookmark list. + * Own. + */ + CFavouritesItemList* iFavItemList; + + /** + * Settings plugin + * Not own. + */ + CAiScutSettings& iPlugin; + + /** + * Coe environment. + * Not own. + */ + CCoeEnv* iEnv; + + /** + * Application list. + * Own. + */ + CAiScutSettingsAppList* iAppList; + + /** + * Bookmark list. + * Own. + */ + CAiScutSettingsBkmList* iBkmList; + + /** + * Notifier for changes in the shortcut settings. + * Own. + */ + CAiScutRepositoryWatcher* iSettingsNotifier; + + /** + * Settings plugin container. + * Not own. + */ + CAiScutSettingsContainer* iContainer; + + // Array of UIDs which are hidden from the TARM + RArray iHiddenApps; + + // Central repository object for Hidden Apps + CRepository* iHiddenAppsRepository; + + // Central repository change handler for Hidden Apps + CAiScutRepositoryWatcher* iHiddenAppsNotifier; + +}; + +#endif // CAISCUTSETTINGSMODEL_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutshortcut.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutshortcut.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,337 @@ +/* +* 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: Implementation for a shortcut. +* +*/ + + +#ifndef CAISCUTSHORTCUT_H +#define CAISCUTSHORTCUT_H + +#include + +#include "taiscutparser.h" + +class CAiScutEngine; +class CAiScutTarget; +class MAiContentObserver; +class MAiPropertyExtension; + +/** + * Implementation for a shortcut + * + * Handles parsing and launching an application shortcut + * + * @since S60 v3.2 + */ +class CAiScutShortcut : public CTimer +{ + +public: + + /** + * First phase constructor. + * Leaves the object on cleanup stack + * + * @since S60 v3.2 + * @param aId Shortcut id + * @param aTarget The shortcut definition string. + * @param aEngine Reference to shortcut plug-in engine + */ + static CAiScutShortcut* NewLC(TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine); + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aId Shortcut id + * @param aTarget The shortcut definition string + * @param aEngine Reference to shortcut plug-in engine + */ + static CAiScutShortcut* NewL(TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine); + + virtual ~CAiScutShortcut(); + + /** + * Returns the shortcut id + * + * @since S60 v3.2 + * @return Shortcut id + */ + TInt32 Id() const; + + /** + * Publishes the shortcut content, non leaving version + * + * @since S60 v3.2 + * @param aPlugin Reference to plug-in + * @param aObserver Content observer to publish to + */ + void Publish(MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver); + + /** + * Checks if the application pointed to can be launched and reverts to the + * default setting if not. If no valid target can be found, the shortcut + * becomes empty. May only leave with KErrNotReady to signify that application + * architecture server or message server is not ready and access check should + * be retried later. + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @return ETrue if the shortcut target is accessible + */ + TBool CheckAccessL(TInt aCheckType); + + /** + * + */ + TBool IsTargetChanged() const; + + /** + * Changes the shortcut target to the user defined setting + * + * @since S60 v3.2 + * @param aNewTarget The new user defined shortcut target + */ + void SetUserTarget(const TDesC& aNewTarget); + + /** + * Deletes the user target. + * + * @since S60 v3.2 + */ + void DeleteUserTarget(); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Launches the shortcut + * + * @since S60 v5.1 + * @param aMessage A message to pass + */ + void LaunchL(const TDesC8& aMessage); + + /** + * Set call state + * + * @since S60 v3.2 + */ + void SetCallState(TBool aStatus); + + /** + * + * @since S60 v3.2 + */ + void SetToBePublished(TBool aFlag); + + /** + * + * @since S60 v3.2 + */ + TBool NeedsToBePublished(); + + /** + * Return shortcut type. + * + * @since S60 v3.2 + */ + TShortcutType Type() const; + + /** + * Return application uid of this shortcut. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + + /** + * Return an additional id this target may use when + * launching. + * + * @since S60 v3.2 + */ + TUid AdditionalUid() const; + + /** + * Return current valid definition. + * + * @since S60 v3.2 + */ + TPtrC ActiveDefinition(); + + /** + * Set the icon to publish to softkeys, + * icon area or to touch toolbar. Uses + * aIcon.iDestination to determine which icon + * is in question + * + * @since S60 v5.0 + */ + void SetIcon(TAiScutIcon aIcon); + + +protected: + + + CAiScutShortcut(TInt aId, CAiScutEngine& aEngine); + + void ConstructL(const TDesC& aTarget); + + /** + * Creates a shortcut target object + * + * @since S60 v3.2 + * @param aDefinition Shortcut target definition + * @return Pointer to shortcut target object + */ + CAiScutTarget* CreateTargetL( + const TDesC& aDefinition, TBool aCreateUserTarget); + + /** + * Publishes the shortcut content, leaving version + * + * @since S60 v3.2 + * @param aPlugin Reference to plug-in + * @param aObserver Content observer to publish to + */ + virtual void PublishL(MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver); + + /** + * Publishes shortcut caption + * + * @since S60 v3.2 + * @param aPlugin Reference to plug-in + * @param aObserver Content observer to publish to + */ + virtual TInt PublishCaption( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, + TInt aCaptionContentId) const; + + /** + * Publishes shortcut icon + * + * @since S60 v3.2 + * @param aPlugin Reference to plug-in + * @param aObserver Content observer to publish to + */ + virtual TInt PublishIcon( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, TInt aIconContentId); + + /** + * Set the icon to use instead of default icon + * + * @since S60 v3.2 + */ + void SetOverrideIcon(TAiScutIcon aIcon); + + /** + * Set the icon to publish to softkeys + * + * @since S60 v3.2 + */ + void SetSoftkeyIcon(TAiScutIcon aIcon); + + /** + * Set the icon to publish to touch toolbar + * + * @since S60 v5.0 + */ + void SetToolbarIcon(TAiScutIcon aIcon); + +// from CActive/CTimer + + TInt RunError(TInt aError); + + void DoCancel(); + + void RunL(); + +protected: // data + + /** + * Shortcut id. + */ + TInt32 iId; + + /** + * Default shortcut target. + * Own. + */ + CAiScutTarget* iDefaultTarget; + + /** + * User defined shortcut target. + * Own. + */ + CAiScutTarget* iUserTarget; + + /** + * Stores the old target data while the new one is being published. + * During publishing the framework might still dereference pointers in the old + * target so it must be kept alive until the new target is successfully published. + * If publishing fails, this is taken back to use and the new target is deleted. + * Own. + */ + CAiScutTarget* iRetiredTarget; + + /** + * Pointer to the last published target. + * DO NOT DELETE THROUGH THIS! + * Not own. + */ + CAiScutTarget* iLastPublishedTarget; + + /** + * Pointer to the active target. + * Can point either to iDefaultTarget, iUserTarget or NULL + * DO NOT DELETE THROUGH THIS! + * Not own. + */ + CAiScutTarget* iActiveTarget; + + /** + * Reference to the shortcut plug-in engine. + */ + CAiScutEngine& iEngine; + + /** + * Boolean indicating if this shortcut needs to be published. + */ + TBool iNeedsToBePublished; + + /** + * Call state + */ + TBool iActiveCall; + + /** + * Force the publish of this shortcut. For example + * after call state has changed the actual shortcut + * isn't changed but it still needs to be published. + */ + TBool iForcePublish; + +}; + +#endif // CAISCUTSHORTCUT_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutshortcutext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutshortcutext.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,164 @@ +/* +* 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: Shortcut plug-in shortcut extensions +* +*/ + + +#ifndef CAISCUTSHORTCUTEXT_H +#define CAISCUTSHORTCUTEXT_H + +#include +#include +#include + +#include "caiscutshortcut.h" +#include "mpopupeventhandleractions.h" + +class CPopupEventHandler; +class MAiScutExtData; + +/** + * + * The class extends CAiScutShortcut by offering means to store + * changeable popup text lines. The class overrides content publishing + * functions from base class. + * + * @since S60 v3.2 + */ +class CAiScutShortcutExt : public CAiScutShortcut, + public MPopupEventHandlerActions + { + public: + /** + * Factory function + * @see CAiScutShortcut + * @since S60 v3.2 + */ + static CAiScutShortcutExt* NewL( TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine ); + + /** + * Factory function + * @see CAiScutShortcut + * @since S60 v3.2 + */ + static CAiScutShortcutExt* NewLC( TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine ); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CAiScutShortcutExt(); + + private: + CAiScutShortcutExt( TInt aId, CAiScutEngine& aEngine ); + void ConstructL( const TDesC& aTarget ); + + public: // New functions + /** + * @return Definition string of active target + * @since S60 v3.2 + */ + TPtrC ActiveTargetDefinition() const; + + /** + * Handles events (e.g. gain/lost focus) from AI framework + * @param aEvent Event + * @since S60 v3.2 + */ + void HandleAIEventL( TInt aEvent ); + + /** + * Handles Resumed event + * @param aResumeReason Resume reason + * @since S60 v3.2 + */ + void HandleResumed( TAiTransitionReason aResumeReason ); + + /** + * Set extension data + * @param aAiScutExtData Pointer to new extension data + * @since S60 v3.2 + */ + void SetAiScutExtData( const MAiScutExtData* aAiScutExtData ); + + + private: // From CAiScutShortcut + void PublishL( MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver ); + + TInt PublishCaption( MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver, TInt aCaptionContentId) const; + + void PublishPopupText( MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver ) const; + + TInt PublishIcon( MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver, TInt aIconContentId ); + + private: // From MPopupEventHandlerActions + void IssuePublishShortcut(); + + private: // data + + /** + * Extension data + * Ref. + */ + const MAiScutExtData* iAiScutExtData; + + /** + * Flag that tells whether to publish or clean the popup text box. + * The flag is controlled by iPopupEventHandler + * Own. + */ + //TBool iPublishLineArray; + + /** + * Handler of various events, includes state machine + * Own. + */ + CPopupEventHandler* iPopupEventHandler; + + /** + * Pointer to previous popup line array. This is used detect changes + * in data. + * Ref. + */ + const MDesCArray* iPreviousPopupLineArray; + + /** + * Pointer to previous icon. This is used detect changes + * in data. + * Ref. + */ + const CGulIcon* iPreviousIcon; + + /** + * Has the icon changed + */ + TBool iIconChanged; + + /** + * Has the text changed + */ + TBool iTextChanged; + + }; + +#endif // CAISCUTSHORTCUTEXT_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscutshortcutinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscutshortcutinfo.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* 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: Small container for shortcut info. +* +*/ + + +#ifndef CAISCUTSHORTCUTINFO_H +#define CAISCUTSHORTCUTINFO_H + +#include + +/** + * Implementation for a shortcut + * + * Handles parsing and launching an application shortcut + * + * @since S60 v3.2 + */ +class CAiScutShortcutInfo : public CBase +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aId Shortcut id + * @param aTarget The shortcut definition string + */ + static CAiScutShortcutInfo* NewL(TInt aId, const TDesC& aTarget); + + virtual ~CAiScutShortcutInfo(); + + /** + * Returns the shortcut id + * + * @since S60 v3.2 + * @return Shortcut id + */ + TInt32 Id() const; + + /** + * Returns the shortcut target string. + * + * @since S60 v3.2 + * @return Shortcut target string + */ + const TDesC& Target(); + +protected: + +private: + + CAiScutShortcutInfo(TInt aId); + + void ConstructL(const TDesC& aTarget); + +private: // data + + /** + * Shortcut id. + */ + TInt32 iId; + + /** + * Shortcut target string. + * Own. + */ + HBufC* iTarget; + +}; + +#endif // CAISCUTSHORTCUTINFO_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttarget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttarget.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,277 @@ +/* +* 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: Base class for all shortcut targets. +* +*/ + + +#ifndef CAISCUTTARGET_H +#define CAISCUTTARGET_H + +#include + +#include "taiscutparser.h" +#include "aiscutdefs.h" +#include + +class CAiScutEngine; +class CGulIcon; + +_LIT(KBitmapFile, "aiscutplugin.mif"); + +/** + * Base class for shortcut targets + * + * @since S60 v3.2 + */ +class CAiScutTarget : public CBase +{ + +public: + + virtual ~CAiScutTarget(); + + /** + * Returns the shortcut definition string. + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + virtual TPtrC Definition() const = 0; + + /** + * Returns the shortcut target caption. + * Caption can be either a descriptor or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the descriptor reference parameter is used. + * Default implementation returns KErrNotSupported; + * + * Getting the target caption and icon utilizes the "lazy evaluation" idiom + * which means they are created only when they are first needed. This is because + * there are (atleast) two scenarios where they are never needed: + * 1. The active theme does not support shortcut captions or icons. + * 2. Shortcuts launched using LaunchByValue are never published. + * + * @since S60 v3.2 + * @param aDes On return, the descriptor if used + * @return The resource id or zero to indicate that the descriptor is used. + */ + virtual TInt GetCaption( TPtrC& aDes, TAiScutAppTitleType aTitleType ) const; + + /** + * Returns the shortcut target icon. + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns the icon that has possibly + * been set with @c SetOverrideIcon() and returns + * KErrNotSupported if no override icon has been set. + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + virtual TInt GetIcon( CGulIcon*& aIcon ) const; + + /** + * Returns the shortcut icon that can be published to softkeys + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns the icon that has possibly + * been set with @c SetSoftkeyIcon() and returns + * KErrNotSupported if no softkey icon has been set. + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + virtual TInt GetSoftkeyIcon( CGulIcon*& aIcon ) const; + + /** + * Returns the shortcut icon that can be published to toolbar + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns the icon that has possibly + * been set with @c SetSoftkeyIcon() and returns + * KErrNotSupported if no softkey icon has been set. + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + virtual TInt GetToolbarIcon( CGulIcon*& aIcon ) const; + + /** + * Checks if the shortcut target is accessible. + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @return ETrue if accessible, EFalse if not + */ + virtual TBool IsAccessibleL( TInt aCheckType ) = 0; + + /** + * Launches the shortcut. + * + * @since S60 v3.2 + */ + virtual void LaunchL() = 0; + + /** + * Launches the shortcut. + * + * @since S60 v5.1 + * @param aMessage A message to pass + */ + virtual void LaunchL(const TDesC8& aMessage) { (void)aMessage; }; + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + virtual TUid AppUid() const = 0; + + /** + * Return an additional id this target may use when + * launching. Default implementation return TUid(-1) + * + * @since S60 v3.2 + */ + virtual TUid AdditionalUid() const; + + /** + * Return shortcut type. + * + * @since S60 v3.2 + */ + TShortcutType Type() const; + + /** + * Starts a full screen effect. + */ + void BeginEffectL(); + + /** + * Set the icon that overrides the shortcut default + * icon. Instead of fetching the icon from for example an + * application the icon defined here can be used. The shortcut + * can use the @c GetIcon() to fetch the + * icon defined here. Currently we support + * icon loading from skin or from MIF/MBM-file. + * The file must reside under z:\resource altough + * it can be under some subdirectory. + * + * @since S60 v3.2 + * @param aIcon The overriding icon + */ + void SetOverrideIcon(TAiScutIcon aIcon); + + /** + * Set the icon that is to be published to softkeys + * The @c GetSoftkeyIcon() can be used to fetch the + * icon defined here. Currently we support + * icon loading from skin or from MIF/MBM-file. + * The file must reside under z:\resource altough + * it can be under some subdirectory. + * + * @since S60 v3.2 + * @param aIcon The softkey icon + */ + void SetSoftkeyIcon(TAiScutIcon aIcon); + + /** + * Set the icon that is to be published to touch toolbar + * The @c GetSoftkeyIcon() can be used to fetch the + * icon defined here. Currently we support + * icon loading from skin or from mif-file. + * The mif-file must reside under z:\resource altough + * it can be under some subdirectory. + * + * @since S60 v5.0 + * @param aIcon The softkey icon + */ + void SetToolbarIcon(TAiScutIcon aIcon); + +protected: + + CAiScutTarget( CAiScutEngine& aEngine, TShortcutType aType ); + +private: + + /** + * Returns the icon defined in aIconToLoads. Loads the icon + * from MIF/MBM-file or from skin. + * + * @return KErrNone if no error + */ + TInt GetIcon(const TAiScutIcon &aIconToLoad, CGulIcon *&aIcon ) const; + + /** + * Loads an icon defined in aIconToLoad from skin + * + * @return KErrNone if no error + */ + void LoadIconFromSkinL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const; + + /** + * Loads an icon defined in aIconToLoad from MIF/MBM-file + * The file must reside under z:\resource. It can be under + * some subdirectory. + * + * @return KErrNone if no error + */ + void LoadIconFromFileL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const; + + +protected: // data + + /** + * Reference to shortcut plug-in engine. + */ + CAiScutEngine& iEngine; + + /** + * Shortcut type. + */ + TShortcutType iType; + + /** + * Icon that is meant to override the default icon + */ + TAiScutIcon iOverrideIcon; + + /** + * Icon that is to be published to softkeys + */ + TAiScutIcon iSoftkeyIcon; + + /** + * Icon that is to be published to toolbar + */ + TAiScutIcon iToolbarIcon; + +}; + +#endif // CAISCUTTARGET_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetapp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetapp.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,226 @@ +/* +* 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: Class for application shortcut target. +* +*/ + + +#ifndef CAISCUTTARGETAPP_H +#define CAISCUTTARGETAPP_H + +#include "caiscuttarget.h" + +class CPeriodic; +class MAknsSkinInstance; +/** + * Implements an application shortcut target + * + * Handles parsing and launching an application shortcut target + * + * @since S60 v3.2 + */ +class CAiScutTargetApp : public CAiScutTarget +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aEngine Reference to the plug-in engine + * @param aParser Shortcut definition parser + */ + static CAiScutTargetApp* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); + + virtual ~CAiScutTargetApp(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * Returns the shortcut target caption. + * Caption can be either a descriptor or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the descriptor reference parameter is used. + * Default implementation returns KErrNotSupported; + * + * Getting the target caption and icon utilizes the "lazy evaluation" idiom + * which means they are created only when they are first needed. This is because + * there are (atleast) two scenarios where they are never needed: + * 1. The active theme does not support shortcut captions or icons. + * 2. Shortcuts launched using LaunchByValue are never published. + * + * @since S60 v3.2 + * @param aDes On return, the descriptor if used + * @return The resource id or zero to indicate that the descriptor is used. + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * Returns the shortcut target icon. + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns KErrNotSupported; + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * Returns the shortcut icon that can be published to toolbar + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns the icon that has possibly + * been set with @c SetSoftkeyIcon() and returns + * KErrNotSupported if no softkey icon has been set. + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + TInt GetToolbarIcon(CGulIcon*& aIcon) const; + + /** + * Checks if the shortcut target is accessible + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @return ETrue if accessible, EFalse if not + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Launches the shortcut + * + * @since S60 v5.1 + */ + void LaunchL( const TDesC8& aCustomMessage ); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + + /** + * Return an additional id this target may use when + * launching. Default implementation return TUid(-1) + * + * @since S60 v3.2 + */ + TUid AdditionalUid() const; + +protected: + +private: + + CAiScutTargetApp(CAiScutEngine& aEngine, TShortcutType aType, const TUid aUid); + + void ConstructL(const TAiScutParser& aParser); + + /** + * + */ + void GetCaptionL(TAiScutAppTitleType aTitleType) const; + + /** + * Creates the application icon + * + * @since S60 v3.2 + */ + void CreateAppIconL(CGulIcon*& aIcon) const; + + /** + * Creates the NonNative application icon + * + * @since S60 v3.2 + */ + CGulIcon* CreateNonNativeIconL() const; + + /** + * Performs Central Repository shortcut set + * for EasyVoIP application. + */ + void SetEasyVoIPShortcutStartL() const; + + CGulIcon* CreateSubstituteIconL( MAknsSkinInstance* aSkin, TUid aAppUid, TUid iViewUid ) const; +private: // data + + /** + * Application uid. + */ + TUid iAppUid; + + /** + * Possible view uid. + */ + TUid iViewUid; + + /** + * Shortcut caption. + * Own. + */ + mutable HBufC* iCaption; + + /** + * Shortcut short caption. + * Own. + */ + mutable HBufC* iShortCaption; + + /** + * Holds the shortcut definition string. + * Own. + */ + HBufC* iDefinition; + + /** + * Run the application in the background. + */ + TBool iBackground; + + /** + * Command line parameter. + * Own. + */ + HBufC8* iMsg; + +}; + +#endif // CAISCUTTARGETAPP_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetbkm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetbkm.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,157 @@ +/* +* 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: Class for bookmark shortcut target. +* +*/ + + +#ifndef CAISCUTTARGETBKM_H +#define CAISCUTTARGETBKM_H + +#include "caiscuttarget.h" + +/** + * Implements an bookmark shortcut target + * + * Handles parsing and launching an bookmark shortcut target + * + * @since S60 v3.2 + */ +class CAiScutTargetBkm : public CAiScutTarget +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aEngine Reference to the plug-in engine + * @param aParser Shortcut definition parser + */ + static CAiScutTargetBkm* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); + + virtual ~CAiScutTargetBkm(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * Returns the shortcut target caption. + * Caption can be either a descriptor or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the descriptor reference parameter is used. + * Default implementation returns KErrNotSupported; + * + * Getting the target caption and icon utilizes the "lazy evaluation" idiom + * which means they are created only when they are first needed. This is because + * there are (atleast) two scenarios where they are never needed: + * 1. The active theme does not support shortcut captions or icons. + * 2. Shortcuts launched using LaunchByValue are never published. + * + * @since S60 v3.2 + * @param aDes On return, the descriptor if used + * @return The resource id or zero to indicate that the descriptor is used. + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * Returns the shortcut target icon. + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns KErrNotSupported; + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * Checks if the shortcut target is accessible + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @return ETrue if accessible, EFalse if not + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + + /** + * Return an additional id this target may use when + * launching. Default implementation return TUid(-1) + * + * @since S60 v3.2 + */ + TUid AdditionalUid() const; + +protected: + +private: + + CAiScutTargetBkm(CAiScutEngine& aEngine, TShortcutType aType); + + void ConstructL(const TAiScutParser& aParser); + + /** + * + */ + void GetCaptionL() const; + +private: // data + + /** + * Bookmark uid. + */ + TUid iBkmUid; + + /** + * Shortcut caption. + * Own. + */ + mutable HBufC* iCaption; + + /** + * Holds the shortcut definition string. + * Own. + */ + HBufC* iDefinition; + +}; + +#endif // CAISCUTTARGETAPP_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetempty.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetempty.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,107 @@ +/* +* 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: Empty target +* +*/ + + +#ifndef CAISCUTEMPTY_H +#define CAISCUTEMPTY_H + +#include "caiscuttarget.h" + +/** + * Empty target. + * + * @since S60 v3.2 + */ +class CAiScutTargetEmpty : public CAiScutTarget +{ +public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param + * @return new instance. + */ + static CAiScutTargetEmpty* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget ); + + /** + * Destructor. + */ + virtual ~CAiScutTargetEmpty(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * See base class + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * See base class + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * See base class + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + +private: // New methods + + /** + * C++ default constructor. + */ + CAiScutTargetEmpty( CAiScutEngine& aEngine, TShortcutType aType ); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL( const TDesC& aTarget ); + +private: // Data + + /** + * Holds the shortcut definition string + * Owned. + */ + HBufC* iDefinition; + +}; + +#endif + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargethttp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargethttp.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,128 @@ +/* +* 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: Class for http shortcut target. +* +*/ + + +#ifndef CAISCUTTARGETHTTP_H +#define CAISCUTTARGETHTTP_H + +#include "caiscuttarget.h" + +/** + * Command line parameter for browser to open an url + */ +_LIT( KOpenUrlParam, "4 " ); + +/** + * Implements an http shortcut target + * + * Handles parsing and launching an http shortcut target + * + * @since S60 v3.2 + */ +class CAiScutTargetHttp : public CAiScutTarget +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aEngine Reference to the plug-in engine + * @param aTarget The shortcut definition string + */ + static CAiScutTargetHttp* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser ); + + virtual ~CAiScutTargetHttp(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * See base class + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * See base class + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * See base class + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + + /** + * Return additional UID this target refers to. In + * URL case this is a unique identifer created from the URL + * + * @since S60 v3.2 + */ + TUid AdditionalUid() const; +protected: + +private: + + CAiScutTargetHttp( CAiScutEngine& aEngine, TShortcutType aType ); + + void ConstructL( const TAiScutParser& aParser ); + +private: // data + + /** + * Target caption, part of the http address or + * custom title given with the URL string + */ + mutable HBufC* iCaption; + + /** + * Holds the shortcut definition string + * Owned. + */ + HBufC* iDefinition; + + /** + * Checksum for the URL + */ + TUid iChecksum; + +}; + +#endif // CAISCUTTARGETHTTP_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetkeylock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetkeylock.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Keylock +* +*/ + + +#ifndef CAISCUTKEYLOCK_H +#define CAISCUTKEYLOCK_H + +#include +#include "caiscuttarget.h" + +/** + * Takes care of locking the keypad. + * + * @since S60 v3.2 + */ +class CAiScutTargetKeyLock : public CAiScutTarget +{ +public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param + * @return new instance. + */ + static CAiScutTargetKeyLock* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget); + + /** + * Destructor. + */ + virtual ~CAiScutTargetKeyLock(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * Returns the shortcut target caption. + * Caption can be either a descriptor or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the descriptor reference parameter is used. + * Default implementation returns KErrNotSupported; + * + * Getting the target caption and icon utilizes the "lazy evaluation" idiom + * which means they are created only when they are first needed. This is because + * there are (atleast) two scenarios where they are never needed: + * 1. The active theme does not support shortcut captions or icons. + * 2. Shortcuts launched using LaunchByValue are never published. + * + * @since S60 v3.2 + * @param aDes On return, the descriptor if used + * @return The resource id or zero to indicate that the descriptor is used. + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * Returns the shortcut target icon. + * Icon can be either an icon pointer or a resource id. + * If the return value has a non-zero value, it is the resource id. + * Zero indicates that the icon pointer is used. + * Default implementation returns KErrNotSupported; + * + * Uses the "lazy evaluation" idiom to get the icon. See Caption() + * + * @since S60 v3.2 + * @param aIcon On return, the icon pointer if used + * @return The resource id or zero to indicate that the icon pointer is used. + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * Checks if the shortcut target is accessible + * + * @since S60 v3.2 + * @param aCheckType Specifies which kind of shortcuts should check its access + * @return ETrue if accessible, EFalse if not + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + +private: // New methods + + /** + * Enables keylock. + */ + void EnableKeyLock(); + + /** + * Checks if keylock is enabled. + */ + TBool IsKeyLockEnabled(); + + /** + * C++ default constructor. + */ + CAiScutTargetKeyLock(CAiScutEngine& aEngine, TShortcutType aType); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(const TDesC& aTarget); + +private: // Data + + /** + * Keylock + */ + RAknKeylock2 iKeyLock; + + /** + * Holds the shortcut definition string + * Owned. + */ + HBufC* iDefinition; + +}; + +#endif // CAIKEYLOCK_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetmessagingview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetmessagingview.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,128 @@ +/* +* 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: Class for messaging view shortcut target. +* +*/ + + +#ifndef CAISCUTTARGETMESSAGINGVIEW_H +#define CAISCUTTARGETMESSAGINGVIEW_H + +#include + +#include "caiscuttarget.h" + +class CGulIcon; + +/** + * Implements a mailbox shortcut target + * + * Handles parsing and launching a mailbox shortcut target + * + * @since S60 v3.2 + */ +class CAiScutTargetMessagingView : public CAiScutTarget +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aEngine Reference to the plug-in engine + * @param aParser Shortcut definition parser + */ + static CAiScutTargetMessagingView* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); + + virtual ~CAiScutTargetMessagingView(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * See base class + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * See base class + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * See base class + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + +protected: + +private: + + CAiScutTargetMessagingView(CAiScutEngine& aEngine, TShortcutType aType); + + void ConstructL(const TAiScutParser& aParser); + + /** + * Tries to find a view id + * + * @since S60 v3.2 + * @return Mailbox id + */ + TMsvId FindViewIdL(); + + /** + * Leaving version of GetIcon. + */ + void GetIconL(CGulIcon*& aIcon) const; + +private: // data + + /** + * View name. Contains the remote mailbox name or the messaging view name + * Own. + */ + HBufC* iViewName; + + /** + * Holds the shortcut definition string + * Owned. + */ + HBufC* iDefinition; + +}; + +#endif // CAISCUTTARGETMESSAGINGVIEW_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/caiscuttargetnewmsg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/caiscuttargetnewmsg.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,151 @@ +/* +* 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: Class for new message shortcut target. +* +*/ + + +#ifndef CAISCUTTARGETNEWMSG_H +#define CAISCUTTARGETNEWMSG_H + +#include + +#include "caiscuttarget.h" + +class CGulIcon; + +/** + * Implements a new message or new email shortcut target + * + * Handles parsing and launching a new message shortcut target + * + * @since S60 v3.2 + */ +class CAiScutTargetNewMsg : public CAiScutTarget +{ + +public: + + /** + * First phase constructor + * + * @since S60 v3.2 + * @param aEngine Reference to the plug-in engine + * @param aParser Shortcut definition parser + */ + static CAiScutTargetNewMsg* NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser); + + virtual ~CAiScutTargetNewMsg(); + + /** + * Returns the shortcut definition string + * + * @since S60 v3.2 + * @return Shortcut definition string + */ + TPtrC Definition() const; + + /** + * See base class + */ + TInt GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const; + + /** + * See base class + */ + TInt GetIcon(CGulIcon*& aIcon) const; + + /** + * See base class + */ + TBool IsAccessibleL(TInt aCheckType); + + /** + * Launches the shortcut + * + * @since S60 v3.2 + */ + void LaunchL(); + + /** + * Return application uid this target launches. + * + * @since S60 v3.2 + */ + TUid AppUid() const; + + + + + +protected: + +private: + + CAiScutTargetNewMsg(CAiScutEngine& aEngine, TShortcutType aType); + + void ConstructL(const TAiScutParser& aParser); + + /** + * + */ + void GetCaptionL(TAiScutAppTitleType aTitleType) const; + + /** + * Leaving version of GetIcon. + */ + void GetIconL(CGulIcon*& aIcon) const; + + void ShowErrorNote(); + +private: // data + + /** + * Application uid. + */ + TUid iAppUid; + + /** + * Possible view uid. + */ + TUid iViewUid; + + /** + * Shortcut caption. + * Own. + */ + mutable HBufC* iCaption; + + /** + * Shortcut short caption. + * Own. + */ + mutable HBufC* iShortCaption; + + /** + * Holds the shortcut definition string + * Owned. + */ + HBufC* iDefinition; + + /** + * Message type + */ + TUid iMtm; +}; + +#endif // CAISCUTTARGETNEWMSG_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/cpopupeventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/cpopupeventhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,143 @@ +/* +* 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: Shortcut plug-in Popup event handler class +* +*/ + + +#ifndef CPOPUPEVENTHANDLER_H +#define CPOPUPEVENTHANDLER_H + +#include +#include + +#include "PopupFSM.h" +#include "MPopupFSMActions.h" + +class MPopupEventHandlerActions; + +/** + * + * The class handles Popup events (set, reset, gain/lost focus, etc.) by + * delegating them to automatically generated state machine class which in + * turn decides what actions the events cause in different states. + * + * This class has bi-directional friend relationship to CAiScutShortcutExt + * in order to establish concrete actions while decoupling state machine + * related functions out of CAiScutShortcutExt. + * + * @since S60 v3.2 + */ +class CPopupEventHandler : public CActive, + public MPopupFSMActions + { + public: + /** + * Factory function + * @param aPopupEventHandlerActions actions interface + * @since S60 v3.2 + */ + static CPopupEventHandler* NewL( + MPopupEventHandlerActions& aPopupEventHandlerActions ); + + /** + * Factory function + * @param aPopupEventHandlerActions actions interface + * @since S60 v3.2 + */ + static CPopupEventHandler* NewLC( + MPopupEventHandlerActions& aPopupEventHandlerActions ); + + /** + * Destructor + * @since S60 v3.2 + */ + ~CPopupEventHandler(); + + private: + + /** + * Constructor + * @param aPopupEventHandlerActions actions interface + * @since S60 v3.2 + */ + CPopupEventHandler( + MPopupEventHandlerActions& aPopupEventHandlerActions ); + + void ConstructL(); + + public: // New functions + /** + * Accessor for state machine + * @return Reference to state machine instance + * @since S60 v3.2 + */ + TPopupFSM& PopupFSM(); + + TBool PublishPopup() const; + TBool PopupVisible() const; + + /** + * @return Is publishing needed + */ + TBool PublishCaption() const; + + /** + * @return Is caption visible + */ + TBool CaptionVisible() const; + + private: // From CActive + void DoCancel(); + void RunL(); + + private: // From MPopupFSMActions + void CompleteSelf(); + void CancelRequest(); + void StartShortTimer(); + void StartLongTimer(); + void IssuePublishPopup(); + void IssueCleanPopup(); + void IssuePublishCaption(); + void IssueCleanCaption(); + + private: // data + /** + * Actions interface + * Ref. + */ + MPopupEventHandlerActions& iPopupEventHandlerActions; + + /** + * State machine instance + * Own. + */ + TPopupFSM iPopupFSM; + + /** + * Timeout timer + * Own. + */ + RTimer iTimer; + + TBool iPublishPopup; + TBool iPopupVisible; + + TBool iPublishCaption; + TBool iCaptionVisible; + }; + +#endif // CPOPUPEVENTHANDLER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/maiscutextdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/maiscutextdata.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: Shortcut plug-in xSP extension data +* +*/ + + +#ifndef MAISCUTEXTDATA_H +#define MAISCUTEXTDATA_H + +#include + +class CGulIcon; + +/** + * @since S60 v3.2 + */ +class MAiScutExtData + { + public: + /** + * @return Pointer to popup line array or NULL if not set + * @since S60 v3.2 + */ + virtual const MDesCArray* PopupLineArray() const = 0; + + /** + * return Pointer to icon or NULL if not set + * @since S60 v3.2 + */ + virtual const CGulIcon* Icon() const = 0; + }; + +#endif // MAISCUTEXTDATA_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/maiscutextmessagehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/maiscutextmessagehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* 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: Shortcut plug-in xSP extension server message handler. +* +*/ + + +#ifndef MAISCUTEXTMESSAGEHANDLER_H +#define MAISCUTEXTMESSAGEHANDLER_H + +#include + +class CGulIcon; + +/** + * + * Shortcut plug-in xSP extension server message handler. + * + * @since S60 v3.2 + */ +class MAiScutExtMessageHandler + { + public: + /** + * Notifies that the popup text has been changed. + * @param aDefinition Target shortcut definition + * @param aLineArray Pointer to array of popup line texts. Ownership + * is transferred. + * @since S60 v3.2 + */ + virtual void HandleSetPopupLineArrayL( const TDesC& aDefinition, + CDesCArray* aLineArray ) = 0; + /** + * Notifies that the popup text has been reseted. + * @param aDefinition Target shortcut definition + * @since S60 v3.2 + */ + virtual void HandleResetPopupLineArrayL( const TDesC& aDefinition ) = 0; + + /** + * Notifies that the ion has been changed. + * @param aDefinition Target shortcut definition + * @param aIcon Pointer to new icon. Ownership + * is transferred. + * @since S60 v3.2 + */ + virtual void HandleSetIconL( const TDesC& aDefinition, + CGulIcon* aIcon ) = 0; + + /** + * Notifies that the icon has been reseted. + * @param aDefinition Target shortcut definition + * @since S60 v3.2 + */ + virtual void HandleResetIconL( const TDesC& aDefinition ) = 0; + + /** + * Checks whether the target is in shortcuts + * @param aDefinition Target shortcut definition + * @return ETrue if the target is in shortcuts + * @since S60 v3.2 + */ + virtual TBool HandleIsInShortcutsL( const TDesC& aDefinition ) const = 0; + + /** + * Launches General Settings so that the target definition is passed in. + * @param aDefinition Target shortcut definition + * @since S60 v3.2 + */ + virtual void HandleIssuePutInShortcutsL( const TDesC& aDefinition ) = 0; + }; + +#endif // MAISCUTEXTMESSAGEHANDLER_H + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/mpopupeventhandleractions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/mpopupeventhandleractions.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 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 MPOPUPEVENTHANDLERACTIONS_H +#define MPOPUPEVENTHANDLERACTIONS_H + +// EXTERNAL INCLUDES +#include + +// CLASS DEFINITION +/** + * MPopupEventHandlerActions. + */ +class MPopupEventHandlerActions + { + public: // Abstract methods + /** + * Publishes the shortcut + */ + virtual void IssuePublishShortcut() = 0; + }; + +#endif // MPOPUPEVENTHANDLERACTIONS_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/inc/taiscutparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/inc/taiscutparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,451 @@ +/* +* 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: Shortcut definition parser. +* +*/ + + +#ifndef TAISCUTPARSER_H +#define TAISCUTPARSER_H +#include // For TUriParser16 +#include + +// ============================================================================= +// ========================= Supported URI schemes ============================= +/** URI scheme for local application shortcuts */ +_LIT( KScutURISchemeLocalApp, "localapp" ); + +/** URI sheme for normal web addresses */ +_LIT( KScutURISchemeHttp, "http" ); +/** URI sheme for secure web addresses */ +_LIT( KScutURISchemeHttps, "https" ); +// ============================================================================= + +// ============================================================================= +// ============= Application shortcut formatting literals ====================== + +/** Literal to format an application shortcut without parameters */ +_LIT( KScutFormatApplication, "localapp:0x%x" ); + +/** Literal to format an application shortcut with parameter name and value */ +_LIT( KScutFormatApplicationWithParams, "localapp:0x%x?%S=%S" ); + +/** Literal to format an application shortcut with a single parameter string */ +_LIT( KScutFormatApplicationWithParamString, "localapp:0x%x?%S" ); + +// ============================================================================= + +// ============================================================================= +// ============ Shortcut parameter name and value literals ===================== + +/** Parameter name for view ids */ +_LIT( KScutParamNameView, "view" ); + +/** Parameter name for remote mailboxes. Specific to messaging shortcuts */ +_LIT( KScutParamNameMailbox, "mailbox" ); + +/** Parameter name for new message and new email. Specific to messaging shortcuts */ +_LIT( KScutParamNameNew, "new" ); + +/** Parameter value for new message shortcuts. */ +_LIT( KScutParamValueMsg, "msg" ); + +/** Parameter value for new email shortcuts */ +_LIT( KScutParamValueEmail, "email" ); + +/** Parameter value for new syncml mail shortcuts */ +_LIT( KScutParamValueSyncMLMail, "syncmlmail" ); + +/** Parameter value for new postcard shortcuts */ +_LIT( KScutParamValuePostcard, "postcard" ); + +/** Parameter value for new audio message shortcuts */ +_LIT( KScutParamValueAudioMsg, "audiomsg" ); + +/** Parameter value for the connectivity status view shortcut */ +const TUid KScutParamValueConnectivityView = { 0x10207250 }; + +/** Parameter name for enable keylock */ +_LIT( KScutParamNameOn, "on" ); + +/** Parameter name for missed calls view */ +_LIT( KScutParamValueMissedCalls, "missed" ); + +/** Parameter name for dialled calls view */ +_LIT( KScutParamValueDialledCalls, "dialled" ); + +/** Parameter name for received calls view */ +_LIT( KScutParamValueReceivedCalls, "received" ); + +/** Parameter name for logs main view */ +_LIT( KScutParamValueMainView, "counters" ); + +/** Parameter name for bookmark ids */ +_LIT( KScutParamNameBookmark, "bkm" ); + +/** Parameter name for icon id in skin + Format localapp:0xUID?iconid=majorid;minorid;optionalColourGroup */ +_LIT( KScutParamNameIconSkinId, "iconid" ); + +/** Parameter name for icon path. Left here for backward + compatibility. + Format localapp:0xUID?iconmifpath=mif_file.mif;index */ +_LIT( KScutParamNameIconMifPath, "iconmifpath" ); + +/** Parameter name for icon path. MBM and MIF supported + Format localapp:0xUID?iconmifpath=mif_file.mif;index */ +_LIT( KScutParamNameIconPath, "iconpath" ); +/** Parameter name for custom URL title. + Format http://www.url.com?customtitle=Here is my great title */ +_LIT( KScutParamNameCustomTitle, "customtitle" ); +/** Parameter name for CBA icon + Format localapp:0xUID?iconid=majorid;minorid;optionalColourGroup&cba=1 */ +_LIT( KScutParamNameCBAIcon, "cba" ); + +/** Parameter name for toolbar icon */ +_LIT( KScutParamNameToolbarIcon, "toolbar" ); + +/** Shortcut definition parameter for "no effect" */ +_LIT( KScutParamNoEffect, "noeffect" ); + +// ============================================================================= +// ============================================================================= +// ============ Shortcut parameter name and value literals ===================== + +/** Alias for messaging shortcuts */ +_LIT( KScutTargetAliasMessaging, "msg" ); + +/** Alias for keylock shortcuts */ +_LIT( KScutTargetAliasKeylock, "keylock" ); + +/** Alias for logs shortcuts */ +_LIT( KScutTargetAliasLogs, "logs" ); + +/** Alias for voice dialer shortcuts */ +_LIT( KScutTargetAliasVoiceDial, "voicedial" ); + +// ============================================================================= +/** Maximum length of shortcut definition. Used when composing a definition */ +const TInt KMaxDefinitionLength = 100; + +/** Shortcut parameter value separator character */ +const TText KParamValueSeparator = '='; + +/** Shortcut parameter next param separator */ +const TText KParamNextSeparator = '&'; + +_LIT( KScutMIFExtension, ".mif" ); +_LIT( KScutMBMExtension, ".mbm" ); +_LIT( KScutSkinItemSeparator, ";" ); + +/** + * Shortcut definition components + */ +enum TScutDefComponent +{ + EScutDefScheme, + EScutDefTarget, + EScutDefParamName, + EScutDefParamValue, + EScutDefParamNameAndValue, + EScutDefComplete +}; + +/** + * Shortcut types + */ +enum TShortcutType +{ + EScutUnknown, + EScutAnyType = 0, + EScutNoEffect, + EScutApplication, + EScutApplicationView, + EScutApplicationWithParams, + EScutNewMessage, + EScutNewEmail, + EScutNewSyncMLMail, + EScutNewPostcard, + EScutNewAudioMsg, + EScutNewMsgType, + EScutMailbox, + EScutChangeTheme, + EScutWebAddress, + EScutBookmark, + EScutKeylock, + EScutLogsMissedCallsView, + EScutLogsDialledCallsView, + EScutLogsReceivedCallsView, + EScutLogsMainView, + EScutConnectivityStatusView, + EScutApplicationManagerView +}; + +/** + * Icon type + */ +enum TShortcutIconType +{ + EScutIconNone, + EScutIconSkin, + EScutIconMif, + EScutIconMbm +}; + +enum TShortcutIconDestination +{ + EScutDestinationNormal, + EScutDestinationSoftkey, + EScutDestinationToolbar +}; + +class TAiScutIcon +{ + public: + /** + * Index of the icon in icon file + */ + TInt iIconId; + + /** + * Path to the icon file + */ + TFileName iPath; + + /** + * Skin item id of the icon + */ + TAknsItemID iSkinId; + + /** + * Colour groups id in skin + */ + TInt iColourGroup; + + /** + * Type of the icon. From skin or from mif + */ + TShortcutIconType iType; + + /** + * AppUid that this icon belongs to + */ + TUid iAppUid; + + /** + * Possible view id + */ + TUid iViewId; + + /** + * Type of the shortcut + */ + TShortcutType iShortcutType; + + /** + * Is this CBA specific icon + */ + TShortcutIconDestination iDestination; + +}; + +/** + * Shortcuf definition parser + * + * @since S60 v3.2 + */ +class TAiScutParser +{ + +public: + TAiScutParser(); + + /** + * Static utility function to parse an uid from the given descriptor + * + * @since S60 v3.2 + * @param aString The String to parse + * @return Parsed application uid + */ + static TUid ParseUid( const TDesC& aDesC ); + + /** + * Parses a shortcut definition + * + * @since S60 v3.2 + * @param aDefinition Shortcut definition + * @return System wide error code. KErrCorrupt if not recognized + */ + TInt Parse( const TDesC& aDefinition ); + + /** + * Checks if the shortcut definition was valid + * + * @since S60 v3.2 + * @return ETrue if valid, EFalse if not + */ + TBool IsValid() const; + + /** + * Returns the shortcut target type + * + * @since S60 v3.2 + * @return Shortcut target type + */ + TShortcutType Type() const; + + /** + * Returns the possible shortcut overriding icon + * that has been defined in the URL either with the format + * localapp:0xUID?iconid=majorid;minorid;colourgroup + * or + * localapp:0xUID?iconmifpath=mif_file.mif;index + * + * @since S60 v3.2 + * @return Shortcut icon override + */ + TAiScutIcon Icon() const; + + /** + * Returns the shortcut target uid. Used for application shortcuts + * + * @since S60 v3.2 + * @return Shortcut target uid + */ + TUid Uid() const; + + /** + * Returns a shortcut definition component value + * + * @since S60 v3.2 + * @param aComponent Shortcut definition component + * @return Pointer descriptor to component value + */ + TPtrC Get( TScutDefComponent aComponent ) const; + + /** + * Composes a shortcut definition string from given parameters + * + * @since S60 v3.2 + * @param aDes On return, the shortcut definition. Transfers ownership + * @param aUid Application uid + * @param aParamName Parameter name + * @param aParamValue Parameter value + */ + void ComposeL( HBufC*& aDes, const TUid aUid, + const TDesC& aParamName, const TDesC& aParamValue ); + + /** + * Composes a shortcut definition string from given parameters + * + * @since S60 v3.2 + * @param aDes On return, the shortcut definition. Transfers ownership + * @param aUid Application uid + * @param aParamString Parameter string + */ + void ComposeL( HBufC*& aDes, const TUid aUid, + const TDesC& aParamString ); + + /** + * Creates a checksum for the given aDefinition. This is used + * in URL matching so that no string need to be stored. Checksum is + * done checksum = positionInString * charValue + * + * @since S60 v3.2 + * @param aDefinition The definition to calculate the checksum from + * @return TInt The checksum + */ + TInt ChecksumForString( const TDesC& aDefinition) const; + + /** + * Removes icon definitions from the given string. Icon definitions are + * KScutParamNameIconSkinId, KScutParamNameIconSkinPath, KScutParamNameCBAIcon + * KScutParamNameCustomTitle + * + * @since S60 v3.2 + */ + void RemoveExtraDefinitionsL( TDes &aString ) const; + /** + * Parses the custom title from the current definition. + * Returns ETrue on success and places the extracted + * custom title to the aTarget + * + * @param aTarget Where to place the custom title. It is callers responsibility + * to provide a descriptor with enough room for the custom title. + * + * @return KErrNone if everything is fine, KErrNotFound + * if there is no custom title in the definition, KErrNoMemory in + * case there is not enough room to place the result (low memory situations + * or too small descriptor provided) + */ + TInt CustomTitle( TDes& aTarget ) const; + +protected: +private: + + /** + * Checks if an alias was used in shortcut definition and parses an uid from it + * + * @since S60 v3.2 + * @return ETrue if alias was found and parsed, EFalse if not + */ + TBool ParseAlias(); + + /** + * Parses the possible application shortcut parameters + * + * @since S60 v3.2 + */ + void ParseParams(); + +private: // data + /** + * URI Parser + */ + TUriParser iUriParser; + + /** + * Pointer to the full shortcut definition + */ + TPtrC iDefinition; + + /** + * Shortcut target type + */ + TShortcutType iType; + + /** + * Shortcut application uid + */ + TUid iUid; + + /** + * Pointer to shortcut parameter name + */ + TPtrC iParamName; + + /** + * Pointer to shortcut parameter value + */ + TPtrC iParamValue; + /** + * Shortcut icon that has been given with the + * URL-string + */ + TAiScutIcon iIcon; + }; + +#endif // TAISCUTPARSER_H + +// End of File. \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/loc/ai3scutplugin.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/loc/ai3scutplugin.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* 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: Localization strings for project aiscutplugin +* +*/ + + +// d: Header text for Information query pop-up window. +// l: heading_pane_t1 +// w: +// r: TB9.2 +// +#define qtn_ai_sc_query_modify_header "Tip:" + +// d: message part in Information query pop-up window, +// d: which informs the user where to set installed application as a shortcut in idle. +// d: %U in the message is the application name +// d: Path in the query text is a link. +// l: popup_info_list_pane_t1 +// w: +// r: TB9.2 +// +#define qtn_ai_sc_query_modify_gs "%U can show additional information in Shortcut area. If you want to modify shortcuts select Options - Change shortcut settings" + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/loc/ai3scutsettings.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/loc/ai3scutsettings.loc Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,2125 @@ +/* +* 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: Localization strings for project aiscutsettings +* +*/ + + +//d:Localized name of the plugin +//d: +//l:list_set_graphic_pane_t1 +//w: +//r:3.2 +// +#define qtn_ai_set_cont_apps "Shortcuts" + +// d: Text in title pane +// l: title_pane_t2/opt9 +// w: +// r: 3.2 +// +#define qtn_set_title_pers_shortcuts "Shortcuts" + +// d: Text of a list item in personalisation view's folder list +// d: Item opens Shortcuts folder +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_pers_shortcuts "Shortcuts" + +// d: Application cannot be opened during Backup +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_ai_scut_operation_disabled "Application cannot be opened during backup" + +// d: Shortcuts Item caption +// d: Active Idle Shortcut Settings View +// d: %N order number of the shortcut item +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_ai_set_myt_linkn "%N. Shortcut item" + +// d: Prompt text for type new URL data query +// d: Active Idle Shortcut Settings View +// l: popup_query_data_window +// w: +// r: 3.2 +// +#define qtn_ai_shorts_type_url "Type URL" + +// d: Prompt text for edit URL data query +// d: Active Idle Shortcut Settings View +// l: popup_query_data_window +// w: +// r: 3.2 +// +#define qtn_ai_shorts_edit_url "Edit URL" + +// d: Prompt text for change shortcut type query +// d: Active Idle Shortcut Settings View +// l: heading_pane_t1 +// w: +// r: 3.2 +// +#define qtn_sc_set_change_prompt "Change to:" + +// d: Application shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_sc_set_change_apps "Application" + +// d: Bookmark shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_sc_set_change_bookmark "Bookmark" + +// d: URL shortcut type choice item in change shortcut type query +// d: Active Idle Shortcut Settings View +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_sc_set_change_url "Web address" + +// d: Text of a list item in shortcut setting view's application list. +// d: User selects this item when she wants Scroll keys or Selection key +// d: have no effect is Idle state. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_skeys_no_effect "No effect" + + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Left idle softkey setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_left_idle_softkey "Left idle softkey" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Right idle softkey setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_right_idle_softkey "Right idle softkey" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Right Scroll key setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_right_scroll "Right Scroll key" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Left Scroll key setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_left_scroll "Left Scroll key" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Down Scroll key setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_down_scroll "Down Scroll key" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Up Scroll key setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_up_scroll "Up Scroll key" + +// d: Title of a list item shortcut setting view's setting list +// d: Item opens Selection key setting page +// l: list_setting_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_selec_key "Selection key" + + +// d: Text for fixed item information note +// d: Shown when user tries to change fixed shortcut in settings +// l: popup_note_window +// w: +// r: 3.2 +// +#define qtn_ai_set_app_note_fixed "Fixed item. Can't be changed" + +// d: Text for empty listbox item +// d: Shown when there are no modifiable shortcuts in settings +// l: main_list_empty_pane +// w: +// r: 3.2 +// +#define qtn_ai_sc_set_all_fixed "(No editable shortcuts available in this Idle theme.)" + +// ===================================================================== +// App titles +// ===================================================================== + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_about_grid "About" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_about_list "About product" + +// d: Focused application name on idle shortcut plugin tooltip. +// l: popup_ai_links_title_window_t1 +// w: +// r: 5.0 +// +#define qtn_app_caption_string "Application Manager" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_am_gs "App. manage" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_am_skey "AppMngr" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_am "AppMngr" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.1 +// +#define qtn_apps_menu_gs "Menu" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_menu_skey "Menu" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_menu "Menu" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_blid_grid "Navigator" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_blid_list "Navigator" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_blid_gs "Navigator" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_blid_skey "Navigator" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_blid "Navigator" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_bluetooth_grid "Bluetooth" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_bluetooth_list "Bluetooth" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_bluetooth_gs "Bluetooth" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_bluetooth_skey "Bluetooth" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_bluetooth "Bluetooth" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_browserng_grid "Web" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_browserng_list "Web" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.1 +// +#define qtn_apps_services_gs_new "WAP services" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_services_skey_new "Services" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_services_new "Services" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_oper_url "%U" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_calculator_grid "Calculator" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_calculator_list "Calculator" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_calculator_gs "Calculator" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_calculator_skey "Calculat." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_calculator "Calculat." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_calendar_grid "Calendar" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_calendar_list "Calendar" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_calendar_gs "Calendar" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_calendar_skey "Calendar" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_calendar "Calendar" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_ccor_grid "Camcorder" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_ccor_list "Camcorder" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_ccor_gs "Camcorder" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_ccor_skey "Camcorder" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_ccor "Camcorder" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_dict_grid "Dictionary" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_dict_list "Dictionary" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_dict_gs "Dictionary" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_dict_skey "Dictionary" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_dict "Dictionary" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_clock_grid "Clock" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_clock_list "Clock" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_clock_gs "Clock" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_clock_skey "Clock" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_clock "Clock" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_cmon_grid "Conn. Manager" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_cmon_list "Conn. Manager" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_cmon_gs "Conn. manager" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_cmon_skey "Conn. m." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_cmon "Conn. m." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_cnv_app_caption_short "Converter" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_cnv_app_caption "Converter" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_converter_gs "Converter" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_converter_skey "Convert." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_converter "Convert." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_dm_grid "Device Manager" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_dm_list "Device Manager" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.6 +// +#define qtn_apps_dm_gs "Device manager" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.6 +// +#define qtn_apps_dm_skey "Dev. mgr." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_dm "Dev. mgr." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_drm_grid "Rights Mgr" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_drm_list "Rights Manager" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_drm_gs "Rights manager" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_drm_skey "DRM Mgr" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_drm "DRM Mgr" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_fax_modem_grid "Modem" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_fax_modem_list "Modem" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_fax_modem_gs "Modem" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_fax_modem_skey "Modem" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_fax_modem "Modem" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_fmgr_grid "File manager" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_fmgr_list "File manager" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_fmgr_gs "File manager" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_fmgr_skey "File manager" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_fmgr "File Manager" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_radio_grid "Radio" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_radio_list "Radio" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_radio_gs "Radio" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.7 +// +#define qtn_apps_radio_skey "Radio" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_radio "Radio" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.7 +// +#define qtn_fmtx_idle_sk "FM Tx sk" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_fmtx_idle_msk "FM Tx msk" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_settings_grid "Settings" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_settings_list "Settings" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_settings_gs "Settings" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_settings_skey "Settings" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_gs "Settings" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 5.0 +// +#define qtn_apps_controlpanel_grid "Control Panel" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 5.0 +// +#define qtn_apps_controlpanel_list "Control Panel" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 5.0 +// +#define qtn_apps_controlpanel_gs "Control Panel" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 5.0 +// +#define qtn_apps_controlpanel_skey "Control Panel" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 5.0 +// +#define qtn_msk_idle_controlpanel "Control Panel" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_help_grid "Help" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_help_list "Help" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_help_gs "Help" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_help_skey "Help" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_help "Help" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_infrared_grid "Infrared" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_infrared_list "Infrared" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_infrared_gs "Infrared" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_infrared_skey "Infrared" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_infrared "Infrared" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_instant_grid "Chat" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_instant_list "Chat" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_instant_gs "Chat" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_instant_skey "Chat" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_instant "Chat" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_udict_grid "User dict." + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_udict_list "User dictionary" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_udict_gs "User dictionary" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_udict_skey "User dict." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_udict "User dict." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_lm_grid "Landmarks" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_lm_list "Landmarks" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_lm_gs "Landmarks" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_lm_skey "Landmarks" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_lm "Landmarks" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_logs_grid "Log" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_logs_list "Log" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_logs_gs "Log" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_logs_skey "Log" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_logs "Log" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mg_grid "Gallery" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mg_list "Gallery" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_mg_gs "Gallery" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_mg_skey "Gallery" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mg "Gallery" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mp_grid "Media Player" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mp_list "Media Player" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_mp_gs "Media Player" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_mp_skey "Media Player" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mp "Media Player" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_memc_appl_grid "Memory" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_memc_appl_list "Memory card" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_mmc_gs "Memory Card" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_mmc_skey "Memory c..." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mmc "Memory c..." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_messaging_grid "Messages" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_messaging_list "Messages" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_messaging_gs "Messages" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_messaging_skey "Messag." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_messaging "Messag." + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_set_idle_skey_new_message "New message" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// d: User is prompted to write SMS, MMS or Email if the softkey is pressed. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_idle_skey_new_message "New msg." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_new_message "New msg." + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special New Message shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_skey_new_msg "New message" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// d: User is prompted to new message if the softkey is pressed. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_idle_skey_new_msg "New message" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_new_msg "New message" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_set_idle_skeys_sms_editor "New SMS" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_sms_skey "New SMS" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_sms "New SMS" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_set_idle_skeys_mms_editor "New MMS" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_mms_skey "New MMS" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mms "New MMS" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special Select message type shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_skey_select_msg_type "Select msg type" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// d: User is prompted to Select message if the softkey is pressed. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_idle_skey_select_msg "Select msg" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_select_msg "Select msg" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special New Email shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_set_idle_skeys_email_editor "New Email" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_email_skey "New Email" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_email "New Email" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special New MMS Postcard shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mmspostcard_gs "New MMS postcard" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_mmspostcard_skey "New MMS postcard" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mmspostcard "New MMS postcard" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special New SyncML mail shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_syncml_mail_gs "New SyncML mail" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_syncml_mail_skey "New SyncML mail" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_syncml_mail "New SyncML mail" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special New Audio message shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_audio_msg_gs "New audio message" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1u +// +#define qtn_apps_audio_msg_skey "New audio msg" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_audio_msg "New audio msg" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mplayer_grid "Music player" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mplayer_list "Music player" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_mplayer_gs "Music player" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_mplayer_skey "Music" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mplayer "Music" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_notepad_grid "Notepad" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_notepad_list "Notepad" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_notepad_gs "Notepad" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_notepad_skey "Notepad" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_notepad "Notepad" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_notepad_newnote_gs "New note" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_notepad_newnote_skey "New note" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_notepad_newnote "New note" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_skins_grid "Skins" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_skins_list "Skins" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_skins_gs "Skins" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_skins_skey "Skins" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_skins "Skins" + +// d: Text of a list item in shortcut setting view's application list. +// d: Caption for the special Change Theme shortcut +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_gs "Idle theme" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_idle_skin_skey "Idle theme" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_skin "Idle theme" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_phone_grid "Telephone" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_phone_list "Telephone" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_phonebook_grid "Contacts" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_phonebook_list "Contacts" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_phonebook_gs "Contacts" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_phonebook_skey "Contacts" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_phonebook "Contacts" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mode_grid "Profiles" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_mode_list "Profiles" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_mode_gs "Profiles" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_mode_skey "Profiles" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_mode "Profiles" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_ptt_grid "PTT" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_ptt_list "Pust to talk" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_ptt_gs "Push to talk" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_ptt_skey "PTT" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_ptt "PTT" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_search_grid "Search" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_search_list "Search" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_search_gs "Search" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.2 +// +#define qtn_apps_search_skey "Search" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_search "Search" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_simapps_grid "SIM services" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_simapps_list "SIM services" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_sd_grid "Speed dial" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_sd_list "Speed dial" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_sd_gs "Speed dial" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_sd_skey "Sp. dials" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_sd "Sp. dials" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_usb_grid "USB" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_usb_list "USB" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_usb_gs "USB" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_usb_skey "USB" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_usb "USB" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_vc_grid "Voice Commands" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_vc_list "Voice Commands" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_vc_gs "Voice Commands" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_vc_skey "Voice Commands" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_vc "Voice Commands" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_smsvo_grid "Voice mail" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_smsvo_list "Voice mailbox" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_smsvo_gs "Voice mailbox" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_smsvo_skey "Voice m." + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_smsvo "Voice m." + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_voip_grid "Voice over IP" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_voip_list "Voice over IP" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 3.0 +// +#define qtn_apps_voip_gs "Voice over IP" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.0 +// +#define qtn_apps_voip_skey "Voice over IP" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_voip "Voice over IP" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_vorec_app_menu_grid "Recorder" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 3.2 +// +#define qtn_vorec_app_menu_list "Recorder" + +// d: Text of a list item in shortcut setting view's application list. +// l: list_set_graphic_pane_t1 +// w: +// r: 2.8 +// +#define qtn_apps_recorder_gs "Recorder" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 2.8 +// +#define qtn_apps_recorder_skey "Recorder" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 3.2 +// +#define qtn_msk_idle_recorder "Recorder" + +// d: Application name in the App Shell grid. +// l: cell_app_pane_t1 +// w: +// r: 3.2 +// +#define qtn_apps_sml_grid "Sync" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1_cp2 +// w: +// r: 3.2 +// +#define qtn_apps_sml_list "Sync" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_video_grid "Vid.Services" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_operatormenu_skey "Oper. menu" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_fplayer_skey "Flash Player" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 3.1 +// +#define qtn_apps_exchangemail_skey "Exh. mail" + +// d: Application name in the App Shell list. +// l: list_single_large_graphic_pane_t1 +// w: +// r: 5.0 +// +#define qtn_apps_connectivity_list "Connectivity" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as Left or Right idle softkey. +// l: control_pane_t1/opt7 +// w: +// r: 5.0 +// +#define qtn_apps_connectivity_skey "Connectivity" + +// d: User can personalize idle softkeys to be other application from general settings. +// d: The text is shown as middle softkey. +// l: control_pane_t3/opt7 +// w: +// r: 5.0 +// +#define qtn_msk_idle_connectivity "Connectivity" + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/rom/aiscutplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/rom/aiscutplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* 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: Image description file for project aiscutplugin +* +*/ + + +#ifndef AISCUTPLUGIN_IBY +#define AISCUTPLUGIN_IBY + +#include + +// Shortcut plugin +data=DATAZ_\BITMAP_DIR\aiscutplugin.mif BITMAP_DIR\aiscutplugin.mif +ECOM_PLUGIN( aiscutplugin.dll, aiscutplugin.rsc ) + +// Shortcut settings plugin +ECOM_PLUGIN( aiscutsettings.dll, aiscutsettings.rsc ) + +file=ABI_DIR\BUILD_DIR\aiscutextserv.dll SHARED_LIB_DIR\aiscutextserv.dll + +// Central repository file, temporarily here +//data=\S60\ActiveIdle2\plugins\shortcutplugin\src\10275104.txt "private\10202BE9\10275104.txt" + +data=ZPRIVATE\102750F9\backup_registration.xml private\102750F9\backup_registration.xml + +#endif // AISCUTPLUGIN_IBY + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/rom/aiscutplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/rom/aiscutplugin_resources.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,31 @@ +/* +* 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: Image description file for project aiscutplugin localizable resources +* +*/ + + +#ifndef AISCUTPLUGIN_RESOURCES_IBY +#define AISCUTPLUGIN_RESOURCES_IBY + +#include + +// Shortcut settings plugin localizable resources +data=DATAZ_\RESOURCE_FILES_DIR\aiscutsettingsres.rsc RESOURCE_FILES_DIR\aiscutsettingsres.rsc +data=DATAZ_\RESOURCE_FILES_DIR\aiscuttexts.rsc RESOURCE_FILES_DIR\aiscuttexts.rsc +data=DATAZ_\RESOURCE_FILES_DIR\aiscutpluginres.rsc RESOURCE_FILES_DIR\aiscutpluginres.rsc + +#endif // AISCUTPLUGIN_RESOURCES_IBY + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/GenPopupFSM.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/GenPopupFSM.py Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,350 @@ +# +# Copyright (c) 2009 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: +# + +''' +Finite State Machine generator for Symbian OS projects. + +Just define fsmName, actionsIfaceName and stt and the script generates the +needed files for you. + +The files are: +- State Machine header file (including state classes, overwrites the existing file) +- State Machine source file (including state classes, overwrites the existing file) +- Actions interface header (abstract M-class, overwrites the existing file) +- Header file for tracing (will be generated only if missing) + + +Version 1: 22-Jun-2006, Jaakko Vuori, Initial version +Version 2: 26-Jun-2006, Jaakko Vuori, Added argument passing +Version 3: 27-Jun-2006, Jaakko Vuori, Changed state classes nested in FSM class + +''' +from sets import Set +import os, re, string + +#------------------------------------------------------------------------ +#State machine name +fsmName = "Popup" + +#Actions interface name +actionsIfaceName = "PopupFSMActions" + +#State transition table +stt=[ #source state #event #dest state #actions + ("NotSetOffFocus", [ + ("HandleUpdate()", "SetOffFocus", ["IssueCleanCaption()"]), + ("HandleGotFocus()", "NotSetOnFocus", []), + ("HandleForeground()", "NotSetOffFocus", ["IssuePublishCaption()"]), + ]), + + ("SetOffFocus", [ + ("HandleGotFocus()", "GettingFocus", ["StartShortTimer()"]), + ("HandleReset()", "NotSetOffFocus", ["IssuePublishCaption()"]), + ]), + + ("GettingFocus", [ + ("HandleRequestCompleted()", "Visible", ["IssuePublishPopup()", "StartLongTimer()"]), + ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()", "CancelRequest()"]), + ("HandleLostFocus()", "SetOffFocus", ["CancelRequest()"]), + ]), + + ("LosingFocus", [ + ("HandleRequestCompleted()", "SetOffFocus", ["IssueCleanPopup()"]), + ("HandleReset()", "NotSetOffFocus", ["IssuePublishCaption()", "CancelRequest()"]), + ("HandleGotFocus()", "Visible", ["CancelRequest()", "StartLongTimer()"]), + ]), + + ("NotSetOnFocus", [ + ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), + ("HandleLostFocus()", "NotSetOffFocus", []), + ("HandleBackground()", "BackgroundNotSetOnFocus", []), + ("HandleForeground()", "NotSetOnFocus", ["IssuePublishCaption()"]), + ]), + + ("Visible", [ + ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), + ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()", "IssueCleanPopup()", "CancelRequest()"]), + ("HandleLostFocus()", "LosingFocus", ["CancelRequest()", "CompleteSelf()"]), + ("HandleRequestCompleted()", "NotVisible", ["IssueCleanPopup()"]), + ("HandleBackground()", "BackgroundSetOnFocus", ["CancelRequest()", "IssueCleanPopup()"]), + ]), + + ("NotVisible", [ + ("HandleUpdate()", "Visible", ["IssueCleanCaption()", "IssuePublishPopup()", "StartLongTimer()"]), + ("HandleReset()", "NotSetOnFocus", ["IssuePublishCaption()"]), + ("HandleLostFocus()", "SetOffFocus", []), + ]), + + ("BackgroundNotSetOnFocus", [ + ("HandleForeground()", "NotSetOnFocus", ["IssuePublishCaption()"]), + ("HandleUpdate()", "BackgroundSetOnFocus", ["IssueCleanCaption()"]), + ]), + + ("BackgroundSetOnFocus", [ + ("HandleReset()", "BackgroundNotSetOnFocus", ["IssuePublishCaption()"]), + ("HandleForeground()", "Visible", ["IssuePublishPopup()", "StartLongTimer()"]), + ]), + + ] +#------------------------------------------------------------------------ + +def write( s ): + f.write( s + '\n' ) + +def writeHeader(): + global f + fname = '%sFSM.h' % (fsmName) + print "Generating %s..." % (fname) + f = open( fname, 'w' ) + + write( "#ifndef %sFSM_H" % ( fsmName.upper() ) ) + write( "#define %sFSM_H" % ( fsmName.upper() ) ) + write( "" ) + write( "// EXTERNAL INCLUDES" ) + write( "#include " ) + write( "" ) + write( "// FORWARD DECLARATIONS" ) + write( "class T%sFSM;" % (fsmName) ) + write( "class M%s;" % (actionsIfaceName) ) + write( "" ) + write( "// CLASS DEFINITIONS" ) + + write( "/**" ) + write( " * %s state machine" % (fsmName) ) + write( " */" ) + write( "class T%sFSM" % (fsmName) ) + write( " {" ) + + write( " /**" ) + write( " * Base class for states" ) + write( " */" ) + write( " class T%sStateBase" % (fsmName) ) + write( " {" ) + write( " public: // New methods" ) + + events=[] + for s in stt: + for e in s[1]: + events.append( e[0] ) + for event in Set(events): + fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() + if len(args)>0: + write( " virtual void %s( T%sFSM* a%sFSM, M%s& a%s,%s);" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) + else: + write( " virtual void %s( T%sFSM* a%sFSM, M%s& a%s );" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) + + + write( " };" ) + write( "" ) + + for s in stt: + write( " /**" ) + write( " * State class T%s" % (s[0]) ) + write( " */" ) + write( " class T%s : public T%sStateBase" % (s[0],fsmName) ) + write( " {" ) + write( " protected: // Methods derived from T%sState" % (fsmName)) + for event in s[1]: + fname, args = re.match('(.*?)[(](.*?)[)]',event[0]).groups() + if len(args)>0: + write( " void %s( T%sFSM* a%sFSM, M%s& a%s,%s);" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) + else: + write( " void %s( T%sFSM* a%sFSM, M%s& a%s );" % (fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) + + write( " };" ) + write( "" ) + + write( "" ) + write( " public: // Constructors" ) + write( " T%sFSM( M%s& a%s );" % (fsmName,actionsIfaceName,actionsIfaceName)) + write( "" ) + write( " public: // New methods" ) + for event in Set(events): + write( " void %s;" % (event)) + write( "" ) + write( " private: // New methods" ) + write( " void SetState( T%sStateBase* aNewState );" % (fsmName) ) + write( "" ) + write( " private: // Data" ) + write( " //Ref:" ) + write( " T%sStateBase* iCurrentState;" % (fsmName)) + write( " M%s& i%s;" % (actionsIfaceName,actionsIfaceName)) + write( "" ) + write( " //Own:" ) + for s in stt: + write( " T%s i%s;" % (s[0],s[0])) + + write( " private: // Friend class definitions" ) + for s in stt: + write( " friend class T%s;" % (s[0])) + + write( " };" ) + write( "" ) + write( "#endif // %sFSM_H" % (fsmName.upper()) ) + write( "" ) + write( "// End of file" ) + f.close() + + +def writeSource(): + global f + fname = '%sFSM.cpp' % (fsmName) + print "Generating %s..." % (fname) + f = open( fname, 'w' ) + + write( '#include "%sFSM.h"' % (fsmName) ) + write( '#include "M%s.h"' % (actionsIfaceName) ) + write( '#include "%sTrace.h"' % (fsmName) ) + write( '' ) + write( '#pragma warning( disable:4100 )' ) + write( '#pragma warning( disable:4068 )' ) + write( '#pragma warn_unusedarg off' ) + + write( '' ) + write( 'T%sFSM::T%sFSM( M%s& a%s ) : ' % (fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) + write( ' iCurrentState( &i%s ),' % (stt[0][0]) ) + write( ' i%s( a%s )' % (actionsIfaceName,actionsIfaceName) ) + write( ' {' ) + write( ' }' ) + write( '' ) + + events=[] + for s in stt: + for e in s[1]: + events.append( e[0] ) + + for event in Set(events): + fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() + if len(args)>0: + write( 'void T%sFSM::T%sStateBase::%s( T%sFSM* /*a%sFSM*/, M%s& /*a%s*/,%s )' % (fsmName,fsmName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args)) + else: + write( 'void T%sFSM::T%sStateBase::%s( T%sFSM* /*a%sFSM*/, M%s& /*a%s*/ )' % (fsmName,fsmName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName)) + write( ' {' ) + write( ' TRACE( _L("T%sStateBase::%s") );' % (fsmName,event)) + write( ' }' ) + write( '' ) + + for event in Set(events): + fname, args = re.match('(.*?)[(](.*?)[)]',event).groups() + write( 'void T%sFSM::%s(%s)' % (fsmName,fname,args) ) + write( ' {' ) + arglist=args.split(',') + argnames = string.join([arg.split()[-1:][0] for arg in arglist if arg!=""], ', ') + if len(argnames)>0: + write( ' iCurrentState->%s( this, i%s, %s );' % (fname,actionsIfaceName,argnames) ) + else: + write( ' iCurrentState->%s( this, i%s );' % (fname,actionsIfaceName) ) + write( ' }' ) + write( '' ) + + write( 'void T%sFSM::SetState( T%sStateBase* aNewState )' % (fsmName,fsmName) ) + write( ' {' ) + write( ' iCurrentState = aNewState;' ) + write( ' }' ) + write( '' ) + + for s in stt: + stateName, events = s + for event in events: + eventName = event[0] + destState = event[1] + actions = event[2] + fname, args = re.match('(.*?)[(](.*?)[)]',eventName).groups() + if len(actions)>0: + if len(args)>0: + write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& a%s,%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) + else: + write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& a%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) + else: + if len(args)>0: + write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& /*a%s*/,%s )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName,args) ) + else: + write( 'void T%sFSM::T%s::%s( T%sFSM* a%sFSM, M%s& /*a%s*/ )' % (fsmName,stateName,fname,fsmName,fsmName,actionsIfaceName,actionsIfaceName) ) + + write( ' {' ) + write( ' TRACE( _L("T%s::%s") );' % (stateName, eventName) ) + write( ' a%sFSM->SetState( &a%sFSM->i%s );' % (fsmName,fsmName,destState) ) + for action in actions: + fname, args = re.match('(.*?)[(](.*?)[)]',action).groups() + if len(args)>0: + arglist=args.split(',') + argnames = string.join([arg.split()[-1:][0] for arg in arglist if arg!=""], ', ') + write( ' a%s.%s( %s );' % (actionsIfaceName,fname,argnames) ) + else: + write( ' a%s.%s();' % (actionsIfaceName,fname) ) + write( ' }' ) + write( '' ) + + write( '// End of file' ) + + +def writeTraceHeader(): + if not os.path.isfile( '%sTrace.h' % (fsmName) ): + global f + fname = '%sTrace.h' % (fsmName) + print "Generating %s..." % (fname) + f = open( fname, 'w' ) + write( '#ifndef %sTRACE_H' % (fsmName.upper()) ) + write( '#define %sTRACE_H' % (fsmName.upper()) ) + write( '' ) + write( '// MACROS' ) + write( '#define TRACE' ) + write( '' ) + write( '#endif // %sTRACE_H' % (fsmName.upper()) ) + write( '' ) + write( '// End of file' ) + f.close() + + +def writeActionsIface(): + global f + fname = 'M%s.h' % (actionsIfaceName) + print "Generating %s..." % (fname) + f = open( fname, 'w' ) + + write( '#ifndef M%s_H' % (actionsIfaceName.upper()) ) + write( '#define M%s_H' % (actionsIfaceName.upper()) ) + write( '' ) + write( '// EXTERNAL INCLUDES' ) + write( '#include ' ) + write( '' ) + write( '// CLASS DEFINITION' ) + write( '/**' ) + write( ' * M%s actions.' % (actionsIfaceName) ) + write( ' * Note: This file has been generated automatically. Do not edit!' ) + write( ' */' ) + write( 'class M%s' % (actionsIfaceName) ) + write( ' {' ) + write( ' public: // Abstract methods' ) + + actions=[] + for s in stt: + for e in s[1]: + actions.extend( e[2] ) + for action in Set(actions): + write( ' virtual void %s = 0;' % (action)) + write( ' };' ) + write( '' ) + write( '#endif // M%s_H' % (actionsIfaceName.upper()) ) + write( '' ) + write( '// End of file' ) + f.close() + +if __name__ == "__main__": + writeHeader() + writeSource() + writeTraceHeader() + writeActionsIface() diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/MPopupFSMActions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/MPopupFSMActions.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 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 MPOPUPFSMACTIONS_H +#define MPOPUPFSMACTIONS_H + +// EXTERNAL INCLUDES +#include + +// CLASS DEFINITION +/** + * MPopupFSMActions actions. + * Note: This file has been generated automatically. Do not edit! + */ +class MPopupFSMActions + { + public: // Abstract methods + virtual void StartLongTimer() = 0; + virtual void IssueCleanPopup() = 0; + virtual void IssuePublishPopup() = 0; + virtual void IssuePublishCaption() = 0; + virtual void IssueCleanCaption() = 0; + virtual void StartShortTimer() = 0; + virtual void CompleteSelf() = 0; + virtual void CancelRequest() = 0; + }; + +#endif // MPOPUPFSMACTIONS_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/PopupFSM.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/PopupFSM.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,306 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "PopupFSM.h" +#include "MPopupFSMActions.h" +#include "PopupTrace.h" + +#pragma warning( disable:4100 ) +#pragma warning( disable:4068 ) +#pragma warn_unusedarg off + +TPopupFSM::TPopupFSM( MPopupFSMActions& aPopupFSMActions ) : + iCurrentState( &iNotSetOffFocus ), + iPopupFSMActions( aPopupFSMActions ) + { + } + +void TPopupFSM::TPopupStateBase::HandleForeground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleForeground()") ); + } + +void TPopupFSM::TPopupStateBase::HandleUpdate( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleUpdate()") ); + } + +void TPopupFSM::TPopupStateBase::HandleRequestCompleted( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleRequestCompleted()") ); + } + +void TPopupFSM::TPopupStateBase::HandleReset( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleReset()") ); + } + +void TPopupFSM::TPopupStateBase::HandleBackground( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleBackground()") ); + } + +void TPopupFSM::TPopupStateBase::HandleGotFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleGotFocus()") ); + } + +void TPopupFSM::TPopupStateBase::HandleLostFocus( TPopupFSM* /*aPopupFSM*/, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TPopupStateBase::HandleLostFocus()") ); + } + +void TPopupFSM::HandleForeground() + { + iCurrentState->HandleForeground( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleUpdate() + { + iCurrentState->HandleUpdate( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleRequestCompleted() + { + iCurrentState->HandleRequestCompleted( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleReset() + { + iCurrentState->HandleReset( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleBackground() + { + iCurrentState->HandleBackground( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleGotFocus() + { + iCurrentState->HandleGotFocus( this, iPopupFSMActions ); + } + +void TPopupFSM::HandleLostFocus() + { + iCurrentState->HandleLostFocus( this, iPopupFSMActions ); + } + +void TPopupFSM::SetState( TPopupStateBase* aNewState ) + { + iCurrentState = aNewState; + } + +void TPopupFSM::TNotSetOffFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotSetOffFocus::HandleUpdate()") ); + aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); + aPopupFSMActions.IssueCleanCaption(); + } + +void TPopupFSM::TNotSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TNotSetOffFocus::HandleGotFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + } + +void TPopupFSM::TNotSetOffFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotSetOffFocus::HandleForeground()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TSetOffFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TSetOffFocus::HandleGotFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iGettingFocus ); + aPopupFSMActions.StartShortTimer(); + } + +void TPopupFSM::TSetOffFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TSetOffFocus::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TGettingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TGettingFocus::HandleRequestCompleted()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.IssuePublishPopup(); + aPopupFSMActions.StartLongTimer(); + } + +void TPopupFSM::TGettingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TGettingFocus::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + aPopupFSMActions.CancelRequest(); + } + +void TPopupFSM::TGettingFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TGettingFocus::HandleLostFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); + aPopupFSMActions.CancelRequest(); + } + +void TPopupFSM::TLosingFocus::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TLosingFocus::HandleRequestCompleted()") ); + aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); + aPopupFSMActions.IssueCleanPopup(); + } + +void TPopupFSM::TLosingFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TLosingFocus::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); + aPopupFSMActions.IssuePublishCaption(); + aPopupFSMActions.CancelRequest(); + } + +void TPopupFSM::TLosingFocus::HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TLosingFocus::HandleGotFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.CancelRequest(); + aPopupFSMActions.StartLongTimer(); + } + +void TPopupFSM::TNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotSetOnFocus::HandleUpdate()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.IssueCleanCaption(); + aPopupFSMActions.IssuePublishPopup(); + aPopupFSMActions.StartLongTimer(); + } + +void TPopupFSM::TNotSetOnFocus::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TNotSetOnFocus::HandleLostFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOffFocus ); + } + +void TPopupFSM::TNotSetOnFocus::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TNotSetOnFocus::HandleBackground()") ); + aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); + } + +void TPopupFSM::TNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotSetOnFocus::HandleForeground()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TVisible::HandleUpdate()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.IssueCleanCaption(); + aPopupFSMActions.IssuePublishPopup(); + aPopupFSMActions.StartLongTimer(); + } + +void TPopupFSM::TVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TVisible::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + aPopupFSMActions.IssueCleanPopup(); + aPopupFSMActions.CancelRequest(); + } + +void TPopupFSM::TVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TVisible::HandleLostFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iLosingFocus ); + aPopupFSMActions.CancelRequest(); + aPopupFSMActions.CompleteSelf(); + } + +void TPopupFSM::TVisible::HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TVisible::HandleRequestCompleted()") ); + aPopupFSM->SetState( &aPopupFSM->iNotVisible ); + aPopupFSMActions.IssueCleanPopup(); + } + +void TPopupFSM::TVisible::HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TVisible::HandleBackground()") ); + aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); + aPopupFSMActions.CancelRequest(); + aPopupFSMActions.IssueCleanPopup(); + } + +void TPopupFSM::TNotVisible::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotVisible::HandleUpdate()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.IssueCleanCaption(); + aPopupFSMActions.IssuePublishPopup(); + aPopupFSMActions.StartLongTimer(); + } + +void TPopupFSM::TNotVisible::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TNotVisible::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TNotVisible::HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& /*aPopupFSMActions*/ ) + { + TRACE( _L("TNotVisible::HandleLostFocus()") ); + aPopupFSM->SetState( &aPopupFSM->iSetOffFocus ); + } + +void TPopupFSM::TBackgroundNotSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TBackgroundNotSetOnFocus::HandleForeground()") ); + aPopupFSM->SetState( &aPopupFSM->iNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TBackgroundNotSetOnFocus::HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TBackgroundNotSetOnFocus::HandleUpdate()") ); + aPopupFSM->SetState( &aPopupFSM->iBackgroundSetOnFocus ); + aPopupFSMActions.IssueCleanCaption(); + } + +void TPopupFSM::TBackgroundSetOnFocus::HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TBackgroundSetOnFocus::HandleReset()") ); + aPopupFSM->SetState( &aPopupFSM->iBackgroundNotSetOnFocus ); + aPopupFSMActions.IssuePublishCaption(); + } + +void TPopupFSM::TBackgroundSetOnFocus::HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ) + { + TRACE( _L("TBackgroundSetOnFocus::HandleForeground()") ); + aPopupFSM->SetState( &aPopupFSM->iVisible ); + aPopupFSMActions.IssuePublishPopup(); + aPopupFSMActions.StartLongTimer(); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/PopupFSM.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/PopupFSM.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2009 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 POPUPFSM_H +#define POPUPFSM_H + +// EXTERNAL INCLUDES +#include + +// FORWARD DECLARATIONS +class TPopupFSM; +class MPopupFSMActions; + +// CLASS DEFINITIONS +/** + * Popup state machine + */ +class TPopupFSM + { + /** + * Base class for states + */ + class TPopupStateBase + { + public: // New methods + virtual void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + virtual void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TNotSetOffFocus + */ + class TNotSetOffFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TSetOffFocus + */ + class TSetOffFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TGettingFocus + */ + class TGettingFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TLosingFocus + */ + class TLosingFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleGotFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TNotSetOnFocus + */ + class TNotSetOnFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TVisible + */ + class TVisible : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleRequestCompleted( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleBackground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TNotVisible + */ + class TNotVisible : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleLostFocus( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TBackgroundNotSetOnFocus + */ + class TBackgroundNotSetOnFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleUpdate( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + /** + * State class TBackgroundSetOnFocus + */ + class TBackgroundSetOnFocus : public TPopupStateBase + { + protected: // Methods derived from TPopupState + void HandleReset( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + void HandleForeground( TPopupFSM* aPopupFSM, MPopupFSMActions& aPopupFSMActions ); + }; + + + public: // Constructors + TPopupFSM( MPopupFSMActions& aPopupFSMActions ); + + public: // New methods + void HandleForeground(); + void HandleUpdate(); + void HandleRequestCompleted(); + void HandleReset(); + void HandleBackground(); + void HandleGotFocus(); + void HandleLostFocus(); + + private: // New methods + void SetState( TPopupStateBase* aNewState ); + + private: // Data + //Ref: + TPopupStateBase* iCurrentState; + MPopupFSMActions& iPopupFSMActions; + + //Own: + TNotSetOffFocus iNotSetOffFocus; + TSetOffFocus iSetOffFocus; + TGettingFocus iGettingFocus; + TLosingFocus iLosingFocus; + TNotSetOnFocus iNotSetOnFocus; + TVisible iVisible; + TNotVisible iNotVisible; + TBackgroundNotSetOnFocus iBackgroundNotSetOnFocus; + TBackgroundSetOnFocus iBackgroundSetOnFocus; + private: // Friend class definitions + friend class TNotSetOffFocus; + friend class TSetOffFocus; + friend class TGettingFocus; + friend class TLosingFocus; + friend class TNotSetOnFocus; + friend class TVisible; + friend class TNotVisible; + friend class TBackgroundNotSetOnFocus; + friend class TBackgroundSetOnFocus; + }; + +#endif // POPUPFSM_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/PopupTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/PopupTrace.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2009 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 POPUPTRACE_H +#define POPUPTRACE_H + +// MACROS +#define TRACE + +#endif // POPUPTRACE_H + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aidefaultshortcut.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aidefaultshortcut.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,180 @@ +/* +* 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: Platform default shortcuts. +* +*/ + + +#include "aidefaultshortcut.h" +#include "taiscutparser.h" +#include +#include +#include +#include // For wchar_t + +namespace { + + struct TDefaultShortcut + { + /** + * Identifier + */ + TInt id; + + /** + * Key to identify this shortcut + */ + TInt key; + + /** + * Definition for this shortcut + */ + const wchar_t* definition; + }; + + enum TDefaultShortcutCenrepId + { + EDefaultShortcutFirst = 0, + EDefaultShortcutSecond, + EDefaultShortcutThird, + EDefaultShortcutFourth, + EDefaultShortcutFifth, + EDefaultShortcutSixth, + EDefaultShortcutSeventh, + EDefaultShortcutEighth, + EDefaultShortcutNaviLeft, + EDefaultShortcutNaviRight, + EDefaultShortcutNaviUp, + EDefaultShortcutNaviDown, + EDefaultShortcutNaviKey, + EDefaultShortcutLSK, + EDefaultShortcutRSK + }; + + // Platform default shortcuts. + const TDefaultShortcut KDefaultShortcuts[] = + { + { EDefaultShortcutFirst, 0x00000001, L"localapp:0x101F4CCE" }, // Phonebook, + { EDefaultShortcutSecond, 0x00000002, L"localapp:0x100058C5" }, // Messaging, + { EDefaultShortcutThird, 0x00000003, L"localapp:0x10008D39" }, // Browser, + { EDefaultShortcutFourth, 0x00000004, L"localapp:0x200009EE" }, // Photos, + { EDefaultShortcutFifth, 0x00000005, L"localapp:0x10005901" }, // Calendar, + { EDefaultShortcutSixth, 0x00000006, L"localapp:msg?new=msg" }, // New message, + { EDefaultShortcutSeventh, 0x00000007, L"localapp:0x102072C3" }, // Music Player, + { EDefaultShortcutEighth, 0x00000008, L"localapp:0x10207A89" }, // Radio, + { EDefaultShortcutNaviLeft, 0x01000000, L"localapp:0x100058C5?new=msg" }, // New message, + { EDefaultShortcutNaviRight, 0x01000001, L"localapp:0x10005901" }, // Calendar, + { EDefaultShortcutNaviUp, 0x01000002, L"localapp:0x101F4CCE" }, // Contacts, + { EDefaultShortcutNaviDown, 0x01000003, L"localapp:0x101F4CCE" }, // Contacts, + { EDefaultShortcutNaviKey, 0x01000004, L"localapp:0x100058C5" }, // Messagind, + { EDefaultShortcutLSK, 0x01000100, L"localapp:0x101F4CD2" }, // Menu, + { EDefaultShortcutRSK, 0x01000101, L"localapp:0x101F4CCE" } // Contacts, + }; + + const TInt KDefaultShortcutCount = (sizeof(KDefaultShortcuts)/sizeof(KDefaultShortcuts[0])); +} + +inline TPtrC16 DefaultDefinition( const TDefaultShortcut& aShortcut ) + { + return TPtrC16( (const TText16*) aShortcut.definition ); + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void GetPlatformDefaultShortcut(TInt aIndex, TUid& aUid, TDes& aDefinition) + { + TInt err = KErrNone; + TAiScutParser parser; + if (aIndex < 0) + { + aIndex = 0; + } + + aIndex = aIndex % ::KDefaultShortcutCount; + aDefinition.Copy( ::DefaultDefinition(::KDefaultShortcuts[aIndex]) ); + + err = parser.Parse( aDefinition ); + if ( err == KErrNone ) + { + aUid = TAiScutParser::ParseUid( parser.Get( EScutDefTarget) ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt ResolveCenrepIdFromKey( TInt aKey, TInt &aCenrepId ) + { + TInt ret = KErrNotFound; + for ( TInt i = 0; i < KDefaultShortcutCount; ++i ) + { + if ( KDefaultShortcuts[i].key == aKey ) + { + aCenrepId = KDefaultShortcuts[i].id; + ret = KErrNone; + break; + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void TAiDefaultShortcut::GetDefaultShortcut(TInt aKey, TUid& aUid, TDes& aDefinition) +{ + CRepository *cr = NULL; + TInt err = KErrNone; + TInt index = KErrNotFound; + err = ::ResolveCenrepIdFromKey( aKey, index ); + TInt32 crIndex = KAIBackupShortcutDefinitionStart; + if ( err == KErrNone ) + { + TRAP( err, cr = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ) ); + + aUid.iUid = KErrNotFound; + if ( err == KErrNone ) + { + crIndex += index; + err = cr->Get( crIndex, aDefinition ); + // In case of a null definition use the platform default + if ( aDefinition.Length() <= 0 ) + { + err = KErrNotFound; + } + else if ( err == KErrNone ) + { + TAiScutParser parser; + err = parser.Parse( aDefinition ); + if ( err == KErrNone ) + { + aUid = TAiScutParser::ParseUid( parser.Get( EScutDefTarget) ); + } + } + } + } + + // Ensure that some definition is returned + // in case of any error occurrs + if ( err != KErrNone ) + { + ::GetPlatformDefaultShortcut( index, aUid, aDefinition ); + } + delete cr; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutappuidparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutappuidparser.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* 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: Shortcut definition parser +* +*/ + + +#include "aiscutappuidparser.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// TAiScutAppUidParser::TAiScutAppUidParser +// --------------------------------------------------------------------------- +// +TAiScutAppUidParser::TAiScutAppUidParser(const TDesC& aData, RArray& aUidArray) + : + iUidArray(aUidArray), + iLex(aData), + iLexIsValid(EFalse) +{ +} + +// --------------------------------------------------------------------------- +// TAiScutAppUidParser::SkipChar +// --------------------------------------------------------------------------- +// +void TAiScutAppUidParser::SkipChar(TChar aChar, TBool aConditionalSkip) +{ + iLex.SkipSpaceAndMark(); + if (iLex.Peek() == aChar) + { + iLex.Inc(); + } + else + { + // If not conditional skip, then the input data is invalid + if (!aConditionalSkip) + { + iLexIsValid = EFalse; + } + } + iLex.SkipSpaceAndMark(); +} + +// --------------------------------------------------------------------------- +// TAiScutAppUidParser::ReadAppUid +// --------------------------------------------------------------------------- +// +TUid TAiScutAppUidParser::ReadAppUid() +{ + TUint32 appUid; + + iLex.Mark(); + while (iLex.Peek().IsHexDigit()) + { + iLex.Inc(); + } + TPtrC uidToken = iLex.MarkedToken(); + TLex uidLex(uidToken); + if (uidLex.Val(appUid, EHex) != KErrNone) + { + iLexIsValid = EFalse; + } + + return TUid::Uid(appUid); +} + +// --------------------------------------------------------------------------- +// TAiScutAppUidParser::ParseL +// --------------------------------------------------------------------------- +// +void TAiScutAppUidParser::ParseL() +{ + iLexIsValid = ETrue; + + while (!iLex.Eos() && iLexIsValid) + { + SkipChar(',', ETrue); + TUid applicationUid = ReadAppUid(); + + if (iLexIsValid) + { + iUidArray.AppendL(TUid(applicationUid)); + } + } +} + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutextserv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutextserv.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,211 @@ +/* +* 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: AI Shortcut xSP Extension API +* +*/ + + +#include +#include +#include +#include + +#include +#include + +// ======== LOCAL DEFINITIONS ======== + +namespace + { + // LOCAL CONSTANTS + /** + * Default message slots + */ + const TUint KDefaultMessageSlots = 4; + + /** + * Marshalling buffer expand size + */ + const TInt KBufExpandSize = 32; + + /** + * Target string format that matches with aiscutplugin + */ + _LIT( KTargetStringFormat, "localapp:0x%x" ); + + // LOCAL TYPES + typedef TBuf<19> TTargetString; + + // LOCAL FUNCTIONS + /** + * Panics server + * @aReason Panic reason code + */ + void Panic( TInt aReason ) + { + User::Panic( KAiScutExtServerName, aReason ); + } + + /** + * Generates target string from Uid3 of current process + */ + TTargetString DefaultTargetString() + { + TUid uid3 = RProcess().Type()[ 2 ]; + TTargetString targetString; + targetString.Format( KTargetStringFormat, uid3 ); + return targetString; + } + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::Connect() + { + return Connect( DefaultTargetString() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::Connect( const TDesC& aTargetDefinition ) + { + TInt err = CreateSession( KAiScutExtServerName, Version(), + KDefaultMessageSlots ); + if( err == KErrNone ) + { + TIpcArgs args( &aTargetDefinition ); + err = SendReceive( EAiScutExtServSetTargetDefinition, args ); + if( err != KErrNone ) + { + Close(); + } + } + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TVersion RAiScutExtServ::Version() const + { + return( TVersion( + KAiScutExtServMajorVersionNumber, + KAiScutExtServMinorVersionNumber, + KAiScutExtServBuildVersionNumber ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::UpdatePopupTextL( + const MDesCArray& aPopupTextLines ) + { + TInt lineCount = aPopupTextLines.MdcaCount(); + __ASSERT_ALWAYS( lineCount <= KMaxPopupTextLines, Panic( KErrArgument ) ); + CBufBase* lineArrayBuf = CBufFlat::NewL( KBufExpandSize ); + CleanupStack::PushL( lineArrayBuf ); + + RBufWriteStream stream( *lineArrayBuf ); + + stream.WriteUint8L( lineCount ); + for( TInt i = 0; i < lineCount; i++ ) + { + stream << aPopupTextLines.MdcaPoint( i ); + } + + TPtr8 lineArray = lineArrayBuf->Ptr( 0 ); + + TIpcArgs args( &lineArray ); + TInt err = SendReceive( EAiScutExtServSetPopupText, args ); + + CleanupStack::PopAndDestroy( lineArrayBuf ); + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::ResetPopupText() + { + return SendReceive( EAiScutExtServResetPopupText ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::UpdateIconL( const CGulIcon& aIcon ) + { + CBufBase* marshallBuf = CBufFlat::NewL( KBufExpandSize ); + CleanupStack::PushL( marshallBuf ); + + RBufWriteStream stream( *marshallBuf ); + + aIcon.Bitmap()->ExternalizeL( stream ); + aIcon.Mask()->ExternalizeL( stream ); + + TPtr8 marshalledData = marshallBuf->Ptr( 0 ); + + TIpcArgs args( &marshalledData ); + TInt err = SendReceive( EAiScutExtServSetIcon, args ); + + CleanupStack::PopAndDestroy( marshallBuf ); + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::ResetIcon() + { + return SendReceive( EAiScutExtServResetIcon ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::IsInShortcuts( TBool& aIsInShortcuts ) const + { + TPtr8 isInShortcutsDes( + reinterpret_cast< TUint8* >( &aIsInShortcuts ), + sizeof( aIsInShortcuts ), + sizeof( aIsInShortcuts ) ); + + TIpcArgs args( &isInShortcutsDes ); + + return SendReceive( EAiScutExtServIsInShortcuts, args ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAiScutExtServ::IssuePutInShortcuts() + { + return SendReceive( EAiScutExtServIssuePutInShortcuts ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutfactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +/* +* 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: Shortcut plug-in factory class. +* +*/ + + +#include "aiscutfactory.h" +#include "caiscutengine.h" +#include "caiscutshortcut.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngine* AiScutFactory::CreateAiScutEngineL( CAiScutPlugin& aPlugin ) + { + return CAiScutEngine::NewL( aPlugin ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* AiScutFactory::CreateAiScutShortcutL( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ) + { + return CAiScutShortcut::NewL( aId, aTarget, aEngine ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* AiScutFactory::CreateAiScutShortcutLC( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ) + { + return CAiScutShortcut::NewLC( aId, aTarget, aEngine ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutfactoryext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutfactoryext.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,52 @@ +/* +* 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: Shortcut plug-in factory class. +* +*/ + + +#include "aiscutfactory.h" +#include "caiscutengineext.h" +#include "caiscutshortcutext.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngine* AiScutFactory::CreateAiScutEngineL( CAiScutPlugin& aPlugin ) + { + return CAiScutEngineExt::NewL( aPlugin ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* AiScutFactory::CreateAiScutShortcutL( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ) + { + return CAiScutShortcutExt::NewL( aId, aTarget, aEngine ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* AiScutFactory::CreateAiScutShortcutLC( TInt aId, + const TDesC& aTarget, CAiScutEngine& aEngine ) + { + return CAiScutShortcutExt::NewLC( aId, aTarget, aEngine ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: ECOM plug-in resource file. +* +*/ + + +#include + +#include + +// --------------------------------------------------------------------------- +// registry_info +// +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = AI_UID_ECOM_DLL_CONTENTPUBLISHER_SCUTPLUGIN; + + // Interface info array. + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface. + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; + version_no = 1; + display_name = "Shortcut Plug-in"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutpluginres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutpluginres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Resource definitions for Shortcut plug-in settings +* +*/ + + +#include +#include +#include + +#include + +NAME SCPL + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="SCPL"; } + +//---------------------------------------------------- +// EIK_APP_INFO +// Contains application information. +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO +{ +} + +// ---------------------------------------------------------------------------- +// +// %U application can show additional information in Shortcut area..." +// +// ---------------------------------------------------------------------------- +// +RESOURCE TBUF r_ai_sc_query_modify_gs + { + buf = qtn_ai_sc_query_modify_gs; + } + +//---------------------------------------------------------- +// r_scut_xsptip_note +// +//---------------------------------------------------------- +// +RESOURCE DIALOG r_scut_xsptip_note +{ + flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + label = qtn_ai_sc_query_modify_header; + headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE; + // headinglayout = R_AVKON_LIST_HEADING_PANE_POPUPS; + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutrepositorywatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutrepositorywatcher.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: Shortcut definition parser +* +*/ + + +#include "aiscutrepositorywatcher.h" +#include // For CRepository + + + +CAiScutRepositoryWatcher* CAiScutRepositoryWatcher::NewL( + const TUid aUid, + const TUint32 aKey, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, + TCallBack aCallBack, + CRepository* aRepository) +{ + CAiScutRepositoryWatcher* self = + new (ELeave) CAiScutRepositoryWatcher(aUid, aKey, aCallBack, aRepository); + + CleanupStack::PushL(self); + self->ConstructL(aKeyType); + CleanupStack::Pop(self); + + return self; +} + +CAiScutRepositoryWatcher* CAiScutRepositoryWatcher::NewL( + const TUid aUid, + TCallBack aCallBack, + CRepository* aRepository) +{ + CAiScutRepositoryWatcher* self = + new (ELeave) CAiScutRepositoryWatcher( + aUid, + NCentralRepositoryConstants::KInvalidNotificationId, + aCallBack, + aRepository); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; +} + +CAiScutRepositoryWatcher::~CAiScutRepositoryWatcher() +{ + if (iNotifyHandler) + { + iNotifyHandler->StopListening(); + delete iNotifyHandler; + } +} + +CAiScutRepositoryWatcher::CAiScutRepositoryWatcher( + const TUid aUid, + const TUint32 aKey, + TCallBack aCallBack, + CRepository* aRepository) +: +iUid(aUid), iKey(aKey), iCallBack(aCallBack), iRepository(aRepository) +{ +} + +void CAiScutRepositoryWatcher::ConstructL( + CCenRepNotifyHandler::TCenRepKeyType aKeyType) +{ + iNotifyHandler = CCenRepNotifyHandler::NewL( + *this, *iRepository, aKeyType, iKey); +} + +void CAiScutRepositoryWatcher::ConstructL() +{ + iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository); +} + +void CAiScutRepositoryWatcher::StartListeningL() +{ + if (iNotifyHandler) + { + iNotifyHandler->StartListeningL(); + } +} + +void CAiScutRepositoryWatcher::StopListening() +{ + if (iNotifyHandler) + { + iNotifyHandler->StopListening(); + } +} + +TUint32 CAiScutRepositoryWatcher::ChangedKey() +{ + return iChangedKey; +} + +void CAiScutRepositoryWatcher::HandleNotifyInt(TUint32 aKey, TInt /*aNewValue*/) +{ + iChangedKey = aKey; + iCallBack.CallBack(); + iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; +} + +void CAiScutRepositoryWatcher::HandleNotifyString( + TUint32 aKey, const TDesC16& /*aNewValue*/) +{ + iChangedKey = aKey; + iCallBack.CallBack(); + iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; +} + +void CAiScutRepositoryWatcher::HandleNotifyGeneric(TUint32 aKey) +{ + iChangedKey = aKey; + iCallBack.CallBack(); + iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId; +} + +void CAiScutRepositoryWatcher::HandleNotifyError( + TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/) +{ +} + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutsettings.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutsettings.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* 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: ECOM plug-in resource file +* +*/ + + +#include + +#include + +// --------------------------------------------------------------------------- +// registry_info +// +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = AI_UID_ECOM_DLL_SETTINGS_SCUTPLUGIN; + + // Interface info array. + interfaces = + { + INTERFACE_INFO + { + // UID of the implemented interface. + interface_uid = 0x10207236; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN; + version_no = 1; + display_name = "Shortcuts"; + default_data = "0x1020723B"; // Parent UID (PrslnPlugin) + opaque_data = "-1"; // Order number + } + }; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscutsettingsres.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscutsettingsres.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,443 @@ +/* +* 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: Resource definitions for Shortcut plug-in settings +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "aiscutsettings.hrh" + + +NAME SCSE + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="SCSE"; } + +//---------------------------------------------------- +// EIK_APP_INFO +// Contains application information. +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO +{ +} + +//---------------------------------------------------- +// r_scutsettings_menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_scutsettings_menubar +{ + titles = + { + MENU_TITLE { menu_pane = r_scutsettings_menupane; } + }; +} + +//---------------------------------------------------- +// r_scutsettings_menupane +// Options menu. +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_scutsettings_menupane +{ + items = + { + MENU_ITEM + { + command = EAiScutSettingsCmdChange; + txt = qtn_options_change; + } + +#ifdef __SERIES60_HELP + , + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + } +#endif // __SERIES60_HELP + , + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; +} + +//---------------------------------------------------- +// r_scut_settings_view +// Settings views. +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_scut_settings_view +{ + menubar = r_scutsettings_menubar; + //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + cba = r_scut_softkeys_options_back_change; +} + +//---------------------------------------------------- +// r_setting_listbox +// Common listbox editor resource for setting pages. +//---------------------------------------------------- +// +RESOURCE LISTBOX r_setting_listbox +{ + flags = EEikListBoxMultipleSelection; +} + +//---------------------------------------------------- +// r_scut_settings_applist_page +// Selection key idle softkey setting page. +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_scut_settings_applist_page +{ + number = EAknSettingPageNoOrdinalDisplayed; + // label = qtn_set_idle_selec_key; + // note: default cba resource is ok_cancel_select + //softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; +} + +//---------------------------------------------------------- +// r_scut_type_url_page +// Setting page editing an url. +//---------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_scut_type_url_page +{ + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + number= EAknSettingPageNoOrdinalDisplayed; + label= qtn_ai_shorts_type_url; + type = EEikCtEdwin; + editor_resource_id = r_scut_url_editor; +} + +//---------------------------------------------------------- +// r_scut_edit_url_page +// Setting page editing an url. +//---------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_scut_edit_url_page +{ + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + number= EAknSettingPageNoOrdinalDisplayed; + label= qtn_ai_shorts_edit_url; + type = EEikCtEdwin; + editor_resource_id = r_scut_url_editor; +} + +//---------------------------------------------------------- +// r_scut_url_editor +// URL editor. +//---------------------------------------------------------- +// +RESOURCE EDWIN r_scut_url_editor +{ + width = 10; + lines = 2; + maxlength = 1000; + numeric_keymap = EAknEditorCalculatorNumberModeKeymap; + allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode; + default_input_mode = EAknEditorTextInputMode; + special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG; + default_case = EAknEditorLowerCase; + flags = EEikEdwinAutoSelection | EAknEditorLowerCase | EEikEdwinNoLineOrParaBreaks; + avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly; +} + +//---------------------------------------------------- +// r_scut_change_to_page +// "Change To" setting page. +//---------------------------------------------------- +// +RESOURCE ARRAY r_scut_change_to_page_lbx +{ + items = + { + LBUF { txt = qtn_sc_set_change_apps; }, + LBUF { txt = qtn_sc_set_change_bookmark; } + + // Only this menu option disabled. + // The implementation of url functionality still exists in code, + // even though this option has been decided to remove due to better + // usability. Affects lots of code if removed entirely. + /*, + LBUF { txt = qtn_sc_set_change_url; }*/ + }; +} + +//---------------------------------------------------- +// r_scut_listquery_change_to_page +// "Change To" setting page. +//---------------------------------------------------- +// +RESOURCE AVKON_LIST_QUERY r_scut_listquery_change_to_page +{ + softkeys=R_AVKON_SOFTKEYS_SELECT_CANCEL; + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + heading = qtn_sc_set_change_prompt; + listbox = AVKON_LIST_QUERY_LIST + { + // array of items will be defined dynamically + }; + }; + } + }; +} + +//---------------------------------------------------------- +// r_scut_wait_note +// +//---------------------------------------------------------- +// +RESOURCE DIALOG r_scut_wait_note +{ + flags = EAknWaitNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control= AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_gen_note_opening; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + }; + } + }; +} + +//---------------------------------------------------- +// r_scut_settings_view_caption +// View caption for plug-in. max 256 +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_view_caption +{ + buf = qtn_set_pers_shortcuts; +} + +//---------------------------------------------------- +// r_scut_settings_view_title +// View title. +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_scut_settings_view_title +{ + txt = qtn_set_title_pers_shortcuts; +} + +//---------------------------------------------------- +// r_ai_settings_txt_fixed_item +// Text used in information note when attempting +// to change a read-only shortcut +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_txt_fixed_item +{ + buf = qtn_ai_set_app_note_fixed; +} + +//---------------------------------------------------- +// r_scut_settings_txt_all_fixed +// Text for empty listbox item +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_txt_all_fixed +{ + buf = qtn_ai_sc_set_all_fixed; +} + +//---------------------------------------------------- +// r_scut_settings_txt_linkn +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_txt_linkn +{ + buf = qtn_ai_set_myt_linkn; +} + +//---------------------------------------------------- +// r_scut_settings_softkey_left +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_softkey_left +{ + buf = qtn_set_left_idle_softkey; +} + +//---------------------------------------------------- +// r_scut_settings_softkey_right +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_softkey_right +{ + buf = qtn_set_right_idle_softkey; +} + +//---------------------------------------------------- +// r_scut_settings_scroll_left +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_scroll_left +{ + buf = qtn_set_idle_left_scroll; +} + +//---------------------------------------------------- +// r_scut_settings_scroll_right +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_scroll_right +{ + buf = qtn_set_idle_right_scroll; +} + +//---------------------------------------------------- +// r_scut_settings_scroll_up +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_scroll_up +{ + buf = qtn_set_idle_up_scroll; +} + +//---------------------------------------------------- +// r_scut_settings_scroll_down +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_scroll_down +{ + buf = qtn_set_idle_down_scroll; +} + +//---------------------------------------------------- +// r_scut_settings_selection_key +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_selection_key +{ + buf = qtn_set_idle_selec_key; +} + +// ----------------------------------------------------------------------------- +// r_scut_settings_no_effect +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_no_effect +{ + buf = qtn_set_idle_skeys_no_effect; +} + +// ----------------------------------------------------------------------------- +// r_scut_msk_edit +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_scut_msk_edit +{ + buf = qtn_msk_edit; +} + +// ----------------------------------------------------------------------------- +// r_scut_msk_change +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_scut_msk_change +{ + buf = qtn_msk_change; +} + +/* +//---------------------------------------------------- +// r_scut_settings_key_press +// +//---------------------------------------------------- +// +//RESOURCE TBUF r_scut_settings_key_press +// { +// buf = qtn_ai_shorts_key_press; +// } + +*/ + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_scut_softkeys_options_back_change +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } + }; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RESOURCE CBA r_scut_softkeys_options_exit_change +{ + buttons = + { + CBA_BUTTON {id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON {id = EAknSoftkeyExit; txt = text_softkey_exit; }, + CBA_BUTTON {id = EAiScutSettingsCmdChange; txt = qtn_msk_change; } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscuttargetshutter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscuttargetshutter.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,274 @@ +/* +* 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: +* +*/ + + +#include //TApaTask +#include //RApaLsSession + +#include "aiscuttargetshutter.h" +#include "aiscutdefs.h" +#include "debug.h" + +#include + +const TUid KMenuUID3 = { 0x101F4CD2 }; + +const TInt KTaskExistsDelay = 1500000; //1.5 second +const TInt KTaskNotExistsDelay = 500000; //0.5 second +const TInt KMaxNumberOfTries = 3; + + +// ======== MEMBER FUNCTIONS ======== + +CAiScutTargetShutter::CAiScutTargetShutter(CCoeEnv* aEnv, TUid aAppUid) + : CActive(CActive::EPriorityLow) + , iEnv(aEnv) + , iAppUid(aAppUid) +{ + CActiveScheduler::Add(this); +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetShutter::~CAiScutTargetShutter() +{ + if (iPeriodic) + { + iPeriodic->Cancel(); + delete iPeriodic; + } + + iWsSession.Close(); + Cancel(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetShutter::ConstructL(TBool aIsRunning, TBool aIsDialog) +{ + iIsRunning = aIsRunning; + iIsDialog = aIsDialog; + iTaskExists = EFalse; + iTaskKilled = EFalse; + iCounter = 0; + iPeriodic = CPeriodic::NewL(CActive::EPriorityLow); + User::LeaveIfError(iWsSession.Connect()); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetShutter* CAiScutTargetShutter::NewL(CCoeEnv* aEnv, TUid aAppUid, TBool aIsRunning, TBool aIsDialog) +{ + CAiScutTargetShutter* self = new (ELeave) CAiScutTargetShutter(aEnv, aAppUid); + CleanupStack::PushL(self); + self->ConstructL(aIsRunning, aIsDialog); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetShutter::StartL() +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutTargetShutter::Start() app uid=0x%x"), iAppUid.iUid); + + + TApaTaskList taskList(iWsSession); + TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); + + if ( idleTask.Exists() && iIsRunning) + { + if ( iIsDialog ) + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyEscape; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + iEnv->SimulateKeyEventL(keyEvent, EEventKey); + } + //idleTask.BringToForeground(); + CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); + iTaskExists = ETrue; + __PRINTS( "XAI: exists and running"); + + } + else + { + TKeyEvent keyEvent; + keyEvent.iCode = EKeyEscape; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + iEnv->SimulateKeyEventL(keyEvent, EEventKey); + + // bring active idle to foreground + TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); + if (idleTask.Exists()) + { + __PRINTS("XAI: idle to foreground"); + //idleTask.BringToForeground(); + CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); + } + TApaTask task(taskList.FindApp(iAppUid)); + if (task.Exists()) + { + //task.SendToBackground(); + CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToBackground); + } + } + if( !iPeriodic->IsActive() ) + { + if (iTaskExists) + { + iPeriodic->Start(KTaskExistsDelay, KTaskExistsDelay, + TCallBack(TaskExistsCallback, this)); + } + else + { + iPeriodic->Start(KTaskNotExistsDelay, KTaskNotExistsDelay, + TCallBack(TaskNotExistsCallback, this)); + } + + } +} + +// --------------------------------------------------------------------------- +// From CActive +// --------------------------------------------------------------------------- +// +void CAiScutTargetShutter::DoCancel() +{ + if (iPeriodic) + { + iPeriodic->Cancel(); + } +} + +// --------------------------------------------------------------------------- +// From CActive. +// --------------------------------------------------------------------------- +// +void CAiScutTargetShutter::RunL() +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutTargetShutter::RunL() app uid=0x%x"), iAppUid.iUid); + + TUid menuUid = KMenuUID3; + + TApaTaskList taskList(iWsSession); + TApaTask task(taskList.FindApp(iAppUid)); + + if (iTaskExists) + { + RWindowGroup windowGroup = iEnv->RootWin(); + + if (windowGroup.OrdinalPosition() != 0) + { + TApaTask idleTask(taskList.FindApp(KScutActiveIdleUid)); + if (idleTask.Exists()) + { + __PRINTS( "XAI: idle to foreground"); + + //idleTask.BringToForeground(); + CAknSgcClient::MoveApp(idleTask.WgId(), ESgcMoveAppToForeground); + } + } + iPeriodic->Cancel(); + } + else + { + if (iCounter >= KMaxNumberOfTries || iTaskKilled) + { + iPeriodic->Cancel(); + } + else if (task.Exists() && iAppUid != menuUid) + { + __PRINTS("XAI: shutdown task"); + //task.SendToBackground(); + CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToBackground); + task.SendSystemEvent(EApaSystemEventShutdown); + iTaskKilled = ETrue; + } + else + { + iCounter++; + } + } +} + +// --------------------------------------------------------------------------- +// From CActive +// Handles an error situation. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetShutter::RunError(TInt aError) +{ + return aError; +} + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetShutter::Run() +{ + SetActive(); + TRequestStatus *status = &iStatus; + User::RequestComplete(status, KErrNone); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetShutter::TaskExistsCallback(TAny* aPtr) +{ + CAiScutTargetShutter* self = static_cast(aPtr); + + if (self) + { + self->Run(); + } + + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetShutter::TaskNotExistsCallback(TAny* aPtr) +{ + CAiScutTargetShutter* self = static_cast(aPtr); + + if (self) + { + self->Run(); + } + + return KErrNone; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/aiscuttexts.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/aiscuttexts.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,707 @@ +/* +* 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: Shortcut plug-in common texts +* +*/ + + +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include +//#include +//#include + +#include + +#include "aiscutapptitle.rh" +#include "aiscutappuids.hrh" + +NAME SCTX + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf=""; } + +//---------------------------------------------------- +// r_scut_plugin_name +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_plugin_name +{ + buf = qtn_ai_set_cont_apps; +} + +//---------------------------------------------------- +// r_scut_settings_change_theme +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_change_theme +{ + buf = qtn_apps_idle_skin_gs; +} + +//---------------------------------------------------- +// r_scut_settings_new_msg +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_new_msg +{ + buf = qtn_set_idle_skey_new_msg; +} + +//---------------------------------------------------- +// r_scut_settings_new_email +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_new_email +{ + buf = qtn_set_idle_skeys_email_editor; +} + +//---------------------------------------------------- +// r_scut_settings_new_syncml_mail +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_new_syncml_mail +{ + buf = qtn_apps_syncml_mail_gs; +} + +//---------------------------------------------------- +// r_scut_settings_new_postcard +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_new_postcard +{ + buf = qtn_apps_mmspostcard_gs; +} + +//---------------------------------------------------- +// r_scut_settings_new_audio_msg +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_new_audio_msg +{ + buf = qtn_apps_audio_msg_gs; +} + +//---------------------------------------------------- +// r_scut_settings_select_msg_type +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_select_msg_type +{ + buf = qtn_set_idle_skey_select_msg_type; +} + +//---------------------------------------------------- +// r_scut_settings_connectivity_status +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_connectivity_status +{ + buf = qtn_apps_connectivity_list; +} + +//---------------------------------------------------- +// r_scut_settings_connectivity_status +// +//---------------------------------------------------- +// +RESOURCE TBUF r_scut_settings_appmngr +{ + buf = qtn_apps_am_gs; +} + +//---------------------------------------------------- +// r_ai_scut_operation_disabled +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_ai_scut_operation_disabled + { + buf = qtn_ai_scut_operation_disabled; + } + + +// ----------------------------------------------------------------------------- +// r_scut_app_title_list +// +// ----------------------------------------------------------------------------- +// +RESOURCE AI_APP_TITLE_LIST r_scut_app_title_list +{ + items = + { + AI_APP_TITLE_ITEM + { + appuid = KScutAboutUidValue; + //longtitle = qtn_apps_about_list; + //shorttitle = qtn_apps_about_grid; + skeytitle = qtn_apps_about_grid; + msktitle = qtn_apps_about_grid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutGeneralSettingsUidValue; + viewid = KScutInstallationViewIdValue; + longtitle = qtn_app_caption_string; + shorttitle = qtn_apps_am_gs; + skeytitle = qtn_apps_am_skey; + msktitle = qtn_msk_idle_am; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutApplicationManagerUidValue; + //viewid = KScutInstallationViewIdValue; + //longtitle = qtn_app_caption_string; + //shorttitle = qtn_app_caption_string; + skeytitle = qtn_apps_am_skey; + msktitle = qtn_msk_idle_am; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutApplicationShellUidValue; + viewid = 1; + //longtitle = ""; + //shorttitle = ""; + skeytitle = qtn_apps_menu_skey; + msktitle = qtn_msk_idle_menu; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutNavigatorUidValue; + //longtitle = qtn_apps_blid_list; + //shorttitle = qtn_apps_blid_grid; + skeytitle = qtn_apps_blid_skey; + msktitle = qtn_msk_idle_blid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutBluetoothUidValue; + //longtitle = qtn_apps_bluetooth_list; + //shorttitle = qtn_apps_bluetooth_grid; + skeytitle = qtn_apps_bluetooth_skey; + msktitle = qtn_msk_idle_bluetooth; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutBrowserUidValue; + //longtitle = qtn_apps_browserng_grid; + //shorttitle = qtn_apps_browserng_list; + skeytitle = qtn_apps_services_skey_new; + msktitle = qtn_msk_idle_services_new; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutCalculatorUidValue; + //longtitle = qtn_apps_calculator_list; + //shorttitle = qtn_apps_calculator_grid; + skeytitle = qtn_apps_calculator_skey; + msktitle = qtn_msk_idle_calculator; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutCalendarUidValue; + //longtitle = qtn_apps_calendar_list; + //shorttitle = qtn_apps_calendar_grid; + skeytitle = qtn_apps_calendar_skey; + msktitle = qtn_msk_idle_calendar; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutCamcorderUidValue; + //longtitle = qtn_apps_ccor_list; + //shorttitle = qtn_apps_ccor_grid; + skeytitle = qtn_apps_ccor_skey; + msktitle = qtn_msk_idle_ccor; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutChineseDictionaryUidValue; + //longtitle = qtn_apps_dict_list; + //shorttitle = qtn_apps_dict_grid; + skeytitle = qtn_apps_dict_skey; + msktitle = qtn_msk_idle_dict; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutClockUidValue; + //longtitle = qtn_apps_clock_list; + //shorttitle = qtn_apps_clock_grid; + skeytitle = qtn_apps_clock_skey; + msktitle = qtn_msk_idle_clock; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutConnectionManagerUidValue; + //longtitle = qtn_apps_cmon_list; + //shorttitle = qtn_apps_cmon_grid; + skeytitle = qtn_apps_cmon_skey; + msktitle = qtn_msk_idle_cmon; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutConverterUidValue; + //longtitle = qtn_cnv_app_caption; + //shorttitle = qtn_cnv_app_caption_short; + skeytitle = qtn_apps_converter_skey; + msktitle = qtn_msk_idle_converter; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutDeviceManagerUidValue; + //longtitle = qtn_apps_dm_list; + //shorttitle = qtn_apps_dm_grid; + skeytitle = qtn_apps_dm_skey; + msktitle = qtn_msk_idle_dm; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutDRMRightsManagerUidValue; + //longtitle = qtn_apps_drm_list; + //shorttitle = qtn_apps_drm_grid; + skeytitle = qtn_apps_drm_skey; + msktitle = qtn_msk_idle_drm; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutFaxModemUidValue; + //longtitle = qtn_apps_fax_modem_list; + //shorttitle = qtn_apps_fax_modem_grid; + skeytitle = qtn_apps_fax_modem_skey; + msktitle = qtn_msk_idle_fax_modem; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutFileManagerUidValue; + //longtitle = qtn_apps_fmgr_list; + //shorttitle = qtn_apps_fmgr_grid; + skeytitle = qtn_apps_fmgr_skey; + msktitle = qtn_msk_idle_fmgr; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutFMRadioUidValue; + //longtitle = qtn_apps_radio_list; + //shorttitle = qtn_apps_radio_grid; + skeytitle = qtn_apps_radio_skey; + msktitle = qtn_msk_idle_radio; + }, + AI_APP_TITLE_ITEM + { + appuid = KScutFMTXRadioUidValue; + //longtitle = qtn_apps_radio_list; + //shorttitle = qtn_apps_radio_grid; + skeytitle = qtn_fmtx_idle_sk; + msktitle = qtn_fmtx_idle_msk; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutGeneralSettingsUidValue; + //longtitle = qtn_apps_settings_list; + //shorttitle = qtn_apps_settings_grid; + skeytitle = qtn_apps_settings_skey; + msktitle = qtn_msk_idle_gs; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutControlPanelUidValue; + //longtitle = qtn_apps_controlpanel_list; + //shorttitle = qtn_apps_controlpanel_grid; + skeytitle = qtn_apps_controlpanel_skey; + msktitle = qtn_msk_idle_controlpanel; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutHelpUidValue; + //longtitle = qtn_apps_help_list; + //shorttitle = qtn_apps_help_grid; + skeytitle = qtn_apps_help_skey; + msktitle = qtn_msk_idle_help; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutIRUidValue; + //longtitle = qtn_apps_infrared_list; + //shorttitle = qtn_apps_infrared_grid; + skeytitle = qtn_apps_infrared_skey; + msktitle = qtn_msk_idle_infrared; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutInstantMessagingUidValue; + //longtitle = qtn_apps_instant_list; + //shorttitle = qtn_apps_instant_grid; + skeytitle = qtn_apps_instant_skey; + msktitle = qtn_msk_idle_instant; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutUserDictionaryUidValue; + //longtitle = qtn_apps_udict_list; + //shorttitle = qtn_apps_udict_grid; + skeytitle = qtn_apps_udict_skey; + msktitle = qtn_msk_idle_udict; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutLandmarksUidValue; + //longtitle = qtn_apps_lm_list; + //shorttitle = qtn_apps_lm_grid; + skeytitle = qtn_apps_lm_skey; + msktitle = qtn_msk_idle_lm; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutLogsUidValue; + //longtitle = qtn_apps_logs_list; + //shorttitle = qtn_apps_logs_grid; + skeytitle = qtn_apps_logs_skey; + msktitle = qtn_msk_idle_logs; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMediaGallery2UidValue; + //longtitle = qtn_apps_mg_list; + //shorttitle = qtn_apps_mg_grid; + skeytitle = qtn_apps_mg_skey; + msktitle = qtn_msk_idle_mg; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMediaPlayerUidValue; + //longtitle = qtn_apps_mp_list; + //shorttitle = qtn_apps_mp_grid; + skeytitle = qtn_apps_mp_skey; + msktitle = qtn_msk_idle_mp; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMemoryCardUidValue; + //longtitle = qtn_apps_memc_appl_list; + //shorttitle = qtn_apps_memc_appl_grid; + skeytitle = qtn_apps_mmc_skey; + msktitle = qtn_msk_idle_mmc; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMessagingCenterUidValue; + //longtitle = qtn_apps_messaging_list; + //shorttitle = qtn_apps_messaging_grid; + skeytitle = qtn_apps_messaging_skey; + msktitle = qtn_msk_idle_messaging; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMusicPlayerUidValue; + //longtitle = qtn_apps_mplayer_list; + //shorttitle = qtn_apps_mplayer_grid; + skeytitle = qtn_apps_mplayer_skey; + msktitle = qtn_msk_idle_mplayer; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutNotepadUidValue; + //longtitle = qtn_apps_notepad_list; + //shorttitle = qtn_apps_notepad_grid; + skeytitle = qtn_apps_notepad_skey; + msktitle = qtn_msk_idle_notepad; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPersonalisationUidValue; + //longtitle = qtn_apps_skins_list; + //shorttitle = qtn_apps_skins_grid; + skeytitle = qtn_apps_skins_skey; + msktitle = qtn_msk_idle_skins; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPhoneUidValue; + //longtitle = qtn_apps_phone_list; + //shorttitle = qtn_apps_phone_grid; + skeytitle = qtn_apps_phone_grid; + msktitle = qtn_apps_phone_grid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPhonebookUidValue; + //longtitle = qtn_apps_phonebook_list; + //shorttitle = qtn_apps_phonebook_grid; + skeytitle = qtn_apps_phonebook_skey; + msktitle = qtn_msk_idle_phonebook; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutProfilesUidValue; + //longtitle = qtn_apps_mode_list; + //shorttitle = qtn_apps_mode_grid; + skeytitle = qtn_apps_mode_skey; + msktitle = qtn_msk_idle_mode; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPocUidValue; + //longtitle = qtn_apps_ptt_list; + //shorttitle = qtn_apps_ptt_grid; + skeytitle = qtn_apps_ptt_skey; + msktitle = qtn_msk_idle_ptt; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutSearchUidValue; + //longtitle = qtn_apps_search_list; + //shorttitle = qtn_apps_search_grid; + skeytitle = qtn_apps_search_skey; + msktitle = qtn_msk_idle_search; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutSatUiUidValue; + //longtitle = qtn_apps_simapps_list; + //shorttitle = qtn_apps_simapps_grid; + skeytitle = qtn_apps_simapps_grid; + msktitle = qtn_apps_simapps_grid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutSpeedDialUidValue; + //longtitle = qtn_apps_sd_list; + //shorttitle = qtn_apps_sd_grid; + skeytitle = qtn_apps_sd_skey; + msktitle = qtn_msk_idle_sd; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutUSBUidValue; + //longtitle = qtn_apps_usb_list; + //shorttitle = qtn_apps_usb_grid; + skeytitle = qtn_apps_usb_skey; + msktitle = qtn_msk_idle_usb; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutVoiceCommandsUidValue; + //longtitle = qtn_apps_vc_list; + //shorttitle = qtn_apps_vc_grid; + skeytitle = qtn_apps_vc_skey; + msktitle = qtn_msk_idle_vc; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutVoiceMailboxUidValue; + //longtitle = qtn_apps_smsvo_list; + //shorttitle = qtn_apps_smsvo_grid; + skeytitle = qtn_apps_smsvo_skey; + msktitle = qtn_msk_idle_smsvo; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutVoIPUidValue; + //longtitle = qtn_apps_voip_list; + //shorttitle = qtn_apps_voip_grid; + skeytitle = qtn_apps_voip_skey; + msktitle = qtn_msk_idle_voip; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutVoiceRecorderUidValue; + //longtitle = qtn_vorec_app_menu_list; + //shorttitle = qtn_vorec_app_menu_grid; + skeytitle = qtn_apps_recorder_skey; + msktitle = qtn_msk_idle_recorder; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutSmlSyncUidValue; + //longtitle = qtn_apps_sml_list; + //shorttitle = qtn_apps_sml_grid; + skeytitle = qtn_apps_sml_grid; + msktitle = qtn_apps_sml_grid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPersonalisationUidValue; + viewid = KScutChangeThemeViewIdValue; + longtitle = qtn_apps_idle_skin_gs; + shorttitle = qtn_apps_idle_skin_skey; + skeytitle = qtn_apps_idle_skin_skey; + msktitle = qtn_msk_idle_skin; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutAmsEditorUidValue; + longtitle = qtn_apps_audio_msg_gs; + shorttitle = qtn_apps_audio_msg_skey; + skeytitle = qtn_apps_audio_msg_skey; + msktitle = qtn_msk_idle_audio_msg; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutEmailEditorUidValue; + longtitle = qtn_set_idle_skeys_email_editor; + shorttitle = qtn_apps_email_skey; + skeytitle = qtn_apps_email_skey; + msktitle = qtn_msk_idle_email; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutPostcardEditorUidValue; + longtitle = qtn_apps_mmspostcard_gs; + shorttitle = qtn_apps_mmspostcard_skey; + skeytitle = qtn_apps_mmspostcard_skey; + msktitle = qtn_msk_idle_mmspostcard; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutUnifiedEditorUidValue; + longtitle = qtn_set_idle_skey_new_msg; + shorttitle = qtn_idle_skey_new_msg; + skeytitle = qtn_idle_skey_new_msg; + msktitle = qtn_msk_idle_new_msg; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutEmailEditorUidValue; + viewid = KScutSyncMlEmailUidValue; + longtitle = qtn_apps_syncml_mail_gs; + shorttitle = qtn_apps_syncml_mail_skey; + skeytitle = qtn_apps_syncml_mail_skey; + msktitle = qtn_msk_idle_syncml_mail; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMessagingCenterUidValue; + viewid = KScutMessagingCenterUidValue; + longtitle = qtn_set_idle_skey_select_msg_type; + shorttitle = qtn_idle_skey_select_msg; + skeytitle = qtn_idle_skey_select_msg; + msktitle = qtn_msk_idle_select_msg; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutGeneralSettingsUidValue; + viewid = KScutConnectivityStatusViewIdValue; + longtitle = qtn_apps_connectivity_list; + shorttitle = qtn_apps_connectivity_skey; + skeytitle = qtn_apps_connectivity_skey; + msktitle = qtn_msk_idle_connectivity; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutVideoServicesUidValue; + skeytitle = qtn_apps_video_grid; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutMusicPlayerUidValue; + skeytitle = qtn_apps_mplayer_skey; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutFlashPlayerUidValue; + skeytitle = qtn_apps_fplayer_skey; + } + , + AI_APP_TITLE_ITEM + { + appuid = KScutExchangeMailUidValue; + skeytitle = qtn_apps_exchangemail_skey; + } + , + AI_APP_TITLE_ITEM + { + appuid = -1; + //longtitle = "not found"; + //shorttitle = "not found"; + skeytitle = "not found"; + msktitle = "not found"; + } + }; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutengine.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1787 @@ +/* +* 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: Shortcut plug-in engine class +* +*/ + + +#include // For CCoeEnv +#include // For CRepository +#include // For RWsSession +#include // For TApaTaskList +#include // For CVwsSessionWrapper +#include // For TVwsViewId +#include // For RProperty +#include // For CnvUtfConverter +#include +#include +#include // For CActiveFavouritesDbNotifier +#include +#include +#include // for fast swap +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "caiscutengine.h" +#include "aiscutpluginprivatecrkeys.h" +#include "aiscutcontentmodel.h" +#include "caiscutplugin.h" +#include "caiscutshortcut.h" +#include "caiscutshortcutinfo.h" +#include "aidefaultshortcut.h" +#include "aiscutappuidparser.h" +#include "aiscutrepositorywatcher.h" +#include "aiscuttargetshutter.h" +#include "aiscutdefs.h" +#include "aiscutfactory.h" + +#include +#include "debug.h" +/** + * Timer delay for access check retry. Two seconds. + */ +const TInt KScutAccessCheckRetryDelay = 2000000; +const TUid KVoiceCallUidViewId = { 0x10282D81 }; +const TUid KVideoCallUid = { 0x101F8681 }; + +_LIT(KScutTextsResourceFileName, "aiscuttexts.rsc"); +_LIT8(KScutDirectOpen, "?open"); + +// ======== LOCAL FUNCTIONS ======== + +LOCAL_C TInt CompareKey(const TUint32& aLeft, const TUint32& aRight) +{ + TUint32 left = aLeft & (KScutBitMaskThemeDefault & KScutBitMaskLocked); + TUint32 right = aRight & (KScutBitMaskThemeDefault & KScutBitMaskLocked); + + if (left < right) + { + return -1; + } + else if (left > right) + { + return 1; + } + + return 0; +} + +static TInt IntFromDesc( const TDesC &aParam ) + { + TInt err = KErrArgument; + if (aParam.Length() > 0) + { + _LIT(KHexPrefix, "0x"); + const TInt prefixLen = 2; + + TRadix radix(EDecimal); + TPtrC ptr(aParam); + + if (aParam.Left(prefixLen).CompareC(KHexPrefix) == 0) + { + // Strip the '0x' prefix. + ptr.Set(aParam.Right(aParam.Length() - prefixLen)); + + radix = EHex; + } + + TLex lexer(ptr); + TUint32 id; + + err = lexer.Val(id, radix); + if ( err == KErrNone ) + { + return id; + } + else + { + return err; + } + } + return err; + } +// --------------------------------------------------------------------------- +// Timer callback. +// --------------------------------------------------------------------------- +// +TInt DelayedCheckCallBack(TAny* aEngine) +{ + if (aEngine) + { + static_cast(aEngine)->RetryAccessCheck(); + } + + return KErrNone; +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngine::CAiScutEngine(CAiScutPlugin& aPlugin) + : + iPlugin(aPlugin), + iResourceLoaderTexts(*CCoeEnv::Static()), + iResourceLoaderSendUi(*CCoeEnv::Static()) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngine::ConstructL() +{ + FeatureManager::InitializeLibL(); + + User::LeaveIfError(iApaSession.Connect()); + User::LeaveIfError(iBookmarkSess.Connect()); + User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); + + iVwsSession = CVwsSessionWrapper::NewL(); + iRepository = CRepository::NewL(KCRUidShortcutItems); + + iHiddenAppsRepository = CRepository::NewL(KCRUidMenu); + + // Create message server session because it may be needed during shortcut + // creation for checking mailbox access. + iMsvSession = CMsvSession::OpenAsObserverL(*this); + + iEnv = CCoeEnv::Static(); + + TParsePtrC driveParse(PathInfo::RomRootPath()); + TFileName resourceName(driveParse.Drive()); + TParse parse; + parse.Set(KScutTextsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + resourceName.Append(parse.FullName()); + iResourceLoaderTexts.OpenL(resourceName); + + TFileName resourceName2(driveParse.Drive()); + TParse parse2; + parse2.Set(KSendNormResource, &KDC_RESOURCE_FILES_DIR, NULL); + resourceName2.Append(parse2.FullName()); + iResourceLoaderSendUi.OpenL(resourceName2); + + LoadAppTitleListL(); + + // Engine should still remain alive even though shortcut construction failed + // because LaunchByValue must still be possible. + TRAP_IGNORE(CreateShortcutsL()); + + // Close message server session for now. It's opened again in Resume if needed. + delete iMsvSession; + iMsvSession = NULL; + + iKeyEventObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack(HandlePSCommand, this), + KUidSystemCategory, KPSUidShortcutCmd); + + iCallStateObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack(CallStateChangeCallback, this), + KPSUidCtsyCallInformation, KCTsyCallState); + + iKeylockApi = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard ); + if ( !iKeylockApi->HasConfiguration() ) + { + delete iKeylockApi; + iKeylockApi = NULL; + } + CRepository* repository = CRepository::NewLC(TUid::Uid(KCRUidActiveIdleLV)); + + repository->Get(KAIFirstKeyLockKey, iFirstLockKey); + repository->Get(KAISecondKeyLockKey, iSecondLockKey); + repository->Get(KAIKeyLockTimeout, iDelayTimerDelay); + CleanupStack::PopAndDestroy(repository); + // convert micro to milliseconds + const TInt KUsInMs = 1000; + iDelayTimerDelay = KUsInMs * iDelayTimerDelay; + iDelayTimer = CPeriodic::NewL (CActive::EPriorityStandard ); +} + +TInt CAiScutEngine::DelayTimerCallBack (TAny *aSelf ) + { + CAiScutEngine* self = static_cast(aSelf ); + TInt err = KErrNone; + if (self ) + { + self->iDelayTimer->Cancel(); + TRAP(err, + self->HandleLaunchByIndexL( *(self->iDelayedLaunchCmd) ); + ); + + } + return err; + } + +void CAiScutEngine::DelayedLaunchByIndexL( const TDesC &aParam ) + { + delete iDelayedLaunchCmd; + iDelayedLaunchCmd = NULL; + iDelayedLaunchCmd = aParam.AllocL(); + iDelayTimer->Cancel(); + iDelayTimer->Start( iDelayTimerDelay, + iDelayTimerDelay, + TCallBack( DelayTimerCallBack, this )); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngine* CAiScutEngine::NewL(CAiScutPlugin& aPlugin) +{ + CAiScutEngine* self = new (ELeave) CAiScutEngine(aPlugin); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngine::~CAiScutEngine() +{ +#ifdef __WEB_WIDGETS + if( iWidgetRegistryConnected ) + { + iWidgetRegistry.Disconnect(); + } +#endif + delete iKeylockApi; + delete iSettingsNotifier; + delete iRepository; + + delete iHiddenAppsNotifier; + delete iHiddenAppsRepository; + + iHiddenApps.Close(); + + delete iAppNotifier; + delete iTimer; + delete iMsvSession; + delete iVwsSession; + delete iScutShutter; + + Release(iKeyEventObserver); + Release(iCallStateObserver); + + iShortcuts.ResetAndDestroy(); + iThemeShortcuts.ResetAndDestroy(); + iDefaultUsed.Close(); + + delete iBookmarkDbObserver; + iBookmarkDb.Close(); + iBookmarkSess.Close(); + + iApaSession.Close(); + + while(iAppTitleList.Count()) + { + delete iAppTitleList[0].iLongTitle; + delete iAppTitleList[0].iShortTitle; + delete iAppTitleList[0].iSkeyTitle; + delete iAppTitleList[0].iMskTitle; + iAppTitleList.Remove(0); + } + iAppTitleList.Close(); + + iResourceLoaderTexts.Close(); + iResourceLoaderSendUi.Close(); + + delete iDelayTimer; + delete iDelayedLaunchCmd; + iIcons.Close(); + FeatureManager::UnInitializeLib(); +} + +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleSessionEventL( + TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) +{ + switch (aEvent) + { + case EMsvEntriesCreated: + case EMsvEntriesDeleted: + case EMsvEntriesChanged: + if (iShortcuts.Count() > 0) + { + MergeShortcuts(EScutMailbox, ETrue); + CheckAccessAndPublish(EScutCheckMailbox, EFalse); + } + break; + + default: + break; + } +} + +// --------------------------------------------------------------------------- +// From class MApaAppListServObserver. +// Handles a change in the application list. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleAppListEvent(TInt /*aEvent*/) +{ + TRAP_IGNORE( CheckForThemeDefaultReinstalledL() ); + MergeShortcuts(EScutAnyType, ETrue); + CheckAccessAndPublish(EScutCheckApp, ETrue); +} + +// --------------------------------------------------------------------------- +// Resumes the engine. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::ResumeL(TBool aPublishAll, TAiTransitionReason /*aReason*/) +{ + // Merge shortcuts and start notifiers only if we have publishable shortcuts. + if (iShortcuts.Count() > 0) + { + if (!iSettingsNotifier) + { + iSettingsNotifier = CAiScutRepositoryWatcher::NewL( + KCRUidShortcutItems, + TCallBack(HandleShortcutsChanged, this), + iRepository); + } + + if (!iHiddenAppsNotifier) + { + iHiddenAppsNotifier = CAiScutRepositoryWatcher::NewL( + KCRUidMenu, + KMenuHideApplication, + CCenRepNotifyHandler::EStringKey, + TCallBack(HandleHiddenAppsChanged, this), + iHiddenAppsRepository); + } + } +#ifdef __WEB_WIDGETS + if( !iWidgetRegistryConnected ) + { + TInt cError = iWidgetRegistry.Connect(); + if( cError == KErrNone ) + { + iWidgetRegistryConnected = ETrue; + } + } +#endif + + GetHiddenAppsL(); + + MergeShortcutsL(EScutAnyType, EFalse); + + // Call state check must be done always because RSK "Back" + // must be published when theme is changed during phone call, too. + HandleCallStateChange(); + + CheckAccessAndPublish(EScutCheckAll, aPublishAll); + + if (iShortcuts.Count() > 0) + { + iSettingsNotifier->StartListeningL(); + + iHiddenAppsNotifier->StartListeningL(); + + if (!iAppNotifier) + { + iAppNotifier = CApaAppListNotifier::NewL(this, CActive::EPriorityStandard); + } + } +} + +// --------------------------------------------------------------------------- +// Suspends the engine. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::Suspend() +{ + delete iMsvSession; // This is to stop receiving message server events. + iMsvSession = NULL; + + delete iSettingsNotifier; + iSettingsNotifier = NULL; + + delete iHiddenAppsNotifier; + iHiddenAppsNotifier = NULL; + + delete iAppNotifier; + iAppNotifier = NULL; + + delete iTimer; + iTimer = NULL; + + delete iScutShutter; + iScutShutter = NULL; + + if (iBookmarkDbObserver) + { + iBookmarkDbObserver->Cancel(); + } + delete iBookmarkDbObserver; + iBookmarkDbObserver = NULL; +#ifdef __WEB_WIDGETS + if( iWidgetRegistryConnected ) + { + TInt cError = iWidgetRegistry.Disconnect(); + if( cError == KErrNone ) + { + iWidgetRegistryConnected = EFalse; + } + } +#endif +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::HandleShortcutsChanged(TAny* aPtr) +{ + __PRINTS("XAI: CAiScutEngine::HandleShortcutsChanged"); + CAiScutEngine* self = static_cast(aPtr); + + if (self) + { + self->MergeShortcuts(EScutAnyType, ETrue); + self->CheckAccessAndPublish(EScutCheckAll, EFalse); + } + + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::HandleHiddenAppsChanged(TAny* aPtr) +{ + CAiScutEngine* self = static_cast(aPtr); + + if (self) + { + TRAP_IGNORE(self->GetHiddenAppsL()); + self->MergeShortcuts(EScutAnyType, ETrue); + self->CheckAccessAndPublish(EScutCheckAll, EFalse); + } + + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsLockKey( TInt aScanCode, TScutLockKey aLockKey ) const + { + TBool returnValue = EFalse; + if ( iKeylockApi ) + { + TInt index = 0; + TUint32 priKey = 0; + TUint32 secKey = 0; + TInt err = KErrNone; + // Loop through all the combinations in order + // to find wether this key is part of the locking + // process or not (1st or 2nd key) + while( !returnValue ) + { + err = iKeylockApi->GetKeyCombination(index, priKey, secKey); + if ( err == KErrNone ) + { + switch( aLockKey ) + { + case EScutFirstLockKey: + returnValue = (priKey == aScanCode); + break; + case EScutSecondLockKey: + returnValue = (secKey == aScanCode); + break; + default: + returnValue = EFalse; + break; + } + } + else // no more combinations + { + break; + } + ++index; + } + return returnValue; + } + switch( aLockKey ) + { + case EScutFirstLockKey: + returnValue = iFirstLockKey == aScanCode; + break; + case EScutSecondLockKey: + returnValue = iSecondLockKey == aScanCode; + break; + default: + returnValue = EFalse; + break; + } + return returnValue; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsHidden(const TUid& aAppUid) const +{ + if (iHiddenApps.Find(aAppUid) == KErrNotFound) + { + return EFalse; + } + + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::IsHidden (0x%x) ETrue"), aAppUid); + return ETrue; +} + +// --------------------------------------------------------------------------- +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleAiEventL(TInt aEvent, const TDesC& aParam) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleAiEventL( %d, '%S' ) alive = %d"), aEvent, &aParam, iPlugin.IsAlive()); + + TUid appUid = KNullUid; + iFirstLockKeyPressed = EFalse; + iSoftkeyAppRunning = EFalse; + + if (aParam.Compare(KLeftSoftkey) == 0) + { + if ( IsLockKey( EStdKeyDevice0, EScutFirstLockKey) || IsLockKey( EStdKeyDevice0 , EScutSecondLockKey)) + { + // Raise the first lock key pressed flag + // only when this is raised, keylock skip causes scut launch + iFirstLockKeyPressed = ETrue; + appUid = SoftkeyUid(KLeftSoftkeyId); + } + } + + if (aParam.Compare(KRightSoftkey) == 0) + { + if ( IsLockKey( EStdKeyDevice1 , EScutFirstLockKey) || IsLockKey( EStdKeyDevice1 , EScutSecondLockKey)) + { + // Raise the first lock key pressed flag + // only when this is raised, keylock skip causes scut launch + iFirstLockKeyPressed = ETrue; + appUid = SoftkeyUid(KRightSoftkeyId); + } + } + + if (iFirstLockKeyPressed && appUid != KNullUid) + { + TApaTaskList taskList(iEnv->WsSession()); + TApaTask task(taskList.FindApp(appUid)); + + if (task.Exists()) + { + if (IsHiddenFromFSW(appUid)) + iSoftkeyAppRunning = EFalse; + else + iSoftkeyAppRunning = ETrue; + } + } + + if (IsDelayRequired(appUid)) + { + DelayedLaunchByIndexL( aParam ); + return; + } + + if( iActiveCall && aParam.Compare( KRightSoftkey ) == 0 ) + { + ActivateTopMostApp(); + return; + } + + switch( aEvent ) + { + case EAiScutEventLaunchByIndex: + HandleLaunchByIndexL(aParam); + break; + + case EAiScutEventLaunchByValue: + HandleLaunchByValueL(aParam); + break; + + case EAiScutEventShowSettings: + ShowSettingsL(aParam); + break; + + case EAiScutEventShowSetting: + ShowSettingL(aParam); + break; + + case EAiScutEventLaunchFastswap: + OpenFastSwap(); + break; + + case EAiScutEventLaunchByIndexAlternate: + HandleLaunchByIndexAlternateL(aParam); + break; + + default: + break; + } + +} + +// --------------------------------------------------------------------------- +// Called by the timer. Retries the access check for shortcuts. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::RetryAccessCheck() +{ + CheckAccessAndPublish(EScutCheckAll, iPublishAll); + + // One retry is enough. + iTimer->Cancel(); + delete iTimer; + iTimer = NULL; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsNonNative(const TUid& aUid) +{ + TBool ret = EFalse; + + const TUid KMidletAppType = { 0x10210E26 }; + TUid typeuid = KNullUid; + + if (KErrNone == iApaSession.GetAppType(typeuid, aUid)) + { + if (typeuid == KMidletAppType) + { + ret = ETrue; + } + } + +#ifdef __WEB_WIDGETS + if (IsWidget(aUid)) + { + ret = ETrue; + } +#endif + + return ret; +} + +#ifdef __WEB_WIDGETS +TBool CAiScutEngine::IsWidget(const TUid& aUid) +{ + if( iWidgetRegistryConnected ) + { + return iWidgetRegistry.IsWidget(aUid); + } + else + { + return EFalse; + } +} +#endif + +// --------------------------------------------------------------------------- +// Creates the default shortcuts. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::CreateShortcutsL() +{ + TInt scIndex = 0; + + iShortcuts.ResetAndDestroy(); + + RArray keys; + CleanupClosePushL(keys); + // Find the keys that define theme-default shortcut settings. + iRepository->FindL(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, keys); + + + TLinearOrder order(CompareKey); + keys.Sort(order); + + HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + if (iSettingsNotifier) + { + iSettingsNotifier->StopListening(); + } + if (iHiddenAppsNotifier) + { + iHiddenAppsNotifier->StopListening(); + } + + for (TInt i = 0; i < keys.Count(); ++i) + { + TUint32 key = keys[i]; + if (iRepository->Get(key, bufferPtr) == KErrNone) + { + // Strip off the default-setting-bit, it's not part of the shortcut id. + key &= KScutBitMaskThemeDefault; + + // Parse the icon from the URL and fetch the icon to our icon array + // The actual icon => shortcut matching and overriding is done in + // CheckAccessAndPublishL() just before publishing + iParser.Parse(bufferPtr); + TAiScutIcon icon = iParser.Icon(); + if ( icon.iType != EScutIconNone ) + { + AddOverrideIcon( icon ); + } + // Keys over 0x20000000 means that they are just icon overrides + if ( !(key & KScutFlagBitIconOverride ) ) + { + key &= KScutMaskAdditionalSetting; + // Ignore possible errors during shortcut construction + // and simply try to move on to the next shortcut. + CAiScutShortcut* shortcut = NULL; + TRAPD(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, bufferPtr, *this)); + if (err == KErrNone) + { + // If shortcut is not accessible, replace it with platform default. + TBool access = EFalse; + if (shortcut) + { + // Append theme default to our array, incase of uninstall/reinstall/mem card removal + // restoration is required. + CAiScutShortcutInfo* shortcutInfo = NULL; + TRAP_IGNORE(shortcutInfo = CAiScutShortcutInfo::NewL(key | KScutFlagBitThemeDefault, + bufferPtr)); + if ( shortcutInfo ) + { + iThemeShortcuts.Append(shortcutInfo); + } + + TScutDefault usedDefault = EScutDefaultToPlatform; + + TRAP_IGNORE(access = shortcut->CheckAccessL(EScutCheckAll)); + if (!access) + { + HBufC* target = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr targetPtr = target->Des(); + TUid dummy; + + // Get the default shortcut definition for index 'scIndex'. + // uid is ignored. + TAiDefaultShortcut::GetDefaultShortcut(key, dummy, targetPtr); + + delete shortcut; + shortcut = NULL; + TRAP(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, targetPtr, *this)); + + if (err == KErrNone) + { + // Add the bit that indicates this is a default shortcut setting. + key |= KScutFlagBitThemeDefault; + iRepository->Set(key, targetPtr); + + // Try to locate a icon override from the default + // definition + iParser.Parse( targetPtr ); + TAiScutIcon tIcon = iParser.Icon(); + if ( tIcon.iType != EScutIconNone ) + { + AddOverrideIcon( tIcon ); + } + } + CleanupStack::PopAndDestroy( target ); + } + else + { + usedDefault = EScutDefaultToTheme; + } + + scIndex++; + + if (shortcut) // This test ensures that the creation right above went well. + { + iDefaultUsed.Append(usedDefault); + err = iShortcuts.Append(shortcut); + + if (err != KErrNone) + { + delete shortcut; + shortcut = NULL; + } + } + } + } + } + } + } + + if (iSettingsNotifier) + { + iSettingsNotifier->StartListeningL(); + } + if (iHiddenAppsNotifier) + { + iHiddenAppsNotifier->StartListeningL(); + } + + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PopAndDestroy(&keys); +} + +// --------------------------------------------------------------------------- +// Check whether theme default sc was reinstalled. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::CheckForThemeDefaultReinstalledL() +{ + HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + if (iSettingsNotifier) + { + iSettingsNotifier->StopListening(); + } + if (iHiddenAppsNotifier) + { + iHiddenAppsNotifier->StopListening(); + } + + TInt count = iThemeShortcuts.Count(); + for (TInt i = 0; (i < count) && + (i < iDefaultUsed.Count()) && + (i < iShortcuts.Count()); + ++i) + { + if (iDefaultUsed[i] == EScutDefaultToPlatform || + iDefaultUsed[i] == EScutUserDefined) + { + bufferPtr.Zero(); + CAiScutShortcut*& shortcut = iShortcuts[i]; + // Strip off the default-setting-bit, it's not part of the shortcut id. + TUint32 scutKey = iThemeShortcuts[i]->Id() & KScutBitMaskThemeDefault; + bufferPtr.Append(iThemeShortcuts[i]->Target()); + CAiScutShortcut* newScut = NULL; + TRAPD(err, newScut = AiScutFactory::CreateAiScutShortcutL(scutKey, bufferPtr, *this)); + if (err == KErrNone) + { + delete shortcut; + shortcut = NULL; + shortcut = newScut; + // Add the bit that indicates this is a default shortcut setting. + scutKey |= KScutFlagBitThemeDefault; + iRepository->Set(scutKey, bufferPtr); + } + iDefaultUsed[i] = EScutDefaultToTheme; + // Recheck access + shortcut->CheckAccessL(EScutCheckAll); + } + } + if (iSettingsNotifier) + { + iSettingsNotifier->StartListeningL(); + } + if (iHiddenAppsNotifier) + { + iHiddenAppsNotifier->StartListeningL(); + } + + CleanupStack::PopAndDestroy(buffer); +} + +// --------------------------------------------------------------------------- +// Merges the user defined shortcuts with the defaults and checks shortcut access. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::MergeShortcuts(TShortcutType aType, TBool aRecreateAll) +{ + TRAP_IGNORE(MergeShortcutsL(aType, aRecreateAll)); +} + +// --------------------------------------------------------------------------- +// Merges the user defined shortcuts with the defaults. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::MergeShortcutsL(TShortcutType aType, TBool aRecreateAll) +{ + RArray keys; + CleanupClosePushL(keys); + + // Find the keys that define user defined shortcut settings. + iRepository->FindL(KScutCenRepKeyUserDefined, KScutCenRepKeyMask, keys); + + HBufC* buffer = HBufC::NewLC( + NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + for (TInt i = 0; i < iShortcuts.Count(); ++i) + { + CAiScutShortcut* shortcut = iShortcuts[i]; + if (aType == EScutAnyType || shortcut->Type() == aType) + { + + TInt keyIndex = keys.Find(shortcut->Id()); + if (keyIndex != KErrNotFound) + { + // Set the new user target. + if (keys.Count() > keyIndex && keyIndex >= 0 && + iRepository->Get(keys[keyIndex], bufferPtr) == KErrNone) + { + iParser.Parse(bufferPtr); + TAiScutIcon icon = iParser.Icon(); + if ( icon.iType != EScutIconNone ) + { + AddOverrideIcon( icon ); + } + if ( aRecreateAll || + buffer->CompareC( shortcut->ActiveDefinition() ) != 0 ) + { + shortcut->DeleteUserTarget(); + shortcut->SetUserTarget(bufferPtr); + } + if (i < iDefaultUsed.Count()) + { + iDefaultUsed[i] = EScutUserDefined; + } + } + } + } + } + + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PopAndDestroy(&keys); +} + +// --------------------------------------------------------------------------- +// Checks shortcut accessibility. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::CheckAccessAndPublish(TInt aCheckType, TBool aPublishAll) +{ + TRAPD(err, CheckAccessAndPublishL(aCheckType, aPublishAll)); + + if (err == KErrNotReady) + { + // Access check failed, create a timer to try again later. + iTimer = CPeriodic::New(CActive::EPriorityStandard); + iTimer->Start(KScutAccessCheckRetryDelay, KScutAccessCheckRetryDelay, + TCallBack(DelayedCheckCallBack)); + } +} + +// --------------------------------------------------------------------------- +// Tells each shortcut to check whether or not its target is accessible. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::CheckAccessAndPublishL(TInt aCheckType, TBool aPublishAll) +{ + __PRINTS("XAI: CheckAccessAndPublishL"); + if (!iMsvSession && IsMsvSessionNeeded()) + { + iMsvSession = CMsvSession::OpenAsObserverL(*this); + } + + if (!iBookmarkDbObserver && IsBookmarkObserverNeeded()) + { + iBookmarkDbObserver = + new (ELeave) CActiveFavouritesDbNotifier(iBookmarkDb, *this); + if (! iBookmarkDbObserver->IsActive()) + { + iBookmarkDbObserver->Start(); + } + } + + iPublishAll = aPublishAll; + + TInt count = iShortcuts.Count(); + for (TInt i = 0; i < count; ++i) + { + CAiScutShortcut*& shortcut = iShortcuts[i]; + + // Check shortcut access and publish it if its target has changed. + // When the plug-in is being resumed, all shortcuts are published. + // Non-visible and locked shortcuts are never published. + if ( !shortcut->CheckAccessL(aCheckType) ) + { + HBufC* target = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr targetPtr = target->Des(); + TUid dummy; + // Get the default shortcut definition from cenrep using key 'key'. + // uid is ignored. + TUint32 key = shortcut->Id(); + TAiDefaultShortcut::GetDefaultShortcut(key, dummy, targetPtr); + delete shortcut; + shortcut = NULL; + TRAPD(err, shortcut = AiScutFactory::CreateAiScutShortcutL(key, targetPtr, *this)); + if (err == KErrNone) + { + // Add the bit that indicates this is a default shortcut setting. + key |= KScutFlagBitThemeDefault; + iRepository->Set(key, targetPtr); + + // Try to locate a icon override from the default + // definition + iParser.Parse( targetPtr ); + TAiScutIcon tIcon = iParser.Icon(); + if ( tIcon.iType != EScutIconNone ) + { + AddOverrideIcon( tIcon ); + } + } + CleanupStack::PopAndDestroy( target ); + if (i < iDefaultUsed.Count()) + { + iDefaultUsed[i] = EScutDefaultToPlatform; + } + // Recheck access + shortcut->CheckAccessL(aCheckType); + } + + TBool targetChanged = shortcut->IsTargetChanged(); + TInt32 id = shortcut->Id(); + TBool nonVisible = (0 != (id & KScutFlagBitNonVisible)); + + if (aCheckType == EScutCheckBkm && shortcut->Type() == EScutBookmark) + { + targetChanged = ETrue; + } + + shortcut->SetToBePublished( + (targetChanged || iPublishAll) && + !nonVisible + ); + + // Assign overridden icons to shortcuts if needed + for ( TInt j = 0; j < iIcons.Count(); j++) + { + // Check that the appuid and type matches + if ( shortcut->AppUid() == iIcons[j].iAppUid && + shortcut->Type() == iIcons[j].iShortcutType ) + { + // We need to check also the view id / bkm id if present or otherwise all bookmarks + // app views would be overridden + if ( iIcons[j].iViewId.iUid <= 0 || + iIcons[j].iViewId == shortcut->AdditionalUid() ) + { + shortcut->SetIcon(iIcons[j]); + } + } + } + + __PRINT( __DBG_FORMAT( "XAI: id = 0x%x, type = %d, publish = %d"), + shortcut->Id(), shortcut->Type(), shortcut->NeedsToBePublished()); + } + + iPlugin.PublishShortcutsL(iShortcuts); +} + +// --------------------------------------------------------------------------- +// Finds the shortcut object with the given id. +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::FindShortcutIndex(TInt32 aId) +{ + for (TInt i = 0; i < iShortcuts.Count(); ++i) + { + if (iShortcuts[i]->Id() == aId) + { + return i; + } + } + + return KErrNotFound; +} + +// --------------------------------------------------------------------------- +// Handles the shortcut launch by index. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleLaunchByIndexL(const TDesC& aParam) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexL ('%S')"), &aParam); + if (aParam.Length() > 0) + { + _LIT(KHexPrefix, "0x"); + const TInt prefixLen = 2; + + TRadix radix(EDecimal); + TPtrC ptr(aParam); + + if (aParam.Left(prefixLen).CompareC(KHexPrefix) == 0) + { + // Strip the '0x' prefix. + ptr.Set(aParam.Right(aParam.Length() - prefixLen)); + + radix = EHex; + } + + TLex lexer(ptr); + TUint32 id; + if (lexer.Val(id, radix) == KErrNone) + { + TInt idx = FindShortcutIndex(id); + if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) + { + iShortcuts[idx]->LaunchL(); + } + } + } +} +// --------------------------------------------------------------------------- +// Handles the shortcut launch by index. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleLaunchByIndexAlternateL(const TDesC& aParam) +/** + * These are the cases at the moment that are handled here. + * 1) Appshell targeted => Fastswap opened + */ +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexAlternateL ('%S')"), &aParam); + TInt index = IntFromDesc( aParam ); + TInt idx = FindShortcutIndex( index ); + if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) + { + CAiScutShortcut *scut = iShortcuts[idx]; + // Open fastswap in case appshell was targeted with alternate launch + if ( scut->AppUid() == KScutAppShellUid ) + { + OpenFastSwap(); + return; + } + // add other special cases here + /*if ( index == EAiScutSoftKeyLeft ) + { + // do something + }*/ + } +} + +// --------------------------------------------------------------------------- +// Handles the shortcut launch by value. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleLaunchByValueL(const TDesC& aParam) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleLaunchByIndexL ('%S')"), &aParam); + + if (aParam.Length() > 0) + { + CAiScutShortcut* shortcut = AiScutFactory::CreateAiScutShortcutLC(0x0, aParam, *this); + shortcut->CheckAccessL(EScutCheckAll); + shortcut->LaunchL(); + CleanupStack::PopAndDestroy(shortcut); + } +} + +// --------------------------------------------------------------------------- +// Shows the plug-in settings dialog. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::ShowSettingsL(const TDesC& aParam) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::ShowSettingsL ('%S')"), &aParam); + + _LIT(KGeneralSettings, "localapp:0x100058EC?view=0x102750FC"); + + CAiScutShortcut* shortcut = CAiScutShortcut::NewLC(0x0, KGeneralSettings, *this); + shortcut->CheckAccessL(EScutCheckAll); + + if (aParam.Length() > 0) + { + HBufC8* param = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aParam); + CleanupStack::PushL(param); + + const TDesC8& msg(*param); + + shortcut->LaunchL(msg); + + CleanupStack::PopAndDestroy(param); + } + else + { + shortcut->LaunchL(KNullDesC8); + } + + + CleanupStack::PopAndDestroy(shortcut); +} + +// --------------------------------------------------------------------------- +// Shows the plug-in setting. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::ShowSettingL(const TDesC& aParam) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::ShowSettingL ('%S')"), &aParam); + + _LIT(KGeneralSettings, "localapp:0x100058EC?view=0x102750FC"); + + CAiScutShortcut* shortcut = CAiScutShortcut::NewLC(0x0, KGeneralSettings, *this); + shortcut->CheckAccessL(EScutCheckAll); + + if (aParam.Length() > 0) + { + HBufC8* param = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aParam); + CleanupStack::PushL(param); + + HBufC8* param2 = HBufC8::NewLC(param->Des().Length()+KScutDirectOpen.iTypeLength); + param2->Des().Copy(param->Des()); + param2->Des().Append(KScutDirectOpen); + const TDesC8& msg(*param2); + + shortcut->LaunchL(msg); + + CleanupStack::PopAndDestroy(param2); + CleanupStack::PopAndDestroy(param); + } + else + { + shortcut->LaunchL(KNullDesC8); + } + + + CleanupStack::PopAndDestroy(shortcut); +} + +// --------------------------------------------------------------------------- +// Opens the fastswap window +// --------------------------------------------------------------------------- +// +void CAiScutEngine::OpenFastSwap() +{ + RAknUiServer* uiServer = CAknSgcClient::AknSrv(); + if ( uiServer ) + { + uiServer->MakeTaskListVisible( ETrue ); + } +} + + + +// --------------------------------------------------------------------------- +// Handles PS commands from WSPlugin. +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::HandlePSCommand(TAny* aAny) +{ + CAiScutEngine* self = reinterpret_cast< CAiScutEngine* >(aAny); + TInt err = KErrNone; + if (self) + { + TRAP(err, self->DoHandlePSCommandL()); + } + + return err; +} + +// --------------------------------------------------------------------------- +// Handles call state changes. +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::CallStateChangeCallback(TAny* /*aAny*/) +{ + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUid CAiScutEngine::SoftkeyUid(TUint32 aSoftkeyId) +{ + TUid uid = KNullUid; + + TInt idx = FindShortcutIndex(aSoftkeyId); + if (idx != KErrNotFound && idx >= 0 && iShortcuts.Count() > idx) + { + uid = iShortcuts[idx]->AppUid(); + + __PRINT( __DBG_FORMAT( "XAI: SoftkeyUid %d app uid = 0x%x"), idx, uid.iUid); + } + + return uid; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsDelayRequired(TUid aAppUid) +{ + // softkey delay is reuired for these applications because of problems + // in killing them immediatly after keylock activation. + if (aAppUid.iUid == KScutBrowserUidValue || + aAppUid.iUid == KScutOperatorMenuUidValue || + aAppUid.iUid == KScutVideoServicesUidValue || + IsNonNative( aAppUid ) + ) + { + return ETrue; + } + + return EFalse; +} + +// --------------------------------------------------------------------------- +// Handles PS commands from WSPlugin. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::DoHandlePSCommandL() +{ + TBuf command; + TUint32 lockKeyId = 0; + iKeyEventObserver->Get(command); + + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::DoHandlePSCommandL command = '%S'"), &command); + + TUid appUid = KNullUid; + + if (iFirstLockKey == EStdKeyDevice0) + { + appUid = SoftkeyUid(KLeftSoftkeyId); + lockKeyId = KLeftSoftkeyId; + } + + if (iFirstLockKey == EStdKeyDevice1) + { + appUid = SoftkeyUid(KRightSoftkeyId); + lockKeyId = KRightSoftkeyId; + } + + if (iFirstLockKeyPressed && command.Compare(KAiPSEnableKeyLock) == 0) + { + if (appUid != KNullUid) + { + TBool isDialog = EFalse; + TInt idx = 0; + delete iScutShutter; + iScutShutter = NULL; + + // In case new message shortcut in lockkey + // we need to dismiss the dialog + if ( lockKeyId > 0 ) + { + idx = FindShortcutIndex( lockKeyId ); + if (idx != KErrNotFound) + { + switch (iShortcuts[idx]->Type()) + { + case EScutNewMsgType: + isDialog = ETrue; + break; + default: + isDialog = EFalse; + break; + } + } + + } + iDelayTimer->Cancel(); + iScutShutter = CAiScutTargetShutter::NewL(iEnv, appUid, iSoftkeyAppRunning, isDialog); + iScutShutter->StartL(); + } + } + + if (command.Compare(KAiPSSkipKeyLock) == 0) + { + iDelayTimer->Cancel(); + return ; + } + else if (command.Compare(KAiPSKeyLockTimeout) == 0) + { + if (iFirstLockKeyPressed) + { + iFirstLockKeyPressed = EFalse; + + if (iFirstLockKey == EStdKeyDevice0) + { + if (IsDelayRequired(appUid)) + { + HandleLaunchByIndexL(KLeftSoftkey); + } + return ; + } + + if (iFirstLockKey == EStdKeyDevice1) + { + if (IsDelayRequired(appUid)) + { + HandleLaunchByIndexL(KRightSoftkey); + } + return ; + } + } + return ; + } + + if (FeatureManager::FeatureSupported(KFeatureIdKeypadNoVoiceKey) && + command.Compare(KAiPSSkipNameDialer) == 0) + { + HandleLaunchByIndexL(KRightSoftkey); + return ; + } + + HandleLaunchByValueL(command); +} + +// --------------------------------------------------------------------------- +// Handles call state changes. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleCallStateChange() +{ + TInt value = 0; + TInt err = iCallStateObserver->Get(value); + iActiveCall = (value > EPSCTsyCallStateNone) && err == KErrNone; + + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleCallStateChange = %d"), value); + __PRINT( __DBG_FORMAT( "XAI: iActiveCall = %d"), iActiveCall); + + for (TInt i = 0; i < iShortcuts.Count(); ++i) + { + iShortcuts[i]->SetCallState(iActiveCall); + } +} + +// --------------------------------------------------------------------------- +// Activates TopMost Application +// --------------------------------------------------------------------------- +// +void CAiScutEngine::ActivateTopMostApp() +{ + // Phone Topmost app as default + TInt idleAppUid = 0; + TInt topMostAppId = 0; + + RProperty::Get(KPSUidAiInformation, KActiveIdleUid, idleAppUid); + + RProperty property; + TInt err = property.Attach(KPSUidUikon, KUikVideoCallTopApp); + + if (err == KErrNone) + { + property.Get(topMostAppId); + } + + property.Close(); + + __PRINT( __DBG_FORMAT( "XAI: ActivateTopMostApp idle uid = 0x%x topmost = 0x%x"), idleAppUid, topMostAppId); + + TUid appId(TUid::Uid(topMostAppId)); + + if(appId == KVideoCallUid) + { + const TVwsViewId viewId(appId, appId); + err = iVwsSession->CreateActivateViewEvent(viewId, KNullUid, KNullDesC8()); + + __PRINT( __DBG_FORMAT( "XAI: CreateActivateViewEvent = %d"), err); + } + else + { + const TVwsViewId viewId(appId, KVoiceCallUidViewId); + err = iVwsSession->CreateActivateViewEvent(viewId, KVoiceCallUidViewId, KNullDesC8()); + + __PRINT( __DBG_FORMAT( "XAI: CreateActivateViewEvent = %d"), err); + } + +} + +// --------------------------------------------------------------------------- +// From class MFavouritesDbObserver. +// Handles database event. +// --------------------------------------------------------------------------- +// +void CAiScutEngine::HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutEngine::HandleFavouritesDbEventL aEvent = %d"), aEvent); + + if (aEvent == RDbNotifier::ECommit) + { + MergeShortcuts(EScutBookmark, ETrue); + CheckAccessAndPublish(EScutCheckBkm, EFalse); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsMsvSessionNeeded() +{ + TInt count = iShortcuts.Count(); + + for (TInt i = 0; i < count; ++i) + { + CAiScutShortcut* shortcut = iShortcuts[i]; + TShortcutType type = shortcut->Type(); + + if (type == EScutNewMessage || + type == EScutNewEmail || + type == EScutNewSyncMLMail || + type == EScutNewPostcard || + type == EScutNewAudioMsg || + type == EScutNewMsgType || + type == EScutMailbox) + { + return ETrue; + } + } + + return EFalse; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsBookmarkObserverNeeded() +{ + TInt count = iShortcuts.Count(); + + for (TInt i = 0; i < count; ++i) + { + CAiScutShortcut* shortcut = iShortcuts[i]; + if (shortcut->Type() == EScutBookmark) + { + return ETrue; + } + } + + return EFalse; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::GetAppTitle( + const TUid& aAppUid, const TUid& aViewId, TDes& aTitle, TAiScutAppTitleType aType) +{ + TBool ret = EFalse; + TInt count = iAppTitleList.Count(); + + for (TInt i = 0; i < count; i++) + { + TAiScutAppTitleEntry entry = iAppTitleList[i]; + + if (entry.iAppUid == aAppUid && entry.iViewId == aViewId) + { + switch (aType) + { + case EAiScutLongTitle: + if (entry.iLongTitle) + { + aTitle = *entry.iLongTitle; + ret = ETrue; + } + break; + + case EAiScutShortTitle: + if (entry.iShortTitle) + { + aTitle = *entry.iShortTitle; + ret = ETrue; + } + break; + + case EAiScutSkeyTitle: + if (entry.iSkeyTitle) + { + aTitle = *entry.iSkeyTitle; + ret = ETrue; + } + break; + + case EAiScutMskTitle: + if (entry.iMskTitle) + { + aTitle = *entry.iMskTitle; + ret = ETrue; + } + break; + default : + break; + } + + break; // break the for loop + } + } + + if (! ret) __PRINT( __DBG_FORMAT( "XAI: GetAppTitle NOT found for uid = 0x%x"), aAppUid); + + return ret; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngine::LoadAppTitleListL() +{ + TResourceReader reader; + iEnv->CreateResourceReaderLC(reader, R_SCUT_APP_TITLE_LIST); + + TInt items = reader.ReadInt16(); + + __PRINT( __DBG_FORMAT( "XAI: LoadAppTitleListL items = %d"), items); + + TUid appuid; + TUid viewid; + + for (TInt i = 0; i < items; i++) + { + appuid.iUid = reader.ReadInt32(); + viewid.iUid = reader.ReadInt32(); + + HBufC16* longTitle = reader.ReadHBufC16L(); + CleanupStack::PushL(longTitle); + + HBufC16* shortTitle = reader.ReadHBufC16L(); + CleanupStack::PushL(shortTitle); + + HBufC16* skeyTitle = reader.ReadHBufC16L(); + CleanupStack::PushL(skeyTitle); + + HBufC16* mskTitle = reader.ReadHBufC16L(); + CleanupStack::PushL(mskTitle); + + TAiScutAppTitleEntry entry; + + entry.iAppUid = appuid; + entry.iViewId = viewid; + entry.iLongTitle = longTitle; + entry.iShortTitle = shortTitle; + entry.iSkeyTitle = skeyTitle; + entry.iMskTitle = mskTitle; + + User::LeaveIfError(iAppTitleList.Append(entry)); + + // Title names are deleted in destructor. + CleanupStack::Pop(4, longTitle); + } + + CleanupStack::PopAndDestroy(); // reader +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngine::GetHiddenAppsL() +{ + HBufC* buffer = HBufC::NewLC( + NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + iHiddenAppsRepository->Get(KMenuHideApplication, bufferPtr); + + __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::GetHiddenAppsL '%S' "), buffer); + + iHiddenApps.Reset(); + TAiScutAppUidParser uidParser(bufferPtr, iHiddenApps); + uidParser.ParseL(); + + CleanupStack::PopAndDestroy(buffer); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngine::IsHiddenFromFSW( const TUid& aAppUid ) +{ + const TUid KPSUidUikon = { 0x101F8773 }; + const TUint32 KUikAppHiddenList = 0x00000010; + const TInt KMaxHiddenApps = 25; + + TBuf16 <2*KMaxHiddenApps> retrievedList; + TInt err = RProperty::Get( KPSUidUikon, KUikAppHiddenList, +retrievedList ); + TInt i = 0; + + TUint32 listValue; + while( i < KMaxHiddenApps && KErrNone == err ) + { + // 32-bit uid values are retrieved in two 16-bit parts + listValue = retrievedList[2*i] << 16; + listValue += retrievedList[2*i+1]; + + if ( listValue ) + { + TUid t ( KNullUid ); + t.iUid = listValue; + if( t == aAppUid ) + { + return ETrue; + } + } + else + { + err = KErrEof; + return EFalse; + } + i++; + } + return EFalse; +} +// --------------------------------------------------------------------------- +// Adds an override icon to iIcons array in case the same icon +// isn't there already +// --------------------------------------------------------------------------- +// +TInt CAiScutEngine::AddOverrideIcon( TAiScutIcon &aIcon ) + { + TBool foundExisting = EFalse; + + for ( TInt i = 0; i < iIcons.Count(); i++) + { + if ( aIcon.iAppUid == iIcons[i].iAppUid && + aIcon.iShortcutType == iIcons[i].iShortcutType && + aIcon.iViewId == iIcons[i].iViewId && + aIcon.iDestination == iIcons[i].iDestination ) + { + foundExisting = ETrue; + break; + } + } + if ( !foundExisting ) + { + return iIcons.Append( aIcon ); + } + return KErrNone; + } +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutengineext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutengineext.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,326 @@ +/* +* 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: Shortcut plug-in engine extension +* +*/ + +#include +#include +#include +#include + +#include + +#include "caiscutengineext.h" +#include "caiscutextserver.h" +#include "taiscutparser.h" +#include "caiscutshortcut.h" +#include "caiscutplugin.h" +#include "aiscutcontentmodel.h" +#include "caiscutextdata.h" +#include "caiscutextdatamodel.h" + +// ======== LOCAL DEFINITIONS ======== + +namespace + { + // LOCAL CONSTANTS + /** + * Target id hex format + */ + _LIT( KTargetIdFormat, "0x%08x" ); + + /** + * Maximum length of target id + */ + const TInt KTargetIdMaxLength = 11; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngineExt* CAiScutEngineExt::NewL( CAiScutPlugin& aPlugin ) + { + CAiScutEngineExt* self = new( ELeave ) CAiScutEngineExt( aPlugin ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngineExt::~CAiScutEngineExt() + { + delete iAiScutExtServer; + delete iExtDataModel; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutEngineExt::CAiScutEngineExt( CAiScutPlugin& aPlugin ) + : CAiScutEngine( aPlugin ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::ConstructL() + { + CAiScutEngine::ConstructL(); + + iExtDataModel = CAiScutExtDataModel::NewL(); + iAiScutExtServer = new( ELeave ) CAiScutExtServer( *this, Env()->WsSession() ); + iAiScutExtServer->ConstructL(); + TRAPD( err, iAiScutExtServer->StartL( KAiScutExtServerName ) ); + + if( err != KErrNone && err != KErrAlreadyExists ) + { + User::Leave( err ); + } + + //Send EAiScutEventGainFocus to the leftmost shortcut in order to put + //its state machine in correct state + if( iShortcuts.Count() > 0 ) + { + static_cast< CAiScutShortcutExt* >( iShortcuts[ 0 ] )->HandleAIEventL( + EAiScutEventGainFocus ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::CheckAccessAndPublish( CAiScutShortcut& aShortcut ) + { + TRAPD( err, + RAiShortcutArray shortcutArray; + CleanupClosePushL( shortcutArray ); + shortcutArray.AppendL( &aShortcut ); + aShortcut.SetToBePublished( ETrue ); + iPlugin.PublishShortcutsL( shortcutArray ); + CleanupStack::PopAndDestroy( &shortcutArray ); + ); + + if( err != KErrNone ) + { + //Delegate publishing to the original engine + CAiScutEngine::CheckAccessAndPublish( EScutCheckAll, ETrue ); + } + } + +// --------------------------------------------------------------------------- +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleAiEventL( TInt aEvent, const TDesC& aParam ) + { + CAiScutShortcutExt* shortcut = FindShortcutById( aParam ); + if( shortcut ) + { + shortcut->HandleAIEventL( aEvent ); + } + CAiScutEngine::HandleAiEventL( aEvent, aParam ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::ResumeL( TBool aPublishAll, TAiTransitionReason aReason ) + { + TArray extDataArray = iExtDataModel->AiScutExtDataArray(); + const TInt count = extDataArray.Count(); + //Iterate extension data items and populate to matching shortcuts. + //Remove the items that are not used in any shortcut. + for( TInt i = 0; i < count; i++ ) + { + CAiScutExtData* extData = extDataArray[ i ]; + const TDesC& targetDefinition = extData->TargetDefinition(); + if( !PopulateExtData( targetDefinition, extData ) ) + { + iExtDataModel->RemoveAiScutExtData( targetDefinition ); + } + } + + TAiTransitionReason resumeReason = iPlugin.ResumeReason(); + const TInt shortcutCount = iShortcuts.Count(); + for( TInt i = 0; i < shortcutCount; i++ ) + { + CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > + ( iShortcuts[ i ] ); + shortcut->HandleResumed( resumeReason ); + } + + iAiScutExtServer->ResumeL( aReason ); + + CAiScutEngine::ResumeL( aPublishAll, aReason ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleSetPopupLineArrayL( const TDesC& aDefinition, + CDesCArray* aLineArray ) + { + CAiScutExtData* extData = iExtDataModel->SetPopupLineArrayL( + aDefinition, aLineArray ); + TBool shortcutsFound = PopulateExtData( + aDefinition, extData ); + if( !shortcutsFound ) + { + iExtDataModel->RemoveAiScutExtData( aDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleResetPopupLineArrayL( const TDesC& aDefinition ) + { + CAiScutExtData* extData = iExtDataModel->ResetPopupLineArray( aDefinition ); + TBool shortcutsFound = PopulateExtData( + aDefinition, extData ); + if( !shortcutsFound ) + { + iExtDataModel->RemoveAiScutExtData( aDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleSetIconL( const TDesC& aDefinition, CGulIcon* aIcon ) + { + CAiScutExtData* extData = iExtDataModel->SetIconL( aDefinition, aIcon ); + TBool shortcutsFound = PopulateExtData( + aDefinition, extData ); + if( !shortcutsFound ) + { + iExtDataModel->RemoveAiScutExtData( aDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleResetIconL( const TDesC& aDefinition ) + { + CAiScutExtData* extData = iExtDataModel->ResetIcon( aDefinition ); + TBool shortcutsFound = PopulateExtData( + aDefinition, extData ); + if( !shortcutsFound ) + { + iExtDataModel->RemoveAiScutExtData( aDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngineExt::HandleIsInShortcutsL( const TDesC& aDefinition ) const + { + const TInt shortcutCount = iShortcuts.Count(); + for( TInt i = 0; i < shortcutCount; i++ ) + { + CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > + ( iShortcuts[ i ] ); + TPtrC activeTargetDefinition = shortcut->ActiveTargetDefinition(); + if( activeTargetDefinition.CompareF( aDefinition ) == 0 ) + { + return ETrue; + } + } + + return EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutEngineExt::HandleIssuePutInShortcutsL( const TDesC& /*aDefinition*/ ) + { + CGSLauncher* l = CGSLauncher::NewLC(); + l->LaunchGSViewL ( TUid::Uid( AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN ), + KScutActiveIdleUid, + KNullDesC8 ); + CleanupStack::PopAndDestroy( l ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutEngineExt::PopulateExtData( const TDesC& aDefinition, + const MAiScutExtData* aAiScutExtData ) + { + //Iterate shortcuts and update matching ones with new extData + TBool shortcutsFound = EFalse; + const TInt shortcutCount = iShortcuts.Count(); + for( TInt i = 0; i < shortcutCount; i++ ) + { + CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > + ( iShortcuts[ i ] ); + TPtrC activeTargetDefinition = shortcut->ActiveTargetDefinition(); + if( activeTargetDefinition.CompareF( aDefinition ) == 0 ) + { + shortcut->SetAiScutExtData( aAiScutExtData ); + shortcutsFound = ETrue; + } + } + + return shortcutsFound; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutExt* CAiScutEngineExt::FindShortcutById( + const TDesC& aId ) const + { + const TInt shortcutCount = iShortcuts.Count(); + for( TInt i = 0; i < shortcutCount; i++ ) + { + CAiScutShortcutExt* shortcut = static_cast< CAiScutShortcutExt* > + ( iShortcuts[ i ] ); + + TBuf< KTargetIdMaxLength > id; + id.Format( KTargetIdFormat, shortcut->Id() ); + + if( id.CompareF( aId ) == 0 ) + { + return shortcut; + } + } + return NULL; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutextdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutextdata.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,183 @@ +/* +* 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: Shortcut plug-in engine extension +* +*/ + + +#include "caiscutextdata.h" +#include +#include + +// ======== LOCAL DEFINITIONS ======== + +namespace + { + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtData* CAiScutExtData::NewL( const TDesC& aTargetDefinition ) + { + CAiScutExtData* self = CAiScutExtData::NewLC( aTargetDefinition ); + CleanupStack::Pop( self ); + return self; + } + +CAiScutExtData* CAiScutExtData::NewLC( const TDesC& aTargetDefinition ) + { + CAiScutExtData* self = new( ELeave ) CAiScutExtData; + CleanupStack::PushL( self ); + self->ConstructL( aTargetDefinition ); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtData::~CAiScutExtData() + { + delete iIcon; + delete iPopupLineArray; + delete iTargetDefinition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtData::CAiScutExtData() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtData::ConstructL( const TDesC& aTargetDefinition ) + { + iTargetDefinition = aTargetDefinition.AllocL(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const TDesC& CAiScutExtData::TargetDefinition() const + { + return *iTargetDefinition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtData::SwitchPopupLineArray( CDesCArray* aPopupLineArray ) + { + delete iPopupLineArray; + iPopupLineArray = aPopupLineArray; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtData::ResetPopupLineArray() + { + delete iPopupLineArray; + iPopupLineArray = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtData::SwitchIcon( CGulIcon* aIcon ) + { + delete iIcon; + iIcon = aIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtData::ResetIcon() + { + delete iIcon; + iIcon = NULL; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const MDesCArray* CAiScutExtData::PopupLineArray() const + { + return iPopupLineArray; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +const CGulIcon* CAiScutExtData::Icon() const + { + return iIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +/* +CGulIcon* CAiScutExtData::DuplicateIconL() const + { + if( !iIcon ) + { + return NULL; + } + + CGulIcon* newIcon = CGulIcon::NewLC(); + + CFbsBitmap* iconBitmap = iIcon->Bitmap(); + if( iconBitmap && iconBitmap->Handle() != 0 ) + { + CFbsBitmap* newBitmap = new( ELeave ) CFbsBitmap(); + CleanupStack::PushL( newBitmap ); + User::LeaveIfError( newBitmap->Duplicate( iconBitmap->Handle() ) ); + CleanupStack::Pop( newBitmap ); + newIcon->SetBitmap( newBitmap ); + } + + CFbsBitmap* iconMask = iIcon->Mask(); + if( iconMask && iconMask->Handle() != 0 ) + { + CFbsBitmap* newMask = new( ELeave ) CFbsBitmap(); + CleanupStack::PushL( newMask ); + User::LeaveIfError( newMask->Duplicate( iconMask->Handle() ) ); + CleanupStack::Pop( newMask ); + newIcon->SetMask( newMask ); + } + + CleanupStack::Pop( newIcon ); + return newIcon; + } +*/ + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutextdatamodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutextdatamodel.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,190 @@ +/* +* 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: Shortcut plug-in extension data model +* +*/ + + +#include "caiscutextdatamodel.h" +#include "caiscutextdata.h" + +// ======== LOCAL DEFINITIONS ======== + +namespace + { + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtDataModel* CAiScutExtDataModel::NewL() + { + CAiScutExtDataModel* self = CAiScutExtDataModel::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +CAiScutExtDataModel* CAiScutExtDataModel::NewLC() + { + CAiScutExtDataModel* self = new( ELeave ) CAiScutExtDataModel; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtDataModel::~CAiScutExtDataModel() + { + iAiScutExtDataArray.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtDataModel::CAiScutExtDataModel() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtDataModel::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtData* CAiScutExtDataModel::SetPopupLineArrayL( + const TDesC& aDefinition, CDesCArray* aLineArray ) + { + CAiScutExtData* extData = NULL; + TInt index = FindAiScutExtData( aDefinition ); + if( index != KErrNotFound ) + { + extData = iAiScutExtDataArray[ index ]; + } + else + { + extData = CreateAiScutExtDataL( aDefinition ); + } + + extData->SwitchPopupLineArray( aLineArray ); //Takes ownership + return extData; + } + +CAiScutExtData* CAiScutExtDataModel::ResetPopupLineArray( const TDesC& aDefinition ) + { + CAiScutExtData* extData = NULL; + TInt index = FindAiScutExtData( aDefinition ); + if( index != KErrNotFound ) + { + extData = iAiScutExtDataArray[ index ]; + if( extData->Icon() ) + { + extData->ResetPopupLineArray(); + } + else + { + iAiScutExtDataArray.Remove( index ); + delete extData; + extData = NULL; + } + } + return extData; + } + +CAiScutExtData* CAiScutExtDataModel::SetIconL( const TDesC& aDefinition, CGulIcon* aIcon ) + { + CAiScutExtData* extData = NULL; + TInt index = FindAiScutExtData( aDefinition ); + if( index != KErrNotFound ) + { + extData = iAiScutExtDataArray[ index ]; + } + else + { + extData = CreateAiScutExtDataL( aDefinition ); + } + + extData->SwitchIcon( aIcon ); //Takes ownership + return extData; + } + +CAiScutExtData* CAiScutExtDataModel::ResetIcon( const TDesC& aDefinition ) + { + CAiScutExtData* extData = NULL; + TInt index = FindAiScutExtData( aDefinition ); + if( index != KErrNotFound ) + { + extData = iAiScutExtDataArray[ index ]; + if( extData->PopupLineArray() ) + { + extData->ResetIcon(); + } + else + { + iAiScutExtDataArray.Remove( index ); + delete extData; + extData = NULL; + } + } + return extData; + } + +TArray CAiScutExtDataModel::AiScutExtDataArray() const + { + return iAiScutExtDataArray.Array(); + } + +void CAiScutExtDataModel::RemoveAiScutExtData( const TDesC& aDefinition ) + { + TInt index = FindAiScutExtData( aDefinition ); + if( index != KErrNotFound ) + { + CAiScutExtData* extData = iAiScutExtDataArray[ index ]; + iAiScutExtDataArray.Remove( index ); + delete extData; + } + } + +TInt CAiScutExtDataModel::FindAiScutExtData( const TDesC& aDefinition ) const + { + const TInt count = iAiScutExtDataArray.Count(); + for( TInt i = 0; i < count; i++ ) + { + if( iAiScutExtDataArray[ i ]->TargetDefinition().CompareF( aDefinition ) == 0 ) + { + return i; + } + } + return KErrNotFound; + } + +CAiScutExtData* CAiScutExtDataModel::CreateAiScutExtDataL( const TDesC& aDefinition ) + { + CAiScutExtData* extData = CAiScutExtData::NewLC( aDefinition ); + iAiScutExtDataArray.AppendL( extData ); //Takes ownership + CleanupStack::Pop( extData ); + return extData; + } +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutextserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutextserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,396 @@ +/* +* 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: Shortcut plug-in xSP extension server class. +* +*/ + + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "caiscutextserver.h" +#include "caiscutextsession.h" +#include "taiscutparser.h" +#include "caiscutextserver.h" +#include "activeidle2domainpskeys.h" + + +// Amount of bytes the data buffer increases at a time. +const TInt KAppsListDataGranularity = 100; + +// The length of '0x' in front of a hex literal. +const TInt KTokenPrefix = 2; + +// Index to UID 3 +const TInt KUidIndex = 2; + +// Count of characters one UID occupies in CenRep (prefix + 8 digits + spacer) +const TInt KUidStorageLength = KTokenPrefix + 8 + 1; + +_LIT(KUidFormat, "0x%08X "); + +_LIT(KResource, "z:\\resource\\aiscutpluginres.rsc"); + +_LIT(KRomDrive, "z"); + + +CLinkParams::CLinkParams(CAiScutExtServer& aServer, HBufC* aTargetDefinition) + : iServer(aServer) + { + iTargetDefinition = aTargetDefinition; + } + +CLinkParams::~CLinkParams() + { + delete iTargetDefinition; + } + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtServer::CAiScutExtServer( MAiScutExtMessageHandler& aObserver, RWsSession& aWsSession ) + : CServer2( CActive::EPriorityStandard ), iObserver( aObserver ), iWsSession(aWsSession) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtServer::ConstructL() +{ + iIdle = CIdle::NewL( EPriorityStandard ); + + TFileName fileName( KResource ); + CEikonEnv* env = CEikonEnv::Static(); + BaflUtils::NearestLanguageFile( env->FsSession(), fileName ); + iResourceOffset = env->AddResourceFileL( fileName ); + + ReadAppListL(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtServer::~CAiScutExtServer() + { + if( iIdle ) + { + iIdle->Cancel(); + delete iIdle; + } + + CEikonEnv::Static()->DeleteResourceFile( iResourceOffset ); + + iShowUids.Close(); + iUids.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CSession2* CAiScutExtServer::NewSessionL( + const TVersion& aVersion, const RMessage2& /*aMessage*/ ) const + { + TVersion version( + KAiScutExtServMajorVersionNumber, + KAiScutExtServMinorVersionNumber, + KAiScutExtServBuildVersionNumber ); + + if ( !User::QueryVersionSupported( version, aVersion ) ) + { + User::Leave( KErrNotSupported ); + } + CAiScutExtSession* session = new( ELeave ) CAiScutExtSession( iObserver ); + return session; +} + +// --------------------------------------------------------------------------- +// Read a list of application UIDs which we must not show the tip. +// --------------------------------------------------------------------------- +// +void CAiScutExtServer::ReadAppListL() + { + CRepository* repository = CRepository::NewL( KCRUidShortcutItems ); + CleanupStack::PushL( repository ); + + RBuf buffer; + buffer.CreateL( KAppsListDataGranularity ); + buffer.CleanupClosePushL(); + + TInt err = repository->Get( KAIxSPNoTipAppsList, buffer ); + while( err == KErrOverflow ) + { + buffer.ReAllocL( buffer.MaxLength() + KAppsListDataGranularity ); + err = repository->Get( KAIxSPNoTipAppsList, buffer ); + } + + // Handle error silently if reading from Central Repository fails. + if( err == KErrNone ) + { + // Parse application UIDs and put them to list. + TLex lex(buffer); + + while( !lex.Eos() ) + { + TPtrC token( lex.NextToken() ); + if( token.Length() < KTokenPrefix ) + { + break; + } + TLex lexUid( token.Right( token.Length() - KTokenPrefix ) ); + + TUint32 uid; + if( lexUid.Val( uid, EHex ) == KErrNone ) + { + iUids.AppendL( TUid::Uid( uid ) ); + } + } + } + + CleanupStack::PopAndDestroy(); // buffer + CleanupStack::PopAndDestroy( repository ); + } + +// --------------------------------------------------------------------------- +// Saves the list of applications UIDs. +// --------------------------------------------------------------------------- +// +void CAiScutExtServer::WriteAppListL() + { + CRepository* repository = CRepository::NewL( KCRUidShortcutItems ); + CleanupStack::PushL( repository ); + + RBuf buffer; + buffer.CreateL( iUids.Count() * KUidStorageLength ); + buffer.Zero(); + buffer.CleanupClosePushL(); + + TBuf uidString; + + for(TInt c = 0; c < iUids.Count(); c++) + { + uidString.Format( KUidFormat, iUids[c] ); + buffer.Append( uidString ); // Ignore error + } + + User::LeaveIfError( repository->Set( KAIxSPNoTipAppsList, buffer ) ); + + CleanupStack::PopAndDestroy(); // buffer + CleanupStack::PopAndDestroy( repository ); + } + +// --------------------------------------------------------------------------- +// Tests if the client has connected us before, i.e. determines if +// the tip message should be shown. +// --------------------------------------------------------------------------- +// +TBool CAiScutExtServer::HasConnectedBefore( TUid& aUid, const RMessage2& aMessage ) + { + // First test if the current theme supports the xSP feature + TInt isXspSupported = EPSAiXspNotSupported; + TInt err = RProperty::Get( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, + isXspSupported ); + + if( err != KErrNone || isXspSupported == EPSAiXspNotSupported) + { + // xSP is not supported so don't show the dialog. Also if we could not + // read the P&S key we won't show the dialog. + return ETrue; + } + + RThread threadClient; + + if( aMessage.Client( threadClient ) != KErrNone ) + { + // In case of error we report that the client has connected us + // before in order not to show the dialog. + return ETrue; + } + + RProcess processClient; + + if( threadClient.Process(processClient) != KErrNone ) + { + // Prevent dialog from showing in case of error. + return ETrue; + } + + // See if client application is in ROM + TFileName fileName = processClient.FileName(); + TPtr processDrive( fileName.LeftTPtr( KRomDrive().Length() ) ); + processDrive.LowerCase(); + + if( processDrive == KRomDrive() ) + { + // Don't show tip message for ROM clients. + return ETrue; + } + + TUidType uidType = processClient.Type(); + + // UID3 of the client process + TUid uid3( uidType[ KUidIndex ] ); + aUid = uid3; + + // See if the uid is already in the list + if( iUids.Find( uid3 ) != KErrNotFound ) + { + return ETrue; + } + + return EFalse; + } + +void CAiScutExtServer::ShowTipMessage( TUid aUid ) + { + if( iShowUids.Find( aUid ) == KErrNotFound ) + { + iShowUids.Append( aUid ); + iIdle->Cancel(); + iIdle->Start( TCallBack( CAiScutExtServer::IdleCallBack, this ) ); + } + } + +TInt CAiScutExtServer::IdleCallBack(TAny* aParam) + { + CAiScutExtServer* p = (CAiScutExtServer*) aParam; + + p->iIdle->Cancel(); + + if( p->iIsForeground ) + { + TRAP_IGNORE( p->DoShowTipMessageL() ); + } + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// Shows a dialog +// --------------------------------------------------------------------------- +// +void CAiScutExtServer::DoShowTipMessageL() + { + // Find out the name of the application + RApaLsSession als; + User::LeaveIfError( als.Connect() ); + CleanupClosePushL( als ); + + while( iShowUids.Count() > 0 && !iIsTipMessageVisible) + { + TUid uid = iShowUids[ 0 ]; + TApaAppInfo appInfo; + User::LeaveIfError( als.GetAppInfo( appInfo, uid ) ); + + // Prepare the parameters for the link function + HBufC* definitionBuf = HBufC::NewLC( KMaxDefinitionLength ); + TPtr definition( definitionBuf->Des() ); + definition.Format( KScutFormatApplication, uid ); + + TBool isInShortcuts = iObserver.HandleIsInShortcutsL( definition ); + + CLinkParams* params = new( ELeave) CLinkParams( *this, definitionBuf ); + CleanupStack::Pop( definitionBuf ); + CleanupStack::PushL( params ); + + TCallBack cb(CAiScutExtServer::LinkCallBack, params); + + // Read and format tip message from the resource file + HBufC* messageBuf = StringLoader::LoadLC( R_AI_SC_QUERY_MODIFY_GS, appInfo.iCaption ); + TPtr message( messageBuf->Des() ); + + // Don't show the tip if the application is already in shortcuts + if( !isInShortcuts ) + { + iIsTipMessageVisible = ETrue; + CAknMessageQueryDialog* note = CAknMessageQueryDialog::NewL( message ); + params->iNote = note; + + note->SetLink( cb ); + note->ExecuteLD( R_SCUT_XSPTIP_NOTE ); + iIsTipMessageVisible = EFalse; + } + + // Update the list so we don't show the tip message + // again for this application. + iUids.Append( uid ); // Ignore error + iShowUids.Remove( 0 ); + + // Save the list of uids to persistant memory. + WriteAppListL(); + + CleanupStack::PopAndDestroy( messageBuf ); + CleanupStack::PopAndDestroy( params ); + } + + CleanupStack::PopAndDestroy(); // als + } + +// --------------------------------------------------------------------------- +// Opens the shurtcuts settings view +// --------------------------------------------------------------------------- +// +TInt CAiScutExtServer::LinkCallBack(TAny* aParam) + { + CLinkParams* params = (CLinkParams*) aParam; + + TRAP_IGNORE( + params->iServer.iObserver.HandleIssuePutInShortcutsL( + params->iTargetDefinition->Des() ); + ); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtServer::ResumeL( TAiTransitionReason aReason ) + { + switch( aReason ) + { + case EAiIdleForeground: + iIsForeground = ETrue; + DoShowTipMessageL(); + break; + + case EAiIdleBackground: + iIsForeground = EFalse; + break; + + default: + break; + } + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutextsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutextsession.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,296 @@ +/* +* 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: Shortcut plug-in xSP extension session class. +* +*/ + + +#include +#include +#include +#include + +#include + +#include "caiscutextsession.h" +#include "maiscutextmessagehandler.h" + +#include "caiscutextserver.h" + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtSession::CAiScutExtSession( MAiScutExtMessageHandler& aObserver ) + : iObserver( aObserver ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutExtSession::~CAiScutExtSession() + { + CAiScutExtServer* server = const_cast( + dynamic_cast( Server() ) ); + + if( iTargetDefinition && server ) + { + TRAP_IGNORE( + iObserver.HandleResetPopupLineArrayL( *iTargetDefinition ); + iObserver.HandleResetIconL( *iTargetDefinition ); + ); + } + + delete iTargetDefinition; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::ServiceL( const RMessage2& aMessage ) + { + CAiScutExtServer* server = const_cast( + dynamic_cast( Server() ) ); + + __ASSERT_ALWAYS( server, User::Leave( KErrCorrupt ) ); + + TUid uid; + if( !server->HasConnectedBefore(uid, aMessage) ) + { + server->ShowTipMessage( uid ); + } + + TRAPD( err, DispatchMessageL( aMessage ) ); + + if( !aMessage.IsNull() ) + { + aMessage.Complete( err ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::DispatchMessageL( const RMessage2& aMessage ) + { + switch ( aMessage.Function() ) + { + case EAiScutExtServSetTargetDefinition: + { + SetTargetDefinitionL( aMessage ); + break; + } + case EAiScutExtServSetPopupText: + { + SetPopupTextL( aMessage ); + break; + } + case EAiScutExtServResetPopupText: + { + ResetPopupTextL( aMessage ); + break; + } + case EAiScutExtServSetIcon: + { + SetIconL( aMessage ); + break; + } + case EAiScutExtServResetIcon: + { + ResetIconL( aMessage ); + break; + } + case EAiScutExtServIsInShortcuts: + { + IsInShortcutsL( aMessage ); + break; + } + case EAiScutExtServIssuePutInShortcuts: + { + IssuePutInShortcutsL( aMessage ); + break; + } + default: + { + User::Leave( KErrNotSupported ); + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::SetTargetDefinitionL( const RMessage2& aMessage ) + { + HBufC* targetStringBuf = HBufC::NewLC( aMessage.GetDesLengthL( 0 ) ); + TPtr targetString( targetStringBuf->Des() ); + aMessage.ReadL( 0, targetString, 0 ); + delete iTargetDefinition; + iTargetDefinition = targetStringBuf; + CleanupStack::Pop( targetStringBuf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::SetPopupTextL( const RMessage2& aMessage ) + { + if( !iTargetDefinition ) + { + return; + } + HBufC8* marshalledLineArrayBuf = HBufC8::NewLC( + aMessage.GetDesLengthL( 0 ) ); + TPtr8 marshalledLineArray( marshalledLineArrayBuf->Des() ); + aMessage.ReadL( 0, marshalledLineArray, 0 ); + + RDesReadStream stream( marshalledLineArray ); + CleanupClosePushL( stream ); + + const TInt lineCount = stream.ReadUint8L(); + __ASSERT_ALWAYS( lineCount >= 0 && lineCount <= KMaxPopupTextLines, + User::Leave( KErrArgument ) ); + + CDesCArray* array = new( ELeave ) CDesCArrayFlat( + lineCount > 0 ? lineCount : 1 ); + CleanupStack::PushL( array ); + + for( TInt i = 0; i < lineCount; i++ ) + { + HBufC* lineBuf = HBufC::NewLC( stream, KMaxTInt ); + array->AppendL( *lineBuf ); + CleanupStack::PopAndDestroy( lineBuf ); + } + + iObserver.HandleSetPopupLineArrayL( *iTargetDefinition, array ); //Takes ownership of array + + CleanupStack::Pop( array ); + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::PopAndDestroy( marshalledLineArrayBuf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::ResetPopupTextL( const RMessage2& /*aMessage*/ ) + { + if( iTargetDefinition ) + { + iObserver.HandleResetPopupLineArrayL( *iTargetDefinition ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::SetIconL( const RMessage2& aMessage ) + { + if( !iTargetDefinition ) + { + return; + } + HBufC8* marshallBuf = HBufC8::NewLC( aMessage.GetDesLengthL( 0 ) ); + TPtr8 marshalledData( marshallBuf->Des() ); + aMessage.ReadL( 0, marshalledData, 0 ); + + RDesReadStream stream( marshalledData ); + CleanupClosePushL( stream ); + + CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + bitmap->InternalizeL( stream ); + + CFbsBitmap* mask = new( ELeave ) CFbsBitmap; + CleanupStack::PushL( mask ); + mask->InternalizeL( stream ); + + CGulIcon* icon = CGulIcon::NewL( bitmap, mask ); + CleanupStack::Pop( 2, bitmap ); + CleanupStack::PushL( icon ); + + iObserver.HandleSetIconL( *iTargetDefinition, icon ); + + CleanupStack::Pop( icon ); + + CleanupStack::PopAndDestroy( &stream ); + CleanupStack::PopAndDestroy( marshallBuf ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::ResetIconL( const RMessage2& /*aMessage*/ ) + { + if( iTargetDefinition ) + { + iObserver.HandleResetIconL( *iTargetDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::IsInShortcutsL( const RMessage2& aMessage ) + { + if( iTargetDefinition ) + { + TBool isInShortcuts = iObserver.HandleIsInShortcutsL( *iTargetDefinition ); + + TPtr8 isInShortcutsDes( + reinterpret_cast< TUint8* >( &isInShortcuts ), + sizeof( isInShortcuts ), + sizeof( isInShortcuts ) ); + aMessage.WriteL( 0, isInShortcutsDes, 0 ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::IssuePutInShortcutsL( const RMessage2& /*aMessage*/ ) + { + if( iTargetDefinition ) + { + iObserver.HandleIssuePutInShortcutsL( *iTargetDefinition ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutExtSession::PanicClient( + const RMessage2& aMessage, TInt aPanicCode ) const + { + aMessage.Panic( KAiScutExtServerName, aPanicCode ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,467 @@ +/* +* 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: Plug-in main class +* +*/ + + +#include +#include + +#include +#include + +#include +#include "aiscutpluginprivatecrkeys.h" +#include "aiscutdefs.h" +#include "aiscutcontentmodel.h" +#include "caiscutplugin.h" +#include "caiscutengine.h" +#include "aiscutfactory.h" +#include "caiscutshortcut.h" + +#include "debug.h" + +const TImplementationProxy KImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(KImplUidScutPlugin, CAiScutPlugin::NewL) +}; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutPlugin::CAiScutPlugin() +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::ConstructL() +{ + // Initialize the info which the fw uses to identify the plug-in. + // Fill in only the uid at this point, the fw will send this back with the + // name filled in later through SetPropertyL(). + iInfo.iUid.iUid = AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SCUTPLUGIN; + + iContent = AiUtility::CreateContentItemArrayIteratorL(KAiScutContent); + iResources = AiUtility::CreateContentItemArrayIteratorL(KAiScutResources); + iEvents = AiUtility::CreateContentItemArrayIteratorL(KAiScutEvents); + + CRepository* repository = NULL; + TRAP_IGNORE(repository = CRepository::NewL(KCRUidShortcutItems)); + // No leaving code here since 'repository' is not in cleanup stack. + if (repository) + { + // A theme might not contain any publishable shortcuts at all, only + // locked ones. To take this into account we must always delete old + // theme-default settings to make sure the engine won't create any + // unwanted shortcut objects. Any errors that might happen during + // deletion are ignored to make sure the plug-in is kept alive. + TUint32 errorKey; + + repository->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); + } + delete repository; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutPlugin* CAiScutPlugin::NewL() +{ + CAiScutPlugin* self = new (ELeave) CAiScutPlugin; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutPlugin::~CAiScutPlugin() +{ + TRAP_IGNORE( DeleteDefaultShortcutsL() ); + Release(iContent); + Release(iResources); + Release(iEvents); + delete iEngine; + iObservers.Close(); +} + +// --------------------------------------------------------------------------- +// Publishes the given shortcut. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::PublishShortcutsL(RAiShortcutArray& aShortcuts) +{ + TInt err = KErrNone; + TInt observers = iObservers.Count(); + TInt shortcuts = aShortcuts.Count(); + + for (TInt i = 0; i < observers; ++i) + { + MAiContentObserver* observer = iObservers[i]; + TBool transactionStarted = EFalse; + TInt transactionId = reinterpret_cast(this); + err = observer->StartTransaction(transactionId); + + if (err != KErrNotSupported) + { + // The observer does not support transactions, check for real errors. + User::LeaveIfError(err); + transactionStarted = ETrue; + } + err = KErrAlreadyExists; + for (TInt j = 0; j < shortcuts; j++) + { + CAiScutShortcut* shortcut = aShortcuts[j]; + + if (shortcut->NeedsToBePublished()) + { + shortcut->Publish(*this, *observer); + err = KErrNone; + } + } + + if ( transactionStarted && err == KErrNone ) + { + User::LeaveIfError(observer->Commit(transactionId)); + } + else if ( transactionStarted ) + { + User::LeaveIfError(observer->CancelTransaction(transactionId)); + } + } +} + +// --------------------------------------------------------------------------- +// Is plug-in suspended or not. +// --------------------------------------------------------------------------- +// +TBool CAiScutPlugin::IsAlive() const +{ + return iAlive; +} + +// --------------------------------------------------------------------------- +// Resume reason +// --------------------------------------------------------------------------- +// +TAiTransitionReason CAiScutPlugin::ResumeReason() const + { + return iResumeReason; + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Resumes the plug-in. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::Resume(TAiTransitionReason aReason) +{ + TRAP_IGNORE(DoResumeL(aReason)); +} + +// --------------------------------------------------------------------------- +// Resumes the plug-in. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::DoResumeL(TAiTransitionReason aReason) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Resume reason %d alive = %d"), aReason, iAlive); + iResumeReason = aReason; + // Reload the engine in case general theme changed or + // the engine has been suspended. + if (aReason == EAiGeneralThemeChanged || !iAlive) + { + // if general theme changed, free engine so that is will be + // loaded again because shortcut icons must be re-created. + FreeEngine(); + } + + if (!iEngine) + { + iEngine = AiScutFactory::CreateAiScutEngineL(*this); + } + + iEngine->ResumeL( (iAlive == EFalse) || + ( + aReason != EAiBacklightOn && + aReason != EAiBacklightOff && + aReason != EAiIdleBackground && + aReason != EAiIdleForeground + ), + aReason + ); + + iAlive = ETrue; +} + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Suspends the plug-in. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::Suspend(TAiTransitionReason aReason) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Suspend reason %d"), aReason); + + if (iEngine) + { + iEngine->Suspend(); + } + + iAlive = EFalse; +} + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Frees the plug-in engine. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::Stop(TAiTransitionReason aReason) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutPlugin::Stop reason %d"), aReason); + + if ( aReason == EAiBackupRestoreStarted ) + { + Suspend( aReason ); + } + else + { + FreeEngine(); + } +} +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Adds the content observer / subscriber to plug-in. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::SubscribeL(MAiContentObserver& aObserver) +{ + iObservers.AppendL(&aObserver); +} + +void CAiScutPlugin::DeleteDefaultShortcutsL() + { + // Ignore any errors that might occur when deleting + // the default keys + TUint32 errorKey; + CRepository* cr = CRepository::NewL(KCRUidShortcutItems); + cr->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); + delete cr; + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Configures the plug-in. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::ConfigureL(RAiSettingsItemArray& aSettings) +{ + CRepository* repository = NULL; + + TRAPD(err, repository = CRepository::NewL(KCRUidShortcutItems)); + + if (err == KErrNotFound) + { + // CenRep file is missing from the image, this is a serious error. + User::Leave(err); + } + + // Write settings if repository was successfully opened. All other errors + // are ignored to ensure that the plug-in is up and running, even if + // crippled. + + // No leaving code here since 'repository' is not in cleanup stack. + if (repository) + { + repository->StartTransaction(CRepository::EConcurrentReadWriteTransaction); + + // A theme might not contain any publishable shortcuts at all, only + // locked ones. To take this into account we must always delete old + // theme-default settings to make sure the engine won't create any + // unwanted shortcut objects. Any errors that might happen during + // deletion are ignored to make sure the plug-in is kept alive. + TUint32 errorKey; + + repository->Delete(KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, errorKey); + + __PRINTS( "XAI: CAiScutPlugin::ConfigureL"); + + TInt count = aSettings.Count(); + if (count > 0) + { + // Write new shortcut definitions. + for (TInt i = 0; i < count; ++i) + { + MAiPluginSettings* settings = aSettings[ i ]; + + if( settings->AiPluginItemType() == EAiPluginSettingsItem ) + { + MAiPluginSettingsItem& item = settings->AiPluginSettingsItem(); + TUint32 key = item.Key(); // implicit cast from TInt32 to TUint32. + + __PRINT( __DBG_FORMAT( "XAI: %d. key = 0x%x"), i+1, key); + + // Add the bit that indicates this is a default shortcut setting. + key |= KScutFlagBitThemeDefault; + + // Ignore possible error and keep going. + repository->Create(key, item.Value()); + } + } + } + + TUint32 info = 0; + repository->CommitTransaction(info); + + delete repository; + repository = NULL; + + if (iEngine) + { + iEngine->CreateShortcutsL(); + iEngine->ResumeL( ETrue, EAiGeneralThemeChanged ); + } + } + + // We don't need to store the settings so clear the array. + aSettings.ResetAndDestroy(); +} + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher. +// Returns the extension interface. +// --------------------------------------------------------------------------- +// +TAny* CAiScutPlugin::Extension(TUid aUid) +{ + if (aUid == KExtensionUidProperty) + { + return static_cast(this); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast(this); + } + else + { + return NULL; + } +} + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::HandleEvent(TInt aEvent, const TDesC& aParam) +{ + if (iEngine) + { + // We have no way of reporting errors to framework so just ignore them. + TRAP_IGNORE(iEngine->HandleAiEventL(aEvent, aParam)); + } +} + +// --------------------------------------------------------------------------- +// CAiScutPlugin::HasMenuItem +// +// --------------------------------------------------------------------------- +// +TBool CAiScutPlugin::HasMenuItem(const TDesC16& /*aMenuItem*/) + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Returns a plug-in property. +// --------------------------------------------------------------------------- +// +TAny* CAiScutPlugin::GetPropertyL(TInt aProperty) +{ + switch (aProperty) + { + case EAiPublisherInfo: + return static_cast(&iInfo); + + case EAiPublisherContent: + return static_cast(iContent); + + case EAiPublisherResources: + return static_cast(iResources); + + case EAiPublisherEvents: + return static_cast(iEvents); + + default: + break; + } + + return NULL; +} + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Sets a plug-in property to optimize the content model. +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::SetPropertyL(TInt aProperty, TAny* aValue) + { + if( aProperty == EAiPublisherInfo ) + { + ASSERT( aValue ); + + const TAiPublisherInfo* info( + static_cast( aValue ) ); + + iInfo = *info; + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CAiScutPlugin::FreeEngine() +{ + delete iEngine; + iEngine = NULL; + iAlive = EFalse; +} + +// ======== GLOBAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); + return KImplementationTable; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettings.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,435 @@ +/* +* 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: Shortcut settings plug-in main class. +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For RProperty +#include // For KPSUidActiveIdle2 + +#include +#include +#include + +#include "aiscutsettings.hrh" +#include "caiscutsettings.h" +#include "caiscutsettingsitem.h" +#include "caiscutsettingscontainer.h" +#include "caiscutsettingsmodel.h" +#include +#include "aiscutdefs.h" +#include + +const TUid KUidScutSettingsPlugin = +{ + AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN +}; + +_LIT(KScutSettingsResourceFileName, "aiscutsettingsres.rsc"); +_LIT(KScutTextsResourceFileName, "aiscuttexts.rsc"); +_LIT8(KScutDirectOpenTag, "?open"); + + +// ======== LOCAL FUNCTIONS ======== + + +static void ParseKeysL( const TDesC8& aCustomMessage, RArray& aKeys, TBool& aOpen ) + { + HBufC8* message = aCustomMessage.AllocLC(); + + TPtr8 ptr( message->Des() ); + + TInt pos; + TInt openPos; + TBool openTag=EFalse; + + do + { + pos = ptr.Locate( ',' ); + + if( pos != KErrNotFound ) + { + const TDesC8& str1 = ptr.Left( pos ); + const TDesC8& str2 = str1.Right( str1.Length() - 2 ); + + TUint32 value; + TLex8 lex( str2 ); + + if( lex.Val( value, EHex ) == KErrNone ) + { + aKeys.AppendL( value ); + } + + ptr = ptr.MidTPtr( pos + 1 ); + } + else + { + const TDesC8& str1 = ptr; + const TDesC8& str2 = str1.Right( str1.Length() - 2 ); + openPos = ptr.Find( KScutDirectOpenTag ); + TLex8 lex; + if( openPos != KErrNotFound ) + { + openTag=ETrue; + const TDesC8& str3 = str2.Left( openPos -2 ); + lex.Assign( str3 ); + } + else + { + lex.Assign( str2 ); + } + TUint32 value; + + + if( lex.Val( value, EHex ) == KErrNone ) + { + aKeys.AppendL( value ); + } + } + } + while( pos != KErrNotFound ); + + if( openTag && aKeys.Count() == 1 ) + { + aOpen = ETrue; + } + CleanupStack::PopAndDestroy(); + } +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettings::CAiScutSettings() : iResourceLoaderTexts(*iCoeEnv) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettings::ConstructL() +{ + FeatureManager::InitializeLibL(); + + TParsePtrC driveParse(PathInfo::RomRootPath()); + TFileName resourceName(driveParse.Drive()); + + // Find the resource file. + TParse parse; + parse.Set(KScutSettingsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + resourceName.Append(parse.FullName()); + + // Open resource file. + iResourceLoader.OpenL(resourceName); + + resourceName.Copy(driveParse.Drive()); + parse.Set(KScutTextsResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL); + resourceName.Append(parse.FullName()); + + // Open resource file. + iResourceLoaderTexts.OpenL(resourceName); + + iModel = CAiScutSettingsModel::NewL(*this, iCoeEnv); + + iListBoxTimer = CIdle::NewL(CActive::EPriorityHigh); + + + BaseConstructL(R_SCUT_SETTINGS_VIEW); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettings* CAiScutSettings::NewL(TAny* /*aInitParams*/) +{ + CAiScutSettings* self = new (ELeave) CAiScutSettings; + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettings::~CAiScutSettings() +{ + FeatureManager::UnInitializeLib(); + + if( iListBoxTimer ) + { + iListBoxTimer->Cancel(); + delete iListBoxTimer; + } + + iResourceLoader.Close(); + iResourceLoaderTexts.Close(); + + delete iModel; +} + +// --------------------------------------------------------------------------- +// From CAknView +// Returns view id. +// --------------------------------------------------------------------------- +// +TUid CAiScutSettings::Id() const +{ + return KUidScutSettingsPlugin; +} + +// --------------------------------------------------------------------------- +// From CAknView +// Handles commands. +// --------------------------------------------------------------------------- +// +void CAiScutSettings::HandleCommandL(TInt aCommand) +{ + switch (aCommand) + { + case EAiScutSettingsCmdChange: + Container()->HandleChangeCommandL(); + break; + + case EAknCmdHelp: + /* + TUid fwUid = TUid::Uid( AI_UID3_AIFW_COMMON ); + TCoeContextName helpString; + helpString.Copy( KSET_HLP_HOME_SCREEN_SHORTCUTS ); + + CArrayFixFlat* array = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL( array ); + array->AppendL( TCoeHelpContext( fwUid, helpString ) ); + HlpLauncher::LaunchHelpApplicationL( CCoeEnv::Static()->WsSession(), array ); + CleanupStack::Pop( array ); + */ + break; + + case EAknSoftkeyBack: + if (iAppUi->View(KGSMainViewUid)) + { + // if we are in GS activate parent plugin view (standby view)... + iAppUi->ActivateLocalViewL(KGSPrslnPluginUid); + } + else + { + iAppUi->ActivateLocalViewL(iPrevViewId.iViewUid); + } + break; + + case EAknSoftkeyExit: + iAppUi->HandleCommandL(EAknCmdExit); + break; + + default: + iAppUi->HandleCommandL(aCommand); + break; + } +} + +// ---------------------------------------------------------------------------- +// From CAknView +// First method called by the Avkon framwork +// ---------------------------------------------------------------------------- +// +void CAiScutSettings::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) +{ +#ifdef MY_DEBUG + RDebug::Print(_L("XAI: CAiScutSettings::DoActivateL")); + RDebug::Print(_L("XAI: aCustomMessageId = 0x%08x"), aCustomMessageId.iUid); + RDebug::Print(_L("XAI: aPrevViewId = 0x%08x"), aPrevViewId.iAppUid.iUid); +#endif + + CEikButtonGroupContainer* cba = Cba(); + + if (cba) + { + if (aCustomMessageId == KScutActiveIdleUid) + { + cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_EXIT_CHANGE); + } + else + { + cba->SetCommandSetL(R_SCUT_SOFTKEYS_OPTIONS_BACK_CHANGE); + } + cba->DrawDeferred(); + } + + CGSBaseView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); + + TBool open=EFalse; + if( aCustomMessage != KNullDesC8 ) + { + RArray keys; + CleanupClosePushL( keys ); + + ParseKeysL( aCustomMessage, keys, open ); + + iModel->SetSettingsKeys( keys ); + + CleanupStack::PopAndDestroy(); + } + + iModel->UpdateSettingsContainerL(); + + if( open ) + { + /* Let idle timer do this job. */ + iListBoxTimer->Cancel(); + iListBoxTimer->Start(TCallBack(DoHandleListBoxSelectionL, this)); + } +} + +// ---------------------------------------------------------------------------- +// From CAknView +// Called by the Avkon view framework when closing. +// ---------------------------------------------------------------------------- +// +void CAiScutSettings::DoDeactivate() +{ + iModel->ActivateObservers(EFalse); + + // deletes iContainer. + CGSBaseView::DoDeactivate(); + + iModel->SetContainer(Container()); +} + +void CAiScutSettings::HandleForegroundEventL(TBool /*aForeground*/) + { + // No implementation required + } + +// ---------------------------------------------------------------------------- +// From MEikMenuObserver +// ---------------------------------------------------------------------------- +// +void CAiScutSettings::DynInitMenuPaneL( + TInt aResourceId, CEikMenuPane* aMenuPane) +{ + if (aMenuPane && aResourceId == R_SCUTSETTINGS_MENUPANE) + { + if (!FeatureManager::FeatureSupported(KFeatureIdHelp)) + { + // Disable help if not supported + aMenuPane->SetItemDimmed(EAknCmdHelp, ETrue); + } + if (iModel->MdcaCount() == 0) + { + aMenuPane->SetItemDimmed(EAiScutSettingsCmdChange, ETrue); + } + } +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface. 256 +// --------------------------------------------------------------------------- +// +void CAiScutSettings::GetCaptionL(TDes& aCaption) const +{ + iCoeEnv->ReadResourceL(aCaption, R_SCUT_SETTINGS_VIEW_CAPTION); +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface +// --------------------------------------------------------------------------- +// +TInt CAiScutSettings::PluginProviderCategory() const +{ + return KGSPluginProviderInternal; +} + +// --------------------------------------------------------------------------- +// From CGSPluginInterface +// --------------------------------------------------------------------------- +// +TBool CAiScutSettings::Visible() const +{ + return EFalse; +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// Returns view id. +// --------------------------------------------------------------------------- +// +CAiScutSettingsContainer* CAiScutSettings::Container() +{ + return static_cast(iContainer); +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// --------------------------------------------------------------------------- +// +void CAiScutSettings::NewContainerL() +{ + delete iContainer; + iContainer = NULL; + + iContainer = new (ELeave) CAiScutSettingsContainer(); + Container()->SetModel(iModel); + iModel->SetContainer(Container()); +} + +// --------------------------------------------------------------------------- +// From CGSBaseView +// --------------------------------------------------------------------------- +// +void CAiScutSettings::HandleListBoxSelectionL() +{ + Container()->HandleChangeCommandL(); +} + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TBool CAiScutSettings::Activated() const + { + return iContainer ? ETrue : EFalse; + } + +// ----------------------------------------------------------------------------- +// CActiveIdleState::DoUpdateSaSetting +// ----------------------------------------------------------------------------- +// +TInt CAiScutSettings::DoHandleListBoxSelectionL(TAny* aAny) + { + CAiScutSettings* self = static_cast(aAny); + if(self) + { + self->iListBoxTimer->Cancel(); + self->HandleListBoxSelectionL(); + } + return KErrNone; + } + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingsapplist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingsapplist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1087 @@ +/* +* 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: Application list for settings listbox +* +*/ + + +#include // For KMsvRootIndexEntryIdValue +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "caiscutsettingsapplist.h" +#include "taiscutparser.h" +#include "caiscutsettingsitem.h" +#include "aiscutdefs.h" +#include + +#include "debug.h" + +using namespace Java; + + +const TInt KDriveAndColon = 2; //drive char and colon string length, e.g. "c:" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList::CAiScutSettingsAppList(CCoeEnv* aEnv, MAiScutListObserver& aObserver) + : CActive(CActive::EPriorityLow) // Background task priority. + // Higher priority would block the wait dialog. + , iEnv(aEnv) + , iObserver(aObserver) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::ConstructL() + { + User::LeaveIfError(iApaSession.Connect()); + iMsvSession = CMsvSession::OpenAsObserverL(*this); + + CActiveScheduler::Add(this); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList* CAiScutSettingsAppList::NewL(CCoeEnv* aEnv, + MAiScutListObserver& aObserver) + { + CAiScutSettingsAppList* self = new (ELeave) CAiScutSettingsAppList(aEnv, aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList::~CAiScutSettingsAppList() + { + if (IsActive()) + { + Cancel(); + } + + delete iAppNotifier; + delete iMsvSession; + iApaSession.Close(); + iListItems.ResetAndDestroy(); + iMailboxes.Close(); // Do not call ResetAndDestroy() to this. + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::MdcaCount() const + { + return iListItems.Count(); + } + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsAppList::MdcaPoint(TInt aIndex) const + { + if (aIndex < 0 || aIndex >= iListItems.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + return iListItems[aIndex]->Caption(); + } + +// --------------------------------------------------------------------------- +// From class MMsvSessionObserver. +// Handles an event from the message server. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::HandleSessionEventL( + TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) + { + TBool updated = ETrue; + TBool added = EFalse; + + switch (aEvent) + { + case EMsvEntriesCreated: + case EMsvEntriesDeleted: + case EMsvEntriesChanged: + if (iObserving) + { + CMsvEntry* rootEntry = GetRootEntryL(); + + CleanupStack::PushL(rootEntry); + TBuf<255> mailboxId; + + // Reset iMailboxes + for (TInt j = iMailboxes.Count() - 1; j >= 0; --j) + { + RemoveMailboxL(iMailboxes[j]->Params()); + } + + // Add all mailboxes + for (TInt i = rootEntry->Count() - 1; i >= 0; --i) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) + { + mailboxId.Num(tentry.Id()); + AddMailboxL(tentry.iDetails, mailboxId); + } + } + + CleanupStack::PopAndDestroy(rootEntry); + } + + if (updated) + { + iObserver.HandleScutListEventL(MAiScutListObserver::EAppListUpdated, added); + } + break; + + default: + break; + } + } + +// --------------------------------------------------------------------------- +// From class MApaAppListServObserver. +// Handles a change in the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::HandleAppListEvent(TInt /*aEvent*/) + { + TRAP_IGNORE(UpdateAppListL()); + } + +// --------------------------------------------------------------------------- +// Starts the asynchronous application list initialization. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::StartL() + { + iListItems.ResetAndDestroy(); + + AddStaticItemsL(); + AddMailboxesL(); + AddExtraItemsFromCRL(); + + if (iApaSession.GetAllApps() == KErrNone && + iApaSession.AppCount(iTotalAppCount) == KErrNone) + { + CompleteSelf(); + } + } + +// --------------------------------------------------------------------------- +// Checks if the application list is ready to be shown. +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsAppList::IsReady() const + { + return iReady; + } + +// --------------------------------------------------------------------------- +// Tells the application list to start or stop observing for changes. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::SetObservingL(TBool aObserving) + { + delete iAppNotifier; + iAppNotifier = NULL; + + if (aObserving) + { + UpdateAppListL(); + + iAppNotifier = CApaAppListNotifier::NewL(this, CActive::EPriorityStandard); + } + + iObserving = aObserving; + } + +// --------------------------------------------------------------------------- +// Finds the index of the given settings item in the application list. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::FindIndex(CAiScutSettingsItem& aItem) + { + TInt index = KErrNotFound; + + TAiScutParser parser; + parser.Parse(aItem.Value()); + TPtrC params(parser.Get(EScutDefParamNameAndValue)); + + TUid uid = aItem.Uid(); + for (TInt i = iListItems.Count() - 1; i >= 0; --i) + { + CAppListItem* item = iListItems[i]; + if ( (item->Uid() == uid) && params.Compare(item->Params()) == 0) + { + index = i; + break; + } + // Url => compare the whole url not just the parameters + else if( item->Type() == EAiScutSettingTypeUrl ) + { + if ( parser.Get(EScutDefComplete).Compare(item->Params()) == 0 ) + { + index = i; + break; + } + } + } + + return index; + } + +// --------------------------------------------------------------------------- +// Returns target application data from the given index. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::GetDataByIndex(TInt aIndex, TUid& aUid, + TPtrC& aParams, TPtrC& aCaption, TAiScutSettingType& aType ) const + { + if (aIndex >= 0 && aIndex < iListItems.Count()) + { + CAppListItem* item = iListItems[aIndex]; + aUid = item->Uid(); + aType = item->Type(); + aParams.Set(item->Params()); + aCaption.Set(item->Caption()); + return KErrNone; + } + + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// From CActive +// Implements cancellation of an outstanding request. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::DoCancel() + { + } + +// --------------------------------------------------------------------------- +// From CActive +// Performs one step of the app list initialization. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::RunL() + { + TApaAppInfo appInfo; + TInt err = GetNextValidApp(appInfo); + + switch (err) + { + case KErrNone: + AddApplicationL(appInfo); + CompleteSelf(); + break; + + case RApaLsSession::ENoMoreAppsInList: + iReady = ETrue; + iObserver.HandleScutListEventL(MAiScutListObserver::EAppListReady, EFalse); + break; + + //Indicates that an RApaLsSession member function was called before the session's + // application list is fully populated. + case RApaLsSession::EAppListInvalid: + StartL(); // Just try again. + break; + + default: + User::LeaveIfError(err); + break; + } + } + +// --------------------------------------------------------------------------- +// From CActive +// Handles an error situation. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::RunError(TInt aError) + { + return aError; + } + +// --------------------------------------------------------------------------- +// Completes own request status to make sure active scheduler calls RunL again. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::CompleteSelf() + { + if (!IsActive()) + { + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + SetActive(); + } + } + +// --------------------------------------------------------------------------- +// Adds an application to the list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddApplicationL(TApaAppInfo& aAppInfo) + { + TBool allowed = ETrue; + + // EasyVoIP is only added when VoIP is supported + if (aAppInfo.iUid == KScutEasyVoIPApplicationUid) + { + // Check VoIP variation status + TInt voipStatus = 0; + // For checking VoIP variation status + CRepository* repository = CRepository::NewL(KCRUidTelephonySettings); + repository->Get(KDynamicVoIP, voipStatus); + delete repository; + allowed = (voipStatus && FeatureManager::FeatureSupported(KFeatureIdCommonVoip)); + + __PRINTS( "XAI: CAiScutSettingsAppList::AddApplicationL"); + __PRINT( __DBG_FORMAT( "XAI: voipStatus = %d, allowed = %d"), voipStatus, allowed); + } + + // VoIP launcher is always invisible in shortcuts. + if (aAppInfo.iUid == KScutVoIPLauncherUid) + { + allowed = EFalse; + } + + if (iObserver.IsHidden(aAppInfo.iUid)) + { + allowed = EFalse; + } + + if (allowed) + { + CAppListItem* listItem = CAppListItem::NewLC(aAppInfo.iUid, aAppInfo.iCaption); + listItem->SetType( EAiScutSettingTypeApplication ); + TLinearOrder sortMethod(CAppListItem::CompareCaption); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + } + } + +// --------------------------------------------------------------------------- +// Adds the static list items to the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddStaticItemsL() + { + HBufC* caption = NULL; + CAppListItem* listItem = NULL; + TLinearOrder sortMethod(CAppListItem::CompareCaption); + + // Connectivity Status item + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_CONNECTIVITY_STATUS, iEnv); + listItem = CAppListItem::NewLC(KScutGeneralSettingsUid, *caption); + listItem->SetParamsL(KScutParamConnectivityView); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + + // New Message item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_MSG, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamNewMsg); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + + // New Email item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_EMAIL, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamNewEmail); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + +#ifdef __SYNCML_DS_EMAIL + // New SyncML mail item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_SYNCML_MAIL, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamNewSyncMLMail); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; +#endif + + if (FeatureManager::FeatureSupported(KFeatureIdMmsPostcard) + && IsInRom( KScutPostcardEditorUid ) ) + { + // New Postcard item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_POSTCARD, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamNewPostcard); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + } + + if (FeatureManager::FeatureSupported(KFeatureIdAudioMessaging)) + { + // New Audio Message item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NEW_AUDIO_MSG, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamNewAudioMsg); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + } + + // Select Message type item. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_SELECT_MSG_TYPE, iEnv); + listItem = CAppListItem::NewLC(KScutMessagingUid, *caption); + listItem->SetParamsL(KScutParamSelectMsgType); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + // Installation view. + caption = StringLoader::LoadLC(R_SCUT_SETTINGS_APPMNGR, iEnv); + listItem = CAppListItem::NewLC(KScutGeneralSettingsUid, *caption); + listItem->SetParamsL(KScutParamInstallationsView); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + caption = NULL; + listItem = NULL; + } + +// --------------------------------------------------------------------------- +// Adds extra list items to the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddExtraItemsL() + { + // No Effect item. + HBufC* caption = StringLoader::LoadLC(R_SCUT_SETTINGS_NO_EFFECT, iEnv); + CAppListItem* listItem = CAppListItem::NewLC(KScutSettingsDllUid, *caption); + listItem->SetParamsL(KScutParamNoEffect); + listItem->SetType( EAiScutSettingTypeApplication ); + User::LeaveIfError(iListItems.Insert(listItem, 0)); // insert as first item. + CleanupStack::Pop(listItem); + CleanupStack::PopAndDestroy(caption); + } + +void CAiScutSettingsAppList::AddExtraItemsFromCRL() + { + CRepository *cr = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + User::LeaveIfNull( cr ); + + CleanupStack::PushL( cr ); + + TUint32 crKey = KAIExtraShortcutsKeyRangeStart; + TBool moreSettings = ETrue; + TInt err = KErrNone; + TAiScutParser parser; + + HBufC* settingValue = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr settingValuePtr = settingValue->Des(); + + while( moreSettings ) + { + err = cr->Get( crKey++, settingValuePtr ); + if ( err == KErrNone && settingValue->Length() > 0 ) + { + CAppListItem* listItem = NULL; + parser.Parse( *settingValue ); + + // First try to find the custom title + HBufC* caption = HBufC::NewLC( settingValue->Length() ); + TPtr captionPtr = caption->Des(); + TInt err = parser.CustomTitle( captionPtr ); + TUid appUid = parser.Uid(); + + if ( err != KErrNone || caption->Length() <= 0 ) + { + CleanupStack::PopAndDestroy( caption ); + caption = NULL; + } + + if ( !caption ) + { + // Web address... + if ( parser.Type() == EScutWebAddress || parser.Type() == EScutUnknown ) + { + TUriParser parser; + TInt err = parser.Parse(*settingValue); + + if (err == KErrNone) + { + // Remove scheme from the url. + caption = parser.Extract(EUriHost).AllocLC(); + } + else + { + caption = settingValue->AllocLC(); + } + } + // ...application. Nothing else supported at the moment + else + { + TApaAppInfo appInfo; + err = iApaSession.GetAppInfo(appInfo, appUid); + if (err == KErrNone) + { + caption = appInfo.iCaption.AllocLC(); + } + } + } + if ( caption ) + { + listItem = CAppListItem::NewLC( KNullUid , *caption ); + listItem->SetParamsL( *settingValue ); + listItem->SetType( EAiScutSettingTypeUrl ); + TLinearOrder sortMethod(CAppListItem::CompareCaption); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop( listItem ); + CleanupStack::PopAndDestroy( caption ); + } + } + else + { + moreSettings = EFalse; + } + } + + + + CleanupStack::PopAndDestroy( settingValue ); + CleanupStack::PopAndDestroy( cr ); + } +// --------------------------------------------------------------------------- +// Removes extra list items from the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::RemoveExtraItemsL() + { + // No Effect item. + CAppListItem* listItem = iListItems[0]; + iListItems.Remove(0); + if (listItem) + { + delete listItem; + listItem = NULL; + } + } + +// --------------------------------------------------------------------------- +// Returns the root entry containing mailboxes. +// --------------------------------------------------------------------------- +// +CMsvEntry* CAiScutSettingsAppList::GetRootEntryL() + { + return iMsvSession->GetEntryL(KMsvRootIndexEntryIdValue); + } + +// --------------------------------------------------------------------------- +// Adds remote mailboxes to the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddMailboxesL() + { + CMsvEntry* rootEntry = GetRootEntryL(); + + CleanupStack::PushL(rootEntry); + TBuf<255> mailboxId; + + for (TInt i = rootEntry->Count() - 1; i >= 0; --i) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + if (tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) + { + mailboxId.Num(tentry.Id()); + AddMailboxL(tentry.iDetails, mailboxId); + } + } + + CleanupStack::PopAndDestroy(rootEntry); + } + +// --------------------------------------------------------------------------- +// Adds a mailbox to the list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddMailboxL(const TDesC& aMailbox, const TDesC& aMailboxId) +{ + CAppListItem* listItem = CAppListItem::NewLC(KScutMessagingUid, aMailbox); + + // Insert params containing mailbox id + HBufC* params = HBufC::NewLC(KScutParamMailbox().Length() + aMailboxId.Length()); + params->Des().Copy(KScutParamMailbox); + params->Des().Append(aMailboxId); + listItem->SetParamsL(*params); + listItem->SetType( EAiScutSettingTypeApplication ); + CleanupStack::PopAndDestroy(params); + + TLinearOrder sortMethod(CAppListItem::CompareCaption); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); + User::LeaveIfError(iMailboxes.Append(listItem)); + listItem = NULL; +} + +// --------------------------------------------------------------------------- +// Removes a mailbox from the list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::RemoveMailboxL(const TDesC& aMailboxParam) + { + for (TInt i = iListItems.Count() - 1; i >= 0; --i) + { + CAppListItem* listItem = iListItems[i]; + if (aMailboxParam.Compare(listItem->Params()) == 0) + { + // Also remove the mailbox from the mailbox array + for (TInt j = iMailboxes.Count() - 1; j >= 0; --j) + { + if (aMailboxParam.Compare(iMailboxes[j]->Params()) == 0) + { + iMailboxes.Remove(j); + } + } + + iListItems.Remove(i); + delete listItem; + listItem = NULL; + + break; + } + } + } + +// --------------------------------------------------------------------------- +// Gets the next valid application from application architecture server. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::GetNextValidApp(TApaAppInfo& aAppInfo) + { + TInt err = KErrNone; + TBool validAppFound = EFalse; + + while (!validAppFound) + { + TApaAppInfo appInfo; + err = iApaSession.GetNextApp(appInfo); + if (err == KErrNone) + { + TApaAppCapabilityBuf capBuf; + TApaAppCapability cap; + + if ((iApaSession.GetAppCapability(capBuf, appInfo.iUid) == KErrNone)) + { + cap = capBuf(); + + TInt screenNumber(0); + err = iApaSession.GetDefaultScreenNumber( screenNumber, appInfo.iUid ); + + if ((err == KErrNone) && (cap.iAppIsHidden == EFalse) && (screenNumber == 0)) + { + aAppInfo = appInfo; + validAppFound = ETrue; + } + } + } + else + { + return err; + } + } + + return err; + } + +// --------------------------------------------------------------------------- +// Updates the application list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::UpdateAppListL() + { + TBool updated = EFalse; + TBool added = EFalse; + + TInt totalAppCount = 0; + + if (iApaSession.AppCount(totalAppCount) == KErrNone) + { + if (totalAppCount < iTotalAppCount) + { + RemoveUninstalledAppFromListL(iTotalAppCount - totalAppCount); + updated = ETrue; + added = EFalse; + } + else if (totalAppCount > iTotalAppCount) + { + AddInstalledAppToListL(totalAppCount - iTotalAppCount); + updated = ETrue; + added = ETrue; + } + + iTotalAppCount = totalAppCount; + } + + if (updated) + { + iObserver.HandleScutListEventL(MAiScutListObserver::EAppListUpdated, added); + } + } + +// --------------------------------------------------------------------------- +// Figures out which application is missing from the list and adds it. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::AddInstalledAppToListL(TInt aCount) + { + TInt added = 0; + TApaAppInfo appInfo; + TInt err = GetNextValidApp(appInfo); + + while (err == KErrNone) + { + TBool found = EFalse; + + for (TInt i = iListItems.Count() - 1; i >= 0; --i) + { + if (iListItems[i]->Uid() == appInfo.iUid) + { + found = ETrue; + break; + } + } + + if (!found) + { + AddApplicationL(appInfo); + if (++added == aCount) + { + // Found all of them, no need to go further + return ; + } + } + + err = GetNextValidApp(appInfo); + } + + // create registry + CJavaRegistry* registry = CJavaRegistry::NewLC(); + + // get all uids stored in registry + RArray uids; + registry->GetRegistryEntryUidsL( uids ); + + CleanupClosePushL(uids); + + for (TInt javaIndex = 0; javaIndex < uids.Count(); ++javaIndex) + { + TInt found = EFalse; + for (TInt listIndex = 0; listIndex < iListItems.Count(); ++listIndex ) + { + if (iListItems[listIndex]->Uid() == uids[javaIndex]) + { + found = ETrue; + } + } + if (!found) + { + // get registry entry by uid (i.e. the first entry) + CJavaRegistryEntry* entry = + registry->RegistryEntryL( uids[javaIndex] ); + if( entry ) + { + CleanupStack::PushL(entry); + + // get entry properties (i.e. name) + const TDesC& name = entry->Name(); + TUid uid = entry->Uid(); + + CAppListItem* listItem = CAppListItem::NewLC(uid, name); + listItem->SetType( EAiScutSettingTypeApplication ); + TLinearOrder sortMethod(CAppListItem::CompareCaption); + if (entry->Type() >= EGeneralApplication) + { + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + ++added; + } + else + { + delete listItem; + } + CleanupStack::Pop(listItem); + + CleanupStack::PopAndDestroy(entry); + } + if (added == aCount) + { + break; + } + } + } + CleanupStack::PopAndDestroy(); // uids + CleanupStack::PopAndDestroy(registry); + } + +// --------------------------------------------------------------------------- +// Figures out which application should not be in the list and removes it. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::RemoveUninstalledAppFromListL(TInt aCount) + { + TInt removed = 0; + + for (TInt i = iListItems.Count() - 1; i >= 0; --i) + { + CAppListItem* listItem = iListItems[i]; + TApaAppInfo ignored; + if (iApaSession.GetAppInfo(ignored, listItem->Uid()) == KErrNotFound) + { + iListItems.Remove(i); + delete listItem; + listItem = NULL; + + if (++removed == aCount) + { + return ; + } + } + } + // create registry + CJavaRegistry* registry = CJavaRegistry::NewLC(); + // get all uids stored in registry + RArray uids; + registry->GetRegistryEntryUidsL( uids ); + + CleanupClosePushL(uids); + + for (TInt listIndex = iListItems.Count(); listIndex >= 0 ; --listIndex ) + { + TInt found = EFalse; + for (TInt javaIndex = 0; javaIndex < uids.Count(); ++javaIndex) + { + if (iListItems[listIndex]->Uid() == uids[javaIndex]) + { + found = ETrue; + } + } + if (!found) + { + // Item removed, remove from item list + CAppListItem* listItem = iListItems[listIndex]; + iListItems.Remove(listIndex); + delete listItem; + if (++removed == aCount) + { + break; + } + } + } + CleanupStack::PopAndDestroy(); // uids + CleanupStack::PopAndDestroy(registry); + } + +TBool CAiScutSettingsAppList::IsNonNative(const TUid& aUid) + { + TBool ret = EFalse; + + const TUid KMidletAppType = { 0x10210E26 }; + TUid typeuid = KNullUid; + + if (KErrNone == iApaSession.GetAppType(typeuid, aUid)) + { + if (typeuid == KMidletAppType) + { + ret = ETrue; + } + } + + return ret; + } + + +TBool CAiScutSettingsAppList::IsInRom( const TUid& aUid ) + { + TBool inROM = EFalse; + + TApaAppInfo appInfo; + if( iApaSession.GetAppInfo( appInfo, aUid ) == KErrNone ) + { + // Does the full path start with z: + if( appInfo.iFullName.FindC( + PathInfo::RomRootPath().Left( KDriveAndColon ) ) >= 0 ) + { + inROM = ETrue; + } + } + return inROM; + } + + +// --------------------------------------------------------------------------- +// Nested class to store individual application list items +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList::CAppListItem::CAppListItem(TUid aUid) : iUid(aUid) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::CAppListItem::ConstructL(const TDesC& aCaption) + { + iCaption = aCaption.AllocL(); + // Defaults to application + iType = EAiScutSettingTypeApplication; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList::CAppListItem* CAiScutSettingsAppList::CAppListItem::NewLC( + TUid aUid, const TDesC& aCaption) + { + CAppListItem* self = new (ELeave) CAppListItem(aUid); + CleanupStack::PushL(self); + self->ConstructL(aCaption); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList::CAppListItem::~CAppListItem() + { + delete iCaption; + delete iParams; + } + +// --------------------------------------------------------------------------- +// Compare method used to add the items to the list in sorted order. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsAppList::CAppListItem::CompareCaption(const CAppListItem& aFirst, + const CAppListItem& aSecond) + { + return aFirst.iCaption->Des().CompareC(*aSecond.iCaption); + } + +// --------------------------------------------------------------------------- +// Returns the item target application uid. +// --------------------------------------------------------------------------- +// +TUid CAiScutSettingsAppList::CAppListItem::Uid() const + { + return iUid; + } + +// --------------------------------------------------------------------------- +// Returns the item target application caption. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsAppList::CAppListItem::Caption() const + { + return TPtrC(*iCaption); + } + +// --------------------------------------------------------------------------- +// Returns the possible parameters for item target. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsAppList::CAppListItem::Params() const + { + TPtrC params; + if (iParams) + { + params.Set(*iParams); + } + return params; + } + +// --------------------------------------------------------------------------- +// Sets the parameters for the item target. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsAppList::CAppListItem::SetParamsL(const TDesC& aParams) + { + HBufC* newParams = aParams.AllocL(); + delete iParams; + iParams = newParams; + } + +TAiScutSettingType CAiScutSettingsAppList::CAppListItem::Type() const +{ + return iType; +} + +void CAiScutSettingsAppList::CAppListItem::SetType( TAiScutSettingType aType ) +{ + iType = aType; +} +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingsbkmlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingsbkmlist.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,307 @@ +/* +* 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: Bookmark list for settings listbox +* +*/ + + +#include +#include // For CActiveFavouritesDbNotifier + +#include +#include + +#include "caiscutsettingsmodel.h" +#include "caiscutsettingsapplist.h" +#include "caiscutsettingsbkmlist.h" +#include "taiscutparser.h" +#include "caiscutsettingsitem.h" +#include "aiscutdefs.h" + +#include "debug.h" + + +_LIT( KText, "bkm=0x%x" ); +const TInt KTBUF16 = 16; + +// ======== MEMBER FUNCTIONS ======== + +CAiScutSettingsBkmList::CAiScutSettingsBkmList( + CCoeEnv* aEnv, + CAiScutSettingsModel* aModel, + MAiScutListObserver& aObserver + ) + : iEnv(aEnv) + , iModel(aModel) + , iObserver(aObserver) +{ +} + +void CAiScutSettingsBkmList::ConstructL() +{ +} + +CAiScutSettingsBkmList* CAiScutSettingsBkmList::NewL( + CCoeEnv* aEnv, + CAiScutSettingsModel* aModel, + MAiScutListObserver& aObserver) +{ + CAiScutSettingsBkmList* self = new (ELeave) CAiScutSettingsBkmList( + aEnv, aModel, aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +CAiScutSettingsBkmList::~CAiScutSettingsBkmList() +{ + iListItems.ResetAndDestroy(); + delete iBookmarkDbObserver; +} + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsBkmList::MdcaCount() const +{ + return iListItems.Count(); +} + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsBkmList::MdcaPoint(TInt aIndex) const +{ + if (aIndex < 0 || aIndex >= iListItems.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + return iListItems[aIndex]->Caption(); +} + +// --------------------------------------------------------------------------- +// Gets bookmark list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::GetBookmarkListL() +{ + iListItems.ResetAndDestroy(); + + iModel->ReadBookmarksL(); + + TInt count = iModel->BookmarkCount(); + + for (TInt i = count - 1; i >= 0; i--) // newest on top + { + CFavouritesItem* item = iModel->GetBookmark(i); + + TUid uid = TUid::Uid(item->Uid()); + TPtrC name = item->Name(); + + AddBookmarkL(uid, name); + } +} + +// --------------------------------------------------------------------------- +// Tells the bookmark list to start or stop observing for changes. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::SetObservingL(TBool aObserving) +{ + delete iBookmarkDbObserver; + iBookmarkDbObserver = NULL; + + if (aObserving) + { + + iBookmarkDbObserver = new (ELeave) CActiveFavouritesDbNotifier( + iModel->FavouritesDb(), *this); + iBookmarkDbObserver->Start(); + } + + iObserving = aObserving; +} + +// --------------------------------------------------------------------------- +// Finds the index of the given settings item in the bookmark list. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsBkmList::FindIndex(CAiScutSettingsItem& aItem) +{ + TInt index = KErrNotFound; + + TAiScutParser parser; + parser.Parse(aItem.Value()); + TUid uid = parser.ParseUid(parser.Get(EScutDefParamValue)); + + for (TInt i = iListItems.Count() - 1; i >= 0; --i) + { + if (iListItems[i]->Uid() == uid) + { + index = i; + break; + } + } + + return index; +} + +// --------------------------------------------------------------------------- +// Returns target bookmark data from the given index. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsBkmList::GetDataByIndex( + TInt aIndex, TPtrC& aParams, TPtrC& aCaption) const +{ + if (aIndex >= 0 && aIndex < iListItems.Count()) + { + CBkmListItem* item = iListItems[aIndex]; + aParams.Set(item->Params()); + aCaption.Set(item->Caption()); + return KErrNone; + } + + return KErrNotFound; +} + +// --------------------------------------------------------------------------- +// Adds an bookmark to the list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::AddBookmarkL(TUid aUid, const TDesC& aCaption) +{ + CBkmListItem* listItem = CBkmListItem::NewLC(aUid, aCaption); + + TBuf buf; + buf.Format( KText, aUid.iUid ); + + listItem->SetParamsL(buf); + TLinearOrder sortMethod(CBkmListItem::CompareCaption); + User::LeaveIfError(iListItems.InsertInOrderAllowRepeats(listItem, sortMethod)); + CleanupStack::Pop(listItem); +} + +// --------------------------------------------------------------------------- +// Updates the bookmark list. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::UpdateBkmListL() +{ + GetBookmarkListL(); + iObserver.HandleScutListEventL(MAiScutListObserver::EBkmListUpdated, EFalse); +} + +// ----------------------------------------------------------------------------- +// From class MFavouritesDbObserver. +// Handles database event. +// ----------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent) +{ + __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsBkmList::HandleFavouritesDbEventL aEvent = %d"), aEvent); + + if (aEvent == RDbNotifier::ECommit) + { + UpdateBkmListL(); + } +} + +// --------------------------------------------------------------------------- +//Nested class to store individual bookmark list items +// --------------------------------------------------------------------------- +// +CAiScutSettingsBkmList::CBkmListItem::CBkmListItem(TUid aUid) : iUid(aUid) +{ +} + +void CAiScutSettingsBkmList::CBkmListItem::ConstructL(const TDesC& aCaption) +{ + iCaption = aCaption.AllocL(); +} + +CAiScutSettingsBkmList::CBkmListItem* CAiScutSettingsBkmList::CBkmListItem::NewLC( + TUid aUid, const TDesC& aCaption) +{ + CBkmListItem* self = new (ELeave) CBkmListItem(aUid); + CleanupStack::PushL(self); + self->ConstructL(aCaption); + return self; +} + +CAiScutSettingsBkmList::CBkmListItem::~CBkmListItem() +{ + delete iCaption; + delete iParams; +} + +// --------------------------------------------------------------------------- +// Compare method used to add the items to the list in sorted order. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsBkmList::CBkmListItem::CompareCaption(const CBkmListItem& aFirst, + const CBkmListItem& aSecond) +{ + return aFirst.iCaption->Des().CompareC(*aSecond.iCaption); +} + +// --------------------------------------------------------------------------- +// Returns the item target bookmark uid. +// --------------------------------------------------------------------------- +// +TUid CAiScutSettingsBkmList::CBkmListItem::Uid() const +{ + return iUid; +} + +// --------------------------------------------------------------------------- +// Returns the item target bookmark caption. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsBkmList::CBkmListItem::Caption() const +{ + return TPtrC(*iCaption); +} + +// --------------------------------------------------------------------------- +// Returns the possible parameters for item target. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsBkmList::CBkmListItem::Params() const +{ + TPtrC params; + if (iParams) + { + params.Set(*iParams); + } + return params; +} + +// --------------------------------------------------------------------------- +// Sets the parameters for the item target. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsBkmList::CBkmListItem::SetParamsL(const TDesC& aParams) +{ + HBufC* newParams = aParams.AllocL(); + delete iParams; + iParams = newParams; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingscontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingscontainer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,488 @@ +/* +* 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: Shortcut settings plug-in container. +* +*/ + + +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include + +#include +#include + +#include "caiscutsettingscontainer.h" +#include "caiscutsettingsmodel.h" +#include "caiscutsettingsbkmlist.h" +#include "caiscutsettingsitem.h" +#include "aiscutpluginprivatecrkeys.h" +#include "aiscutdefs.h" + +const TUid KUidAI = { 0x101F8701 }; // Active Standby Shortcuts help uid + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsContainer::CAiScutSettingsContainer() +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::ConstructL(const TRect& aRect) +{ + iListBox = new (ELeave) CAknSettingStyleListBox; + BaseConstructL(aRect, R_SCUT_SETTINGS_VIEW_TITLE, NULL); + + iOldType = EAiScutSettingTypeUndefined; + + CheckMiddleSoftkeyLabelL(); + + iModel->ActivateObservers(ETrue); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsContainer::~CAiScutSettingsContainer() +{ + HideWaitNoteDialog(); +} + +// --------------------------------------------------------------------------- +// Sets pointer to settings plug-in model. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::SetModel(CAiScutSettingsModel* aModel) +{ + iModel = aModel; +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::HandleChangeCommandL() +{ + if ( iChangeProcessInProgress ) + { + return; + } + TBool changed = EFalse; + TInt current = iListBox->CurrentItemIndex(); + CAiScutSettingsItem* item = iModel->Item(current); + if (!item) + { + return ; + } + + TUint32 key = item->Key(); + TBool locked = (0 != (key & KScutFlagBitLocked)); + + if (locked) + { + HBufC* text = iCoeEnv->AllocReadResourceLC(R_SCUT_SETTINGS_TXT_FIXED_ITEM); + CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue); + note->ExecuteLD(*text); + CleanupStack::PopAndDestroy(text); + } + else + { + TAiScutSettingType oldType = item->Type(); + TInt newType = oldType; + + CDesCArrayFlat* array = iCoeEnv->ReadDesC16ArrayResourceL( + R_SCUT_CHANGE_TO_PAGE_LBX); + CleanupStack::PushL(array); + + CAknListQueryDialog* dialog = new(ELeave)CAknListQueryDialog(&newType); + CleanupStack::PushL(dialog); + dialog->PrepareLC(R_SCUT_LISTQUERY_CHANGE_TO_PAGE); + CleanupStack::Pop(dialog); + dialog->SetItemTextArray(array); + dialog->SetOwnershipType(ELbmDoesNotOwnItemArray); + iChangeProcessInProgress = ETrue; + if (dialog->RunLD()) + { + item = iModel->Item(current); + if (newType == EAiScutSettingTypeUrl) + { + changed = HandleUrlChangeCommandL(*item, (newType != oldType)); + } + else if (newType == EAiScutSettingTypeBookmark) + { + changed = HandleBookmarkChangeCommandL(*item, (newType != oldType)); + } + else + { + changed = HandleAppListChangeCommandL(*item, (newType != oldType)); + } + if ( changed ) + { + ResetCurrentListL(current); + } + + } + iChangeProcessInProgress = EFalse; + CleanupStack::PopAndDestroy(array); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsContainer::IsChangeDialogShowing() +{ + return (iAppListDialog || iBkmListDialog || iEditDialog); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::CloseChangeDialog() +{ + TKeyEvent keyEvent; + + keyEvent.iCode = EKeyEscape; + keyEvent.iScanCode = EStdKeyEscape; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + + CCoeControl* dialog = NULL; + + if (iAppListDialog) + { + dialog = static_cast(iAppListDialog); + } + else if (iBkmListDialog) + { + dialog = static_cast(iBkmListDialog); + } + else if (iEditDialog) + { + dialog = static_cast(iEditDialog); + } + + if (dialog) + { + TRAP_IGNORE(dialog->OfferKeyEventL(keyEvent, EEventKey)); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::ResetCurrentListL(TInt aIndex) +{ + if (iModel->MdcaCount() == 0) + { + iListBox->HandleItemRemovalL(); + } + else + { + iListBox->HandleItemAdditionL(); + } + + iListBox->SetCurrentItemIndex(aIndex); + + CheckMiddleSoftkeyLabelL(); +} + +// --------------------------------------------------------------------------- +// From CGSBaseContainer +// Constructs the settings listbox. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::ConstructListBoxL(TInt /*aResLbxId*/) +{ + iListBox->ConstructL(this, EAknListBoxSelectionList); + + // Set empty listbox's text. + HBufC* text = iCoeEnv->AllocReadResourceLC(R_SCUT_SETTINGS_TXT_ALL_FIXED); + iListBox->View()->SetListEmptyTextL(*text); + CleanupStack::PopAndDestroy(text); + + iListBox->Model()->SetItemTextArray(iModel); + iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command to select application from a list. +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsContainer::HandleAppListChangeCommandL(CAiScutSettingsItem& aItem, + TBool /*aNew*/) +{ + + TBool changed = EFalse; + + iChangeProcessStopped = EFalse; + + if (!iModel->AppList()->IsReady()) + { + ShowWaitNoteDialogL(); // Blocks until applist reports that it is ready. + } + // If wait note was "killed" then don't continue the change process + // If the process is not stopped here it could lead to situation where + // self is deleted before the ShowWaitNoteDialogL() returns + if ( iChangeProcessStopped ) + { + return EFalse; + } + + TUint32 key = aItem.Key(); + TBool optional = (0 != (key & KScutFlagBitOptionallyVisible)); + TBool scrollkey = (0 != ((key & 0xFFFF) < EAiScutSoftKeyLeft)); + + if (optional && scrollkey) + { + iModel->AppList()->AddExtraItemsL(); + } + + TInt index = iModel->AppList()->FindIndex(aItem); + TInt oldIndex = index; + + iAppListDialog = new (ELeave) CAknRadioButtonSettingPage( + R_SCUT_SETTINGS_APPLIST_PAGE, index, iModel->AppList()); + + iAppListDialog->SetSettingTextL(aItem.Title()); + iAppListDialog->ConstructL(); + + if (iAppListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && + index != oldIndex) + { + TUid uid; + TPtrC params; + TPtrC caption; + TAiScutSettingType type; + if (iModel->AppList()->GetDataByIndex(index, uid, params, caption, type) == KErrNone) + { + if ( type == EAiScutSettingTypeUrl ) + { + aItem.ChangeUrlL( params ); + } + else + { + aItem.ChangeApplicationL(uid, params, caption); + } + iModel->SaveItemL(aItem); + changed = ETrue; + } + } + + if (optional && scrollkey) + { + iModel->AppList()->RemoveExtraItemsL(); + } + + iAppListDialog = NULL; + return changed; +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command to select bookmark from a list. +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsContainer::HandleBookmarkChangeCommandL(CAiScutSettingsItem& aItem, + TBool /*aNew*/) +{ + + TBool changed = EFalse; + iModel->BkmList()->GetBookmarkListL(); + TInt index = iModel->BkmList()->FindIndex(aItem); + TInt oldIndex = index; + + iBkmListDialog = new (ELeave) CAknRadioButtonSettingPage( + R_SCUT_SETTINGS_APPLIST_PAGE, index, iModel->BkmList()); + + iBkmListDialog->SetSettingTextL(aItem.Title()); + iBkmListDialog->ConstructL(); + + if (iBkmListDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged) && + index != oldIndex) + { + TPtrC params; + TPtrC caption; + if (iModel->BkmList()->GetDataByIndex(index, params, caption) == KErrNone) + { + aItem.ChangeBookmarkL(params, caption); + iModel->SaveItemL(aItem); + changed = ETrue; + } + } + + iBkmListDialog = NULL; + return changed; +} + +// --------------------------------------------------------------------------- +// Chandles a setting change command to edit an URL. +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsContainer::HandleUrlChangeCommandL(CAiScutSettingsItem& aItem, + TBool aNew) +{ + TBool changed = EFalse; + HBufC* newUrl = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr urlPtr = newUrl->Des(); + + if (!aNew) + { + urlPtr.Copy(aItem.Value()); + } + + if (EditTextL(R_SCUT_TYPE_URL_PAGE , urlPtr)) + { + aItem.ChangeUrlL(urlPtr); + iModel->SaveItemL(aItem); + changed = ETrue; + } + + CleanupStack::PopAndDestroy(newUrl); + return changed; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsContainer::EditTextL(TInt aResId, TDes& aDes) +{ + TBool ret = EFalse; + + iEditDialog = new (ELeave) CAknTextSettingPage(aResId, aDes); + + if (iEditDialog->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) + { + if (aDes.Length()) + { + ret = ETrue; + } + } + + iEditDialog = NULL; + + return ret; +} + +// --------------------------------------------------------------------------- +// Shows the wait note dialog. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::ShowWaitNoteDialogL() +{ + if (!iWaitDialog) + { + iWaitDialog = new (ELeave) CAknWaitDialog( + (reinterpret_cast (&iWaitDialog)), + ETrue // aVisibilityDelayOff + ); + iWaitDialog->ExecuteLD(R_SCUT_WAIT_NOTE); + } +} + +// --------------------------------------------------------------------------- +// Hides the wait note dialog. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::HideWaitNoteDialog() +{ + if (iWaitDialog) + { + TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog. + iWaitDialog = NULL; + } +} + +void CAiScutSettingsContainer::StopShortcutChangeProcess() +{ + iChangeProcessStopped = ETrue; + HideWaitNoteDialog(); + if ( IsChangeDialogShowing() ) + { + CloseChangeDialog(); + } +} + +// --------------------------------------------------------------------------- +// Gets Help +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::GetHelpContext(TCoeHelpContext& aContext) const +{ + aContext.iMajor = KUidAI; + //aContext.iContext = KSET_HLP_PERSONAL_SHORTCUTS; // This is specified in HRH file +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TKeyResponse CAiScutSettingsContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) +{ + switch (aKeyEvent.iCode) + { + case EKeyUpArrow: + case EKeyDownArrow: + { + TKeyResponse resp = iListBox->OfferKeyEventL(aKeyEvent, aType); + return resp; + } + + case EKeyLeftArrow: + case EKeyRightArrow: + // Listbox takes all event even if it doesn't use them: + return EKeyWasNotConsumed; + + default: + break; + } + + // Now it's iListBox's job to process the key event + return iListBox->OfferKeyEventL(aKeyEvent, aType); +} + +// --------------------------------------------------------------------------- +// Checks if there is a need to update the middle softkey label. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsContainer::CheckMiddleSoftkeyLabelL() +{ + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba) + { + cba->MakeCommandVisible(EAiScutSettingsCmdChange, (iModel->MdcaCount() != 0)); + } +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingsimplementationtable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingsimplementationtable.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* 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: Implementation table for shortcut settings plug-in +* +*/ + + +#include +#include + +#include "caiscutsettings.h" +#include + +/** Implementation table for shortcut settings plug-in */ +const TImplementationProxy KAiScutSettingsImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY( + AI_UID_ECOM_IMPLEMENTATION_SETTINGS_SCUTPLUGIN, CAiScutSettings::NewL) +}; + + +// --------------------------------------------------------------------------- +// Gate/factory function. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = + sizeof(KAiScutSettingsImplementationTable) / + sizeof(TImplementationProxy); + return KAiScutSettingsImplementationTable; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingsitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingsitem.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,588 @@ +/* +* 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: Class for shortcut setting items +* +*/ + + + +#include +#include +#include // For KMsvRootIndexEntryIdValue +#include +#include // For TUriParser16 +#include +#include +#include "caiscutsettingsitem.h" +#include "caiscutsettingsmodel.h" +#include "aiscutpluginprivatecrkeys.h" +#include "taiscutparser.h" +#include "aiscutdefs.h" +#include "aiscutsettings.hrh" +#include "aidefaultshortcut.h" +#include "debug.h" + +const TInt KMaxBufSize = 250; +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// + +CAiScutSettingsItem::CAiScutSettingsItem( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey) + : iModel(aModel) + , iIndex(aIndex) + , iKey(aKey) +{ +} +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsItem::ReadL(CRepository* aRepository) +{ + if( !aRepository ) + { + return; + } + + HBufC* buffer = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + // try user key first. + TUint32 key = iKey & KScutBitMaskThemeDefault; + TInt err = aRepository->Get(key, bufferPtr); + + if (err == KErrNone) + { + err = ParseValueL(bufferPtr); + } + + if (err == KErrNone) + { + iKey = key; + } + else + { + // if no user key try default key then. + key = iKey | KScutFlagBitThemeDefault; + err = aRepository->Get(key, bufferPtr); + if (err == KErrNone) + { + err = ParseValueL(bufferPtr); + } + + } + + if (err != KErrNone || + (iType == EAiScutSettingTypeApplication && iModel.IsHidden(iUid))) + { + HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufPtr = buf->Des(); + HBufC* caption = NULL; + + // Get the default shortcut uid for key 'key' + iType = EAiScutSettingTypeApplication; + TAiDefaultShortcut::GetDefaultShortcut(key, iUid, bufPtr); + + err = iModel.GetAppCaption(iUid, bufPtr); + if (err == KErrNone) + { + caption = bufPtr.AllocLC(); + CreateListBoxLineL(*caption); + CleanupStack::PopAndDestroy(caption); + } + + CleanupStack::PopAndDestroy(buf); + + } + + delete iValue; + iValue = NULL; + iValue = bufferPtr.AllocL(); + + CleanupStack::PopAndDestroy(buffer); + + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + TInt CAiScutSettingsItem::Save(CRepository* aRepository) + { + + if( !aRepository ) + { + return KErrGeneral; + } + + iKey = iKey & KScutBitMaskThemeDefault; + + TInt err = aRepository->Set(iKey, Value()); + + return err; + } + + + // --------------------------------------------------------------------------- + // Constructs a new settings item leaving it on the cleanup stack. + // --------------------------------------------------------------------------- + // + CAiScutSettingsItem* CAiScutSettingsItem::NewLC( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey) + { + CAiScutSettingsItem* self = new (ELeave) CAiScutSettingsItem( + aModel, aIndex, aKey); + + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + CAiScutSettingsItem* CAiScutSettingsItem::NewLC( + CAiScutSettingsModel& aModel, + TInt aIndex, + TUint32 aKey, + const TDesC& aValue) + { + CAiScutSettingsItem* self = new (ELeave) CAiScutSettingsItem( + aModel, aIndex, aKey); + + CleanupStack::PushL(self); + self->ConstructL(aValue); + return self; + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + void CAiScutSettingsItem::ConstructL() + { + + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + void CAiScutSettingsItem::ConstructL(const TDesC& aValue) + { + ParseValueL(aValue); + iValue = aValue.AllocL(); + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + CAiScutSettingsItem::~CAiScutSettingsItem() + { + delete iValue; + delete iListBoxLine; + } + + // --------------------------------------------------------------------------- + // + // --------------------------------------------------------------------------- + // + TInt CAiScutSettingsItem::ParseValueL(const TDesC& aValue) + { + HBufC* caption = NULL; + TInt err = KErrNone; + HBufC* buf = HBufC::NewLC(KMaxBufSize); + TPtr bufPtr = buf->Des(); + + TAiScutParser parser; + parser.Parse(aValue); + + TShortcutType type = parser.Type(); + + iUid = parser.Uid(); + iType = EAiScutSettingTypeApplication; + + switch (type) + { + case EScutApplication: + case EScutApplicationWithParams: + case EScutApplicationView: + case EScutLogsMissedCallsView: + case EScutLogsDialledCallsView: + case EScutLogsReceivedCallsView: + case EScutLogsMainView: + err = iModel.GetAppCaption(iUid, bufPtr); + if (err == KErrNone) + { + caption = bufPtr.AllocLC(); + } + break; + + case EScutNewMessage: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NEW_MSG, iModel.Env()); + break; + + case EScutNewEmail: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NEW_EMAIL, iModel.Env()); + break; + + #ifdef __SYNCML_DS_EMAIL + case EScutNewSyncMLMail: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NEW_SYNCML_MAIL, iModel.Env()); + break; + #endif + + case EScutNewPostcard: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NEW_POSTCARD, iModel.Env()); + break; + + case EScutNewAudioMsg: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NEW_AUDIO_MSG, iModel.Env()); + break; + + case EScutNewMsgType: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_SELECT_MSG_TYPE, iModel.Env()); + break; + + case EScutChangeTheme: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_CHANGE_THEME, iModel.Env()); + break; + + case EScutMailbox: + { + err = KErrNotFound; + // Parse the mailbox id from the definition + TLex lex(parser.Get(EScutDefParamValue)); + TInt mailboxId = KErrNone; + lex.Val(mailboxId); + + CMsvSession* msvSession = CMsvSession::OpenAsObserverL(*iModel.AppList()); + CleanupStack::PushL(msvSession); + + CMsvEntry* rootEntry = msvSession->GetEntryL(KMsvRootIndexEntryIdValue); + CleanupStack::PushL(rootEntry); + + // Searching the mailbox name + for (TInt i = rootEntry->Count() - 1; i >= 0; --i) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + if ((tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) && + tentry.Id() == mailboxId) + { + caption = tentry.iDetails.AllocL(); + err = KErrNone; + break; + } + } + CleanupStack::PopAndDestroy(rootEntry); + CleanupStack::PopAndDestroy(msvSession); + if ( caption ) + { + CleanupStack::PushL( caption ); + } + } + break; + + case EScutNoEffect: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_NO_EFFECT, iModel.Env()); + break; + + case EScutConnectivityStatusView: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_CONNECTIVITY_STATUS, iModel.Env()); + break; + + case EScutApplicationManagerView: + caption = StringLoader::LoadLC( + R_SCUT_SETTINGS_APPMNGR, iModel.Env()); + break; + + case EScutBookmark: + { + // aValue = "localapp:0x102750fb?bkm=0x12345678" + iUid = KScutSettingsDllUid; + iType = EAiScutSettingTypeBookmark; + TUid uid = parser.ParseUid(parser.Get(EScutDefParamValue)); + TRAP(err, iModel.GetBkmCaptionL(uid, bufPtr)); + if (err == KErrNone) + { + caption = bufPtr.AllocLC(); + + __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsItem bkm uid = 0x%x caption = '%S' "), + uid.iUid, caption); + } + } + break; + + case EScutWebAddress: + default: + // treat unknown shortcuts as typed urls. + iUid.iUid = 0; + iType = EAiScutSettingTypeUrl; + HBufC* tmp = HBufC::NewLC( aValue.Length() ); + TPtr tmpPtr = tmp->Des(); + TInt err = parser.CustomTitle( tmpPtr ); + + if ( err != KErrNone || tmp->Length() <= 0 ) + { + CleanupStack::PopAndDestroy( tmp ); + caption = aValue.AllocLC(); + } + else + { + caption = tmp; + } + break; + } + + if (caption) + { + CreateListBoxLineL(*caption); + CleanupStack::PopAndDestroy(caption); + } + + CleanupStack::PopAndDestroy(buf); + return err; + } + + // --------------------------------------------------------------------------- + // Changes the setting item target application. + // --------------------------------------------------------------------------- + // + void CAiScutSettingsItem::ChangeApplicationL(TUid aUid, const TDesC& aParams, + const TDesC& aCaption) + { + iUid = aUid; + iType = EAiScutSettingTypeApplication; + + HBufC* newValue = NULL; + TAiScutParser parser; + parser.ComposeL(newValue, iUid, aParams); + + delete iValue; + iValue = NULL; + iValue = newValue; + + CreateListBoxLineL(aCaption); + } + + // ----------------------------------------------------------------------------- + // Changes the setting item target bookmark. + // ----------------------------------------------------------------------------- + // + void CAiScutSettingsItem::ChangeBookmarkL(const TDesC& aParams, const TDesC& aCaption) + { + iUid = KScutSettingsDllUid; + iType = EAiScutSettingTypeBookmark; + + HBufC* newValue = NULL; + TAiScutParser parser; + parser.ComposeL(newValue, iUid, aParams); + + delete iValue; + iValue = NULL; + iValue = newValue; + + CreateListBoxLineL(aCaption); + } + + // ----------------------------------------------------------------------------- + // Changes the setting item target url. + // ----------------------------------------------------------------------------- + // + void CAiScutSettingsItem::ChangeUrlL(const TDesC& aUrl) + { + iUid.iUid = 0; + iType = EAiScutSettingTypeUrl; + + delete iValue; + iValue = NULL; + iValue = aUrl.AllocL(); + + CreateListBoxLineL(*iValue); + } + + // ----------------------------------------------------------------------------- + // Creates a formatted listbox line. + // ----------------------------------------------------------------------------- + // + void CAiScutSettingsItem::CreateListBoxLineL(const TDesC& aCaption) + { + HBufC* title = CreateItemTitleLC(); + + TPtrC caption; + caption.Set(aCaption); + + TUriParser parser; + TInt err = parser.Parse(aCaption); + if (err == KErrNone) + { + // Remove scheme from the url. + const TDesC& host = parser.Extract(EUriHost); + if (host.Length()) + { + caption.Set(host); + } + } + + // Format (" \t%S\t\t%S") without %S characters. + TInt formatLength = KSettingListboxLineFormat().Length(); + + HBufC* listBoxLine = + HBufC::NewLC(title->Length() + caption.Length() + formatLength); + + TPtr ptr = listBoxLine->Des(); + ptr.Format(KSettingListboxLineFormat, title, &caption); + + delete iListBoxLine; + iListBoxLine = NULL; + iListBoxLine = listBoxLine; + CleanupStack::Pop(listBoxLine); + + TInt titlePos = ptr.Find(*title); + if (titlePos < 0) + { + titlePos = 0; + } + iTitle.Set(ptr.Mid(titlePos, title->Length())); + + CleanupStack::PopAndDestroy(title); + } + + // ----------------------------------------------------------------------------- + // Creates a setting item title. + // ----------------------------------------------------------------------------- + // + HBufC* CAiScutSettingsItem::CreateItemTitleLC() + { + HBufC* title = NULL; + if (iKey & KScutFlagBitOptionallyVisible) + { + // Optionally visible shortcuts are either navigation keys or soft keys. + title = CreateOptionallyVisibleKeyTitleLC(); + } + + // Make sure something gets loaded and put to cleanup stack. + if (!title) + { + title = StringLoader::LoadLC( + R_SCUT_SETTINGS_TXT_LINKN, iIndex+1, iModel.Env()); + } + + __PRINT( __DBG_FORMAT( "XAI: CreateItemTitleLC %d key = 0x%x (0x%x) title = '%S' "), + iIndex+1, iKey, (iKey & 0xFFFF), title); + + return title; + } + + // ----------------------------------------------------------------------------- + // Creates a key title for an optionally visible shortcut. + // ----------------------------------------------------------------------------- + // + HBufC* CAiScutSettingsItem::CreateOptionallyVisibleKeyTitleLC() + { + HBufC* title = NULL; + TInt resourceId = 0; + + switch (iKey & 0xFFFF) + { + case EAiScutScrollKeyLeft: + resourceId = R_SCUT_SETTINGS_SCROLL_LEFT; + break; + + case EAiScutScrollKeyRight: + resourceId = R_SCUT_SETTINGS_SCROLL_RIGHT; + break; + + case EAiScutScrollKeyUp: + resourceId = R_SCUT_SETTINGS_SCROLL_UP; + break; + + case EAiScutScrollKeyDown: + resourceId = R_SCUT_SETTINGS_SCROLL_DOWN; + break; + + case EAiScutSelectionKey: + resourceId = R_SCUT_SETTINGS_SELECTION_KEY; + break; + + case EAiScutSoftKeyLeft: + resourceId = R_SCUT_SETTINGS_SOFTKEY_LEFT; + break; + + case EAiScutSoftKeyRight: + resourceId = R_SCUT_SETTINGS_SOFTKEY_RIGHT; + break; + + default: + resourceId = 0; + break; + } + + if (resourceId) + { + title = StringLoader::LoadLC(resourceId, iModel.Env()); + } + else + { + title = NULL; + } + + return title; + } + + // --------------------------------------------------------------------------- + // Returns the setting item value. + // --------------------------------------------------------------------------- + // + TPtrC CAiScutSettingsItem::Value() const + { + if(iValue) + { + return TPtrC( *iValue ); + } + return TPtrC(KNullDesC); + } + + // --------------------------------------------------------------------------- + // Returns the formatted listbox line descriptor. + // --------------------------------------------------------------------------- + // + TPtrC CAiScutSettingsItem::ListBoxLine() const + { + if(iListBoxLine) + { + return TPtrC( *iListBoxLine ); + } + return TPtrC(KNullDesC); + } +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutsettingsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutsettingsmodel.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,603 @@ +/* +* 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: Shrortcut settings plug-in model. +* +*/ + + +#include +#include +#include + +#include "caiscutsettings.h" +#include "caiscutsettingsmodel.h" +#include "caiscutsettingscontainer.h" +#include "caiscutsettingsitem.h" +#include "aiscutpluginprivatecrkeys.h" +#include "aiscutdefs.h" +#include "aiscutappuidparser.h" +#include "aiscutrepositorywatcher.h" + +#include "debug.h" + +LOCAL_C TInt CompareKey(const TUint32& aLeft, const TUint32& aRight) +{ + TBool softkey1 = (0 != ((aLeft & 0xFFFF) >= EAiScutSoftKeyLeft)); + TBool softkey2 = (0 != ((aRight & 0xFFFF) >= EAiScutSoftKeyLeft)); + TUint32 left = aLeft & (KScutBitMaskThemeDefault & KScutBitMaskLocked); + TUint32 right = aRight & (KScutBitMaskThemeDefault & KScutBitMaskLocked); + + // Softkey shortcuts are always sorted to be smallest. + if (!(softkey1 && softkey2)) + { + if (softkey1) + { + return -1; + } + else if (softkey2) + { + return 1; + } + } + + if (left < right) + { + return -1; + } + else if (left > right) + { + return 1; + } + + return 0; +} + + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsModel* CAiScutSettingsModel::NewL(CAiScutSettings& aPlugin, + CCoeEnv* aEnv) +{ + CAiScutSettingsModel* self = new (ELeave) CAiScutSettingsModel(aPlugin, aEnv); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsModel::CAiScutSettingsModel(CAiScutSettings& aPlugin, CCoeEnv* aEnv) + : iPlugin(aPlugin), iEnv(aEnv) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsModel::~CAiScutSettingsModel() +{ + ActivateObservers(EFalse); + + delete iSettingsNotifier; + delete iRepository; + + delete iHiddenAppsNotifier; + delete iHiddenAppsRepository; + + iHiddenApps.Close(); + + delete iAppList; + delete iBkmList; + + iSettings.ResetAndDestroy(); + iKeys.Reset(); + delete iFavItemList; + iBookmarkDb.Close(); + iBookmarkSess.Close(); + iApaSession.Close(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::ConstructL() +{ + User::LeaveIfError(iApaSession.Connect()); + User::LeaveIfError(iBookmarkSess.Connect()); + User::LeaveIfError(iBookmarkDb.Open(iBookmarkSess, KBrowserBookmarks)); + + iRepository = CRepository::NewL(KCRUidShortcutItems); + + iHiddenAppsRepository = CRepository::NewL(KCRUidMenu); + + // Create cenrep key observer for monitoring settings changes + // when theme is changed. + iSettingsNotifier = CAiScutRepositoryWatcher::NewL( + KCRUidShortcutItems, + TCallBack(HandleShortcutsChanged, this), + iRepository); + + iSettingsNotifier->StartListeningL(); + + iHiddenAppsNotifier = CAiScutRepositoryWatcher::NewL( + KCRUidMenu, + KMenuHideApplication, + CCenRepNotifyHandler::EStringKey, + TCallBack(HandleHiddenAppsChanged, this), + iHiddenAppsRepository); + + iHiddenAppsNotifier->StartListeningL(); + + GetHiddenAppsL(); + + iAppList = CAiScutSettingsAppList::NewL(iEnv, *this); + iAppList->StartL(); + + iBkmList = CAiScutSettingsBkmList::NewL(iEnv, this, *this); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::SetSettingsKeys(RArray& aKeys) + { + iKeys.Reset(); + + for( TInt i = 0; i < aKeys.Count(); i++ ) + { + TUint32 value( aKeys[i] ); + + iKeys.Append( value ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::UpdateSettingsL() +{ + if( !iPlugin.Activated() ) + { + return; + } + + iSettings.ResetAndDestroy(); + + TInt keyCount( iKeys.Count() ); + + if( keyCount > 0 ) + { + for( TInt i = 0; i < keyCount; i++ ) + { + CAiScutSettingsItem* setting = CAiScutSettingsItem::NewLC( + *this, i, iKeys[i] ); + + setting->ReadL( iRepository ); + + User::LeaveIfError( iSettings.Append( setting ) ); + CleanupStack::Pop( setting ); + } + + return; + } + + RArray defaultKeys; + CleanupClosePushL(defaultKeys); + + // Find the default keys and user defined keys. + iRepository->FindL( + KScutCenRepKeyThemeDefault, KScutCenRepKeyMask, defaultKeys); + + TInt i; + TUint32 defaultKey; + TUint32 userKey; + TInt count; + TInt lockedKeys = 0; + TInt visibleKeys = 0; + + TLinearOrder order(CompareKey); + defaultKeys.Sort(order); + + count = defaultKeys.Count(); + for (i = 0; i < count; ++i) + { + defaultKey = defaultKeys[i]; + userKey = defaultKey & KScutBitMaskThemeDefault; + // We show only actual shortcuts + if ( (! ( defaultKey & KScutFlagBitIconOverride )) && + (! ( defaultKey & KScutFlagBitToolbarShortcut ))) + { + __PRINT( __DBG_FORMAT( "XAI: %d. key = 0x%x"), i+1, + (defaultKey & (KScutBitMaskThemeDefault & KScutBitMaskLocked))); + + if (!(userKey & KScutFlagBitOptionallyVisible)) + { + visibleKeys++; + } + + TBool locked = (0 != (userKey & KScutFlagBitLocked)); + + if (locked) + { + lockedKeys++; + } + else + { + CAiScutSettingsItem* setting = CAiScutSettingsItem::NewLC( + *this, visibleKeys-1, defaultKey); + + setting->ReadL(iRepository); + + User::LeaveIfError(iSettings.Append(setting)); + CleanupStack::Pop(setting); + } + } + + } + + __PRINT( __DBG_FORMAT("XAI: %d keys, %d locked"), count, lockedKeys); + + CleanupStack::PopAndDestroy(&defaultKeys); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::UpdateSettingsContainerL() +{ + if (iContainer) + { + if (iContainer->IsChangeDialogShowing()) + { + iContainer->CloseChangeDialog(); + } + } + + UpdateSettingsL(); + + if (iContainer) + { + iContainer->ResetCurrentListL(0); + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::GetHiddenAppsL() +{ + HBufC* buffer = HBufC::NewLC( + NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr bufferPtr = buffer->Des(); + + iHiddenAppsRepository->Get(KMenuHideApplication, bufferPtr); + + __PRINT( __DBG_FORMAT("XAI: CAiScutSettingsModel::GetHiddenAppsL '%S' "), buffer); + + iHiddenApps.Reset(); + TAiScutAppUidParser uidParser(bufferPtr, iHiddenApps); + uidParser.ParseL(); + + CleanupStack::PopAndDestroy(buffer); +} + +// --------------------------------------------------------------------------- +// From MDesCArray +// Returns the number of descriptor elements in a descriptor array. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::MdcaCount() const +{ + return iSettings.Count(); +} + +// --------------------------------------------------------------------------- +// From MDesCArray +// Indexes into a descriptor array. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutSettingsModel::MdcaPoint(TInt aIndex) const +{ + if (aIndex < 0 || aIndex >= iSettings.Count()) + { + TPtrC ret(KNullDesC); + return ret; + } + + return iSettings[aIndex]->ListBoxLine(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::HandleShortcutsChanged(TAny* aPtr) +{ + __PRINTS( "XAI: CAiScutSettingsModel::HandleShortcutsChanged"); + + if (aPtr) + { + CAiScutSettingsModel* self = static_cast(aPtr); + TRAP_IGNORE(self->UpdateSettingsContainerL()); + } + + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::HandleHiddenAppsChanged(TAny* aPtr) +{ + __PRINTS("XAI: CAiScutSettingsModel::HandleHiddenAppsChanged"); + + if (aPtr) + { + CAiScutSettingsModel* self = static_cast(aPtr); + + TRAP_IGNORE( + self->iAppList->StartL(); + self->GetHiddenAppsL(); + self->UpdateSettingsContainerL() ) // TRAP_IGNORE + } + + return KErrNone; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CAiScutSettingsModel::IsHidden(const TUid& aAppUid) const +{ + if (iHiddenApps.Find(aAppUid) == KErrNotFound) + { + return EFalse; + } + + __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::IsHidden (0x%x) ETrue"), aAppUid); + + return ETrue; +} + +// --------------------------------------------------------------------------- +// From MAiScutListObserver +// Callback for application list events. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::HandleScutListEventL(TScutListEvent aEvent, + TBool /*aAdded*/) +{ + switch (aEvent) + { + case MAiScutListObserver::EAppListReady: + if (iContainer) + { + iContainer->HideWaitNoteDialog(); + } + break; + + case MAiScutListObserver::EAppListUpdated: + case MAiScutListObserver::EBkmListUpdated: + UpdateSettingsContainerL(); + break; + + default: + break; + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::ActivateObservers(TBool aActivate) +{ + TRAP_IGNORE( + if (iAppList) + { + iAppList->SetObservingL(aActivate); + } + if (iBkmList) + { + iBkmList->SetObservingL(aActivate); + } + ) +} + +// --------------------------------------------------------------------------- +// Returns a setting item for the given index. +// --------------------------------------------------------------------------- +// +CAiScutSettingsItem* CAiScutSettingsModel::Item(TInt aIndex) const +{ + if (aIndex >= 0 && aIndex < iSettings.Count()) + { + return iSettings[aIndex]; + } + + return NULL; +} + +// --------------------------------------------------------------------------- +// Utility function to retrieve a bookmark caption from an uid. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::GetBkmCaptionL(const TUid aUid, TDes& aCaption) +{ + CFavouritesItem* favItem = CFavouritesItem::NewLC(); + TInt err = iBookmarkDb.Get(aUid.iUid, *favItem); + if (err == KErrNone) + { + aCaption.Copy(favItem->Name()); + } + + CleanupStack::PopAndDestroy(favItem); + + return err; +} + +// --------------------------------------------------------------------------- +// Utility function to retrieve an appliation caption from an uid. +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::GetAppCaption(const TUid aUid, TDes& aCaption) +{ + TInt err = KErrNone; + TApaAppInfo appInfo; + + err = iApaSession.GetAppInfo(appInfo, aUid); + if (err == KErrNone) + { + aCaption.Copy(appInfo.iCaption); + } + + return err; +} + +// --------------------------------------------------------------------------- +// Returns a pointer to the coe environment. +// --------------------------------------------------------------------------- +// +CCoeEnv* CAiScutSettingsModel::Env() +{ + return iEnv; +} + +// --------------------------------------------------------------------------- +// Handles saving a setting item to central repository. +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::SaveItemL(CAiScutSettingsItem& aItem) +{ + // Stop monitoring own settings changes. + iSettingsNotifier->StopListening(); + + TInt err = aItem.Save(iRepository); + + __PRINT( __DBG_FORMAT( "XAI: CAiScutSettingsModel::SaveItemL key = 0x%x, err = %d"), + aItem.Key(), err); + UpdateSettingsL(); + iSettingsNotifier->StartListeningL(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutSettingsModel::SetContainer(CAiScutSettingsContainer* aContainer) +{ + iContainer = aContainer; +} + +// ----------------------------------------------------------------------------- +// Using the Favorites dB, get the bookmarked pages +// ----------------------------------------------------------------------------- +// +void CAiScutSettingsModel::ReadBookmarksL() +{ + // Get bookmarks + delete iFavItemList; + iFavItemList = NULL; + + iFavItemList = new (ELeave) CFavouritesItemList(); + TInt err = iBookmarkDb.GetAll( + *iFavItemList, KFavouritesNullUid, CFavouritesItem::EItem); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutSettingsModel::BookmarkCount() const +{ + if (iFavItemList) + { + return iFavItemList->Count(); + } + else + { + return 0; + } +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CFavouritesItem* CAiScutSettingsModel::GetBookmark(TInt aIndex) +{ + if (aIndex >= 0 && aIndex < iFavItemList->Count()) + { + + if (iFavItemList) + { + return iFavItemList->At(aIndex); + } + else + { + return NULL; + } + } + else + { + return NULL; + } +} + +// --------------------------------------------------------------------------- +// Returns reference to the bookmark database owned by the engine. +// --------------------------------------------------------------------------- +// +RFavouritesDb& CAiScutSettingsModel::FavouritesDb() +{ + return iBookmarkDb; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsAppList* CAiScutSettingsModel::AppList() +{ + return iAppList; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutSettingsBkmList* CAiScutSettingsModel::BkmList() +{ + return iBkmList; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutshortcut.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutshortcut.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,913 @@ +/* +* 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: Implementation for a shortcut. +* +*/ + + +#include +#include // For CGulIcon +#include // For CFbsBitmap +#include // For RProperty + +#include +#include "aiscutcontentmodel.h" +#include "caiscutshortcut.h" +#include "aiscutdefs.h" +#include "caiscuttargetapp.h" +#include "caiscuttargetbkm.h" +#include "caiscuttargethttp.h" +#include "caiscuttargetmessagingview.h" +#include "caiscuttargetnewmsg.h" +#include "caiscuttargetkeylock.h" +#include "caiscuttargetempty.h" +#include "aiscutpluginprivatecrkeys.h" + +#include "debug.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut::CAiScutShortcut(TInt aId, CAiScutEngine& aEngine) + : CTimer( CActive::EPriorityLow ) + , iId(aId) + , iEngine(aEngine) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcut::ConstructL(const TDesC& aTarget) +{ + iDefaultTarget = CreateTargetL(aTarget, EFalse); + + if (!iDefaultTarget) + { + iDefaultTarget = CAiScutTargetEmpty::NewL(iEngine, EScutUnknown, aTarget); + } + CTimer::ConstructL(); + CActiveScheduler::Add( this ); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* CAiScutShortcut::NewLC(TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine) +{ + CAiScutShortcut* self = new (ELeave) CAiScutShortcut(aId, aEngine); + CleanupStack::PushL(self); + self->ConstructL(aTarget); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut* CAiScutShortcut::NewL(TInt aId, const TDesC& aTarget, + CAiScutEngine& aEngine) +{ + CAiScutShortcut* self = CAiScutShortcut::NewLC(aId, aTarget, aEngine); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcut::~CAiScutShortcut() +{ + Cancel(); + delete iDefaultTarget; + delete iUserTarget; + delete iRetiredTarget; +} + +// ----------------------------------------------------------------------------- +// Returns the shortcut id. +// ----------------------------------------------------------------------------- +// +TInt32 CAiScutShortcut::Id() const +{ + return iId; +} + +// ----------------------------------------------------------------------------- +// Publishes the shortcut content, non leaving version. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::Publish( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver) +{ + TRAPD(err, PublishL(aPlugin, aObserver)); + //Possible forcing done already so reset the flag + iForcePublish = EFalse; + if (err == KErrNone) + { + delete iRetiredTarget; + iRetiredTarget = NULL; + iLastPublishedTarget = iActiveTarget; + } + else + { + // Publish failed, roll back to previous content. + TInt transactionId = reinterpret_cast(this); + aObserver.CancelTransaction(transactionId); + + // Delete the new target and put the retired one back to work. + if (iRetiredTarget) + { + delete iUserTarget; + iUserTarget = iRetiredTarget; + iRetiredTarget = NULL; + } + + iActiveTarget = iLastPublishedTarget; + } + + +} + +// ----------------------------------------------------------------------------- +// Checks if the application or messaging view pointed to can be launched. +// ----------------------------------------------------------------------------- +// +TBool CAiScutShortcut::CheckAccessL(TInt aCheckType) +{ + TBool userTargetAccessible = EFalse; + + __PRINT( __DBG_FORMAT( "XAI: CAiScutShortcut::CheckAccessL( %d )"), aCheckType); + + // First try the user setting if it is defined. + if (iUserTarget && iUserTarget->IsAccessibleL(aCheckType)) + { + iActiveTarget = iUserTarget; + userTargetAccessible = ETrue; + } + + if (!userTargetAccessible) + { + + __PRINTS("XAI: *** user target NOT accessible ***"); + // User setting was not accessible or not defined, try the default. + if (iDefaultTarget->IsAccessibleL(aCheckType)) + { + iActiveTarget = iDefaultTarget; + } + else + { + // The default is not accessible either, the shortcut is empty. + iActiveTarget = NULL; + + __PRINTS( "XAI: *** default target NOT accessible ***"); + } + } + + if (iActiveTarget) + { + return ETrue; + } + else + { + return EFalse; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CAiScutShortcut::IsTargetChanged() const +{ + // We need to publish if target changed during access checking. + return (iLastPublishedTarget != iActiveTarget); +} + +// ----------------------------------------------------------------------------- +// Changes the shortcut target to the user defined setting. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::SetUserTarget(const TDesC& aNewTarget) +{ + + TPtrC defaultTarget(iDefaultTarget->Definition()); + __PRINTS( "XAI: CAiScutShortcut::SetUserTarget"); + __PRINT( __DBG_FORMAT( "XAI: id = 0x%x"), iId); + __PRINT( __DBG_FORMAT( "XAI: default target = '%S'"), &defaultTarget); + __PRINT( __DBG_FORMAT("XAI: new target = '%S'"), &aNewTarget); + if (iUserTarget) + { + TPtrC userTarget(iUserTarget->Definition()); + __PRINT( __DBG_FORMAT("XAI: user target = '%S'"), &userTarget); + } + + + if (iUserTarget && (aNewTarget.CompareC(iUserTarget->Definition()) == 0)) + { + return; + } + + + // Creating the new target might leave, so it is done before the old target + // is deleted to ensure that the shortcut object remains in a consistent state + // in case of a leave. If target creation leaves, nothing has changed. + // + // As a side effect this means that the new target is allocated to a different + // memory address than the old one, the address of the old target will not be re-used + // by this target. That doesn't mean anything for the plug-in, but it helps the + // plug-in tester to notice premature target deletion, since the address will still + // contain 0xDEDEDEDE instead of the new target. + CAiScutTarget* tempTarget = NULL; + + TRAPD(err, tempTarget = CreateTargetL(aNewTarget, ETrue)); + + if (err == KErrNone) + { + DeleteUserTarget(); + iUserTarget = tempTarget; + } +} + +// ----------------------------------------------------------------------------- +// Deletes the user target. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::DeleteUserTarget() +{ + if (iUserTarget) + { + + __PRINTS("XAI: CAiScutShortcut::DeleteUserTarget"); + + if (iLastPublishedTarget == iUserTarget && !(iId & KScutFlagBitNonVisible)) + { + // Previous user target was the last published target so the Ai framework + // is still using the icon pointer. Deleting the target now would cause a + // KERN-EXEC 3 panic when the framework tries to access the deleted icon. + // The target must be kept alive until the new target has been successfully + // published and the framework is no longer using its icon. + // This is unnecessary for non-visible shortcuts because they are not published. + iRetiredTarget = iUserTarget; + iUserTarget = NULL; + + __PRINTS("XAI: iUserTarget = NULL"); + + } + + if (iActiveTarget == iUserTarget) + { + // Previous user target was the active target. We don't know if the new + // user target is accessible, so the shortcut is effectively empty until + // the access check has been run. + iActiveTarget = NULL; + } + + delete iUserTarget; + iUserTarget = NULL; + + __PRINTS( "XAI: delete iUserTarget"); + } +} + +// ----------------------------------------------------------------------------- +// Launches the shortcut. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::LaunchL() +{ + Cancel(); + RProperty::Set( + KPSUidAiInformation, + KActiveIdleLaunch, + EPSAiLaunchIsActive ); + + if (iActiveTarget) + { + TRAP_IGNORE( iActiveTarget->BeginEffectL() ); //start a full screen effect + iActiveTarget->LaunchL(); + } + + // When preparing for backup, the plugin is suspended and calling After() would + // cause a crash + if ( IsAdded() ) + { + After(1000000); + } +} + +// ----------------------------------------------------------------------------- +// Launches the shortcut. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::LaunchL(const TDesC8& aMessage) +{ + Cancel(); + RProperty::Set( + KPSUidAiInformation, + KActiveIdleLaunch, + EPSAiLaunchIsActive ); + + if (iActiveTarget) + { + TRAP_IGNORE( iActiveTarget->BeginEffectL() ); //start a full screen effect + iActiveTarget->LaunchL(aMessage); + } + + // When preparing for backup, the plugin is suspended and calling After() would + // cause a crash + if ( IsAdded() ) + { + After(1000000); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::SetToBePublished(TBool aFlag) +{ + if ( !iForcePublish ) + { + iNeedsToBePublished = aFlag; + } + else + { + iNeedsToBePublished = iForcePublish; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CAiScutShortcut::NeedsToBePublished() +{ + return iNeedsToBePublished; +} + +// ----------------------------------------------------------------------------- +// Return shortcut type. +// ----------------------------------------------------------------------------- +// +TShortcutType CAiScutShortcut::Type() const +{ + if (iUserTarget) + { + return iUserTarget->Type(); + } + else + { + return iDefaultTarget->Type(); + } +} + +// --------------------------------------------------------------------------- +// Return application uid of this shortcut. +// --------------------------------------------------------------------------- +// +TUid CAiScutShortcut::AppUid() const +{ + if (iUserTarget) + { + return iUserTarget->AppUid(); + } + else + { + return iDefaultTarget->AppUid(); + } +} +void CAiScutShortcut::SetIcon(TAiScutIcon aIcon) + { + switch(aIcon.iDestination) + { + case EScutDestinationSoftkey: + SetSoftkeyIcon(aIcon); + break; + case EScutDestinationToolbar: + SetToolbarIcon(aIcon); + break; + case EScutDestinationNormal: + SetOverrideIcon(aIcon); + break; + default: + break; + } + } +void CAiScutShortcut::SetOverrideIcon(TAiScutIcon aIcon) +{ + if (iUserTarget) + { + iUserTarget->SetOverrideIcon(aIcon); + } + else + { + iDefaultTarget->SetOverrideIcon(aIcon); + } +} + +void CAiScutShortcut::SetSoftkeyIcon(TAiScutIcon aIcon) +{ + if (iUserTarget) + { + iUserTarget->SetSoftkeyIcon(aIcon); + } + else + { + iDefaultTarget->SetSoftkeyIcon(aIcon); + } +} + + +void CAiScutShortcut::SetToolbarIcon(TAiScutIcon aIcon) +{ + if (iUserTarget) + { + iUserTarget->SetToolbarIcon(aIcon); + } + else + { + iDefaultTarget->SetToolbarIcon(aIcon); + } +} + + +// ----------------------------------------------------------------------------- +// Creates a shortcut target object. +// ----------------------------------------------------------------------------- +// +CAiScutTarget* CAiScutShortcut::CreateTargetL( + const TDesC& aDefinition, TBool aCreateUserTarget) +{ + + __PRINTS("XAI: CAiScutShortcut::CreateTargetL"); + __PRINT( __DBG_FORMAT("XAI: id = 0x%x, target = '%S'"), iId, &aDefinition); + + CAiScutTarget* target = NULL; + TAiScutParser parser; + TInt err = parser.Parse(aDefinition); + + if (parser.IsValid()) + { + TShortcutType type = parser.Type(); + + switch (type) + { + case EScutApplication: + case EScutChangeTheme: + case EScutApplicationView: + case EScutApplicationWithParams: + case EScutLogsMissedCallsView: + case EScutLogsDialledCallsView: + case EScutLogsReceivedCallsView: + case EScutLogsMainView: + target = CAiScutTargetApp::NewL(iEngine, type, parser); + break; + + case EScutNewMsgType: + case EScutNewMessage: + case EScutNewEmail: +#ifdef __SYNCML_DS_EMAIL + case EScutNewSyncMLMail: +#endif + case EScutNewPostcard: + case EScutNewAudioMsg: + target = CAiScutTargetNewMsg::NewL(iEngine, type, parser); + break; + + case EScutMailbox: + target = CAiScutTargetMessagingView::NewL(iEngine, type, parser); + break; + + case EScutWebAddress: + target = CAiScutTargetHttp::NewL(iEngine, type, parser); + break; + + case EScutKeylock: + target = CAiScutTargetKeyLock::NewL(iEngine, type, aDefinition); + break; + + case EScutNoEffect: + target = CAiScutTargetEmpty::NewL(iEngine, type, aDefinition); + break; + + case EScutBookmark: + target = CAiScutTargetBkm::NewL(iEngine, type, parser); + break; + + case EScutConnectivityStatusView: + target = CAiScutTargetApp::NewL(iEngine, EScutApplicationView, parser); + break; + + case EScutApplicationManagerView: + target = CAiScutTargetApp::NewL(iEngine, EScutApplicationView, parser); + break; + + default: + break; + } + } + + if (!target && aCreateUserTarget) + { + // treat unknown user targets as web addresses. + target = CAiScutTargetHttp::NewL(iEngine, EScutWebAddress, parser); + } + + if (!target) + { + __PRINTS( "XAI: *** empty target ***"); + } + + + return target; +} + +// ----------------------------------------------------------------------------- +// Publishes the shortcut content, leaving version. +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::PublishL( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver) + { + TInt err = KErrNone; + TBool cbaIconPublished = EFalse; + + __PRINT( __DBG_FORMAT("XAI: CAiScutShortcut::PublishL 0x%x"), iId); + + // Publish caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutCaption].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishCaption( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutCaption].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT( "XAI: publish caption err = %d"), err); + } + + // Publish short caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutShortCaption].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishCaption( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutShortCaption].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT( "XAI: publish short caption err = %d"), err); + } + + /** softkeys **/ + // Publish short caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutSkIcon].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishIcon( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutSkIcon].id); + + if ( err == KErrNone ) + { + cbaIconPublished = ETrue; + } + if (err != KErrNone) + __PRINT( __DBG_FORMAT("XAI: publish icon err = %d"), err); + } + + // No CBA icon published so publish the caption + if ( !cbaIconPublished ) + { + // Publish sk caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutSkCaption].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishCaption( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutSkCaption].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT( "XAI: publish short caption err = %d"), err); + } + } + + /** end of softkeys **/ + + // Publish MSK caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutMskCaption].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishCaption( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutMskCaption].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT( "XAI: publish msk caption err = %d"), err); + } + + // Publish icon if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutIcon].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishIcon( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutIcon].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT("XAI: publish icon err = %d"), err); + } + + // Publish toolbar caption if the framework can handle it. + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutToolbarCaption].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishCaption( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutToolbarCaption].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT( "XAI: publish toolbar caption err = %d"), err); + } + + // Publish the toolbar icon if the framework can handle it + if (!aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentShortcutToolbarIcon].id, iId)) + { + err = KErrNotSupported; + } + else + { + err = PublishIcon( + aPlugin, aObserver, KAiScutContent[EAiScutContentShortcutToolbarIcon].id); + + if (err != KErrNone) + __PRINT( __DBG_FORMAT("XAI: publish toolbar icon err = %d"), err); + } + } + +// ----------------------------------------------------------------------------- +// Publishes shortcut caption. +// ----------------------------------------------------------------------------- +// +TInt CAiScutShortcut::PublishCaption(MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver, TInt aCaptionContentId) const +{ + TInt err = KErrNone; + + if (iId == KRightSoftkeyId) + { + if (iActiveCall) + { + TInt backCaptionResId = KAiScutResources[EAiScutResourceBackCaption].id; + err = aObserver.Publish(aPlugin, aCaptionContentId, backCaptionResId, iId); + return err; + } + } + + if (!iActiveTarget) + { + // Publish the EmptyCaption resource id. + TInt emptyCaptionResId = KAiScutResources[EAiScutResourceEmptyCaption].id; + err = aObserver.Publish(aPlugin, aCaptionContentId, emptyCaptionResId, iId); + } + else + { + TPtrC captionDes; + TInt captionResId = 0; + TAiScutAppTitleType titleType = EAiScutLongTitle; + if (aCaptionContentId == KAiScutContent[EAiScutContentShortcutShortCaption].id || + aCaptionContentId == KAiScutContent[EAiScutContentShortcutSkCaption].id || + aCaptionContentId == KAiScutContent[EAiScutContentShortcutToolbarCaption].id) + { + titleType = EAiScutSkeyTitle; + } + else if (aCaptionContentId == KAiScutContent[EAiScutContentShortcutMskCaption].id) + { + titleType = EAiScutMskTitle; + } + + captionResId = iActiveTarget->GetCaption(captionDes, titleType); + + if (captionResId == 0) + { + // Publish descriptor. + err = aObserver.Publish(aPlugin, aCaptionContentId, captionDes, iId); + } + else if (captionResId > 0) + { + // Publish resource. + err = aObserver.Publish(aPlugin, aCaptionContentId, captionResId, iId); + + __PRINT( __DBG_FORMAT("XAI: publish resource = %d"), captionResId); + } + } + + return err; +} + +// ----------------------------------------------------------------------------- +// Publishes shortcut icon. +// ----------------------------------------------------------------------------- +// +TInt CAiScutShortcut::PublishIcon(MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver, TInt aIconContentId ) +{ + TInt emptyIconResId = KAiScutResources[EAiScutResourceEmptyIcon].id; + TInt err = KErrNone; + // In case of an active call cancel the SK icon publication + // to RSK + if ( iActiveCall && iId == KRightSoftkeyId ) + { + return KErrCancel; + } + if (!iActiveTarget) + { + // Publish the EmptyIcon resource id. + + __PRINT( __DBG_FORMAT( "XAI: PublishIcon publish empty #1 = %d"), emptyIconResId); + + err = aObserver.Publish(aPlugin, aIconContentId, emptyIconResId, iId); + } + else + { + CGulIcon* iconPtr = NULL; + TInt iconResId = 0; + // Normal icon + if (aIconContentId == KAiScutContent[EAiScutContentShortcutIcon].id) + { + iconResId = iActiveTarget->GetIcon(iconPtr); + } + // Soft key icon + else if ( aIconContentId == KAiScutContent[EAiScutContentShortcutSkIcon].id ) + { + iconResId = iActiveTarget->GetSoftkeyIcon(iconPtr); + } + else if ( aIconContentId == KAiScutContent[EAiScutContentShortcutToolbarIcon].id ) + { + iconResId = iActiveTarget->GetToolbarIcon(iconPtr); + } + + // No error, continue with the publish + if (iconResId == 0) + { + if (iconPtr) + { + // Publish pointer. + err = aObserver.PublishPtr(aPlugin, aIconContentId, iconPtr, iId); + + if( err != KErrNone ) + { + delete iconPtr; + } + } + else + { + // The target hasn't been able to initialize its icon, publish the empty icon. + + __PRINT( __DBG_FORMAT("XAI: PublishIcon publish empty #2 = %d"), emptyIconResId); + + err = aObserver.Publish(aPlugin, aIconContentId, emptyIconResId, iId); + } + } + // Publish by resource + else if (iconResId > 0) + { + // Publish resource. + + __PRINT( __DBG_FORMAT("XAI: PublishIcon publish resource = %d"), iconResId); + + err = aObserver.Publish(aPlugin, aIconContentId, iconResId, iId); + } + // < 0 error occurred, return it + else + { + err = iconResId; + } + } + + return err; +} + +// ----------------------------------------------------------------------------- +// Set call state +// ----------------------------------------------------------------------------- +// +void CAiScutShortcut::SetCallState(TBool aStatus) +{ + // Call state changed force the publish of RSK + if ( iActiveCall != aStatus ) + { + if ( iId == KRightSoftkeyId ) + { + iForcePublish = ETrue; + } + } + iActiveCall = aStatus; +} + +TPtrC CAiScutShortcut::ActiveDefinition() + { + if( iUserTarget ) + { + return iUserTarget->Definition(); + } + if( iDefaultTarget ) + { + return iDefaultTarget->Definition(); + } + return TPtrC(); + } + +// --------------------------------------------------------------------------- +// Return the possible additional id +// --------------------------------------------------------------------------- +// +TUid CAiScutShortcut::AdditionalUid() const + { + if( iUserTarget ) + { + return iUserTarget->AdditionalUid(); + } + if( iDefaultTarget ) + { + return iDefaultTarget->AdditionalUid(); + } + return TUid::Uid(-1); + } + +// --------------------------------------------------------------------------- +// CActive +// --------------------------------------------------------------------------- +// +TInt CAiScutShortcut::RunError(TInt /*aError*/) + { + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CActive +// --------------------------------------------------------------------------- +// +void CAiScutShortcut::DoCancel() + { + CTimer::DoCancel(); + RProperty::Set( + KPSUidAiInformation, + KActiveIdleLaunch, + EPSAiLaunchNotActive ); + } + +// --------------------------------------------------------------------------- +// CActive +// --------------------------------------------------------------------------- +// +void CAiScutShortcut::RunL() + { + RProperty::Set( + KPSUidAiInformation, + KActiveIdleLaunch, + EPSAiLaunchNotActive ); + } +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutshortcutext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutshortcutext.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,419 @@ +/* +* 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: Shortcut plug-in shortcut extensions +* +*/ + + +#include +#include +#include +#include + +#include "caiscutshortcutext.h" +#include "aiscutcontentmodel.h" +#include "caiscuttarget.h" +#include "caiscutengineext.h" +#include "PopupFSM.h" +#include "cpopupeventhandler.h" +#include "maiscutextdata.h" +#include "activeidle2domainpskeys.h" + +#include "debug.h" + + +// P&S access policies +_LIT_SECURITY_POLICY_C1( KAiScutReadPolicy, ECapabilityReadDeviceData ); +_LIT_SECURITY_POLICY_C1( KAiScutWritePolicy, ECapabilityWriteDeviceData ); + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutExt* CAiScutShortcutExt::NewL( + TInt aId, const TDesC& aTarget, CAiScutEngine& aEngine ) + { + CAiScutShortcutExt* self = CAiScutShortcutExt::NewLC( + aId, aTarget, aEngine ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutExt* CAiScutShortcutExt::NewLC( + TInt aId, const TDesC& aTarget, CAiScutEngine& aEngine ) + { + CAiScutShortcutExt* self = new( ELeave ) CAiScutShortcutExt( + aId, aEngine ); + CleanupStack::PushL( self ); + self->ConstructL( aTarget ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutExt::~CAiScutShortcutExt() + { + delete iPopupEventHandler; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutExt::CAiScutShortcutExt( TInt aId, CAiScutEngine& aEngine ) + : CAiScutShortcut( aId, aEngine )//, + //iPublishLineArray( EFalse ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::ConstructL( const TDesC& aTarget ) + { + iPopupEventHandler = CPopupEventHandler::NewL( *this ); + CAiScutShortcut::ConstructL( aTarget ); + + RProperty::Define( + KPSUidAiInformation, + KActiveIdleThemeSupportsXsp, + RProperty::EInt, + KAiScutReadPolicy, + KAiScutWritePolicy ); + RProperty::Set( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, EPSAiXspNotSupported ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TPtrC CAiScutShortcutExt::ActiveTargetDefinition() const + { + if( iActiveTarget ) + { + return iActiveTarget->Definition(); + } + return KNullDesC(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::HandleAIEventL( TInt aEvent ) + { + switch ( aEvent ) + { + case EAiScutEventLoseFocus: + { + iPopupEventHandler->PopupFSM().HandleLostFocus(); + break; + } + case EAiScutEventGainFocus: + { + iPopupEventHandler->PopupFSM().HandleGotFocus(); + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::HandleResumed( TAiTransitionReason aResumeReason ) + { + switch( aResumeReason ) + { + case EAiIdleBackground: + { + iPopupEventHandler->PopupFSM().HandleBackground(); + break; + } + case EAiIdleForeground: + { + // Handleforeground() calls unnecessary publishes in case nothing + // has changed. + if ( iTextChanged || iIconChanged ) + { + iPopupEventHandler->PopupFSM().HandleForeground(); + } + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::SetAiScutExtData( + const MAiScutExtData* aAiScutExtData ) + { + iAiScutExtData = aAiScutExtData; + + const MDesCArray* newPopupLineArray = + aAiScutExtData ? aAiScutExtData->PopupLineArray() : NULL; + const CGulIcon* newIcon = + aAiScutExtData ? aAiScutExtData->Icon() : NULL; + + if( iPreviousPopupLineArray != newPopupLineArray && + newPopupLineArray ) + { + iTextChanged = ETrue; + iPopupEventHandler->PopupFSM().HandleUpdate(); + } + else if( iPreviousPopupLineArray && !newPopupLineArray ) + { + iTextChanged = ETrue; + iPopupEventHandler->PopupFSM().HandleReset(); + } + + if( iPreviousIcon != newIcon ) + { + iIconChanged = ETrue; + CAiScutEngineExt& engine = static_cast< CAiScutEngineExt& > ( iEngine ); + engine.CheckAccessAndPublish( *this ); + } + + iPreviousPopupLineArray = newPopupLineArray; + iPreviousIcon = newIcon; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::PublishL( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver ) + { + if( iLastPublishedTarget && iActiveTarget && + iLastPublishedTarget->Definition() != iActiveTarget->Definition() ) + { + iAiScutExtData = NULL; + iPopupEventHandler->PopupFSM().HandleReset(); + } + + if( aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentPopupTextFirstLine].id, iId) && + aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentPopupTextSecondLine].id, iId) && + aObserver.CanPublish( + aPlugin, KAiScutContent[EAiScutContentPopupTextThirdLine].id, iId) ) + { + PublishPopupText( aPlugin, aObserver ); + RProperty::Set( KPSUidAiInformation, KActiveIdleThemeSupportsXsp, EPSAiXspIsSupported ); + } + + CAiScutShortcut::PublishL( aPlugin, aObserver ); + iTextChanged = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutShortcutExt::PublishCaption( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver, + TInt aCaptionContentId ) const + { + if( iPopupEventHandler->PublishCaption() ) + { + if( !iPopupEventHandler->CaptionVisible() ) + { + return aObserver.Clean( aPlugin, aCaptionContentId, iId ); + } + else + { + return CAiScutShortcut::PublishCaption( + aPlugin, aObserver, aCaptionContentId ); + } + } + else + { + return CAiScutShortcut::PublishCaption( + aPlugin, aObserver, aCaptionContentId ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::PublishPopupText( + MAiPropertyExtension& aPlugin, MAiContentObserver& aObserver ) const + { + if( iPopupEventHandler->PublishPopup() ) + { + TAiScutContentIds popupTextContentIds[] = + { + EAiScutContentPopupTextFirstLine, + EAiScutContentPopupTextSecondLine, + EAiScutContentPopupTextThirdLine + }; + const TInt idCount = + sizeof( popupTextContentIds ) / sizeof( TAiScutContentIds ); + + TInt err = KErrNone; + + //iLineArray is set or reset via xSP API. iPublishLineArray is controlled + //by state machine in iPopupEventHandler + if( iAiScutExtData && iAiScutExtData->PopupLineArray() && + iPopupEventHandler->PopupVisible() ) + { + //Publish caption line in popup text box + TPtrC captionDes; + TInt captionResId = iActiveTarget->GetCaption( captionDes, EAiScutLongTitle ); + + if ( captionResId == 0 ) + { + // Publish descriptor + err = aObserver.Publish( aPlugin, + KAiScutContent[ EAiScutContentPopupTextCaptionLine ].id, + captionDes, iId ); + if( err != KErrNone ) + { + __PRINT( __DBG_FORMAT( "XAI: publish Popup caption text err = %d" ), err ); + } + } + else if ( captionResId > 0 ) + { + // Publish resource + err = aObserver.Publish( aPlugin, + KAiScutContent[ EAiScutContentPopupTextCaptionLine ].id, + captionResId, iId ); + if( err != KErrNone ) + { + __PRINT( __DBG_FORMAT( "XAI: publish Popup caption text (resource) err = %d" ), err ); + } + } + + const MDesCArray& lineArray = *iAiScutExtData->PopupLineArray(); + TInt numberOfLines = lineArray.MdcaCount(); + //Iterate each popup text content and either publish or clean it + //depending on the number or lines in iLineArray + for( TInt i = 0; i < idCount; i++ ) + { + if( numberOfLines > i ) + { + err = aObserver.Publish( aPlugin, + KAiScutContent[ popupTextContentIds[ i ] ].id, + lineArray.MdcaPoint( i ), iId ); + if( err != KErrNone ) + { + __PRINT( __DBG_FORMAT( "XAI: publish Popup text err = %d" ), err ); + } + } + else + { + err = aObserver.Clean( aPlugin, + KAiScutContent[ popupTextContentIds[ i ] ].id, iId ); + if( err != KErrNone ) + { + __PRINT( __DBG_FORMAT( "XAI: clean Popup text err = %d" ), err ); + } + } + } + } + else + { + //Clean each popup text content + for( TInt i = 0; i < idCount; i++ ) + { + err = aObserver.Clean( aPlugin, + KAiScutContent[ popupTextContentIds[ i ] ].id, iId ); + if ( err != KErrNone ) + { + __PRINT( __DBG_FORMAT( "XAI: clean Popup text err = %d" ), err ); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt CAiScutShortcutExt::PublishIcon( MAiPropertyExtension& aPlugin, + MAiContentObserver& aObserver, TInt aIconContentId ) + { + if( aIconContentId == KAiScutContent[EAiScutContentShortcutIcon].id && + iAiScutExtData && iAiScutExtData->Icon() ) + { + const CGulIcon& icon = *iAiScutExtData->Icon(); + CGulIcon* duplicatedIcon = NULL; + TRAP_IGNORE( + CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap(); + CleanupStack::PushL( bitmap ); + CFbsBitmap* mask = new( ELeave ) CFbsBitmap(); + CleanupStack::PushL( mask ); + + User::LeaveIfError( bitmap->Duplicate( icon.Bitmap()->Handle() ) ); + User::LeaveIfError( mask->Duplicate( icon.Mask()->Handle() ) ); + + duplicatedIcon = CGulIcon::NewL( bitmap, mask ); + + CleanupStack::Pop( 2, bitmap ); + ); + + if( duplicatedIcon ) + { + TInt err = aObserver.PublishPtr( aPlugin, + aIconContentId, duplicatedIcon, iId ); + if( err != KErrNone ) + { + delete duplicatedIcon; + } + return err; + } + } + + TInt err = CAiScutShortcut::PublishIcon( aPlugin, aObserver, aIconContentId ); + iIconChanged = EFalse; + return err; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutExt::IssuePublishShortcut() + { +// iPublishLineArray = aVisiblePopup; + CAiScutEngineExt& engine = static_cast< CAiScutEngineExt& >( iEngine ); + engine.CheckAccessAndPublish( *this ); + } + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscutshortcutinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscutshortcutinfo.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +/* +* 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: Small container for shortcut info. +* +*/ + + +#include "caiscutshortcutinfo.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutInfo::CAiScutShortcutInfo(TInt aId) + : iId(aId) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutShortcutInfo::ConstructL(const TDesC& aTarget) +{ + iTarget = aTarget.AllocL(); +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutInfo* CAiScutShortcutInfo::NewL(TInt aId, const TDesC& aTarget) +{ + CAiScutShortcutInfo* self = new(ELeave) CAiScutShortcutInfo(aId); + CleanupStack::PushL(self); + self->ConstructL(aTarget); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutShortcutInfo::~CAiScutShortcutInfo() +{ + delete iTarget; +} + +// ----------------------------------------------------------------------------- +// Returns the shortcut id. +// ----------------------------------------------------------------------------- +// +TInt32 CAiScutShortcutInfo::Id() const +{ + return iId; +} + +// ----------------------------------------------------------------------------- +// Returns the shortcut target string. +// ----------------------------------------------------------------------------- +// +const TDesC& CAiScutShortcutInfo::Target() + { + if( iTarget ) + return *iTarget; + else + return KNullDesC; + } + +// Eof diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttarget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttarget.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,243 @@ +/* +* 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: Base class for shortcut target +* +*/ + + +#include "caiscutengine.h" +#include "caiscuttarget.h" +#include +#include // For AknsUtils +#include +#include +#include +#include // For CAknTaskList +#include // For CApaWindowGroupName +#include // For Transition effect +#include +#include + +// ======== MEMBER FUNCTIONS ======== +_LIT(KFileLoadDir,"z:\\resource\\"); +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTarget::CAiScutTarget(CAiScutEngine& aEngine, TShortcutType aType) + : iEngine(aEngine) + , iType(aType) +{ +} + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTarget::~CAiScutTarget() +{ + +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTarget::GetCaption(TPtrC& /*aDes*/, TAiScutAppTitleType /*aTitleType*/) const +{ + // Default implementation. + return KErrNotSupported; +} + +TUid CAiScutTarget::AdditionalUid() const + { + return TUid::Uid(-1); + } + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTarget::GetIcon(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon ) const +{ + TInt err = KErrNotSupported; + + if ( aIconToLoad.iType == EScutIconSkin ) + { + TRAP(err, LoadIconFromSkinL(aIconToLoad, aIcon)); + } + else if ( aIconToLoad.iType == EScutIconMif ) + { + TRAP(err, LoadIconFromFileL(aIconToLoad, aIcon)); + } + else if ( aIconToLoad.iType == EScutIconMbm ) + { + TRAP(err, LoadIconFromFileL(aIconToLoad, aIcon)); + } + + return err; +} + +TInt CAiScutTarget::GetIcon(CGulIcon*& aIcon) const + { + return GetIcon(iOverrideIcon, aIcon); + } + +TInt CAiScutTarget::GetSoftkeyIcon(CGulIcon*& aIcon) const + { + return GetIcon(iSoftkeyIcon, aIcon); + } + +TInt CAiScutTarget::GetToolbarIcon(CGulIcon*& aIcon) const + { + return GetIcon(iToolbarIcon, aIcon); + } + +void CAiScutTarget::SetOverrideIcon(TAiScutIcon aIcon) + { + iOverrideIcon = aIcon; + } + +void CAiScutTarget::SetSoftkeyIcon(TAiScutIcon aIcon) + { + iSoftkeyIcon = aIcon; + } + +void CAiScutTarget::SetToolbarIcon(TAiScutIcon aIcon) + { + iToolbarIcon = aIcon; + } + +void CAiScutTarget::LoadIconFromSkinL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* bitmapMask = NULL; + + // With colour group support + if ( aIconToLoad.iColourGroup >= EAknsCIQsnTextColorsCG1 && + aIconToLoad.iColourGroup <= EAknsCIQsnTextColorsCG62) + { + + AknsUtils::CreateColorIconLC( + AknsUtils::SkinInstance(), + aIconToLoad.iSkinId, + KAknsIIDQsnTextColors, + aIconToLoad.iColourGroup, + bitmap, + bitmapMask, + KNullDesC, /* no backup */ + 0, /* no backup */ + 0, /* no backup */ + KRgbBlack ); + + if ( bitmap ) + { + aIcon = CGulIcon::NewL( bitmap, bitmapMask ); + } + CleanupStack::Pop( 2 ); // bitmap, bitmapMask + } + // no colour group support + else + { + aIcon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), aIconToLoad.iSkinId, KNullDesC, 0, 0 ); + } + if ( !aIcon ) + { + User::Leave( KErrNotFound ); + } + } + +void CAiScutTarget::LoadIconFromFileL(const TAiScutIcon &aIconToLoad, CGulIcon*& aIcon) const + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* bitmapMask = NULL; + TFileName actualPath; + TInt iconIndexStart = 0; + + if ( aIconToLoad.iType == EScutIconMif ) + { + iconIndexStart = KMifIdFirst; + } + actualPath.Append(KFileLoadDir); + actualPath.Append(aIconToLoad.iPath); + + RFs fs; fs.Connect(); + if ( aIconToLoad.iIconId < 0 || !BaflUtils::FileExists(fs, actualPath)) + { + fs.Close(); + User::Leave( KErrNotFound ); + } + fs.Close(); + // Mask is next after bitmap + AknIconUtils::CreateIconLC(bitmap,bitmapMask, actualPath, + aIconToLoad.iIconId+iconIndexStart, aIconToLoad.iIconId+iconIndexStart+1); + + + aIcon = CGulIcon::NewL(bitmap, bitmapMask); + + CleanupStack::Pop(bitmapMask); + CleanupStack::Pop(bitmap); + + if ( !aIcon ) + { + User::Leave( KErrNotFound ); + } + + } + +// --------------------------------------------------------------------------- +// Returns the shortcut target type. +// --------------------------------------------------------------------------- +// +TShortcutType CAiScutTarget::Type() const +{ + return iType; +} + +// --------------------------------------------------------------------------- +// Determines which effect should be shown, and starts it. +// --------------------------------------------------------------------------- +// +void CAiScutTarget::BeginEffectL() + { + RWsSession& aWs = iEngine.Env()->WsSession(); + TUid appUid = AppUid(); + TInt effectType = AknTransEffect::EApplicationStart; + CAknTaskList* taskList = CAknTaskList::NewL( aWs ); + TApaTask task = taskList->FindRootApp( appUid ); + delete taskList; + + if ( task.Exists() ) + { + TBool inHiddenList = iEngine.IsHiddenFromFSW(appUid); + CApaWindowGroupName* wgName = CApaWindowGroupName::NewL( aWs, task.WgId() ); + wgName->SetAppUid( appUid ); + const TBool isHidden = wgName->Hidden() || inHiddenList; + delete wgName; + + if (!isHidden) + { + effectType = AknTransEffect::EApplicationStartSwitchRect; + } + + //start a full screen effect + GfxTransEffect::BeginFullScreen( effectType, + TRect(0,0,0,0), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( appUid, + AknTransEffect::TParameter::EActivateExplicitContinue ) ); + } + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetapp.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,633 @@ +/* +* 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: Class for application shortcut target +* +*/ + + +#include // For CCoeEnv +#include // For RWsSession +#include +#include +#include // For CApaCommandLine +#include // For TApaTaskList +#include // For CApaWindowGroupName +#include // For CGulIcon +#include // For AknsUtils +#include // For CAknTaskList +#include // For Transition effect +#include +#include // For CVwsSessionWrapper +#include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +#include +#include +#include +#include +#include + +#include +//#include +#include + +#include + +#include "aiscutcontentmodel.h" +#include "caiscuttargetapp.h" +#include "caiscutengine.h" + +#include +#include "debug.h" + +#include + +const TInt KIconSizeArray = 4; + +// ======== MEMBER FUNCTIONS ================================================= + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetApp::CAiScutTargetApp( + CAiScutEngine& aEngine, TShortcutType aType, const TUid aUid) + : CAiScutTarget(aEngine, aType) + , iAppUid(aUid) + { + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetApp::ConstructL(const TAiScutParser& aParser) + { + iDefinition = aParser.Get(EScutDefComplete).AllocL(); + + iViewUid.iUid = -1; + + switch (Type()) + { + case EScutApplicationView: + case EScutChangeTheme: + if (iAppUid == KScutAppShellUid) + { + iViewUid.iUid = 1; // activate always appshell main view. + } + else + { + iViewUid = TAiScutParser::ParseUid(aParser.Get(EScutDefParamValue)); + } + break; + + case EScutLogsMissedCallsView: + iMsg = TPtrC8(KLogsMissedCallsView).AllocL(); + break; + + case EScutLogsDialledCallsView: + iMsg = TPtrC8(KLogsDialledCallsView).AllocL(); + break; + + case EScutLogsReceivedCallsView: + iMsg = TPtrC8(KLogsReceivedCallsView).AllocL(); + break; + + case EScutLogsMainView: + iMsg = TPtrC8(KLogsMainView).AllocL(); + break; + + case EScutApplicationWithParams: + { + TPtrC ptr = aParser.Get(EScutDefParamNameAndValue); + iMsg = EscapeUtils::ConvertFromUnicodeToUtf8L(ptr); + break; + } + + default: + break; + } + + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetApp* CAiScutTargetApp::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) + { + CAiScutTargetApp* self = + new (ELeave) CAiScutTargetApp(aEngine, aType, aParser.Uid()); + + CleanupStack::PushL(self); + self->ConstructL(aParser); + + CleanupStack::Pop(self); + + return self; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetApp::~CAiScutTargetApp() + { + delete iCaption; + delete iShortCaption; + delete iMsg; + delete iDefinition; + } + + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetApp::Definition() const + { + return iDefinition ? TPtrC(*iDefinition) : TPtrC(); + } + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetApp::GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const + { + TRAP_IGNORE(GetCaptionL(aTitleType)); + + if (aTitleType == EAiScutSkeyTitle) + { + aDes.Set(iShortCaption ? *iShortCaption : KNullDesC()); + } + else + { + aDes.Set(iCaption ? *iCaption : KNullDesC()); + } + + return 0; + } + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +void CAiScutTargetApp::GetCaptionL(TAiScutAppTitleType aTitleType) const + { + TApaAppInfo appInfo; + + // Use lazy evaluation, create the caption only when it is first needed. + if (aTitleType == EAiScutSkeyTitle) + { + if( !iShortCaption ) + { + iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); + iShortCaption = appInfo.iShortCaption.AllocL(); + } + } + else + { + if (!iCaption) + { + iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); + iCaption = appInfo.iCaption.AllocL(); + } + } + } + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetApp::GetIcon(CGulIcon*& aIcon) const + { + // First try to make the override icon + // if not successful then do it ourself + if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) + { + TRAP_IGNORE(CreateAppIconL(aIcon)); + } + + + return 0; + } + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon for toolbar. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetApp::GetToolbarIcon(CGulIcon*& aIcon) const + { + if ( CAiScutTarget::GetToolbarIcon(aIcon) != KErrNone) + { + TRAP_IGNORE(CreateAppIconL(aIcon)); + } + + return 0; + } + +// --------------------------------------------------------------------------- +// Creates the application icon. +// --------------------------------------------------------------------------- +// + +void CAiScutTargetApp::CreateAppIconL(CGulIcon*& aIcon) const + { + // To make sure we won't end up with a partially created icon, we first create + // a temporary icon and take it into use only when it is propertly initialized. + CGulIcon* tempIcon = NULL; + TInt err = KErrNone; + + // If no scalable icon support is available then the icon is constructed the "old way" + // java icon separately from the native icon. If the support is available then the + // java icon is constructed the same way the native icon is constructed. + + const TBool isNonNative = iEngine.IsNonNative(iAppUid); + + // First try to create a normal non-native icon + if (isNonNative) + { + TRAP(err, + tempIcon = CreateNonNativeIconL() + ); + // Just to be sure + if (err != KErrNone) + { + tempIcon = NULL; + } + } + // No icon yet so either native icon or non-native SVG icon. + if (!tempIcon) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ((iAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId) + || (iAppUid == KScutGeneralSettingsUid && (iViewUid == KScutInstallationViewId + || iViewUid == KScutConnectivityViewId)) + ) + { + tempIcon = CreateSubstituteIconL(skin, iAppUid, iViewUid); + } + else + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + AknsUtils::CreateAppIconLC(skin, iAppUid, EAknsAppIconTypeList, bitmap, mask); + if (bitmap) + { + tempIcon = CGulIcon::NewL(bitmap, mask); + CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number + // because the order in which they are pushed in is undefined. + } + + } + + } + + aIcon = tempIcon; + } + + +CGulIcon* CAiScutTargetApp::CreateSubstituteIconL( MAknsSkinInstance* aSkin, TUid aAppUid, TUid iViewUid ) const + { + CGulIcon* tempIcon = NULL; + TParse* parse = new (ELeave) TParse; + CleanupStack::PushL(parse); + parse->Set(KBitmapFile, &KDC_APP_BITMAP_DIR, NULL); + HBufC* fileName = parse->FullName().AllocLC(); + TPtr fileNamePtr = fileName->Des(); + + //change idle theme + if (aAppUid == KScutPersonalisationUid && iViewUid == KScutChangeThemeViewId) + { + tempIcon = AknsUtils::CreateGulIconL( + aSkin, + KAknsIIDQgnPropPslnAiSub, + fileNamePtr, + EMbmAiscutpluginQgn_prop_psln_ai_sub, + EMbmAiscutpluginQgn_prop_psln_ai_sub_mask); + } + //appmngr + else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutInstallationViewId) + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + AknsUtils::CreateAppIconLC(aSkin, KScutAppMngrUid, EAknsAppIconTypeList, bitmap, mask); + + // The icon may reside in cache so we need to exclude in order + // for updated icons to be loaded properly. + AknIconUtils::ExcludeFromCache( bitmap ); + if (bitmap) + { + tempIcon = CGulIcon::NewL(bitmap, mask); + CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number + // because the order in which they are pushed in is undefined. + } + } + //connectivity view + else if(aAppUid == KScutGeneralSettingsUid && iViewUid == KScutConnectivityViewId) + { + tempIcon = AknsUtils::CreateGulIconL( + aSkin, + KAknsIIDQgnPropAiShortcut, + fileNamePtr, + EMbmAiscutpluginQgn_prop_cp_conn_shortcut, + EMbmAiscutpluginQgn_prop_cp_conn_shortcut_mask); + } + else + { + //never should go here! + } + + CleanupStack::PopAndDestroy(2, parse); // fileName, parse + return tempIcon; + } + +// --------------------------------------------------------------------------- +// Creates the NonNative application icon. +// --------------------------------------------------------------------------- +// + +CGulIcon* CAiScutTargetApp::CreateNonNativeIconL() const + { + CApaMaskedBitmap* maskedbitmap = CApaMaskedBitmap::NewLC(); + + CArrayFixFlat* sizesArray = new (ELeave) CArrayFixFlat(KIconSizeArray); + CleanupStack::PushL(sizesArray); + + TInt err = iEngine.ApaSession().GetAppIconSizes(iAppUid, *sizesArray); + + // If there is no error and there is something in array + // use first icon size and get an icon. + if (!err && sizesArray->Count()) + { + err = iEngine.ApaSession().GetAppIcon(iAppUid, sizesArray->At(0), *maskedbitmap); + } + + // If there was an error, delete every allocated object and leave. + if (err) + { + CleanupStack::PopAndDestroy(sizesArray); + CleanupStack::PopAndDestroy(maskedbitmap); + User::Leave(err); + } + + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(bitmap); + CFbsBitmap* mask = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(mask); + + User::LeaveIfError(bitmap->Duplicate(maskedbitmap->Handle())); + User::LeaveIfError(mask->Duplicate(maskedbitmap->Mask()->Handle())); + + CGulIcon* icon = CGulIcon::NewL(bitmap, mask); + //icon->SetBitmapsOwnedExternally(ETrue); + + CleanupStack::Pop(mask); + CleanupStack::Pop(bitmap); + + CleanupStack::PopAndDestroy(sizesArray); + CleanupStack::PopAndDestroy(maskedbitmap); + + return icon; + } + +// --------------------------------------------------------------------------- +// Checks if the target application is accessible. +// --------------------------------------------------------------------------- +// +TBool CAiScutTargetApp::IsAccessibleL(TInt /*aCheckType*/) + { + if (iAppUid == KNullUid || iEngine.IsHidden(iAppUid)) + { + return EFalse; + } + + TApaAppInfo appInfo; + TInt ret = iEngine.ApaSession().GetAppInfo(appInfo, iAppUid); + + if (ret == RApaLsSession::EAppListInvalid) + { + // Application list not fully populated yet. Leave with KErrNotReady so + // the engine can trap it and start the timer to check accessiblity later. + User::Leave(KErrNotReady); + } + + return (ret == KErrNone); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetApp::LaunchL() + { + LaunchL( KNullDesC8 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetApp::LaunchL( const TDesC8& aCustomMessage ) + { + __PRINTS( "XAI: CAiScutShortcut::LaunchL"); + __PRINT( __DBG_FORMAT("XAI: type = %d"), Type()); + + if (iAppUid != KNullUid) + { + + // Some special cases + // --------------------------------- + if( Type() == EScutApplicationView && + iAppUid == KScutGeneralSettingsUid ) + { + CGSLauncher* l = CGSLauncher::NewLC(); + l->LaunchGSViewL ( iViewUid, + KScutActiveIdleUid, + aCustomMessage ); + CleanupStack::PopAndDestroy( l ); + + return; + } + else if ( ( ( Type() == EScutChangeTheme) && ( iAppUid == KScutPersonalisationUid ) ) || // For AI2 Themes + ( iAppUid == KScutDiallerUid ) ) // Dialer + { + const TVwsViewId viewId(iAppUid, iViewUid); + TUid msgId = KScutGeneralSettingsUid; + + if( iAppUid == KScutDiallerUid ) + { + msgId = KScutDiallerViewCommand; + RProperty::Set(KPSUidAiInformation, KActiveIdleState, EPSAiNumberEntry ); + } + + TInt err = iEngine.VwsSession()->CreateActivateViewEvent( viewId, msgId, aCustomMessage ); + + return; + } + + TBool exists = EFalse; + + CAknTaskList* taskList = CAknTaskList::NewL(iEngine.Env()->WsSession()); + TApaTask task(taskList->FindRootApp(iAppUid)); + delete taskList; + + exists = task.Exists(); + + // If not found, try again little harder + // ---------------------------------------- + if (!exists) + { + RWsSession wsSession = iEngine.Env()->WsSession(); + task.SetWgId(0); // Set task to non-existant task + TInt wgId=0; + CApaWindowGroupName::FindByAppUid(iAppUid, wsSession, wgId); + + if (wgId != KErrNotFound) + { + exists = ETrue; + task.SetWgId(wgId); + } + } + + // Actual reactivatio / starting + // ----------------------------- + if (exists) // Found, reactivate + { + if (iMsg && iMsg->Length()) + { + task.SendMessage(KNullUid, *iMsg); + } + if ( iAppUid == KScutAppShellUid ) // AppShell effect is an exception + { + //start different fullscreen effect when launching appshell + GfxTransEffect::BeginFullScreen( AknTransEffect::EApplicationActivate , + TRect(0,0,0,0), + AknTransEffect::EParameterType, + AknTransEffect::GfxTransParam( iAppUid, + AknTransEffect::TParameter::EActivateExplicitContinue ) ); + } + + if( iAppUid == KScutAppShellUid ) // Appshell starting is an exception + { + task.SendMessage( KUidApaMessageSwitchOpenFile , KNullDesC8 ); + } + else + { + // If message was sent, don't try to bring task to foreground as task will do it itself + if ( !( (iAppUid == KScutLogsUid) && (iMsg && iMsg->Length() > 0)) ) + { + CAknSgcClient::MoveApp(task.WgId(), ESgcMoveAppToForeground); + } + } + } + else // Not exists, starting + { + TApaAppInfo appInfo; + + if (iEngine.ApaSession().GetAppInfo(appInfo, iAppUid) == KErrNone) + { + if (FeatureManager::FeatureSupported(KFeatureIdCommonVoip) && + (iAppUid == KScutEasyVoIPApplicationUid) ) + { + SetEasyVoIPShortcutStartL(); + } + + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL(appInfo.iFullName); + if (iMsg && iMsg->Length()) + { + cmdLine->SetCommandL(EApaCommandRun); + cmdLine->SetTailEndL(*iMsg); + } + if (iBackground) + { + cmdLine->SetCommandL(EApaCommandBackground); + } + if ( iAppUid == KScutVoiceDialUid ) + { + cmdLine ->SetCommandL( EApaCommandRunWithoutViews ); + } + + TInt err = iEngine.ApaSession().StartApp(*cmdLine); + + + __PRINT( __DBG_FORMAT("XAI: StartApp err = %d"), err); + + User::LeaveIfError(err); + + CleanupStack::PopAndDestroy(cmdLine); + } + } + } + } + + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetApp::AppUid() const + { + +#ifdef __WEB_WIDGETS + // for widgets return widgetapp uid. + if (iEngine.IsWidget(iAppUid)) + { + return KUidWidgetUi; + } +#endif + + return iAppUid; + } + +// --------------------------------------------------------------------------- +// Return the view id +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetApp::AdditionalUid() const + { + return iViewUid; + } + +// --------------------------------------------------------------------------- +// CScShortcutNativeApp::SetEasyVoIPShortcutStartL() +// +// Performs Central Repository shortcut set for EasyVoIP application. +// --------------------------------------------------------------------------- +// +void CAiScutTargetApp::SetEasyVoIPShortcutStartL() const + { + CRepository* repository = CRepository::NewL(KUidEasyVoIPRepository); + CleanupStack::PushL(repository); + + // Set shortcut start for EasyVoIP application. + TInt error = repository->Set(KEasyVoIPShortcutStartup, 1); + User::LeaveIfError(error); + + CleanupStack::PopAndDestroy(repository); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetbkm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetbkm.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,247 @@ +/* +* 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: Class for bookmark shortcut target +* +*/ + + +#include // For CCoeEnv +#include // For RWsSession +#include // For TApaTaskList +#include // For CGulIcon +#include // For AknsUtils +#include + +#include "aiscutcontentmodel.h" +#include "caiscuttargetbkm.h" +#include "caiscutengine.h" +#include + +#include "debug.h" + + + +_LIT16(KParam, "1 "); +const TInt KTBUF16 = 16; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetBkm::CAiScutTargetBkm(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetBkm::ConstructL(const TAiScutParser& aParser) +{ + iDefinition = aParser.Get(EScutDefComplete).AllocL(); + iBkmUid = aParser.ParseUid(aParser.Get(EScutDefParamValue)); +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetBkm* CAiScutTargetBkm::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) +{ + CAiScutTargetBkm* self = new (ELeave) CAiScutTargetBkm(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aParser); + CleanupStack::Pop(self); + + return self; +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetBkm::~CAiScutTargetBkm() +{ + delete iCaption; + delete iDefinition; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetBkm::Definition() const +{ + return iDefinition ? TPtrC(*iDefinition) : TPtrC(); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetBkm::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const +{ + // Use lazy evaluation, create the caption only when it is first needed. + if (!iCaption) + { + // Get the caption. + TRAP_IGNORE(GetCaptionL()); + } + + aDes.Set(iCaption ? *iCaption : KNullDesC()); + + return 0; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +void CAiScutTargetBkm::GetCaptionL() const +{ + RFavouritesDb& db = iEngine.FavouritesDb(); + + CFavouritesItem* favItem = CFavouritesItem::NewLC(); + TInt err = db.Get(iBkmUid.iUid, *favItem); + iCaption = favItem->Name().AllocL(); + + CleanupStack::PopAndDestroy(favItem); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetBkm::GetIcon(CGulIcon*& aIcon) const +{ + if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) + { + + CGulIcon* tempIcon = NULL; + + TFileName pluginIconFile(KDC_APP_BITMAP_DIR); + pluginIconFile.Append(KBitmapFile); + + TRAP_IGNORE( + tempIcon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropAiShortcut, + pluginIconFile, + EMbmAiscutpluginQgn_menu_url, + EMbmAiscutpluginQgn_menu_url_mask + ) + ); + + aIcon = tempIcon; + } + + return 0; +} + +// ----------------------------------------------------------------------------- +// Checks if the target bookmark is accessible. +// ----------------------------------------------------------------------------- +// +TBool CAiScutTargetBkm::IsAccessibleL(TInt /*aCheckType*/) +{ + if (iBkmUid == KNullUid) + { + return EFalse; + } + + // Search bookmark from favourites. + RFavouritesDb& db = iEngine.FavouritesDb(); + + TBool exists = EFalse; + TInt err = db.ItemExists(iBkmUid.iUid, exists); + if (err != KErrNone) + { + exists = EFalse; + } + + return exists; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAiScutTargetBkm::LaunchL() +{ +/* +1. Start/Continue the browser and nothing is specified (the default case) Parameter = +2. Start/Continue the browser specifying a Bookmark Parameter = "1"+""+"" +3. Start/Continue the browser specifying a Saved deck Parameter = "2"+""+"" +4. Start/Continue the browser specifying a URL Parameter = "4"+""+"" +5. Start/Continue the browser specifying a URL and an Access Point Parameter = "4"+""+""+""+"" +6. Start/Continue the browser with the start page. + (Used when starting the browser with a long press of "0" in the + Idle state of the phone. Parameter = "5" +7. Start/Continue the browser specifying a Bookmark folder Parameter = "6"+""+"" +*/ + + TApaTaskList taskList(iEngine.Env()->WsSession()); + TApaTask task = taskList.FindApp(KScutBrowserUid); + + + TBuf param(KParam); + param.AppendNum(iBkmUid.iUid); + + __PRINT( __DBG_FORMAT("XAI: CAiScutTargetBkm::LaunchL '%S' "), ¶m); + + if (task.Exists()) + { + HBufC8* param8 = HBufC8::NewLC(param.Length()); + param8->Des().Copy(param); + task.SendMessage(KNullUid, *param8); // Uid is not used. + CleanupStack::PopAndDestroy(param8); + } + else + { + TThreadId id; + User::LeaveIfError(iEngine.ApaSession().StartDocument( + param, KScutBrowserUid, id)); + } +} + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetBkm::AppUid() const +{ + return KScutBrowserUid; +} + +// --------------------------------------------------------------------------- +// Return the bkm id +// --------------------------------------------------------------------------- +TUid CAiScutTargetBkm::AdditionalUid() const + { + return iBkmUid; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetempty.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetempty.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,119 @@ +/* +* 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: Class for empty target. +* +*/ + + +#include "caiscuttargetempty.h" + +// ---------------------------------------------------------------------------- +// CAiScutEmpty::CAiScutEmpty +// ---------------------------------------------------------------------------- +// +CAiScutTargetEmpty::CAiScutTargetEmpty(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + +// ---------------------------------------------------------------------------- +// CAiScutEmpty::ConstructL +// ---------------------------------------------------------------------------- +// +void CAiScutTargetEmpty::ConstructL(const TDesC& aTarget) +{ + iDefinition = aTarget.AllocL(); +} + +// ---------------------------------------------------------------------------- +// CAiScutEmpty::NewL +// ---------------------------------------------------------------------------- +// +CAiScutTargetEmpty* CAiScutTargetEmpty::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget) +{ + CAiScutTargetEmpty* self = new (ELeave) CAiScutTargetEmpty(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aTarget); + CleanupStack::Pop(self); + + return self; +} + +// ---------------------------------------------------------------------------- +// CAiScutEmpty::~CAiScutEmpty +// ---------------------------------------------------------------------------- +// +CAiScutTargetEmpty::~CAiScutTargetEmpty() +{ + delete iDefinition; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetEmpty::Definition() const +{ + return iDefinition ? TPtrC(*iDefinition) : TPtrC(); +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetEmpty::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const +{ + aDes.Set(KNullDesC()); + return 0; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetEmpty::GetIcon(CGulIcon*& aIcon) const +{ + aIcon = NULL; + return 0; +} + +// ----------------------------------------------------------------------------- +// Checks if the target is accessible +// ----------------------------------------------------------------------------- +// +TBool CAiScutTargetEmpty::IsAccessibleL(TInt /*aCheckType*/) +{ + return (iType != EScutUnknown); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAiScutTargetEmpty::LaunchL() +{ +} + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetEmpty::AppUid() const +{ + return KNullUid; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargethttp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargethttp.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,226 @@ +/* +* 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: Class for http shortcut target +* +*/ + + +#include // For CCoeEnv +#include // For RWsSession +#include // For TApaTaskList +#include // For CGulIcon +#include // For AknsUtils +#include + +#include "caiscuttargethttp.h" +#include "caiscutengine.h" +#include + +#include "debug.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetHttp::CAiScutTargetHttp(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetHttp::ConstructL(const TAiScutParser& aParser) +{ + iDefinition = aParser.Get( EScutDefComplete ).AllocL(); + iChecksum = TUid::Uid( aParser.ChecksumForString( *iDefinition) ); + + // Get the possible custom title string from the parser + iCaption = HBufC::NewL( iDefinition->Length() ); + TPtr captionPtr = iCaption->Des(); + TInt err = aParser.CustomTitle( captionPtr ); + + if ( err != KErrNone || iCaption->Length() <= 0 ) + { + delete iCaption; + iCaption = NULL; + } + TPtr defPtr = iDefinition->Des(); + // we need to strip the possible icon definitions away from + // the URL as they are not part of it. + aParser.RemoveExtraDefinitionsL( defPtr ); +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetHttp* CAiScutTargetHttp::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) +{ + CAiScutTargetHttp* self = new (ELeave) CAiScutTargetHttp(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aParser); + CleanupStack::Pop(self); + + return self; +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetHttp::~CAiScutTargetHttp() +{ + delete iDefinition; + delete iCaption; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetHttp::Definition() const +{ + return iDefinition ? TPtrC(*iDefinition) : TPtrC(); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetHttp::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const +{ + // Custom title is fetched when constructing. If no custom + // title then use part of the URL as title + if ( !iCaption ) + { + TUriParser parser; + TInt err = parser.Parse(*iDefinition); + + if (err == KErrNone) + { + // Remove scheme from the url. + iCaption = parser.Extract(EUriHost).Alloc(); + } + else + { + iCaption = iDefinition->Alloc(); + } + } + + aDes.Set(*iCaption); + + return 0; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetHttp::GetIcon(CGulIcon*& aIcon) const +{ + + if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) + { + CGulIcon* tempIcon = NULL; + + TFileName pluginIconFile(KDC_APP_BITMAP_DIR); + pluginIconFile.Append(KBitmapFile); + + TRAP_IGNORE( + tempIcon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropAiShortcut, + pluginIconFile, + EMbmAiscutpluginQgn_menu_url, + EMbmAiscutpluginQgn_menu_url_mask + ) + ); + + aIcon = tempIcon; + } + return 0; +} + + +// --------------------------------------------------------------------------- +// Checks if the shortcut target is accessible. +// --------------------------------------------------------------------------- +// +TBool CAiScutTargetHttp::IsAccessibleL(TInt /*aCheckType*/) +{ + return (iDefinition->Length() > 0); +} + + +// ----------------------------------------------------------------------------- +// Launches the browser +// ----------------------------------------------------------------------------- +// +void CAiScutTargetHttp::LaunchL() +{ + // Store the http address directly in the browser parameter format. + // For example "4 http://www.nokia.com". 4 = open an url. + HBufC* param = HBufC::NewLC(iDefinition->Length() + KOpenUrlParam().Length()); + param->Des().Copy(KOpenUrlParam()); + param->Des().Append(*iDefinition); + + __PRINT( __DBG_FORMAT("XAI: CAiScutTargetHttp::LaunchL '%S' "), param); + + TApaTaskList taskList(iEngine.Env()->WsSession()); + TApaTask task = taskList.FindApp(KScutBrowserUid); + + if (task.Exists()) + { + HBufC8* param8 = HBufC8::NewLC(param->Length()); + param8->Des().Copy(*param); + task.SendMessage(KNullUid, *param8); // Uid is not used. + CleanupStack::PopAndDestroy(param8); + } + else + { + TThreadId id; + User::LeaveIfError(iEngine.ApaSession().StartDocument( + *param, KScutBrowserUid, id)); + } + + CleanupStack::PopAndDestroy(param); +} + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetHttp::AppUid() const +{ + return KScutBrowserUid; +} + +TUid CAiScutTargetHttp::AdditionalUid() const +{ + return iChecksum; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetkeylock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetkeylock.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* 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: Class for key lock +* +*/ + + +#include "caiscuttargetkeylock.h" +#include + +// Amount of attempts to try to connect to server. +const TInt KTriesToConnectServer(3); + +// Delay between retries to connect. +const TInt KTimeBeforeRetryingServerConnection(50000); + +// ---------------------------------------------------------------------------- +// CAiScutKeyLock::CAiScutKeyLock +// ---------------------------------------------------------------------------- +// +CAiScutTargetKeyLock::CAiScutTargetKeyLock(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + +// ---------------------------------------------------------------------------- +// CAiScutKeyLock::ConstructL +// ---------------------------------------------------------------------------- +// +void CAiScutTargetKeyLock::ConstructL(const TDesC& aTarget) +{ + iDefinition = aTarget.AllocL(); + + TInt err(KErrGeneral); + TInt thisTry(0); + + // Try connect successfully with server limited a number of times + err = iKeyLock.Connect(); + while ((err != KErrNone) && (thisTry++ < KTriesToConnectServer)) + { + User::After(KTimeBeforeRetryingServerConnection); + err = iKeyLock.Connect(); + } + User::LeaveIfError(err); + +} + +// ---------------------------------------------------------------------------- +// CAiScutKeyLock::NewL +// ---------------------------------------------------------------------------- +// +CAiScutTargetKeyLock* CAiScutTargetKeyLock::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TDesC& aTarget) +{ + CAiScutTargetKeyLock* self = new (ELeave) CAiScutTargetKeyLock(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aTarget); + CleanupStack::Pop(self); + + return self; +} + +// ---------------------------------------------------------------------------- +// CAiScutKeyLock::~CAiScutKeyLock +// ---------------------------------------------------------------------------- +// +CAiScutTargetKeyLock::~CAiScutTargetKeyLock() +{ + delete iDefinition; + iKeyLock.Close(); +} + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetKeyLock::Definition() const +{ + return iDefinition ? TPtrC(*iDefinition) : TPtrC(); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetKeyLock::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const +{ + aDes.Set(KNullDesC()); + return 0; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetKeyLock::GetIcon(CGulIcon*& aIcon) const +{ + aIcon = NULL; + return 0; +} + + +// ----------------------------------------------------------------------------- +// Checks if the target is accessible +// ----------------------------------------------------------------------------- +// +TBool CAiScutTargetKeyLock::IsAccessibleL(TInt /*aCheckType*/) +{ + return ETrue; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CAiScutTargetKeyLock::LaunchL() +{ + EnableKeyLock(); +} + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetKeyLock::AppUid() const +{ + return KNullUid; +} + + +// ---------------------------------------------------------------------------- +// CAiScutTargetKeyLock::EnableKeyLock +// ---------------------------------------------------------------------------- +// +void CAiScutTargetKeyLock::EnableKeyLock() +{ + iKeyLock.EnableKeyLock(); +} + + +// ---------------------------------------------------------------------------- +// CAiScutTargetKeyLock::IsKeyLockEnabled +// ---------------------------------------------------------------------------- +// +TBool CAiScutTargetKeyLock::IsKeyLockEnabled() +{ + return iKeyLock.IsKeyLockEnabled(); +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetmessagingview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetmessagingview.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,236 @@ +/* +* 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: Class for messaging view shortcut target +* +*/ + + +#include // For KMsvRootIndexEntryIdValue +#include // For CGulIcon +#include +#include // For CVwsSessionWrapper +#include // For AknsUtils +#include +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +#include "caiscuttargetmessagingview.h" +#include "caiscutengine.h" +#include + +#include "debug.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetMessagingView::CAiScutTargetMessagingView(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetMessagingView::ConstructL(const TAiScutParser& aParser) +{ + iDefinition = aParser.Get(EScutDefComplete).AllocL(); + // Updates the view name also + FindViewIdL(); +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetMessagingView* CAiScutTargetMessagingView::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) +{ + CAiScutTargetMessagingView* self = new (ELeave) CAiScutTargetMessagingView(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aParser); + CleanupStack::Pop(self); + + return self; +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetMessagingView::~CAiScutTargetMessagingView() +{ + delete iDefinition; + delete iViewName; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetMessagingView::Definition() const +{ + return TPtrC(*iDefinition); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetMessagingView::GetCaption(TPtrC& aDes, TAiScutAppTitleType /*aTitleType*/) const +{ + aDes.Set(*iViewName); + return 0; +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetMessagingView::GetIcon(CGulIcon*& aIcon) const +{ + if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) + { + TRAP_IGNORE(GetIconL(aIcon)); + } + + return 0; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +void CAiScutTargetMessagingView::GetIconL(CGulIcon*& aIcon) const +{ + CGulIcon* tempIcon = NULL; + + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::CreateAppIconLC(skin, KScutMessagingUid, EAknsAppIconTypeList, bitmap, mask); + + tempIcon = CGulIcon::NewL(bitmap, mask); + + CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number + // because the order in which they are pushed in is undefined. + + //Do not need to sets the bitmap and mask to be owned externally + + aIcon = tempIcon; +} + + +// --------------------------------------------------------------------------- +// Checks if the shortcut target is accessible. +// --------------------------------------------------------------------------- +// +TBool CAiScutTargetMessagingView::IsAccessibleL(TInt /*aCheckType*/) +{ + return FindViewIdL() != KErrNotFound; +} + + +// --------------------------------------------------------------------------- +// Launches a remote mailbox. +// --------------------------------------------------------------------------- +// +void CAiScutTargetMessagingView::LaunchL() +{ + TMsvId id(FindViewIdL()); + if (id != KErrNotFound) + { + const TVwsViewId viewId(KScutMessagingUid, KScutRemoteMailboxViewId); + iEngine.VwsSession()->CreateActivateViewEvent(viewId, TUid::Uid(id), KNullDesC8()); + } +} + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetMessagingView::AppUid() const +{ + return KScutMessagingUid; +} + + +// --------------------------------------------------------------------------- +// Tries to find a view id. +// --------------------------------------------------------------------------- +// +TMsvId CAiScutTargetMessagingView::FindViewIdL() + { + TMsvId id(KErrNotFound); + + TInt mailboxId = KErrNone; + TAiScutParser parser; + parser.Parse(*iDefinition); + TLex lex(parser.Get(EScutDefParamValue)); + lex.Val(mailboxId); + + if (iEngine.MsvSession()) + { + // KErrNotReady is the only allowed leave code. Engine will trap it and start a timer + // to check access later. Other possible leaves emitted by the message server are + // substituted with KErrNotReady. + CMsvEntry* rootEntry = NULL; + TRAPD(err, rootEntry = iEngine.MsvSession()->GetEntryL(KMsvRootIndexEntryIdValue)); + if (err != KErrNone) + { + User::Leave(KErrNotReady); + } + + if(rootEntry) + { + // No leaving code here since rootEntry is not in cleanup stack. + for (TInt i = rootEntry->Count(); --i >= 0;) + { + const TMsvEntry& tentry = (*rootEntry)[i]; + + __PRINT( __DBG_FORMAT("XAI: CAiScutTargetMessagingView::FindViewIdL id = 0x%x '%S'"), + tentry.Id(), &tentry.iDetails); + if ((tentry.iMtm == KSenduiMtmImap4Uid || tentry.iMtm == KSenduiMtmPop3Uid) && + tentry.Id() == mailboxId) + { + id = tentry.Id(); + delete iViewName; + iViewName = NULL; + iViewName = tentry.iDetails.AllocL(); + break; + } + } + + delete rootEntry; + rootEntry = NULL; + + } + } + + return id; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/caiscuttargetnewmsg.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/caiscuttargetnewmsg.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,448 @@ +/* +* Copyright (c) 2005-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: Class for new message shortcut target +* +*/ + + +#include // For CSendUi +#include // For settings not ok - error dialog +#include // For CGulIcon +#include +#include // For finding out available email account counts +#include // For AknsUtils + +#include + +#include +#include // For error note +#include +#include + +#include "aiscutcontentmodel.h" +#include "caiscuttargetnewmsg.h" +#include "caiscutengine.h" +#include +#include +#include +#include +#include + +#include "debug.h" + +using namespace conn; +const TInt KMaxBufSize = 256; + +// Status keys adopted from FileManager to be used when checking file backup status +const TUid KPSUidFileManagerStatus = { 0x101F84EB }; // File Manager SID +const TUint32 KFileManagerBkupStatus = 0x00000001; + +enum TFileManagerBkupStatusType + { + EFileManagerBkupStatusUnset = 0x00000000, + EFileManagerBkupStatusBackup = 0x00000001, + EFileManagerBkupStatusRestore = 0x00000002 + }; + +TBool PhoneIsInBackupOrRestoreMode() + { + TBool backupOrRestore = EFalse; + + TInt status( EFileManagerBkupStatusUnset ); + TInt err( RProperty::Get( KPSUidFileManagerStatus, KFileManagerBkupStatus, status ) ); + if ( status == EFileManagerBkupStatusBackup ) + { + backupOrRestore = ETrue; + return backupOrRestore; + } + + // Get the back-up restore key, return EFalse if we can't get the key + TInt keyVal = 0; + const TInt error = RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal ); + if( error ) + { + return backupOrRestore; + } + + const conn::TBURPartType partType = static_cast< conn::TBURPartType >( keyVal & conn::KBURPartTypeMask ); + if (keyVal != 0) + { + switch(partType) + { + case EBURUnset: + case EBURNormal: + break; + case EBURBackupFull: + case EBURBackupPartial: + case EBURRestoreFull: + case EBURRestorePartial: + backupOrRestore = ETrue; + break; + } + } + // + + return backupOrRestore; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetNewMsg::CAiScutTargetNewMsg(CAiScutEngine& aEngine, TShortcutType aType) + : CAiScutTarget(aEngine, aType) +{ +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAiScutTargetNewMsg::ConstructL(const TAiScutParser& aParser) +{ + iDefinition = aParser.Get(EScutDefComplete).AllocL(); + + iAppUid = KNullUid; + iViewUid.iUid = -1; + + switch (aParser.Type()) + { + case EScutNewMessage: + iMtm = KSenduiMtmUniMessageUid; + iAppUid.iUid = KScutUnifiedEditorUidValue; + break; + + case EScutNewEmail: + iMtm = KSenduiMtmSmtpUid; + iAppUid.iUid = KScutEmailEditorUidValue; + break; + +#ifdef __SYNCML_DS_EMAIL + case EScutNewSyncMLMail: + iMtm = KSenduiMtmSyncMLEmailUid; + iAppUid.iUid = KScutEmailEditorUidValue; // check that these uids are in sync with aiscuttexts.rss + iViewUid.iUid = KScutSyncMlEmailUidValue; + break; +#endif + + case EScutNewPostcard: + iMtm = KSenduiMtmPostcardUid; + iAppUid.iUid = KScutPostcardEditorUidValue; + break; + + case EScutNewAudioMsg: + iMtm = KSenduiMtmAudioMessageUid; + iAppUid.iUid = KScutAmsEditorUidValue; + break; + + case EScutNewMsgType: + iAppUid.iUid = KScutMessagingCenterUidValue; // check that these uids are in sync with aiscuttexts.rss + iViewUid.iUid = KScutMessagingCenterUidValue; + // fallthrough + default: + iMtm = KNullUid; + break; + } +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetNewMsg* CAiScutTargetNewMsg::NewL( + CAiScutEngine& aEngine, TShortcutType aType, const TAiScutParser& aParser) +{ + CAiScutTargetNewMsg* self = new (ELeave) CAiScutTargetNewMsg(aEngine, aType); + + CleanupStack::PushL(self); + self->ConstructL(aParser); + CleanupStack::Pop(self); + + return self; +} + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CAiScutTargetNewMsg::~CAiScutTargetNewMsg() +{ + delete iCaption; + delete iShortCaption; + delete iDefinition; + +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut definition string. +// --------------------------------------------------------------------------- +// +TPtrC CAiScutTargetNewMsg::Definition() const +{ + return TPtrC(*iDefinition); +} + + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetNewMsg::GetCaption(TPtrC& aDes, TAiScutAppTitleType aTitleType) const +{ + TRAP_IGNORE(GetCaptionL(aTitleType)); + + if (aTitleType == EAiScutSkeyTitle) + { + aDes.Set(iShortCaption ? *iShortCaption : KNullDesC()); + } + else + { + aDes.Set(iCaption ? *iCaption : KNullDesC()); + } + + return 0; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target caption. +// --------------------------------------------------------------------------- +// +void CAiScutTargetNewMsg::GetCaptionL(TAiScutAppTitleType aTitleType) const +{ + HBufC* titlePtr = HBufC::NewLC(KMaxBufSize); + TPtr titlePtrP = titlePtr->Des(); + + + // Use lazy evaluation, create the caption only when it is first needed. + if (aTitleType == EAiScutSkeyTitle) + { + if (!iShortCaption) + { + if (iEngine.GetAppTitle(iAppUid, iViewUid, titlePtrP, aTitleType)) + { + iShortCaption = titlePtrP.AllocL(); + } + } + } + else + { + if (!iCaption) + { + if (iEngine.GetAppTitle(iAppUid, iViewUid, titlePtrP, aTitleType)) + { + iCaption = titlePtrP.AllocL(); + } + } + } + + CleanupStack::PopAndDestroy(titlePtr); +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +TInt CAiScutTargetNewMsg::GetIcon(CGulIcon*& aIcon) const +{ + if ( CAiScutTarget::GetIcon(aIcon) != KErrNone ) + { + TRAP_IGNORE(GetIconL(aIcon)); + } + + + return 0; +} + +// --------------------------------------------------------------------------- +// Returns the shortcut target icon. +// --------------------------------------------------------------------------- +// +void CAiScutTargetNewMsg::GetIconL(CGulIcon*& aIcon) const +{ + + CGulIcon* tempIcon = NULL; + TBool useAppIcon = ETrue; + TInt iconId = 0; + TInt maskId = 0; + + if (iMtm == KNullUid) + { + useAppIcon = EFalse; + iconId = EMbmAiscutpluginQgn_menu_mce_sel_mes; + maskId = EMbmAiscutpluginQgn_menu_mce_sel_mes_mask; + } +#ifdef __SYNCML_DS_EMAIL + else if (iMtm.iUid == KSenduiMtmSyncMLEmailUidValue) + { + useAppIcon = EFalse; + iconId = EMbmAiscutpluginQgn_menu_mce_syncmail; + maskId = EMbmAiscutpluginQgn_menu_mce_syncmail_mask; + } +#endif + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + if (useAppIcon) + { + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + AknsUtils::CreateAppIconLC(skin, iAppUid, EAknsAppIconTypeList, bitmap, mask); + tempIcon = CGulIcon::NewL(bitmap, mask); + CleanupStack::Pop(2); // Bitmap and mask. They have to be popped out by number + // because the order in which they are pushed in is undefined. + } + else + { + TFileName pluginIconFile(KDC_APP_BITMAP_DIR); + pluginIconFile.Append(KBitmapFile); + + tempIcon = AknsUtils::CreateGulIconL( + skin, + KAknsIIDQgnPropAiShortcut, + pluginIconFile, + iconId, + maskId + ); + } + + //Do not need to sets the bitmap and mask to be owned externally + + + aIcon = tempIcon; +} + + +// ----------------------------------------------------------------------------- +// Checks if the shortcut target is accessible. +// ----------------------------------------------------------------------------- +// +TBool CAiScutTargetNewMsg::IsAccessibleL(TInt /*aCheckType*/) +{ + return ETrue; +} + + +// ----------------------------------------------------------------------------- +// Launches the message editor to send an Sms, Mms or Email message. +// ----------------------------------------------------------------------------- +// +void CAiScutTargetNewMsg::LaunchL() + { + if( PhoneIsInBackupOrRestoreMode() ) + { + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + + HBufC* prompt = StringLoader::LoadLC( R_QTN_AI_SCUT_OPERATION_DISABLED ); + + note->SetSoftkeys( R_AVKON_SOFTKEYS_OK_EMPTY ); + note->ShowNoteL( EAknGlobalInformationNote, *prompt ); + + CleanupStack::PopAndDestroy( prompt ); + CleanupStack::PopAndDestroy( note ); + return; + } + + CSendUi* sendUi = CSendUi::NewLC(); + + if (iMtm == KNullUid) + { + TSendingCapabilities capabs(0, 0, TSendingCapabilities::ESupportsEditor); + + TUid uid = sendUi->ShowTypedQueryL(CSendUi::EWriteMenu, NULL, capabs, NULL, KNullDesC); + if (uid != KNullUid) + { + sendUi->ServiceCapabilitiesL(uid, capabs); + sendUi->CreateAndSendMessageL(uid, NULL, KNullUid, EFalse); // launch standalone + } + } + else + { + if( iMtm == KSenduiMtmSmtpUid ) // pop, imap, smtp + { + RArray popAccounts; + RArray imapAccounts; + RArray smtpAccounts; + CEmailAccounts* emailAccounts = CEmailAccounts::NewLC(); + // check that mailbox exists or else display error message + emailAccounts->GetPopAccountsL(popAccounts); + emailAccounts->GetImapAccountsL(imapAccounts); + emailAccounts->GetSmtpAccountsL(smtpAccounts); + CleanupStack::PopAndDestroy(emailAccounts); + + if( iMtm == KSenduiMtmSmtpUid && + (popAccounts.Count() + imapAccounts.Count() + smtpAccounts.Count() ) > 0 ) + { + sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone + } + else + { + ShowErrorNote(); + } + popAccounts.Reset(); + imapAccounts.Reset(); + smtpAccounts.Reset(); + } + else if ( iMtm == KSenduiMtmSyncMLEmailUid ) // syncml + { + CMsvEntrySelection* sel = + MsvUiServiceUtilities::GetListOfAccountsWithMTML( *(iEngine.MsvSession()), iMtm ); + TInt accounts = sel->Count(); + delete sel; + if ( accounts > 0 ) + { + sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone + } + else + { + ShowErrorNote(); + } + } + else + { + sendUi->CreateAndSendMessageL(iMtm, NULL, KNullUid, EFalse); // launch standalone + } + + } + CleanupStack::PopAndDestroy(sendUi); +} + +void CAiScutTargetNewMsg::ShowErrorNote() + { + TRAP_IGNORE( + // Display global error note. + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + HBufC* prompt = StringLoader::LoadLC( R_SENDUI_SETTINGS_NOT_OK ); + note->ShowNoteL( EAknGlobalErrorNote, *prompt ); + CleanupStack::PopAndDestroy( prompt ); + CleanupStack::PopAndDestroy( note ); + ); // end TRAP_IGNORE + } + +// --------------------------------------------------------------------------- +// Return application uid this target launches. +// --------------------------------------------------------------------------- +// +TUid CAiScutTargetNewMsg::AppUid() const +{ + return iAppUid; +} + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/cpopupeventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/cpopupeventhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,238 @@ +/* +* 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: Shortcut plug-in Popup event handler class +* +*/ + + +#include "cpopupeventhandler.h" +#include "PopupFSM.h" +#include "mpopupeventhandleractions.h" + +/** + * Timeout timer values + */ +const TInt KTimeoutShort = 900000; //900 ms +const TInt KTimeoutLong = 6000000; //6 sec + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CPopupEventHandler* CPopupEventHandler::NewL( + MPopupEventHandlerActions& aPopupEventHandlerActions ) + { + CPopupEventHandler* self = CPopupEventHandler::NewLC( aPopupEventHandlerActions ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CPopupEventHandler* CPopupEventHandler::NewLC( + MPopupEventHandlerActions& aPopupEventHandlerActions ) + { + CPopupEventHandler* self = new( ELeave ) CPopupEventHandler( + aPopupEventHandlerActions ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CPopupEventHandler::~CPopupEventHandler() + { + Cancel(); + iTimer.Close(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CPopupEventHandler::CPopupEventHandler( + MPopupEventHandlerActions& aPopupEventHandlerActions ) + : CActive( EPriorityStandard ), + iPopupEventHandlerActions( aPopupEventHandlerActions ), + iPopupFSM( *this ), + iPublishPopup( ETrue ), + iPublishCaption( ETrue ), + iCaptionVisible( ETrue ) + { + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::ConstructL() + { + User::LeaveIfError( iTimer.CreateLocal() ); + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TPopupFSM& CPopupEventHandler::PopupFSM() + { + return iPopupFSM; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CPopupEventHandler::PublishPopup() const + { + return iPublishPopup; + } + +TBool CPopupEventHandler::PopupVisible() const + { + return iPopupVisible; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CPopupEventHandler::PublishCaption() const + { + return iPublishCaption; + } + +TBool CPopupEventHandler::CaptionVisible() const + { + return iCaptionVisible; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::DoCancel() + { + iTimer.Cancel(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::RunL() + { + iPopupFSM.HandleRequestCompleted(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::CompleteSelf() + { + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::CancelRequest() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::StartShortTimer() + { + Cancel(); // Cancel previous request by calling iTimer.Cancel() + iTimer.After( iStatus, KTimeoutShort ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::StartLongTimer() + { + Cancel(); // Cancel previous request by calling iTimer.Cancel() + iTimer.After( iStatus, KTimeoutLong ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::IssuePublishPopup() + { + iPublishPopup = ETrue; + iPopupVisible = ETrue; + iPopupEventHandlerActions.IssuePublishShortcut(); + iPublishPopup = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::IssueCleanPopup() + { + iPublishPopup = ETrue; + iPopupVisible = EFalse; + iPopupEventHandlerActions.IssuePublishShortcut(); + iPublishPopup = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::IssuePublishCaption() + { + iPublishCaption = ETrue; + iCaptionVisible = ETrue; + iPopupEventHandlerActions.IssuePublishShortcut(); + iPublishCaption = EFalse; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CPopupEventHandler::IssueCleanCaption() + { + iPublishCaption = ETrue; + iCaptionVisible = EFalse; + iPopupEventHandlerActions.IssuePublishShortcut(); + iPublishCaption = EFalse; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/shortcutplugin/src/taiscutparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/shortcutplugin/src/taiscutparser.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,816 @@ +/* +* 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: Shortcut definition parser +* +*/ + + +#include "taiscutparser.h" +#include "aiscutdefs.h" + +#include "debug.h" + + +// ======== LOCAL FUNCTIONS ======== +/** + * Extract a value with the given name from a URI query string. + * For example a query string of ?view=1234&iconid=3;5&foo=bar + * and we wanted iconid from that string. Function places the 3;5 + * into aValue and if needed deletes the "iconid=3;5&" string from the + * query string. + * + * @param aQueryString The querystring + * @param aParameterName The name of the parameter to find + * @param aValue Where to place the value + * @param aRemoveNameAndValue ETrue to remove the name=value from the querystring + * @return KErrNone on succesful extraction. KErrNotFound if the parameter was not found +*/ +TInt ExtractValueFromQueryString( TDes &aQueryString, const TDesC &aParameterName, + TDes &aValue, TBool aRemoveNameAndValue ) + { + TInt err = KErrNone; + HBufC *tempBuffer = aQueryString.Alloc(); + if ( !tempBuffer ) + { + return KErrNoMemory; + } + + TPtr temp = tempBuffer->Des(); + + TInt foundStartPos = 0; + TInt foundStopPos = 0; + foundStartPos = aQueryString.FindC(aParameterName); + if ( foundStartPos != KErrNotFound ) + { + // remove the beginning of the string from temp, so no additional &-marks are found + // at the start of string + temp.Delete(0,foundStartPos); + + foundStopPos = temp.Locate(KParamNextSeparator); + // stop either at the eos or at the next & mark + foundStopPos = (foundStopPos != KErrNotFound ) ? (foundStopPos): (temp.Length() ); + // start after the = separator and stop either on eos or at & mark + TInt from = (aParameterName.Length() + 1); + TInt length = foundStopPos - from; + + // Get just the value part + if ( aValue.MaxLength() >= length ) + { + aValue = temp.Mid( from, length ); + } + else // Can't place the value to aValue string + { + err = KErrNoMemory; + } + + if ( err == KErrNone && aRemoveNameAndValue ) + { + // Delete the aParameterName=aValue string from the querystring + // If eos reached then we need to delete the & before us also + // Don't try to delete if this is an only parameter + if ( foundStopPos == temp.Length() && foundStartPos > 0 ) + { + aQueryString.Delete(foundStartPos - 1, (foundStopPos + 1)); + } + else + { + aQueryString.Delete(foundStartPos, (foundStopPos + 1)); + } + } + } + else + { + err = KErrNotFound; + } + + delete tempBuffer; + return err; + } + +/** + * Tests if string ends with given pattern + * + * @param aString input string + * @param aPattern test pattern + * @return ETrue if string ends with given pattern. + */ +TBool EndsWith( const TDesC& aString, const TDesC& aPattern ) + { + TBuf<10> temp(aString.Right(aPattern.Length())); + return ( aString.Right( aPattern.Length() ) == aPattern ); + } + +/** + * Resolves skin item id from pattern majorId;minorId;colourGroupId. + * The colourGroupId in the syntax is optional, and if no value found then + * aColourValue will be -1 + * + * @param aPath skin item id string + * @param aItemId skin item id to fill + * @param aColourValue colour value to fill. + * + * @return ETrue if id was succesfully parsed. + */ +TBool ResolveSkinItemId( const TDesC& aPath, TAknsItemID& aItemId, TInt& aColourValue ) + { + // Syntax: major;minor;colourgroup + aColourValue = -1; + + // Initialize lexer + TLex lex( aPath ); + lex.SkipSpace(); + + TInt majorId( 0 ); + TInt minorId( 0 ); + + // Resolve major id + TInt error = lex.Val( majorId ); + + // Resolve minor id + if ( lex.Eos()) + return KErrNotFound; + + lex.Inc(); + error |= lex.Val( minorId ); + + // initilize skin item id object + aItemId.Set( majorId, minorId ); + + if ( lex.Eos()) + return KErrNotFound; + lex.Inc(); + + TInt colorError = lex.Val( aColourValue ); + if ( colorError != KErrNone || aColourValue < 0) + { + aColourValue = -1; + } + + // Check error + return ( error == KErrNone ); + + } + +/** +* Resolves filename and id from syntax +* filename.ext;id. If the syntax is incorrect +* aId is -1 and filename zeroed and EFalse is returned +* MIF and MBM supported. +* +* @param aPath The path to extract the data from +* @param aId Id to fill +* @param aFilename Filename to fill +* @return ETrue if id and path was succesfully parsed. +*/ +TBool ResolveFileIdAndPath( const TDesC& aPath, TInt& aId, TDes& aFilename ) +{ + // Syntax: filename.ext;index + // Supported: MIF, MBM + TInt pos = aPath.FindF( KScutSkinItemSeparator ); + aFilename.Zero(); + if( pos != KErrNotFound ) + { + aFilename = (aPath.Left(pos)); + + if ( ( !EndsWith(aFilename, KScutMIFExtension ) ) && + ( !EndsWith(aFilename, KScutMBMExtension ) ) ) + { + aFilename.Zero(); + return EFalse; + } + + TLex lex(aPath.Mid(pos+1)); + TInt error = lex.Val(aId); + if ( error != KErrNone ) + { + aId = -1; + return EFalse; + } + return ETrue; + } + return EFalse; +} + +TInt CreateChecksumFromString( const TDesC& aString ) + { + TInt checksum = 0; + + for ( TInt i = 0; i < aString.Length(); i++ ) + { + checksum += aString[i] * ( i + 1); + } + return checksum; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TAiScutParser::TAiScutParser() : iType(EScutUnknown), iUid(KNullUid) +{ +} + + +// ----------------------------------------------------------------------------- +// Static utility function to parse an uid from the given descriptor. +// ----------------------------------------------------------------------------- +// +TUid TAiScutParser::ParseUid(const TDesC& aDesC) +{ + TRadix radix(EDecimal); + + // Check if the number is in hexadecimal format. + _LIT(KHexPrefix, "0x"); + const TInt prefixLen = 2; + TPtrC ptr(aDesC); + + if (ptr.Left(prefixLen).CompareC(KHexPrefix) == 0) + { + // Strip the '0x' prefix. + ptr.Set(ptr.Right(ptr.Length() - prefixLen)); + + radix = EHex; + } + + // Do the actual parsing. + TUint uint; + TUid uid(KNullUid); + TLex lexer(ptr); + TInt err = lexer.Val(uint, radix); + if (err == KErrNone) + { + uid.iUid = uint; + } + + return uid; +} + + +// --------------------------------------------------------------------------- +// Parses a shortcut definition. +// --------------------------------------------------------------------------- +// +TInt TAiScutParser::Parse(const TDesC& aDefinition) +{ + iType = EScutUnknown; + iDefinition.Set(aDefinition); + + // Default values for the icon + iIcon.iIconId = KErrNotFound; + iIcon.iPath.Zero(); + iIcon.iSkinId.iMajor = -1; + iIcon.iSkinId.iMinor = -1; + iIcon.iColourGroup = -1; + + iIcon.iType = EScutIconNone; + iIcon.iDestination = EScutDestinationNormal; + iIcon.iShortcutType = EScutUnknown; + iIcon.iAppUid = TUid::Uid(0); + iIcon.iViewId = TUid::Uid(0); + + TInt err = iUriParser.Parse(aDefinition); + if (err != KErrNone) + { + return err; + } + + TPtrC scheme(iUriParser.Extract(EUriScheme)); + + if (scheme.Length() == 0 || + scheme.Compare(KScutURISchemeHttp) == 0 || + scheme.Compare(KScutURISchemeHttps) == 0) + { + ParseParams(); + iType = EScutWebAddress; + + if ( iIcon.iType != EScutIconNone ) + { + // create a checksum for unique identifying + TInt checksum = CreateChecksumFromString( aDefinition ); + iIcon.iViewId = TUid::Uid( checksum ); + iIcon.iShortcutType = iType; + iIcon.iAppUid = KScutBrowserUid; + } + err = KErrNone; + } + else if (scheme.Compare(KScutURISchemeLocalApp) == 0) + { + iType = EScutApplication; + + if (!ParseAlias()) + { + iUid = ParseUid(iUriParser.Extract(EUriPath)); + } + + if (iUid == KScutAppShellUid) + { + // appshell shortcut is always of type app view. + iType = EScutApplicationView; + } + + // ParseParams() parses params from an URL. If it encounters + // iconid, iconmifpath or cba parameter from the URL, then it + // places the values to iIcon and removes the parameters from + // the URL. It also extract the additional viewid if needed. + // For example bookmarks and apps with views use them. + + ParseParams(); + // Icon found so apply the appuid and type to icon. + if ( iIcon.iType != EScutIconNone ) + { + iIcon.iShortcutType = iType; + + // If we are dealing with messaging icons then the + // appuid needs to be changed in order to match it against + // the shortcuts appuid + switch( iType ) + { + case EScutNewMessage: + iIcon.iAppUid.iUid = KScutUnifiedEditorUidValue; + break; + + case EScutNewEmail: + iIcon.iAppUid.iUid = KScutEmailEditorUidValue; + break; + + #ifdef __SYNCML_DS_EMAIL + case EScutNewSyncMLMail: + iIcon.iAppUid.iUid = KScutEmailEditorUidValue; + iIcon.iViewId.iUid = KScutSyncMlEmailUidValue; + break; + #endif + + case EScutNewPostcard: + iIcon.iAppUid.iUid = KScutPostcardEditorUidValue; + break; + + case EScutNewAudioMsg: + iIcon.iAppUid.iUid = KScutAmsEditorUidValue; + break; + + case EScutNewMsgType: + iIcon.iAppUid.iUid = KScutMessagingCenterUidValue; + iIcon.iViewId.iUid = KScutMessagingCenterUidValue; + break; + + default: + iIcon.iAppUid = iUid; + break; + + } + + } + err = KErrNone; + } + else + { + err = KErrCorrupt; + } + + __PRINTS( "XAI: TAiScutParser::Parse"); + __PRINT( __DBG_FORMAT( "XAI: type = %d, definition = '%S', err = %d"), iType, &aDefinition, err); + return err; +} + + +// --------------------------------------------------------------------------- +// Checks if the shortcut definition was valid. +// --------------------------------------------------------------------------- +// +TBool TAiScutParser::IsValid() const +{ + return iType != EScutUnknown; +} + + +// ----------------------------------------------------------------------------- +// Returns the shortcut target type. +// ----------------------------------------------------------------------------- +// +TShortcutType TAiScutParser::Type() const +{ + return iType; +} + + +// ----------------------------------------------------------------------------- +// Returns the shortcut target uid. Used for application shortcuts. +// ----------------------------------------------------------------------------- +// +TUid TAiScutParser::Uid() const +{ + return iUid; +} + + +TAiScutIcon TAiScutParser::Icon() const + { + return iIcon; + } +// ----------------------------------------------------------------------------- +// Returns a shortcut definition component value. +// ----------------------------------------------------------------------------- +// +TPtrC TAiScutParser::Get(TScutDefComponent aComponent) const +{ + TPtrC componentValue; + + switch (aComponent) + { + case EScutDefScheme: + componentValue.Set(iUriParser.Extract(EUriScheme)); + break; + + case EScutDefTarget: + componentValue.Set(iUriParser.Extract(EUriPath)); + break; + + case EScutDefParamName: + componentValue.Set(iParamName); + break; + + case EScutDefParamValue: + componentValue.Set(iParamValue); + break; + + case EScutDefParamNameAndValue: + componentValue.Set(iUriParser.Extract(EUriQuery)); + break; + + case EScutDefComplete: + componentValue.Set(iDefinition); + break; + + default: + break; + } + + return componentValue; +} + + +// --------------------------------------------------------------------------- +// Composes a shortcut definition string from given parameters. +// --------------------------------------------------------------------------- +// +void TAiScutParser::ComposeL(HBufC*& aDes, const TUid aUid, + const TDesC& aParamName, const TDesC& aParamValue) +{ + HBufC* temp = HBufC::NewLC(KMaxDefinitionLength); + TPtr ptr = temp->Des(); + + if (aParamName.Length() && aParamValue.Length()) + { + ptr.Format(KScutFormatApplicationWithParams, aUid.iUid, &aParamName, &aParamValue); + } + else + { + ptr.Format(KScutFormatApplication, aUid.iUid); + } + + aDes = temp->AllocL(); + CleanupStack::PopAndDestroy(temp); +} + + +// --------------------------------------------------------------------------- +// Composes a shortcut definition string from given parameters. +// --------------------------------------------------------------------------- +// +void TAiScutParser::ComposeL(HBufC*& aDes, const TUid aUid, + const TDesC& aParamString) +{ + HBufC* temp = HBufC::NewLC(KMaxDefinitionLength); + TPtr ptr = temp->Des(); + + if (aParamString.Length()) + { + ptr.Format(KScutFormatApplicationWithParamString, aUid.iUid, &aParamString); + } + else + { + ptr.Format(KScutFormatApplication, aUid.iUid); + } + + aDes = temp->AllocL(); + CleanupStack::PopAndDestroy(temp); +} + + +// --------------------------------------------------------------------------- +// Checks if an alias was used in shortcut definition and parses an uid from it. +// --------------------------------------------------------------------------- +// +TBool TAiScutParser::ParseAlias() +{ + TPtrC ptr(iUriParser.Extract(EUriPath)); + + // "localapp:msg?..." is an alias for messaging application. + if (ptr.CompareC(KScutTargetAliasMessaging) == 0) + { + iUid = KScutMessagingUid; + return ETrue; + } + // "localapp:keylock?..." is an alias for keylock + else if (ptr.CompareC(KScutTargetAliasKeylock) == 0) + { + iUid = KScutKeyLockUid; + return ETrue; + } + + // "localapp:voicedial..." is an alias for voicedial + else if (ptr.CompareC(KScutTargetAliasVoiceDial) == 0) + { + iUid = KScutVoiceDialUid; + return ETrue; + } + + // "localapp:logs?..." is an alias for logs + else if (ptr.CompareC(KScutTargetAliasLogs) == 0) + { + iUid = KScutLogsUid; + return ETrue; + } + else + { + return EFalse; + } +} + + +// --------------------------------------------------------------------------- +// Parses the possible application shortcut parameters. +// --------------------------------------------------------------------------- +// +void TAiScutParser::ParseParams() +{ + TPtrC params(iUriParser.Extract(EUriQuery)); + + if (params.Length() > 0) + { + HBufC *tempParams = params.Alloc(); + // value can't be longer than the params + // but in some cases it can be equally long + HBufC *value = HBufC::New(params.Length()); + + // low memory or similar situation so cannot do anything + if ( !value || !tempParams ) + { + return; + } + + TPtr valuePtr = value->Des(); + TPtr tempParamsPtr = tempParams->Des(); + + TBool addonFound = EFalse; + TInt err = KErrNone; + + // First extract the CBA + err = ExtractValueFromQueryString(tempParamsPtr,KScutParamNameCBAIcon,valuePtr, ETrue); + if ( err == KErrNone ) + { + iIcon.iDestination = EScutDestinationSoftkey; + } + // Then the toolbar + + err = ExtractValueFromQueryString(tempParamsPtr,KScutParamNameToolbarIcon,valuePtr, ETrue); + + if ( err == KErrNone ) + { + iIcon.iDestination = EScutDestinationToolbar; + } + + // then extract the iconskinid + err = ExtractValueFromQueryString(tempParamsPtr, + KScutParamNameIconSkinId,valuePtr, ETrue); + if ( err == KErrNone && + ResolveSkinItemId(valuePtr,iIcon.iSkinId,iIcon.iColourGroup)) + { + iIcon.iType = EScutIconSkin; + addonFound = ETrue; + } + // Then extract the iconmifpath + // Iconmifpath extraction left here for backward compatibility + valuePtr.Zero(); + err = ExtractValueFromQueryString(tempParamsPtr, + KScutParamNameIconMifPath,valuePtr, ETrue); + if ( err == KErrNone && + ResolveFileIdAndPath(valuePtr,iIcon.iIconId,iIcon.iPath) ) + { + iIcon.iType = EScutIconMif; + addonFound = ETrue; + } + + // Then extract the iconpath. + valuePtr.Zero(); + err = ExtractValueFromQueryString(tempParamsPtr, + KScutParamNameIconPath,valuePtr, ETrue); + if ( err == KErrNone && + ResolveFileIdAndPath(valuePtr,iIcon.iIconId,iIcon.iPath) ) + { + if ( EndsWith(iIcon.iPath, KScutMIFExtension )) + { + iIcon.iType = EScutIconMif; + } + else if ( EndsWith(iIcon.iPath, KScutMBMExtension )) + { + iIcon.iType = EScutIconMbm; + } + addonFound = ETrue; + } + + // Use the new params string where the addons + // have been removed + if( addonFound ) + { + params.Set(tempParamsPtr); + // no need to process anything because there are no + // parameters left after our addons have been taken out + if ( params.Length() <= 0) + { + delete value; + delete tempParams; + return; + } + } + + delete value; + + iType = EScutApplicationWithParams; + + const TInt valueSeparatorPos = params.Locate(KParamValueSeparator); + + if (valueSeparatorPos >= 0) + { + iParamName.Set(params.Left(valueSeparatorPos)); + } + if (valueSeparatorPos >= 0) + { + iParamValue.Set(params.Mid(valueSeparatorPos + 1)); + } + if (valueSeparatorPos == -1) + { + iParamName.Set(params); + } + + if (iParamName.CompareC(KScutParamNameView) == 0) + { + iType = EScutApplicationView; + + if (iUid == KScutPersonalisationUid) + { + TUid uid = ParseUid(iParamValue); + if (uid == KScutChangeThemeViewId) + { + iType = EScutChangeTheme; + } + iIcon.iViewId = uid; + } + + if (iUid == KScutLogsUid) + { + if (iParamValue.CompareC(KScutParamValueMissedCalls) == 0) + { + iType = EScutLogsMissedCallsView; + } + else if (iParamValue.CompareC(KScutParamValueDialledCalls) == 0) + { + iType = EScutLogsDialledCallsView; + } + else if (iParamValue.CompareC(KScutParamValueReceivedCalls) == 0) + { + iType = EScutLogsReceivedCallsView; + } + else if (iParamValue.CompareC(KScutParamValueMainView) == 0) + { + iType = EScutLogsMainView; + } + } + + if (iUid == KScutGeneralSettingsUid) + { + if (ParseUid(iParamValue) == KScutParamValueConnectivityView) + { + iType = EScutConnectivityStatusView; + } + else if (ParseUid(iParamValue) == KScutInstallationViewId) + { + iType = EScutApplicationManagerView; + } + } + + + } + else if (iUid == KScutMessagingUid) + { + if (iParamName.CompareC(KScutParamNameNew) == 0) + { + if (iParamValue.CompareC(KScutParamValueMsg) == 0) + { + iType = EScutNewMessage; + } + else if (iParamValue.CompareC(KScutParamValueEmail) == 0) + { + iType = EScutNewEmail; + } +#ifdef __SYNCML_DS_EMAIL + else if (iParamValue.CompareC(KScutParamValueSyncMLMail) == 0) + { + iType = EScutNewSyncMLMail; + } +#endif + else if (iParamValue.CompareC(KScutParamValuePostcard) == 0) + { + iType = EScutNewPostcard; + } + else if (iParamValue.CompareC(KScutParamValueAudioMsg) == 0) + { + iType = EScutNewAudioMsg; + } + else + { + iType = EScutNewMsgType; + } + } + else if (iParamName.CompareC(KScutParamNameMailbox) == 0) + { + iType = EScutMailbox; + } + } + else if (iUid == KScutKeyLockUid) + { + iType = EScutKeylock; + } + else if (iUid == KScutSettingsDllUid || iUid == KScutBrowserUid) + { + if (iParamName.CompareC(KScutParamNameBookmark) == 0) + { + iType = EScutBookmark; + iIcon.iViewId = ParseUid(iParamValue); + } + else if (iParamName.CompareC(KScutParamNoEffect) == 0) + { + iType = EScutNoEffect; + } + } + delete tempParams; + } +} + +TInt TAiScutParser::ChecksumForString( const TDesC& aDefinition) const + { + return CreateChecksumFromString( aDefinition ); + } + +TInt TAiScutParser::CustomTitle( TDes& aTarget ) const + { + TPtrC params(iUriParser.Extract(EUriQuery)); + HBufC *tempParams = params.Alloc(); + if ( !tempParams ) + { + return KErrNoMemory; + } + + TPtr tempParamsPtr = tempParams->Des(); + + TInt err = ExtractValueFromQueryString(tempParamsPtr, + KScutParamNameCustomTitle, aTarget, EFalse); + + delete tempParams; + return err; + } + +void TAiScutParser::RemoveExtraDefinitionsL( TDes &aString ) const + { + HBufC *temp = HBufC::NewL( aString.Length( )); + TPtr tempPtr = temp->Des(); + ExtractValueFromQueryString(aString, + KScutParamNameCBAIcon, tempPtr, ETrue); + + ExtractValueFromQueryString(aString, + KScutParamNameIconSkinId,tempPtr, ETrue); + + ExtractValueFromQueryString(aString, + KScutParamNameIconMifPath,tempPtr, ETrue); + + ExtractValueFromQueryString(aString, + KScutParamNameCustomTitle, tempPtr, ETrue); + ExtractValueFromQueryString(aString, + KScutParamNameIconPath, tempPtr, ETrue); + delete temp; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/data/wrtdataplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/data/wrtdataplugin.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 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: Registry info + * +*/ + + +// INCLUDES +#include +#include "wrtdatapluginuids.hrh" + + + +// ----------------------------------------------------------------------------- +// +// registry_info +// Registry information required for identifying the ECOM component +// +// ----------------------------------------------------------------------------- +// + +RESOURCE REGISTRY_INFO registry_info +{ + resource_format_version = RESOURCE_FORMAT_VERSION_2; + + dll_uid = WRTDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = AI_UID_ECOM_INTERFACE_CONTENTPUBLISHER; + + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = WRTDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; + version_no = 1; + display_name = "WRT Data plug-in"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; +} + + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 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: The build information file of Data Plugin +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +../rom/wrtdataplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(wrtdataplugin.iby) + +PRJ_MMPFILES +wrtdataplugin.mmp + +//#include "../internal/testpublisher/group/bld.inf" +//#include "../internal/templatedwidget/group/bld.inf" + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/group/wrtdataplugin.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2005-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: Project definition file for project wrtdataplugin +* +*/ +#include +#include + +#include "../inc/wrtdatapluginuids.hrh" + +TARGET wrtdataplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D WRTDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + + +USERINCLUDE ../inc + + +APP_LAYER_SYSTEMINCLUDE + + +SOURCEPATH ../data +START RESOURCE wrtdataplugin.rss +TARGET wrtdataplugin.rsc +END + + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY liwservicehandler.lib +LIBRARY ecom.lib +LIBRARY aiutils.lib +LIBRARY cone.lib +LIBRARY avkon.lib +LIBRARY fbscli.lib +LIBRARY egul.lib +LIBRARY aknskins.lib + +// End of File +SOURCEPATH ../src + +SOURCE wrtdataplugin.cpp +SOURCE wrtdata.cpp +SOURCE wrtdataobserver.cpp diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/inc/wrtdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdata.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef WRTDATA_H +#define WRTDATA_H + +// INCLUDE FILES +#include +#include +#include "wrtdatapluginconst.h" +#include "aicontentpublisher.h" + +class MLiwInterface; +class CLiwServiceHandler; +class CWrtDataObserver; +class CWrtDataPlugin; + +/** + * @ingroup group_wrtdataplugin + * + * Wrt data + * + * @since S60 v3.2 + */ +class CWrtData : public CBase + { + public: + + /** + * Part of the two phased construction + * + * @param aPlugin refrence of the plugin + * @return none + */ + static CWrtData* NewL(CWrtDataPlugin* aPlugin); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtData(); + + private : + + /** + * Constructor + * + * @param none + * @return none + */ + CWrtData(); + + + /** + * Part of the two phased construction + * + * @param aPlugin reference of the plugin + * @return void + */ + void ConstructL(CWrtDataPlugin* aPlugin); + + /** + * Change the publisher status + * + * @param aStatus new status of the publisher + * @return void + */ + void ChangePublisherStatusL(const TDesC& aStatus); + + /** + * Gets the menu item from the publisher + * + * @param none + * @return void + */ + void GetMenuItemsL(); + + public : + + /** + * Configures the subscriber and data to subscribe. + * + * @param aConfigurations Information about the subscriber + * and the data to subscribe. + * @return void + */ + void ConfigureL(RAiSettingsItemArray& aConfigurations); + + /** + * Publish updated data for all the items in the widget + * + * @param aObserver to publish data + * @return void + */ + void PublishAllL( MAiContentObserver* aObserver ); + + /** + * Execute the command to get the data from CPS + * + * @param aInFilter input filter for the command + * @param aOutDataMap output data map + * @param aRegistry type of registry (publisher/cp_data) + * @return void + */ + void ExecuteCommandL(CLiwDefaultMap* aInFilter, + CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ); + + /** + * Checks is this menu item is supported by the publisher + * + * @param aMenuItem menu item name. + * @return boolean (ETrue/EFalse) + */ + TBool HasMenuItem(const TDesC16& aMenuItem ); + + /** + * Publish the updated data + * + * @param aObserver to publish data + * @return void + */ + void PublishL( MAiContentObserver* aObserver ); + + /** + * Tigger for execution of a action for a specific content id. + * + * @param aObjectId object Id. + * @param aTrigger name of the trigger. + * @return void + */ + void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger); + + /** + * Register to CPS for all (add/delete/update/execute) action + * + * @param none + * @return void + */ + void RegisterL(); + + /** + * Called by the observer to refresh the changed content + * + * @param aPublisher publisher. + * @param aContentType content type. + * @param aContentId content Id. + * @param aOperation operation (add/delete/update/execute). + * @return void + */ + void RefreshL( TDesC& aPublisher, TDesC& aContentType, + TDesC& aContentId, TDesC& aOperation ); + + /** + * Createts the filter map + * + * @return filter map + */ + CLiwDefaultMap* CreateFilterLC( ); + + /** + * Is the pugin is active to publish the data. + * + * @param None + * @return boolean (ETrue/EFalse). + */ + TBool IsPluginActive(); + + /** + * Resume the publisher + * + * @param None + * @return void + */ + void ResumeL(); + + /** + * Suspend the publisher + * + * @param None + * @return void + */ + void SuspendL(); + + /** + * Activate the publisher + * + * @param None + * @return void + */ + void ActivateL(); + + /** + * Deactivate the publisher + * + * @param None + * @return void + */ + void DeActivateL(); + + /** + * OnLineL + * + * @param None + * @return void + */ + void OnLineL(); + + /** + * OffLineL + * + * @param None + * @return void + */ + void OffLineL(); + + /** + * InActiveL + * + * @param None + * @return void + */ + void InActiveL(); + + /** + * Update the publisher status + * + * @param None + * @return void + */ + void UpdatePublisherStatusL(); + + /** + * Resolves skin item id and Mif id from pattern + * skin( () + * mif( ) + * + * @param aPath skin pattern / mif pattern value + * @param aItemId skin item id + * @param aMifId mif id + * @param aMaskId mask id + * @param aFilename mif file name + * @return boolean (ETrue/EFalse) + */ + TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& aMifId, TInt& aMaskId, TDes& aFilename ); + + private : + + // Subscriber interface + // own + MLiwInterface* iInterface; + + // Data Observer to CPS + // Own + CWrtDataObserver* iObserver; + + // Service handler + // Own + CLiwServiceHandler* iServiceHandler; + + // Command name in configuration Array + HBufC8* iCommandName; + + // Reference of the wrt data plugin + // Not owned + CWrtDataPlugin* iPlugin; + + // Menu item names + // Own + RPointerArray iMenuItems; + + // Trigger names for the menu items + // Own + RPointerArray iMenuTriggers; + + HBufC* iContentId; + }; + +#endif /*WRTDATA_H*/ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef WRTDATAOBSERVER_H +#define WRTDATAOBSERVER_H + +// INCLUDE FILES +#include + +class CWrtData; + +/** + * @ingroup group_wrtdataplugin + * + * Wrt data observer + * + * @since S60 v3.2 + */ +class CWrtDataObserver : public CBase, public MLiwNotifyCallback + { +public: + + /** + * Part of the two phased constuction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return none + */ + static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData ); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtDataObserver(); + +private : + + /** + * Constructor + * + * @param none + * @return none + */ + CWrtDataObserver(); + + /** + * Part of the two phased construction + * + * @param aInterface reference of the interface + * @param aData reference of the wrt data object + * @return void + */ + void ConstructL( MLiwInterface* aInterface, CWrtData* aData ); + +public: //from MLiwNotifyCallbackc + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId occurred event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the call back. + */ + virtual TInt HandleNotifyL( + TInt aCmdId, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/); + +public: + + /** + * Registers to CPS for add, delete , update and execute notifications + * @aFilter - filter for input parameter list + * @return void. + */ + void RegisterL( CLiwDefaultMap* aFilter ); + + /** + * Cancel all the registered notifications. + * @return void. + */ + void ReleaseL(); + +private: + + // Reference of + // Not owned + MLiwInterface* iInterface; + + // Reference of the wrt data + // Not owned + CWrtData* iData; + + // Call back error code + TInt iError; + + }; + +#endif /*WRTDATAOBSERVER_H*/ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,402 @@ +/* +* Copyright (c) 2005-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: Plug-in main class +* +*/ + + +#ifndef WRTDATAPLUGIN_H +#define WRTDATAPLUGIN_H + +#include +#include +#include +#include + +class MAiContentObserver; +class MAiContentItemIterator; +class MAiPSPropertyObserver; +class CWrtData; +class CDesC16Array; +class CGulIcon; + +enum TContentItem + { + EImage1, + EText1 + }; +/** + * @ingroup group_wrtdataplugin + * + * Plug-in main class + * + * @since S60 v3.2 + */ +class CWrtDataPlugin : public CAiContentPublisher, + public MAiPropertyExtension, + public MAiEventHandlerExtension + + { + +public : + /** + * Plugin's network state. + */ + enum TPluginNetworkStatus + { + EUnknown, + EOffline, + EOnline + }; + + /** + * Plugin's state. + */ + enum TPluginStates + { + ENone, + EResume, + ESuspend, + EInActive, + }; +public: + + /** + * Part of the two phased constuction + * + * @param none + * @return none + */ + static CWrtDataPlugin* NewL(); + + /** + * Destructor + * + * @param none + * @return none + */ + ~CWrtDataPlugin(); + +private: + + /** + * Constructor + * + * @param none + * @return none + */ + CWrtDataPlugin(); + + /** + * Publishes widget's texts and images + * + * @param void + * @return void + */ + void PublishL(); + + /** + * Part of the two phased construction + * + * @param void + * @return void + */ + void ConstructL(); + + /** + * Resume the plug-in. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void DoResumeL(TAiTransitionReason aReason); + +public: // from base class CAiContentPublisher + + /** + * From CAiContentPublisher + * The method is called by the framework to request the plug-in free all + * memory and CPU resources and close all its open files, e.g. the plug-in + * should unload its engines due backup operation. The method transits the + * plug-in to "Idle" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Stop( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * allowed to consume CPU resources, e.g plug-in is able to run timers, + * perform asynchronous operations, etc. The method transits the plug-in + * to "Alive" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Resume( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * The method is called by the framework to instruct plug-in that it is + * not allowed to consume CPU resources, e.g plug-in MUST stop each + * timers, cancel outstanding asynchronous operations, etc. The method + * transits the plug-in to "Suspendend" state. + * + * @param aReason reason for state change, see TAiTransitionChange. + * @return void + */ + void Suspend( TAiTransitionReason aReason ); + + /** + * From CAiContentPublisher + * Adds the content observer / subscriber to plug-in. The plug-in MUST + * maintain a registry of subscribers and send notification to all them + * whenever the plug-in changes state or new content available. + * + * @param aObserver content observer to register. + * @return void + */ + void SubscribeL( MAiContentObserver& aObserver ); + + /** + * From CAiContentPublisher + * Configures the plug-in. + * Plug-ins take ownership of the settings array, so it must either + * store it in a member or free it. Framework has put the array in cleanup + * stack so the plugin shouldn't do that. + * If this leaves, the plug-in will be destroyed by AI FW. + * Plug-in must support LaunchByValue-event even if normal shortcuts don't + * work. The only allowed serious enough leave is KErrNotFound from CenRep. + * + * @param aSettings setting items defined in the UI definition. + * @return void + */ + void ConfigureL( RAiSettingsItemArray& aSettings ); + + /** + * From CAiContentPublisher + * Returns interface extension. In Series 60 3.1 only event & property + * extensions are supported. See MAiEventExtension & MAiPropertyExtension + * interfaces. + * + * @param aUid - UID of the extension interface to access. + * @return the extension interface. Actual type depends on the passed aUid + * argument. + */ + TAny* Extension( TUid aUid ); + +// from base class MAiPropertyExtension + + /** + * From MAiPropertyExtension. + * Read property of publisher plug-in. + * + * @param aProperty - identification of property. + * @return pointer to property value. + */ + TAny* GetPropertyL( TInt aProperty ); + + /** + * From MAiPropertyExtension. + * Write property value. + * + * @param aProperty - identification of property. + * @param aValue - contains pointer to property value. + */ + void SetPropertyL( TInt aProperty, TAny* aValue ); + + // from base class MAiEventHandlerExtension + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * @param aEvent - unique identifier of event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where is mapped by the framework to unique + * identifier supplied in aEvent, are provided to + * plug-in as-is in the descriptor. + * @since S60 3.2 + */ + void HandleEvent(TInt aEvent, const TDesC& aParam); + + /** + * From MAiEventHandlerExtension + * Invoked by the framework when plug-in must handle an event. + * + * @param aEventName - name of the event from plug-in content model. + * @param aParam - parameters associated with event. Each UI Definition + * declares events in the format: (), + * where mapping to unique identifier supplied by event + * is failed by the frame work then the and + * are provided to plug-in as-is in the descriptor. + */ + void HandleEvent(const TDesC& aEventName, const TDesC& aParam); + + /** + * Invoked by the framework for querying if plugin has menu item + * + * @param aMenuItem menu item name. + * @return ETrue if plugin has specific menu item, EFalse otherwise + */ + TBool HasMenuItem(const TDesC16& aMenuItem); + +public : + + /** + * Gets the id of a content + * + * @param aObjectId image or text id + * @return id of the content + */ + TInt GetIdL(TDesC16& aObjectId); + + /** + * Gets the type of a specific content + * + * @param aObjectId image or text id + * @param aType type + * @return void + */ + void GetTypeL( TDesC16& aObjectId, TDes16& aType ); + + /** + * RefereshL a specific image of text in the widget + * + * @param aOperation operation performed + * @return void + */ + void RefreshL(TDesC16& aOperation ); + + /** + * Is plugin active to publish the data + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsActive(); + + /** + * Publish a specific text of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aContentValue content value + * @return void + */ + /*void PublishTextL(MAiContentObserver* aObserver, + TInt& aContentId, TDesC16& aContentValue);*/ + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aHandle image handle + * @param aMaskHandle handle of the mask image + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TInt aHandle, TInt aMaskHandle); + + /** + * Publish a specific image of the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aPath image path / skin id pattern / mif id Pattern + * @return void + */ + void PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TDesC16& aPath ); + + /** + * Cleans a data from the widget + * + * @param aObserver observer + * @param aContentId content model id + * @return void + */ + void Clean(MAiContentObserver* aObserver, + TInt aContentId ); + + /** + * CWrtData getter + * @return Pointer to CWrtData + */ + inline CWrtData* Data() const + { + return iData; + } + + /* + * Plugin's network status getter + * @return Pointer to Harvester status observer + */ + inline TPluginNetworkStatus NetworkStatus() const + { + return iNetworkStatus; + } + +private: // data + + // Iterator for plugin content + // Own + MAiContentItemIterator* iContent; + + // Array of content observers + // Own + RPointerArray iObservers; + + // Information about the content publisher (this plug-in) + TAiPublisherInfo iInfo; + + // Number of data in the content model. + TInt iDataCount; + + // Dynamic content model + // Own + TAiContentItem* iContentModel; + + // Reference array for Published text + // Own + RPointerArray iDataArray; + + // Service API Data Subscriber. + // Own + CWrtData* iData; + + // References array for published images + // Own + RArray iIconArray; + + // File Server + // Reference + RFs iRfs; + + // Plugin's network status + TPluginNetworkStatus iNetworkStatus; + + // Is Homescreen foreground. + TBool iHSForeGround; + + // Plugin state + TPluginStates iPluginState; + }; + +#endif // WRTDATAPLUGIN_H + + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginconst.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,120 @@ +/* +* 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: +* Content model for data plug-in. +* +*/ + + +#ifndef WRTDATAPLUGINCONST_H +#define WRTDATAPLUGINCONST_H + +#include +#include "wrtdatapluginuids.hrh" + +// AI Data Plug-in ECOM implementation UID. +const TInt KImplUidDataPlugin = WRTDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; +const TUid KUidDataPlugin = { KImplUidDataPlugin }; + +// ================================= CONTENT =================================== + +/** + * Content Model type identifier + */ +_LIT(KText ,"text"); +_LIT(KImage, "image"); +_LIT(KPlugin, "plugin"); + +_LIT(KNewsTicker ,"newsticker"); + + +// CPS Constants +_LIT(KService, "service"); +_LIT(KInterface, "interface"); +_LIT(KCommand, "command"); +_LIT8( KType, "type"); +_LIT( KCpData, "cp_data"); +_LIT( KPubData, "publisher" ); +_LIT( KCpData_PubData, "cp_data:publisher"); + +_LIT8( KFilter, "filter" ); +_LIT8( KDataMap, "data_map"); +_LIT8( KActionTrigger, "action_trigger" ); +_LIT8( KGetList , "GetList" ); +_LIT8( KExecuteAction, "ExecuteAction" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KChangeInfo, "change_info" ); +_LIT8( KListMap, "list_map" ); +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KResults, "results"); +_LIT8( KMenuItems, "menuitems"); +_LIT( KMenuItem16, "menuitem"); +_LIT( KAll, "all"); +_LIT8( KOperation, "operation" ); +_LIT8( KFLAG, "flag"); + +_LIT( KOperationAdd, "add" ); +_LIT( KOperationUpdate, "update" ); +_LIT( KOperationDelete, "delete" ); +_LIT( KOperationExecute, "execute" ); +_LIT( KAddUpdateDelete, "add:update:delete" ); + +_LIT( KDeActive, "deactive"); +_LIT( KActive, "active"); +_LIT( KSuspend , "suspend"); +_LIT( KResume, "resume"); +_LIT( KOnLine, "online"); +_LIT( KOffLine, "offline"); +_LIT( KInActive, "inactive"); +// reserved extension for retrieving mask handle +_LIT8( KImageMask, "image1_mask"); + +_LIT( KSkin, "skin" ); +_LIT( KMif, "mif" ); +_LIT( KMIFExtension, ".mif" ); +_LIT( KColon, ":"); + +_LIT( KTemplateWidget,"ai3templatedwidget"); +_LIT( KWRTPublisher, "wrt_publisher"); +_LIT8(KImage1, "image1"); +const TUint KLeftParenthesis = '('; + + +// WRT Data Plugin Constants +const TUint KPluginNameSeprator = '/'; + +/** + * Maximum length for the content name + */ +const TInt KMaxTypeLength = 8; + +/** + * Maximum length for the content name + */ +const TInt KWRTContentNameMaxLength = 255; + +/** + * Maximum length for the content value + */ +const TInt KWRTContentValueMaxLength = 255; + +/** + * Maximum length for the plugin name + */ +const TInt KAiPluginNameMaxLength = 255; + + +#endif /* WRTDATAPLUGINCONST_H */ diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/inc/wrtdatapluginuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdatapluginuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2005-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: +* {Name} {Company} - {Description of contribution} +* +* Description: +* UIDs for the Active Idle subsystem components. +* +*/ + +#ifndef WRTDATAPLUGINUIDS_HRH +#define WRTDATAPLUGINUIDS_HRH + +#include + +/** + * Ecom dll uid for AI Data plug-in. + */ +#define WRTDP_UID_ECOM_DLL_CONTENTPUBLISHER_DATAPLUGIN 0x200286DC + +/** + * Ecom implementation uid for AI Data plug-in. + */ +#define WRTDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN 0x200286DD + +#endif //WRTDATAPLUGINUIDS_HRH diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/rom/wrtdataplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/rom/wrtdataplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 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: +* IBY file for Data plug-in +* +*/ + +#ifndef WRTDATAPLUGIN_IBY +#define WRTDATAPLUGIN_IBY +#include + +#ifdef RD_CUSTOMIZABLE_AI + +ECOM_PLUGIN(wrtdataplugin.dll, wrtdataplugin.rsc) + +#endif // RD_CUSTOMIZABLE_AI + +#endif // WRTDATAPLUGIN_IBY + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/src/wrtdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,707 @@ +/* +* Copyright (c) 2005-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: +* Profile plug-in publisher +* +*/ + +#include +#include +#include + + +#include "wrtdata.h" +#include "wrtdatapluginconst.h" +#include "wrtdataobserver.h" +#include "wrtdataplugin.h" +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CWrtData* CWrtData::NewL(CWrtDataPlugin* aPlugin) + { + CWrtData* self = new (ELeave) CWrtData(); + CleanupStack::PushL( self ); + self->ConstructL(aPlugin); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CWrtData::CWrtData() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CWrtData::ConstructL(CWrtDataPlugin* aPlugin) + { + iPlugin = aPlugin; + iCommandName = HBufC8::NewL( KWRTContentValueMaxLength ); + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CWrtData::~CWrtData() + { + if( iCommandName ) + { + delete iCommandName; + iCommandName = NULL; + } + if(iObserver) + { + TRAP_IGNORE(iObserver->ReleaseL() ); + delete iObserver; + iObserver = NULL; + } + if( iInterface ) + { + iInterface->Close(); + iInterface = NULL; + } + if( iServiceHandler ) + { + iServiceHandler->Reset(); + delete iServiceHandler; + iServiceHandler = NULL; + } + if ( iContentId ) + { + delete iContentId; + iContentId = NULL; + } + iMenuItems.ResetAndDestroy(); + iMenuTriggers.ResetAndDestroy(); + // not owned + iPlugin = NULL; + } + +// --------------------------------------------------------------------------- +// ConfigureL +// --------------------------------------------------------------------------- +// +void CWrtData::ConfigureL(RAiSettingsItemArray& aConfigurations ) + { + HBufC8* serviceName = HBufC8::NewLC( KWRTContentValueMaxLength ); + HBufC8* interfaceName = HBufC8::NewLC( KWRTContentValueMaxLength ); + + // Interface name + RCriteriaArray criteriaArray; + + TInt count = aConfigurations.Count(); + + for(TInt i = 0;iAiPluginConfigurationItem(); + // if owner is plugin then it (key,value) is for plugin configurations items + if(confItem.Owner() == KPlugin()) + { + if(confItem.Name() == KService()) + { + serviceName->Des().Copy(confItem.Value()); + } + else if( confItem.Name() == KInterface() ) + { + interfaceName->Des().Copy(confItem.Value()); + } + else if( confItem.Name() == KCommand() ) + { + iCommandName->Des().Copy(confItem.Value()); + } + else if( confItem.Name() == KMenuItem16() ) + { + iMenuItems.AppendL( confItem.Value().AllocL() ); + } + else if( confItem.Name() == KPubData() ) + { + iContentId = confItem.Value().AllocL(); + } + } + } + + if( !( serviceName->Des().Length() >= 0 && interfaceName->Des().Length() >= 0 + && iCommandName->Des().Length() >= 0 ) ) + { + // No service to offer without plugin configurations + User::Leave( KErrNotSupported ); + } + + iServiceHandler = CLiwServiceHandler::NewL(); + + // for convenience keep pointers to Service Handler param lists + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + CLiwCriteriaItem* criteriaItem = CLiwCriteriaItem::NewLC( KLiwCmdAsStr, *interfaceName , *serviceName ); + criteriaItem->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + criteriaArray.AppendL( criteriaItem ); + + + // attach Liw criteria + iServiceHandler->AttachL( criteriaArray ); + iServiceHandler->ExecuteServiceCmdL( *criteriaItem, *inParamList, *outParamList ); + + CleanupStack::PopAndDestroy(criteriaItem); + criteriaArray.Reset(); + + // extract CPS interface from output params + TInt pos( 0 ); + outParamList->FindFirst( pos, *interfaceName ); + if( pos != KErrNotFound ) + { + //iInterface is MLiwInterface* + iInterface = (*outParamList)[pos].Value().AsInterface(); + User::LeaveIfNull( iInterface ); + } + else + { + User::Leave( KErrNotFound ); + } + inParamList->Reset(); + outParamList->Reset(); + CleanupStack::PopAndDestroy( interfaceName ); + CleanupStack::PopAndDestroy( serviceName ); + + //Gets the menu items from the publisher registry + GetMenuItemsL(); + + iObserver = CWrtDataObserver::NewL( iInterface, this ); + } + +// --------------------------------------------------------------------------- +// GetMenuItemsL +// --------------------------------------------------------------------------- +// +void CWrtData::GetMenuItemsL() + { + if(iInterface) + { + TInt confindex( 0 ); + + CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* filter = CreateFilterLC( ); + //append filter to input param + ExecuteCommandL( filter, outDataMap, KPubData ); + CleanupStack::PopAndDestroy( filter ); + + TLiwVariant variant; + TInt pos = outDataMap->FindL( KMenuItems, variant ) ; + + if ( pos ) + { + CLiwDefaultMap *menuMap = CLiwDefaultMap::NewLC(); + variant.Get( *menuMap ); + for ( TInt i = 0; i < menuMap->Count(); i++) + { + menuMap->FindL(menuMap->AtL(i), variant ); + HBufC8* value = HBufC8::NewL( KWRTContentValueMaxLength ); + CleanupStack::PushL( value ); + TPtr8 valPtr = value->Des(); + variant.Get( valPtr); + if ( valPtr.Length() > 0 ) + { + iMenuTriggers.AppendL( value ); + CleanupStack::Pop( value ); + HBufC16* triggerName = HBufC16::NewLC( KWRTContentNameMaxLength ); + triggerName->Des().Copy( menuMap->AtL(i) ); + iMenuItems.AppendL( triggerName ); + CleanupStack::Pop( triggerName ); + } + else + { + CleanupStack::PopAndDestroy( value ); + } + variant.Reset(); + } + CleanupStack::PopAndDestroy( menuMap ); + } + variant.Reset(); + CleanupStack::PopAndDestroy( outDataMap ); + } + } + +// --------------------------------------------------------------------------- +// CreateFilterL +// --------------------------------------------------------------------------- +// +CLiwDefaultMap* CWrtData::CreateFilterLC() + { + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + filter->InsertL( KPublisherId, TLiwVariant( KWRTPublisher )); + filter->InsertL( KContentType, TLiwVariant( KTemplateWidget )); + filter->InsertL( KContentId, TLiwVariant( iContentId )); + return filter; + } + +// --------------------------------------------------------------------------- +// HasMenuItem +// --------------------------------------------------------------------------- +// +TBool CWrtData::HasMenuItem(const TDesC16& aMenuItem ) + { + TBool found = EFalse; + for (TInt i = 0; i < iMenuItems.Count(); i++ ) + { + if( aMenuItem == iMenuItems[i] ) + { + found = ETrue; + break; + } + } + return found; + } + +// --------------------------------------------------------------------------- +// PublishAllL +// --------------------------------------------------------------------------- +// +void CWrtData::PublishAllL( MAiContentObserver* aObserver ) + { + PublishL( aObserver ); + } + +// --------------------------------------------------------------------------- +// PublishL +// --------------------------------------------------------------------------- +// +void CWrtData::PublishL( MAiContentObserver* aObserver ) + { + CLiwDefaultMap *outDataMap = CLiwDefaultMap::NewLC(); + //Create filter criteria for requested entries in form of LIW map: + CLiwDefaultMap* filter = CreateFilterLC(); + ExecuteCommandL( filter, outDataMap, KCpData ); + CleanupStack::PopAndDestroy( filter ); + TInt id = KErrNotFound; + TLiwVariant variant; + if ( outDataMap->FindL( KImage1, variant ) ) + { + TInt handle = KErrBadHandle; + TUint uintHandle = 0; + TPtrC16 valPtr; + if ( variant.Get( uintHandle ) ) + { + handle = uintHandle; + } + else if ( !variant.Get( handle ) ) + { + handle = KErrBadHandle; + } + // read as a image handle + if( handle == KErrBadHandle ) + { + // no handle, so read as image path + variant.Get( valPtr ); + iPlugin->PublishImageL(aObserver, EImage1, valPtr ); + } + else + { + TInt maskHandle = KErrBadHandle; + //Look for image mask + if ( outDataMap->FindL( KImageMask, variant ) ) + { + variant.Get( maskHandle ); + } + iPlugin->PublishImageL(aObserver, EImage1, handle, maskHandle ); + } + } + + variant.Reset(); + CleanupStack::PopAndDestroy( outDataMap ); + } + +// --------------------------------------------------------------------------- +// ExecuteCommandL +// --------------------------------------------------------------------------- +// +void CWrtData::ExecuteCommandL(CLiwDefaultMap* aInFilter, CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry ) + { + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( aRegistry ) ); + inParamList->AppendL( type ); + + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( aInFilter )); + inParamList->AppendL( item ); + + // execute service.It is assumed that iInterface is already initiatedd + if(iInterface) + { + iInterface->ExecuteCmdL( *iCommandName, *inParamList, *outParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + type.Reset(); + item.Reset(); + inParamList->Reset(); + + //extracts data map + TInt pos = 0; + outParamList->FindFirst( pos, KResults ); + if( pos != KErrNotFound ) + // results present + { + //extract iterator on results list + TLiwVariant variant = (*outParamList)[pos].Value(); + CLiwIterable* iterable = variant.AsIterable(); + iterable->Reset(); + + //get next result + if( iterable->NextL( variant ) ) + { + //extract content map + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + if( map->FindL( KDataMap, variant) ) + { + variant.Get( *aOutDataMap ); + } + CleanupStack::PopAndDestroy( map ); + } + iterable->Reset(); + variant.Reset(); + } + outParamList->Reset(); + } + +// --------------------------------------------------------------------------- +// ExecuteActionL +// --------------------------------------------------------------------------- +// +void CWrtData::ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger ) + { + HBufC8* triggerName = HBufC8::NewLC( KWRTContentNameMaxLength ); + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + CLiwDefaultMap* filter = NULL; + TInt confindex (0); + + triggerName->Des().Copy(aTrigger); + if ( aObjectId == KPubData ) + { + // this trigger belongs to publisher registery. + // in such case it is assumed that all the items in the widgets + // belongs to same publisher, type and id. + TLiwGenericParam cptype( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + // use the first item configuration to create the filter + filter = CreateFilterLC(); + } + else + { + if ( aObjectId == KMenuItem16 ) + { + TInt pos = KErrNotFound; + for (TInt i = 0; i < iMenuItems.Count(); i++) + { + if ( aTrigger == iMenuItems[i] ) + { + pos = i; + break; + } + } + if( pos == KErrNotFound ) + { + // No such menu items + CleanupStack::PopAndDestroy( triggerName ); + return; + } + triggerName->Des().Copy( iMenuTriggers[pos]->Des() ); + filter = CreateFilterLC(); + } + else + { + //Create filter criteria for requested entries in form of LIW map: + filter = CreateFilterLC(); + } + //append type to inparam list + TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); + inParamList->AppendL( cptype ); + cptype.Reset(); + } + + filter->InsertL( KActionTrigger, TLiwVariant( triggerName->Des() ) ); + //append filter to input param + TLiwGenericParam item( KFilter, TLiwVariant( filter ) ); + inParamList->AppendL( item ); + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList ); + + CleanupStack::PopAndDestroy( filter ); + CleanupStack::PopAndDestroy( triggerName ); + item.Reset(); + + inParamList->Reset(); + outParamList->Reset(); + + } + +// --------------------------------------------------------------------------- +// RegisterL +// --------------------------------------------------------------------------- +// +void CWrtData::RegisterL() + { + CLiwDefaultMap* filter = CreateFilterLC(); + filter->InsertL( KOperation, TLiwVariant( KAddUpdateDelete ) ); + iObserver->RegisterL(filter); + CleanupStack::PopAndDestroy( filter ); + } + +// --------------------------------------------------------------------------- +// RefreshL +// --------------------------------------------------------------------------- +// +void CWrtData::RefreshL( TDesC& aPublisher, TDesC& aContentType, + TDesC& aContentId, TDesC& aOperation ) + { + if ( aPublisher == KWRTPublisher() && aContentType == KTemplateWidget() + && aContentId == iContentId ) + { + iPlugin->RefreshL( aOperation); + } + } + +// --------------------------------------------------------------------------- +// IsPluginActive +// --------------------------------------------------------------------------- +// +TBool CWrtData::IsPluginActive() + { + return iPlugin->IsActive(); + } + +// --------------------------------------------------------------------------- +// PublisherStatusL +// --------------------------------------------------------------------------- +// +void CWrtData::ChangePublisherStatusL(const TDesC& aStatus) + { + if( iContentId == NULL ) + { + return; + } + HBufC8* triggerName = HBufC8::NewLC(KWRTContentNameMaxLength); + triggerName->Des().Copy(aStatus); + + CLiwGenericParamList* inParamList = &iServiceHandler->InParamListL(); + CLiwGenericParamList* outParamList = &iServiceHandler->OutParamListL(); + + TLiwGenericParam type( KType, TLiwVariant( KPubData ) ); + inParamList->AppendL( type ); + + CLiwDefaultMap* filter = CreateFilterLC(); + filter->InsertL(KActionTrigger, TLiwVariant(triggerName->Des()) ); + + TLiwGenericParam item( KFilter, TLiwVariant( filter )); + inParamList->AppendL( item ); + + if(iInterface) + { + iInterface->ExecuteCmdL( KExecuteAction, *inParamList, *outParamList); + } + else + { + User::Leave( KErrNotSupported ); + } + CleanupStack::PopAndDestroy( filter ); + + inParamList->Reset(); + outParamList->Reset(); + CleanupStack::PopAndDestroy( triggerName ); + } + +// --------------------------------------------------------------------------- +// ResumeL +// --------------------------------------------------------------------------- +// +void CWrtData::ResumeL() + { + ChangePublisherStatusL( KResume ); + } + +// --------------------------------------------------------------------------- +// SuspendL +// --------------------------------------------------------------------------- +// +void CWrtData::SuspendL() + { + ChangePublisherStatusL( KSuspend ); + } + +// --------------------------------------------------------------------------- +// ActivateL +// --------------------------------------------------------------------------- +// +void CWrtData::ActivateL() + { + ChangePublisherStatusL( KActive ); + } + +// --------------------------------------------------------------------------- +// DeActivateL +// --------------------------------------------------------------------------- +// +void CWrtData::DeActivateL() + { + ChangePublisherStatusL( KDeActive ); + } + +// --------------------------------------------------------------------------- +// OnLineL +// --------------------------------------------------------------------------- +// +void CWrtData::OnLineL() + { + ChangePublisherStatusL( KOnLine ); + } + +// --------------------------------------------------------------------------- +// offLineL +// --------------------------------------------------------------------------- +// +void CWrtData::OffLineL() + { + ChangePublisherStatusL( KOffLine ); + } + +// --------------------------------------------------------------------------- +// InActiveL +// --------------------------------------------------------------------------- +// +void CWrtData::InActiveL() + { + ChangePublisherStatusL( KInActive ); + } + +// --------------------------------------------------------------------------- +// UpdatePublisherStatusL +// --------------------------------------------------------------------------- +// +void CWrtData::UpdatePublisherStatusL() + { + // Resent the plugin status to publisher + ActivateL(); + if ( iPlugin->IsActive() ) + { + ResumeL(); + } + else + { + SuspendL(); + } + // forward the network status if it uses. + if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) + { + OnLineL(); + } + else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) + { + OffLineL(); + } + } + +// --------------------------------------------------------------------------- +// ResolveSkinItemId +// --------------------------------------------------------------------------- +// +TBool CWrtData::ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId, + TInt& abitmapId, TInt& aMaskId, TDes& aFilename ) + { + // Syntax: skin( ):mif(filename bimapId maskId) + TInt error = KErrNotFound; + TInt pos = aPath.FindF( KSkin ); + if( pos != KErrNotFound ) + { + // Skip skin token + pos += KSkin().Length(); + + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + //lex.SkipSpace(); + + TInt majorId( 0 ); + TInt minorId( 0 ); + + // Resolve major id + error = lex.Val( majorId ); + + // Resolve minor id + lex.SkipSpace(); + error |= lex.Val( minorId ); + + // initilize skin item id object + aItemId.Set( majorId, minorId ); + } + } + + if( (error == KErrNone && aPath.FindF( KColon ) != KErrNotFound ) + || ( error == KErrNotFound ) ) + { + error = KErrNotFound; + pos = aPath.FindF( KMif ); + if ( pos != KErrNotFound ) + { + pos += KMif().Length(); + // Initialize lexer + TLex lex( aPath.Mid( pos ) ); + lex.SkipSpace(); + + // Check left parenthesis + if (lex.Get() == KLeftParenthesis ) + { + lex.SkipSpaceAndMark(); + lex.SkipCharacters(); + // Resolve MifFile name + aFilename.Copy(lex.MarkedToken()); + if( aFilename.Length()!= 0) + { + // Resolve bitmap id + lex.SkipSpace(); + error = lex.Val( abitmapId ); + + // Resolve mask id + // dont return error if it is not found, that is ok + lex.SkipSpace(); + lex.Val( aMaskId ); + } + else + { + error = KErrNotFound; + } + } + } + } + return (error == KErrNone ); + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2005-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: +* Plug-in main class +* +*/ + +#include +#include +#include +#include "wrtdata.h" +#include "wrtdataobserver.h" +#include "wrtdatapluginconst.h" +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CWrtDataObserver::CWrtDataObserver () + { + + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CWrtDataObserver ::~CWrtDataObserver () + { + TRAP_IGNORE( ReleaseL()); + iInterface = NULL; + iData = NULL; + } + +// --------------------------------------------------------------------------- +// Register for notifications +// --------------------------------------------------------------------------- +// +void CWrtDataObserver::RegisterL( CLiwDefaultMap* aFilter ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + // Fill in input list for RequestNotification command + inParamList->AppendL(TLiwGenericParam(KType,TLiwVariant(KCpData_PubData))); + inParamList->AppendL(TLiwGenericParam(KFilter ,TLiwVariant(aFilter))); + + iError = KErrNone; + TRAP( iError, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + 0, + this ) ); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + +// --------------------------------------------------------------------------- +// Sing off to notification +// --------------------------------------------------------------------------- +// +void CWrtDataObserver ::ReleaseL() + { + if( iInterface ) + { + CLiwGenericParamList* inParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( inParamList ); + CLiwGenericParamList* outParamList = CLiwGenericParamList::NewL(); + CleanupStack::PushL( outParamList ); + + TInt err(KErrNone); + TRAP(err, iInterface->ExecuteCmdL( + KRequestNotification, + *inParamList, + *outParamList, + KLiwOptCancel, + this )); + + CleanupStack::PopAndDestroy( outParamList ); + CleanupStack::PopAndDestroy( inParamList ); + } + } + +// --------------------------------------------------------------------------- +// Factory method construction +// --------------------------------------------------------------------------- +// +CWrtDataObserver * CWrtDataObserver::NewL( MLiwInterface* aInterface, CWrtData* aData ) + { + CWrtDataObserver * self = new (ELeave) CWrtDataObserver(); + CleanupStack::PushL( self ); + self->ConstructL( aInterface, aData ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// 2n phase constructor +// --------------------------------------------------------------------------- +// +void CWrtDataObserver::ConstructL( MLiwInterface* aInterface, CWrtData* aData ) + { + iData = aData; + iInterface = aInterface; + } + +// --------------------------------------------------------------------------- +// Handles Published content notification +// --------------------------------------------------------------------------- +// +TInt CWrtDataObserver::HandleNotifyL( + TInt aErrorCode, + TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + + // Is plugin active to refresh the published data + iError = aErrorCode; + TInt count(0); + TInt pos(0); + const TLiwGenericParam* param(NULL); + CLiwDefaultList* listOfMaps = CLiwDefaultList::NewLC(); + param = aEventParamList.FindFirst(pos,KChangeInfo); + if( param ) + { + User::LeaveIfError( param->Value().Get( *listOfMaps ) ); + count = listOfMaps->Count(); + } + TLiwVariant variant; + // Extract the data from the map + for(TInt i = 0;i < count; i++) + { + listOfMaps->AtL(i,variant); + HBufC16* operation = NULL; + + CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); + variant.Get( *map ); + TBool found; + found = map->FindL( KOperation, variant ); + if (found) + { + operation = variant.AsDes().AllocLC(); + } + variant.Reset(); + if( operation->Des() != KOperationExecute ) + { + // Nothing to update for execute action + HBufC16* publisher = NULL; + HBufC16* contentType = NULL; + HBufC16* contentId = NULL; + found = map->FindL( KFLAG, variant ); + if ( found) + { + // notification from publisher registry + if ( operation->Des() != KOperationDelete ) + { + iData->UpdatePublisherStatusL(); + } + } + // ignore update if plugin is in suspend mode + else if ( iData->IsPluginActive() ) + { + // notification from content registry + found = map->FindL( KPublisherId, variant ); + if (found) + { + publisher = variant.AsDes().AllocLC(); + } + variant.Reset(); + found = map->FindL( KContentType, variant ); + if (found) + { + contentType = variant.AsDes().AllocLC(); + } + variant.Reset(); + found = map->FindL( KContentId, variant ); + if (found) + { + contentId = variant.AsDes().AllocLC(); + } + variant.Reset(); + iData->RefreshL( *publisher, *contentType, *contentId, *operation ); + + if ( contentId ) + { + CleanupStack::PopAndDestroy( contentId ); + } + if ( contentType ) + { + CleanupStack::PopAndDestroy( contentType ); + } + if ( publisher ) + { + CleanupStack::PopAndDestroy( publisher ); + } + } + variant.Reset(); + } + if ( operation ) + { + CleanupStack::PopAndDestroy( operation ); + } + CleanupStack::PopAndDestroy( map ); + } + CleanupStack::PopAndDestroy( listOfMaps ); + + return aErrorCode; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,766 @@ +/* +* Copyright (c) 2005-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: +* Profile plug-in publisher +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wrtdatapluginconst.h" +#include "wrtdatapluginuids.hrh" +#include "wrtdataplugin.h" +#include "wrtdata.h" + +// CONST CLASS VARIABLES +const TImplementationProxy KImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidDataPlugin, CWrtDataPlugin::NewL ) + }; + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// Constructs and returns an application object. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / + sizeof( TImplementationProxy ); + return KImplementationTable; + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +CWrtDataPlugin* CWrtDataPlugin::NewL() + { + CWrtDataPlugin* self = new (ELeave) CWrtDataPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Default constructor +// --------------------------------------------------------------------------- +// +CWrtDataPlugin::CWrtDataPlugin() + { + } + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::ConstructL() + { + iInfo.iUid.iUid = WRTDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; + iPluginState = ENone; + iHSForeGround = EFalse; + iNetworkStatus = EUnknown; + iData = CWrtData::NewL(this); + + } + +// --------------------------------------------------------------------------- +// Destructor +// Deletes all data created to heap +// --------------------------------------------------------------------------- +// +CWrtDataPlugin::~CWrtDataPlugin() + { + // deactivate the publishers + if( iData ) + { + if ( iPluginState != EInActive ) + { + TRAP_IGNORE(iData->DeActivateL()); + } + delete iData; + } + iObservers.Close(); + Release( iContent ); + iDataArray.ResetAndDestroy(); + + if( iContentModel) + { + for( TInt i = iDataCount-1;i>=0 ; i-- ) + { + User::Free((TAny*)iContentModel[i].cid); + } + delete []iContentModel; + } + iIconArray.Reset(); + } + +// --------------------------------------------------------------------------- +// Publishes widget's texts and images +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishL() + { + TInt err( KErrNone ); + User::LeaveIfError( iRfs.Connect() ); + + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( int i = 0; i < observers; i++ ) + { + MAiContentObserver* observer = iObservers[i]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + {// Publish all the data + iData->PublishAllL(observer); + observer->Commit( transactionId ); + } + + // Release memory of the published text + iDataArray.ResetAndDestroy(); + // Release memory of the published icons + iIconArray.Reset(); + } + iRfs.Close(); + } + +// --------------------------------------------------------------------------- +// Publish a specific text of the widget +// --------------------------------------------------------------------------- +// +/* +void CWrtDataPlugin::PublishTextL(MAiContentObserver* aObserver, + TInt& aContentId, TDesC16& aContentValue) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aContentValue.Length() > 0 ) + { + HBufC* contentText = HBufC::NewLC(aContentValue.Size()); + TPtr16 cDes = contentText->Des(); + cDes.Copy(aContentValue); + aObserver->Publish( *this, aContentId, cDes, aContentId ); + iDataArray.AppendL( contentText ); + CleanupStack::Pop( contentText ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + } + }*/ + +// --------------------------------------------------------------------------- +// Publish a specific image of the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TDesC16& aPath ) + { + TInt err = KErrNone; + TAknsItemID iconId; + iconId.iMajor=0; + iconId.iMinor=0; + TInt bitmapId(0); + TInt maskId(0); + TFileName fileName; + CGulIcon* icon = NULL; + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + TBool inSkin = iData->ResolveSkinIdAndMifId( aPath, iconId, bitmapId, maskId, fileName ); + if ( inSkin ) + { + // Load from skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + if ( iconId.iMajor != 0 && iconId.iMajor!=0 ) + { + // Create icon with fall back + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + mask, + fileName, /* backup filename */ + bitmapId, /* backup bit map id */ + maskId)); /* backup mask id */ + } + else if( bitmapId !=0 ) + { + if ( maskId!=0 ) + { + // Create icon from Mif filename , bitmap id and mask id + TRAP_IGNORE(icon = AknsUtils::CreateGulIconL( + skin, + iconId, + fileName, + bitmapId, + maskId) ); + } + else + { + TRAP_IGNORE(AknsUtils::CreateIconL( + skin, + iconId, + bitmap, + fileName, /* backup filename */ + bitmapId)); /* backup bit map id */ + } + } + + if ( icon == NULL && bitmap != NULL ) + { + icon = CGulIcon::NewL( bitmap, mask ); + } + + if ( icon != NULL ) // Syntax correct but icon not found + { + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + err = KErrNotFound; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + else // Interpret as File path + { + RFile* iconFile = new (ELeave) RFile(); + err = iconFile->Open( iRfs, aPath, EFileShareReadersOnly | EFileRead ); + if( err == KErrNone ) + { + aObserver->Publish( *this, aContentId, *iconFile, aContentId ); + } + else + { + aObserver->Clean( *this, aContentId, aContentId ); + } + iconFile->Close(); + delete iconFile; + iconFile = NULL; + } + } + } + +// --------------------------------------------------------------------------- +// Publish a image of the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::PublishImageL(MAiContentObserver* aObserver, + TContentItem aContentId, TInt aHandle, TInt aMaskHandle ) + { + if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) + { + if( aHandle != KErrBadHandle ) + { + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + if( KErrNone == bitmap->Duplicate( aHandle) ) + { + // Take the ownership + CGulIcon* icon = CGulIcon::NewL(bitmap); + if( aMaskHandle != KErrBadHandle ) + { + CFbsBitmap* mask = new (ELeave) CFbsBitmap(); + if (KErrNone == mask->Duplicate( aMaskHandle) ) + { + icon->SetMask( mask ); + } + } + aObserver->PublishPtr( *this, aContentId, icon , aContentId ); + iIconArray.Append(icon); + } + else + { + delete bitmap; + bitmap = NULL; + aObserver->Clean( *this, aContentId, aContentId ); + } + } + } + } + +// --------------------------------------------------------------------------- +// Gets the id of a content +// --------------------------------------------------------------------------- +// +TInt CWrtDataPlugin::GetIdL( TDesC16& aObjectId) + { + TInt id = KErrNotFound; + HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); + for( TInt i = 0;i< iDataCount; i++ ) + { + objectId->Des().Copy((TUint16*)iContentModel[i].cid); + if( aObjectId == objectId->Des() ) + { + id = iContentModel[i].id; + break; + } + } + CleanupStack::PopAndDestroy( objectId ); + return id; + } + + +// --------------------------------------------------------------------------- +// Gets type of a content +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::GetTypeL(TDesC16& aObjectId, TDes16& aType ) + { + HBufC16* objectId = HBufC16::NewLC( KAiContentIdMaxLength ); + for( TInt i = 0;i< iDataCount; i++ ) + { + objectId->Des().Copy((TUint16*)iContentModel[i].cid); + if( aObjectId == objectId->Des() ) + { + if( iContentModel[i].type == KAiContentTypeText) + { + aType.Copy( KText ); + } + else if( iContentModel[i].type == KAiContentTypeBitmap) + { + aType.Copy( KImage ); + } + break; + } + } + CleanupStack::PopAndDestroy( objectId ); + } + +// --------------------------------------------------------------------------- +//Refresh a specific image of text in the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::RefreshL(TDesC16& aOperation) + { + TInt err( KErrNone ); + User::LeaveIfError( iRfs.Connect() ); + TInt observers( iObservers.Count() ); + TInt transactionId = reinterpret_cast( this ); + + for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ ) + { + MAiContentObserver* observer = iObservers[obsIndex]; + + if ( observer->StartTransaction( transactionId ) == KErrNone ) + { + if( aOperation != KOperationDelete) + { + iData->PublishL( observer ); + } + else + { + Clean( observer , EImage1 ) ; + } + + observer->Commit( transactionId ); + } + + // Relese memory of the published text + iDataArray.ResetAndDestroy(); + // Release memory of the published icons + iIconArray.Reset(); + } + + iRfs.Close(); + } + +// --------------------------------------------------------------------------- +// Cleans a data from the widget +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::Clean(MAiContentObserver* aObserver, + TInt aContentId ) + { + if ( aObserver->CanPublish( *this, aContentId, aContentId ) ) + { + aObserver->Clean( *this, aContentId, aContentId ); + } + + } +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is requested to unload its engines due backup operation +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::Stop( TAiTransitionReason aReason ) + { + if( iPluginState == EResume ) + { + Suspend( aReason ); + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::Resume( TAiTransitionReason aReason ) + { + TRAP_IGNORE( DoResumeL( aReason ) ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-in is instructed that it is not allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::Suspend( TAiTransitionReason aReason ) + { + switch( aReason ) + { + case EAiKeylockDisabled: + case EAiKeylockEnabled: + { + // handled in resume + break; + } + default : + { + iPluginState = ESuspend; + TRAP_IGNORE ( iData->SuspendL() ); + } + } + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// The plug-in MUST maintain a registry of subscribers and send +// notification to all of them whenever the state changes or new content +// is available +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::SubscribeL( MAiContentObserver& aObserver ) + { + iObservers.AppendL( &aObserver ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Plug-ins take ownership of the settings array, so it must either +// store it in a member or free it. +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) + { + if( iDataCount > 0 ) + { + // We own the array so destroy it + aSettings.ResetAndDestroy(); + return; + } + + RAiSettingsItemArray contentItemsArr; + RAiSettingsItemArray configurationItemsArr; + RAiSettingsItemArray settingItemsArr; + + TInt count = aSettings.Count(); + for(TInt i = 0; i < count; i++ ) + { + MAiPluginSettings* pluginSetting = aSettings[i]; + if( pluginSetting->AiPluginItemType() == EAiPluginContentItem ) + { + contentItemsArr.Append(pluginSetting); + } + else if( pluginSetting->AiPluginItemType() == EAiPluginConfigurationItem ) + { + configurationItemsArr.Append(pluginSetting); + } + else + { + settingItemsArr.Append(pluginSetting); + } + } + + iDataCount = contentItemsArr.Count(); + if(iDataCount > 0 ) + { + // Create the content Model + HBufC16* contentId = HBufC16::NewLC( KAiContentIdMaxLength + KAiPluginNameMaxLength ); + iContentModel = new TAiContentItem[iDataCount]; + for(TInt i = 0; i < iDataCount; i++) + { + MAiPluginContentItem& contentItem = (contentItemsArr[i])->AiPluginContentItem(); + iContentModel[i].id = i; + /*if( contentItem.Type() == KText() || contentItem.Type() == KNewsTicker() ) + { + // text + iContentModel[i].type = KAiContentTypeText; + }*/ + if( contentItem.Type() == KImage() ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + + contentId->Des().Copy(contentItem.Name()); + contentId->Des().Delete(0, contentId->Des().LocateReverse(KPluginNameSeprator) +1); + + TInt sizeOfContentId = contentId->Des().Size()+sizeof(wchar_t); + iContentModel[i].cid = static_cast( User::Alloc( sizeOfContentId ) ); + Mem::Copy((TAny*)iContentModel[i].cid, contentId->Des().PtrZ(), sizeOfContentId); + + contentId->Des().Delete( 0, contentId->Des().Length()); + } + + CleanupStack::PopAndDestroy( contentId ); + iContent = AiUtility::CreateContentItemArrayIteratorL( iContentModel, iDataCount ); + // Configurations + iData->ConfigureL(configurationItemsArr); + + iPluginState = ESuspend; + // Register for notifications + iData->RegisterL(); + + // Activate the publisher + iData->ActivateL(); + } + + settingItemsArr.Reset(); + contentItemsArr.Reset(); + configurationItemsArr.Reset(); + // We own the array so destroy it + aSettings.ResetAndDestroy(); + // publish the initial data + PublishL(); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// Returns the extension interface. Actual type depends on the passed +// aUid argument. +// --------------------------------------------------------------------------- +// +TAny* CWrtDataPlugin::Extension( TUid aUid ) + { + if ( aUid == KExtensionUidProperty ) + { + return static_cast( this ); + } + else if (aUid == KExtensionUidEventHandler) + { + return static_cast( this ); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Read property of publisher plug-in. +// --------------------------------------------------------------------------- +// +TAny* CWrtDataPlugin::GetPropertyL( TInt aProperty ) + { + TAny* property = NULL; + + switch ( aProperty ) + { + case EAiPublisherInfo: + { + property = static_cast( &iInfo ); + break; + } + + case EAiPublisherContent: + { + property = static_cast( iContent ); + break; + } + default: + break; + } + + return property; + } + +// --------------------------------------------------------------------------- +// From class MAiPropertyExtension +// Write property value to optimize the content model. +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) + { + switch ( aProperty ) + { + case EAiPublisherInfo: + { + if( aValue ) + { + const TAiPublisherInfo* info = static_cast( aValue ); + iInfo.iName.Copy( info->iName ); + iInfo.iNamespace.Copy( info->iNamespace ); + } + break; + } + default: + break; + } + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::HandleEvent( TInt /*aEvent*/, const TDesC& /*aParam*/ ) + { + // This is not as there is no event id to retrieve in this dynamic plugin. + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Handles an event sent by the AI framework. +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::HandleEvent( const TDesC& aEventName, const TDesC& aParam ) + { + // We have no way of reporting errors to framework so just ignore them. + TRAP_IGNORE(iData->ExecuteActionL( aEventName , aParam ) ); + } + +// --------------------------------------------------------------------------- +// From class MAiEventHandlerExtension. +// Invoked by the framework for querying if plugin has menu item +// --------------------------------------------------------------------------- +// +TBool CWrtDataPlugin::HasMenuItem( const TDesC16& aMenuItem ) + { + return iData->HasMenuItem ( aMenuItem ); + } + +// --------------------------------------------------------------------------- +// From class CAiContentPublisher +// framework instructs plug-in that it is allowed to consume CPU resources +// --------------------------------------------------------------------------- +// +void CWrtDataPlugin::DoResumeL( TAiTransitionReason aReason ) + { + //update in startup phase and idle is on foreground. + switch ( aReason ) + { + case EAiIdleOnLine: + { + iNetworkStatus = EOnline; + iData->OnLineL(); + break; + } + case EAiIdleOffLine: + { + iNetworkStatus = EOffline; + iData->OffLineL(); + break; + } + case EAiIdlePageSwitch: + { + if ( iPluginState == EResume ) + { + iData->SuspendL(); + } + iPluginState = EInActive; + iData->InActiveL(); + } + break; + case EAiSystemStartup: + case EAiIdleForeground: + { + iHSForeGround = ETrue; + } + case EAiBacklightOn: + { + if ( iPluginState == ESuspend ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockDisabled: + { + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == ESuspend ) + { + iPluginState = EResume; + iData->ResumeL(); + } + break; + } + case EAiKeylockEnabled: + { + // Key lock events considered only if HS is in foreground + if ( iHSForeGround && iPluginState == EResume ) + { + iPluginState = ESuspend ; + iData->SuspendL(); + } + break; + } + case EAiScreenLayoutChanged: + { + // ignore events + break; + } + case EAiGeneralThemeChanged: + { + // ignore event + break; + } + case EAiIdleBackground: + { + iHSForeGround = EFalse; + } + default : + { + if ( iPluginState == EResume ) + { + iPluginState = ESuspend; + iData->SuspendL(); + } + break; + } + } + } + +// --------------------------------------------------------------------------- +// Is plugin active to publish the data +// --------------------------------------------------------------------------- +// +TBool CWrtDataPlugin::IsActive() + { + return (iPluginState == EResume ); + } diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/aiwspluginanim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/aiwspluginanim.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2005-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: Active Idle Window Server Plug-in. +* +*/ + +#ifndef C_AIWSPLUGINANIM_H +#define C_AIWSPLUGINANIM_H + +#include +#include "aiwspluginanimdef.h" +#include "uistate.h" +#include "modifierkeytracker.h" + +namespace AiWsPlugin + { + class CEventHandler; + } + +typedef MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo TIdPlgWindowGroupInfo; + +/** + * @ingroup group_wsplugin + * + * Active Idle Window Server Plug-in. + * + * @since 3.2 + */ +class CAiWsPluginAnim : + public CWindowAnim, public AiWsPlugin::MUiState + { + public: // Constructors and destructors + + /** + * Constructor. + */ + CAiWsPluginAnim(); + + /** + * Destructor. + */ + ~CAiWsPluginAnim(); + +// From base class CWindowAnim + + TInt CommandReplyL( TInt aOpcode, TAny* aArgs ); + + void Command( TInt aOpcode, TAny* aArgs ); + + void Animate( TDateTime* aDateTime ); + + void ConstructL( TAny* aArgs, TBool aHasFocus ); + + void Redraw(); + + void FocusChanged( TBool aState ); + + TBool OfferRawEvent( const TRawEvent& aRawEvent ); + +// From base class MUiState + + TUint Modifiers() const; + + TBool HasFocus() const; + + private: // Implementation + + void AddEventHandlerAndPopL( AiWsPlugin::CEventHandler* aEventHandler ); + + private: // Data + + /// Event handlers. Own. + RPointerArray< AiWsPlugin::CEventHandler > iEventHandlers; + + /// Window group ids passed as construction parameters + TAiWsPluginAnimInitData iWgInfo; + + /// Active Idle Focus status + TBool iAiFocused; + + /// Modifier key tracker + AiWsPlugin::TModifierKeyTracker iModifierTracker; + }; + +#endif // C_AIWSPLUGINANIM_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/aiwspluginanimdll.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/aiwspluginanimdll.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + +#ifndef AIWSPLUGINANIMDLL_H +#define AIWSPLUGINANIMDLL_H + +#include +#include + +/** +* @ingroup group_wsplugin +* +* Active Idle Window Server plug-in. +* +* @since S60 3.2 +*/ +class CAiWsPluginAnimDll + : public CAnimDll + { +public: // From base classes + + /** + * From CAnimDll, creates an instance of requested plugin. + * + * @param aType type of the plug-in. AI WS implements EAnimKeyForward. + * @return instance of animation service. + */ + virtual CAnim* CreateInstanceL( TInt aType ); + + }; + +/** +* Creates an instance of CPhoneAnimDll. +* Factory function. +* +* @since S60 3.2 +* @return instance of anim dll. +*/ +IMPORT_C CAnimDll* CreateCAnimDllL(); + +#endif // AIWSPLUGINANIMDLL_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/eventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/eventhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 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: Event handler base class for Active Idle WS Plug-in. +* +*/ + + +#ifndef C_AIWSPLUGIN_EVENTHANDLER_H +#define C_AIWSPLUGIN_EVENTHANDLER_H + + +#include + +class TRawEvent; + +namespace AiWsPlugin { + +class MUiState; + +/** + * @ingroup group_wsplugin + * + * Event handler base class for Active Idle WS Plug-in. + * + * Window server plug-in animation class CAiWsPluginAnim forwards events to + * instances of this class for processing. + * + * @since S60 3.2 + */ +class CEventHandler : public CBase + { +public: + /** + * Sets the UI State query interface for this event handler. + */ + virtual void SetUiStateQuery( MUiState& aUiState ) =0; + + /** + * Calls to CWindowAnim::FocusChanged are forwarded to this function. + * + * @param Indicates whether the focus has or has not changed. + */ + virtual void FocusChanged( TBool aState ) =0; + + /** + * Calls to CWindowAnim::OfferRawEvent are forwarded to this function. + * Forwarding is stopped if this function returns true. + * + * @param aRawEvent The raw event to be processed. + * @return ETrue if the raw event is handled by this function, EFalse if + * the function chooses not to process it. + */ + virtual TBool OfferRawEvent(const TRawEvent& aRawEvent) =0; + }; + +} // namespace AiWsPlugin + +#endif // C_AIWSPLUGIN_EVENTHANDLER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/keyhandlertimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/keyhandlertimer.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2005-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: Key handler timer for Active Idle WS Plug-in. +* +*/ + +#ifndef C_AIWSPLUGIN_KEYHANDLERTIMER_H +#define C_AIWSPLUGIN_KEYHANDLERTIMER_H + +#include + +namespace AiWsPlugin { + +/** + * Handler timer interface. + */ +class MHandlerTimer + { +public: + virtual void TimerDone() = 0; + }; + +/** + * @ingroup group_wsplugin + * + * Logs app launch handler for Active Idle WS Plug-in. + */ +class CKeyHandlerTimer : + public CTimer + { +public: + +// Construction + + static CKeyHandlerTimer* NewL( MHandlerTimer* aHandler ); + + static CKeyHandlerTimer* NewLC( MHandlerTimer* aHandler ); + + ~CKeyHandlerTimer(); + +// new methods + + void StopTimer(); + + TBool IsActive(); + +protected: // From CActive + + void RunL(); + + TInt RunError( TInt aError ); + +private: + +// Construction + + CKeyHandlerTimer( MHandlerTimer* aHandler ); + + void ConstructL(); + +private: // data + + /// Pointer to handler timer. Not owned. + MHandlerTimer* iHandler; + }; + +} // namespace AiWsPlugin + + +#endif // C_AIWSPLUGIN_KEYHANDLERTIMER_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/keylockcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/keylockcontrol.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2005-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: Keylock handler settings class and control interface for +* Active Idle WS Plug-in. +* +*/ + + +#ifndef M_AIWSPLUGIN_KEYLOCKCONTROL_H +#define M_AIWSPLUGIN_KEYLOCKCONTROL_H + +#include +class TRawEvent; + +namespace AiWsPlugin { + +class TKeypadSettings; +class TKeylockState; + +/** + * @ingroup group_wsplugin + * + * Callback interface for CKeyLockHandler internal states. + */ +class MKeyLockHandlerControl + { +public: + + virtual const TKeypadSettings& Settings() const = 0; + + virtual void StartTimeoutTimer( TInt aTimeout = -1 ) = 0; + + virtual void StopTimeoutTimer() = 0; + + virtual void ActivateKeypadLock() = 0; + + virtual void CancelKeypadLock() = 0; + + virtual void KeypadLockTimeout() = 0; + + virtual void SetNextState( const TKeylockState& aState ) = 0; + + virtual void ActivateNextState() = 0; + + virtual void SetLastLockKeyScanCode( TInt aScanCode ) = 0; + + virtual TInt LastLockKeyScanCode() const = 0; + + virtual TBool HasFocus() = 0; + + virtual TBool TimeoutTimerActive() = 0; + + virtual TBool IsFirstLockKey( TInt aScanCode ) = 0; + + virtual TBool IsSecondLockKey( TInt aScanCode ) = 0; + + +protected: + /** + * Protected dtor prevents deletion through this interface. + */ + ~MKeyLockHandlerControl() { } + }; + +} // namespace AiWsPlugin + +#endif // M_AIWSPLUGIN_KEYLOCKCONTROL_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/keylockhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/keylockhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2005-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: Keylock handler for Active Idle WS Plug-in. +* +*/ + + +#ifndef C_AIWSPLUGIN_KEYLOCKHANDLER_H +#define C_AIWSPLUGIN_KEYLOCKHANDLER_H + +#include "eventhandler.h" +#include "keylockcontrol.h" +#include "keypadsettings.h" +#include "keyhandlertimer.h" + +class CKeyLockPolicyApi; +namespace AiWsPlugin { + +class TKeylockState; + +/** + * @ingroup group_wsplugin + * + * Keylock handler for Active Idle WS Plug-in. + * + * Monitors key presses that activate keyboard lock on the device. + * + * @since S60 3.2 + */ +class CKeyLockHandler : + public CEventHandler, + public MKeyLockHandlerControl, + public MHandlerTimer + { +public: + + static CKeyLockHandler* NewLC(); + + ~CKeyLockHandler(); + +// from MHandlerTimer + + void TimerDone(); + +private: + +// from base class CEventHandler + + void SetUiStateQuery( MUiState& aUiState ); + + void FocusChanged( TBool aState ); + + TBool OfferRawEvent(const TRawEvent& aRawEvent); + +// from base class MKeyLockHandlerControl + + const TKeypadSettings& Settings() const; + + void StartTimeoutTimer( TInt aTimeout ); + + void StopTimeoutTimer(); + + void ActivateKeypadLock(); + + void CancelKeypadLock(); + + void KeypadLockTimeout(); + + void SetNextState( const TKeylockState& aState ); + + void ActivateNextState(); + + void SetLastLockKeyScanCode( TInt aScanCode ); + + TInt LastLockKeyScanCode() const; + + TBool HasFocus(); + + TBool TimeoutTimerActive(); + +// construction + + CKeyLockHandler(); + + void ConstructL(); + + static TInt TimerElapsed( TAny* aSelf ); + + TBool IsFirstLockKey( TInt aScanCode ); + + TBool IsSecondLockKey( TInt aScanCode ); + +private: // data + /** + * Current state of this object. + * Not owned. + */ + const TKeylockState* iCurrentState; + + /** + * Next state of this object. + * Not owned. + */ + const TKeylockState* iNextState; + + /** + * Timeout timer for keypad lock. + * Own. + */ + CPeriodic* iKeypadLockTimer; + + /** + * Key lock settings. + */ + TKeypadSettings iSettings; + + /** + * Last value of SetLastLockKeyScanCode( TInt aScanCode). + */ + TInt iLastLockKeyScanCode; + + /** + * Pointer to ui state. + * Not owned. + */ + MUiState* iUiState; + + /** + * For checking keylock buttons + * Own + */ + CKeyLockPolicyApi *iKeylockApi; + }; + +} // namespace AiWsPlugin + + +#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/keylockstates.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/keylockstates.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2005-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: Keylock handler states for Active Idle WS Plug-in. +* +*/ + + +#ifndef T_AIWSPLUGIN_KEYLOCKSTATES_H +#define T_AIWSPLUGIN_KEYLOCKSTATES_H + +#include +class TRawEvent; + +namespace AiWsPlugin { + +class MKeyLockHandlerControl; + +/** + * @ingroup group_wsplugin + * + * Internal state structure for class CKeyLockHandler. + * The states are behaviour-only and thus consist of just function pointers. + */ +class TKeylockState + { +public: + /** + * Returns the state machine's initial startup state. + */ + static const TKeylockState& StartupState(); + + /** + * Returns this state's default succeeding state. + */ + inline const TKeylockState& DefaultNextState() const + { return (*iDefaultNextState)(); } + + /** + * Handles Active Idle focus changes. + * + * @param aControl Key lock control interface. + * @param aState current focus state. See CWindowAnim::FocusChaned. + */ + inline void FocusChanged( MKeyLockHandlerControl& aControl, TBool aState ) const + { (*iFocusChanged)( aControl, aState ); } + + /** + * Handles raw Window Server events. + * + * @param aControl Key lock control interface. + * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent. + * @return true if the event was consumed by the state, false otherwise. + */ + inline TBool OfferRawEvent + ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) const + { return (*iOfferRawEvent)( aControl, aRawEvent ); } + + /** + * Handles key lock timeout timer elapsed event. + * + * @param aControl Key lock control interface. + */ + inline void TimerElapsed( MKeyLockHandlerControl& aControl ) const + { (*iTimerElapsed)( aControl ); } + +// Public function pointers + + /** + * Pointer to state function that returns this state's default succeeding state. + */ + const TKeylockState& (*iDefaultNextState)(); + + /** + * Pointer to state function which handles Active Idle focus changes. + * + * @param aControl Key lock control interface. + * @param aState current focus state. See CWindowAnim::FocusChaned. + */ + void (*iFocusChanged)( MKeyLockHandlerControl& aControl, TBool aState ); + + /** + * Pointer to state function which handles raw Window Server events. + * + * @param aControl Key lock control interface. + * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent. + * @return true if the event was consumed by the state, false otherwise. + */ + TBool (*iOfferRawEvent)( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ); + + /** + * Pointer to state function which handles key lock timeout timer elapsed + * event. + * + * @param aControl Key lock control interface. + */ + void (*iTimerElapsed)( MKeyLockHandlerControl& aControl ); + }; + +} // namespace AiWsPlugin + +#endif // T_AIWSPLUGIN_KEYLOCKSTATES_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/keypadsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/keypadsettings.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2005-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: Keypad settings class for Active Idle WS Plug-in. +* +*/ + + +#ifndef T_AIWSPLUGIN_KEYPADSETTINGS_H +#define T_AIWSPLUGIN_KEYPADSETTINGS_H + +#include +class TRawEvent; + +namespace AiWsPlugin { + +/** + * @ingroup group_wsplugin + * + * Internal class for keypad settings. + */ +class TKeypadSettings + { +public: + /** + * Initializes this object from settings repository. + */ + void ReadFromRepositoryL(); + + /** + * Returns true if aScanCode matches the first lock key. + */ + TBool IsFirstLockKey( TInt aScanCode ) const; + + /** + * Returns true if aScanCode matches the second lock key. + */ + TBool IsSecondLockKey( TInt aScanCode ) const; + + /** + * Returns the key lock timeout in microseconds. + */ + TTimeIntervalMicroSeconds32 KeylockTimeout() const; + + /** + * Returns true if aScanCode matches the SIND key. + */ + TBool IsSINDKey( TInt aScanCode ) const; + + /** + * Returns the key lock timeout in microseconds. + */ + TTimeIntervalMicroSeconds32 KeySINDTimeout() const; + + TInt16 MapNkpScanCodeToChar( TInt aScanCode ); + +private: // data + /** + * Scan code of first keypad lock key. + */ + TInt16 iFirstLockKeyScanCode; + + /** + * Character code (if any) that matches iFirstLockKeyScanCode. + */ + TInt16 iFirstLockKeyChar; + + /** + * Scan code of second keypad lock key. + */ + TInt16 iSecondLockKeyScanCode; + + /** + * Character code (if any) that matches iSecondLockKeyChar. + */ + TInt16 iSecondLockKeyChar; + + /** + * Scan code of optional second keypad lock key. + */ + TInt16 iSecondLockKeyScanCode2; + + /** + * Character code (if any) that matches iSecondLockKeyChar2. + */ + TInt16 iSecondLockKeyChar2; + + /** + * Keypad lock timeout in microseconds. + */ + TTimeIntervalMicroSeconds32 iKeylockTimeout; + + /** + * Scan code of SIND keypad key. + */ + TInt16 iSINDKeyScanCode; + + /** + * Character code (if any) that matches iSINDKeyScanCode. + */ + TInt16 iSINDKeyScanChar; + + /** + * Keypad SIND timeout in microseconds. + */ + TTimeIntervalMicroSeconds32 iKeySINDTimeout; + + }; + +} // namespace AiWsPlugin + +#endif // T_AIWSPLUGIN_KEYPADETTINGS_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/logslaunchhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/logslaunchhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2005-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: Logs app launch handler for Active Idle WS Plug-in. +* +*/ + + +#ifndef C_AIWSPLUGIN_LOGSLAUNCHANDLER_H +#define C_AIWSPLUGIN_LOGSLAUNCHANDLER_H + +#include "eventhandler.h" +#include "keyhandlertimer.h" + +namespace AiWsPlugin { + +/** + * @ingroup group_wsplugin + * + * Logs app launch handler for Active Idle WS Plug-in. + */ +class CLogsLaunchHandler : + public CEventHandler, + public MHandlerTimer + { +public: + + static CLogsLaunchHandler* NewLC(); + + ~CLogsLaunchHandler(); + +private: + +// from base class CEventHandler + + void SetUiStateQuery( MUiState& aUiState ); + + void FocusChanged( TBool aState ); + + TBool OfferRawEvent(const TRawEvent& aRawEvent); + +// from MHandlerTimer + + void TimerDone(); + +// Construction + + CLogsLaunchHandler(); + + void ConstructL(); + +private: // data + + /// Pointer to state. Not owned. + MUiState* iUiState; + + /// Timer for long key down event. Owned. + CKeyHandlerTimer* iTimer; + }; + +} // namespace AiWsPlugin + + +#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/modifierkeytracker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/modifierkeytracker.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2005-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: Modifier key status tracker for Active Idle WS Plug-in. +* +*/ + + +#ifndef T_AIWSPLUGIN_MODIFIERKEYTRACKER_H +#define T_AIWSPLUGIN_MODIFIERKEYTRACKER_H + +#include + +class TRawEvent; + +namespace AiWsPlugin { + +/** + * @ingroup group_wsplugin + * + * Numeric key forwarding handler for Active Idle WS Plug-in. + * + * Monitors and forwards numeric key presses that should be handled by Phone + * application. + * + * @since S60 3.2 + */ +class TModifierKeyTracker + { +public: + TModifierKeyTracker(); + + /** + * Returns true if modifier key states were updated. + */ + TBool Update(const TRawEvent& aRawEvent); + + /** + * Returns the current modifier key status as bits, see enum TEventModifier. + */ + TUint Status() const { return iModifiers; } + +private: // data + TUint iModifiers; + }; + +} // namespace AiWsPlugin + + +#endif // T_AIWSPLUGIN_MODIFIERKEYTRACKER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/numerickeyhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/numerickeyhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2005-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: Numeric key forwarding handler for Active Idle WS Plug-in. +* +*/ + + +#ifndef C_AIWSPLUGIN_NUMERICKEYHANDLER_H +#define C_AIWSPLUGIN_NUMERICKEYHANDLER_H + +#include "eventhandler.h" +#include +#include + +class MAnimGeneralFunctionsWindowExtension; +class MAiPSPropertyObserver; + +namespace AiWsPlugin { + +class MUiState; + +/** + * @ingroup group_wsplugin + * + * Numeric key forwarding handler for Active Idle WS Plug-in. + * + * Monitors and forwards numeric key presses that should be handled by Phone + * application. + * + * @since S60 3.2 + */ +class CNumericKeyHandler : + public CEventHandler, + private MCenRepNotifyHandlerCallback + { +public: + /** + * Creates a new instance of this class. + * + * @param aTargetWgId Window Group id of the target application where + * numeric key events are forwarded. + * @return A new object of this class. The returned object is left on the + * cleanup stack. + */ + static CNumericKeyHandler* NewLC + ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt ); + + ~CNumericKeyHandler(); + +private: +// from base class CEventHandler + void SetUiStateQuery( MUiState& aUiState ); + + void FocusChanged( TBool aState ); + + TBool OfferRawEvent(const TRawEvent& aRawEvent); + +// new methods + CNumericKeyHandler + ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt ); + + void ConstructL(); + + TBool CheckPostToTarget( const TRawEvent& aRawEvent ) const; + + void LoadInputLanguageKeyBindings( TInt aLanguage ); + + static TInt HandleQwertyModeChanged( TAny *aPtr ); + + TInt HandleInputLanguageChanged( TInt aNewValue ); + + void SetQwertyMode( TInt aValue ); + + void SetInputLanguage( TInt aValue ); + +// from base class MCenRepNotifyHandlerCallback + + void HandleNotifyGeneric(TUint32 aKey); + + void HandleNotifyError(TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler); + +private: // data + + /// Target window group id + TInt iTargetWgId; + + /// Anim extension. Not own. + MAnimGeneralFunctionsWindowExtension* iWindowExt; + + /// Pointer ot state. Not own. + MUiState* iUiState; + + /// Qwerty ps observer. Owned. + MAiPSPropertyObserver* iQwertyObserver; + + /// Input language observer. Owned. + CCenRepNotifyHandler* iInputLanguageObserver; + + /// Input language repository. Owned. + CRepository* iInputLanguageRepository; + + /// Numeric keys array. + RArray iNumericKeys; + + /// Qwerty mode indicator. + TInt iQwertyMode; + + /// Input language indicator. + TInt iInputLanguage; + }; + +} // namespace AiWsPlugin + + +#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/panic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/panic.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2005-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: Panic codes and helper function for Active Idle WS Plug-in. +* +*/ + + +#ifndef AIWSPLUGIN_PANIC_H +#define AIWSPLUGIN_PANIC_H + +#include "panic.h" // Include AI2 panic.h + +namespace AiWsPlugin { + +#ifndef NDEBUG + +/** + * Panic codes for Active Idle WS Plug-in. + */ +enum TPanicCode + { + /** + * Key lock state machine received an invalid event. + */ + EPanicInvalidKeylockEvent = 1 + }; + +void Panic( TPanicCode aPanicCode ); + +#endif // !NDEBUG + +} // namespace AiWsPlugin + +#endif // AIWSPLUGIN_PANIC_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/sindlaunchhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/sindlaunchhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2005-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: SIND launch handler for Active Idle WS Plug-in. +* +*/ + + +#ifndef C_AIWSPLUGIN_SINDLAUNCHANDLER_H +#define C_AIWSPLUGIN_SINDLAUNCHANDLER_H + +#include "eventhandler.h" +#include "keyhandlertimer.h" + +#include + +namespace AiWsPlugin { + +/** + * @ingroup group_wsplugin + * + * Logs app launch handler for Active Idle WS Plug-in. + */ +class CSINDLaunchHandler : + public CEventHandler, + public MHandlerTimer + { +public: + +// Construction + + static CSINDLaunchHandler* NewLC(); + + ~CSINDLaunchHandler(); + +// from base class CEventHandler + + void SetUiStateQuery( MUiState& aUiState ); + + void FocusChanged( TBool aState ); + + TBool OfferRawEvent(const TRawEvent& aRawEvent); + +// from MHandlerTimer + + void TimerDone(); + +private: + +// Construction + + CSINDLaunchHandler(); + + void ConstructL(); + +// New methods + + void SkipVoiceDial(); + +private: // data + + /// Pointer to state. Not owned. + MUiState* iUiState; + + /// Timer for long key down event. Owned. + CKeyHandlerTimer* iTimer; + + /// Flag for SIND key down + TBool iSINDKeyDown; + + /// Flag for SIND launched + TBool iSINDLaunched; + }; + +} // namespace AiWsPlugin + + +#endif // C_AIWSPLUGIN_SINDLAUNCHANDLER_H \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/inc/uistate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/inc/uistate.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2005-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: UI State query interface for Active Idle WS Plug-in. +* +*/ + + +#ifndef M_AIWSPLUGIN_UISTATE_H +#define M_AIWSPLUGIN_UISTATE_H + + +#include + +namespace AiWsPlugin { + +/** + * @ingroup group_wsplugin + * + * UI State query interface for Active Idle WS Plug-in + */ +class MUiState + { +public: + /** + * Returns the current modifier key status. + * @see TEventModifier + */ + virtual TUint Modifiers() const =0; + + /** + * Returns true if Active Idle currently has focus. + */ + virtual TBool HasFocus() const =0; + +protected: + /** + * Protected destructor to prevent deletion through this interface. + */ + ~MUiState() { } + }; + +} // namespace AiWsPlugin + +#endif // M_AIWSPLUGIN_UISTATE_H diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/rom/aiwsplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/rom/aiwsplugin.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 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: IBY file for Active Idle Window Server Plug-in +* +*/ + + +#ifndef AIWSPLUGIN_IBY +#define AIWSPLUGIN_IBY + +#ifdef RD_CUSTOMIZABLE_AI + +file=ABI_DIR\BUILD_DIR\aiwsplugin.dll SHARED_LIB_DIR\aiwsplugin.dll + +#endif // RD_CUSTOMIZABLE_AI + +#endif // AIWSPLUGIN_IBY + +// End of File diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/aiwspluginanim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/aiwspluginanim.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2005-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: Active Idle Window Server Plug-in implementation. +* +*/ + + +#include "aiwspluginanim.h" +#include "aiwspluginanimdef.h" +#include "keylockhandler.h" +#include "numerickeyhandler.h" +#include "logslaunchhandler.h" +#include "sindlaunchhandler.h" + +#include + +using namespace AiWsPlugin; + +CAiWsPluginAnim::CAiWsPluginAnim() + { + } + +CAiWsPluginAnim::~CAiWsPluginAnim() + { + iEventHandlers.ResetAndDestroy(); + if ( iFunctions ) + { + iFunctions->GetRawEvents( EFalse ); + } + FeatureManager::UnInitializeLib(); + } + +TInt CAiWsPluginAnim::CommandReplyL( TInt /*aOpcode*/, TAny* /*aArgs*/ ) + { + return KErrNone; + } + +void CAiWsPluginAnim::Command( TInt /*aOpcode*/, TAny* /*aArgs*/ ) + { + } + +void CAiWsPluginAnim::Animate( TDateTime* /*aDateTime*/ ) + { + } + +void CAiWsPluginAnim::AddEventHandlerAndPopL( CEventHandler* aEventHandler ) + { + if( aEventHandler ) + { + aEventHandler->SetUiStateQuery( *this ); + iEventHandlers.AppendL( aEventHandler ); + CleanupStack::Pop( aEventHandler ); + } + } + +void CAiWsPluginAnim::ConstructL( TAny* aArgs, TBool aHasFocus ) + { + FeatureManager::InitializeLibL(); + + iFunctions->GetRawEvents( ETrue ); + if( !aArgs ) + { + User::Leave( KErrArgument ); + } + iWgInfo = *( static_cast(aArgs) ); + + AddEventHandlerAndPopL( CKeyLockHandler::NewLC() ); + + MAnimGeneralFunctionsWindowExtension* ext = reinterpret_cast + ( iFunctions->ExtendedInterface( + MAnimGeneralFunctions::EWindowExtensionInterface ) ); + AddEventHandlerAndPopL( CNumericKeyHandler::NewLC( iWgInfo.iTargetWgId, ext ) ); + + AddEventHandlerAndPopL( CLogsLaunchHandler::NewLC() ); + +/* Leave this commented code here for now.. 2.5.2007, unclear if needed still in some config. + if ( FeatureManager::FeatureSupported( KFeatureIdKeypadNoVoiceKey ) ) + { + AddEventHandlerAndPopL( CSINDLaunchHandler::NewLC() ); + } +*/ + // Update initial focus status + FocusChanged( aHasFocus ); + } + +void CAiWsPluginAnim::Redraw() + { + } + +void CAiWsPluginAnim::FocusChanged( TBool aState ) + { + iAiFocused = aState; + const TInt handlerCount = iEventHandlers.Count(); + for( TInt i = 0; i < handlerCount; ++i ) + { + iEventHandlers[i]->FocusChanged( aState ); + } + } + +TBool CAiWsPluginAnim::OfferRawEvent( const TRawEvent& aRawEvent ) + { + // Forward event to all event handlers + const TInt handlerCount = iEventHandlers.Count(); + for( TInt i = 0; i < handlerCount; ++i ) + { + // All other are made to return EFalse + // Except wait for 2ndkeyup and 2ndkeydown of keylock states. + if( iEventHandlers[i]->OfferRawEvent( aRawEvent ) ) + { + return ETrue; + } + } + + // Update modifier key status + iModifierTracker.Update( aRawEvent ); + + return EFalse; + } + +TUint CAiWsPluginAnim::Modifiers() const + { + return iModifierTracker.Status(); + } + +TBool CAiWsPluginAnim::HasFocus() const + { + return iAiFocused; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/aiwspluginanimdll.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/aiwspluginanimdll.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + +#include "aiwspluginanimdef.h" +#include "aiwspluginanimdll.h" +#include "aiwspluginanim.h" + +// Create idle key forwarding plug-in. +CAnim* CAiWsPluginAnimDll::CreateInstanceL( TInt aType ) + { + switch ( aType ) + { + case EAnimKeyForward: + return new ( ELeave ) CAiWsPluginAnim(); + default: + return NULL; + } + } + +// Create plug-in. Factory function. +EXPORT_C CAnimDll* CreateCAnimDllL() + { + return new ( ELeave ) CAiWsPluginAnimDll(); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/keyhandlertimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/keyhandlertimer.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2005-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: Key handler timer for Active Idle WS Plug-in. +* +*/ + + +#include + +#include "keyhandlertimer.h" +#include "sindlaunchhandler.h" + +namespace AiWsPlugin { + +CKeyHandlerTimer::CKeyHandlerTimer( MHandlerTimer* aHandler ) + : CTimer( CTimer::EPriorityStandard ) + { + iHandler = aHandler; + } + +void CKeyHandlerTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +CKeyHandlerTimer* CKeyHandlerTimer::NewL( MHandlerTimer* aHandler ) + { + CKeyHandlerTimer* self = CKeyHandlerTimer::NewLC( aHandler ); + CleanupStack::Pop( self ); + return self; + } + + +CKeyHandlerTimer* CKeyHandlerTimer::NewLC( MHandlerTimer* aHandler ) + { + CKeyHandlerTimer* self = new(ELeave) CKeyHandlerTimer( aHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CKeyHandlerTimer::~CKeyHandlerTimer() + { + Cancel(); + } + +void CKeyHandlerTimer::RunL() + { + if( iHandler ) + { + iHandler->TimerDone(); + } + } + +TInt CKeyHandlerTimer::RunError( TInt /*aError*/ ) + { + return 0; + } + +TBool CKeyHandlerTimer::IsActive() + { + return CActive::IsActive(); + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/keylockhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/keylockhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,241 @@ +/* +* Copyright (c) 2005-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: Keylock handler implementation for Active Idle WS Plug-in +* +*/ + + +#include "keylockhandler.h" +#include "keyhandlertimer.h" +#include "keylockstates.h" +#include "aiwspluginanimdef.h" +#include "uistate.h" + +#include +#include +#include + +#include "debug.h" + +namespace AiWsPlugin { + +CKeyLockHandler::CKeyLockHandler() : + // Initialize to start-up state + iCurrentState( &TKeylockState::StartupState() ), + iNextState( &iCurrentState->iDefaultNextState() ) + { + } + +void CKeyLockHandler::ConstructL() + { + // Read capability: ReadDeviceData. + _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); + // Write capability: WriteDeviceData. + _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); + + // Initialize Shortcut Plug-in command API + RProperty::Define( + KUidSystemCategory, + KPSUidShortcutCmd, + RProperty::EText, + KReadDevicePolicy, + KWriteDevicePolicy + ); + + iSettings.ReadFromRepositoryL(); + iKeypadLockTimer = CPeriodic::NewL( CActive::EPriorityUserInput ); + iKeylockApi = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard ); + if ( !iKeylockApi->HasConfiguration() ) + { + delete iKeylockApi; + iKeylockApi = NULL; + } + } + +CKeyLockHandler* CKeyLockHandler::NewLC() + { + CKeyLockHandler* self = new( ELeave ) CKeyLockHandler; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CKeyLockHandler::~CKeyLockHandler() + { + delete iKeypadLockTimer; + delete iKeylockApi; + } + +void CKeyLockHandler::SetUiStateQuery( MUiState& aUiState ) + { + iUiState = &aUiState; + } + +TBool CKeyLockHandler::HasFocus() + { + return iUiState->HasFocus(); + } + +TBool CKeyLockHandler::TimeoutTimerActive() + { + return iKeypadLockTimer->IsActive(); + } + +void CKeyLockHandler::FocusChanged( TBool aState ) + { + iCurrentState->FocusChanged( *this, aState ); + } + +TBool CKeyLockHandler::OfferRawEvent(const TRawEvent& aRawEvent) + { + return iCurrentState->OfferRawEvent( *this, aRawEvent ); + } + +TBool CKeyLockHandler::IsFirstLockKey( TInt aScanCode ) + { + if ( iKeylockApi ) + { + TKeyEvent event; + event.iModifiers = 0; + event.iCode = 0; + event.iRepeats = 0; + event.iScanCode = aScanCode; + // Keylock API return ETrue on handlekeyeventL only if the whole key + // sequence has been inputted (1st + 2nd key pressed) + TRAP_IGNORE(iKeylockApi->HandleKeyEventL( event,EEventKeyDown )); + return iKeylockApi->PrimaryKeyPressed(); + } + else + { + return Settings().IsFirstLockKey( aScanCode ); + } + } + +TBool CKeyLockHandler::IsSecondLockKey( TInt aScanCode ) + { + TBool returnValue = EFalse; + if ( iKeylockApi ) + { + TKeyEvent event; + event.iModifiers = 0; + event.iCode = 0; + event.iRepeats = 0; + event.iScanCode = aScanCode; + TRAP_IGNORE(returnValue = iKeylockApi->HandleKeyEventL( event,EEventKeyDown )); + return returnValue; + } + else + { + return Settings().IsSecondLockKey( aScanCode ); + } + } + +const TKeypadSettings& CKeyLockHandler::Settings() const + { + return iSettings; + } + +void CKeyLockHandler::StartTimeoutTimer( TInt aTimeout ) + { + __PRINTS( "AiWsPlugin: CKeyLockHandler::StartTimeoutTimer()" ); + + iKeypadLockTimer->Cancel(); + if( aTimeout < 0 ) + { + iKeypadLockTimer->Start( + iSettings.KeylockTimeout(), iSettings.KeylockTimeout(), + TCallBack( &CKeyLockHandler::TimerElapsed, this ) ); + } + else + { + iKeypadLockTimer->Start( + aTimeout, aTimeout, + TCallBack( &CKeyLockHandler::TimerElapsed, this ) ); + } + } + +void CKeyLockHandler::StopTimeoutTimer() + { + __PRINTS( "AiWsPlugin: CKeyLockHandler::StopTimeoutTimer()" ); + iKeypadLockTimer->Cancel(); + } + +void CKeyLockHandler::ActivateKeypadLock() + { + __PRINTS( "AiWsPlugin: CKeyLockHandler::ActivateKeypadLock()" ); + StopTimeoutTimer(); + // Use Shortcut Plug-in API to set the keylock + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSEnableKeyLock ); + } + +void CKeyLockHandler::CancelKeypadLock() + { + __PRINTS( "AiWsPlugin: CKeyLockHandler::CancelKeypadLock()" ); + StopTimeoutTimer(); + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSSkipKeyLock ); + } + +void CKeyLockHandler::KeypadLockTimeout() + { + __PRINTS( "AiWsPlugin: CKeyLockHandler::CancelKeypadLock()" ); + StopTimeoutTimer(); + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSKeyLockTimeout ); + } + +void CKeyLockHandler::SetNextState( const TKeylockState& aState ) + { + iNextState = &aState; + } + +void CKeyLockHandler::ActivateNextState() + { + iCurrentState = iNextState; + iNextState = &(*iCurrentState->iDefaultNextState)(); + } + +void CKeyLockHandler::SetLastLockKeyScanCode( TInt aScanCode ) + { + iLastLockKeyScanCode = aScanCode; + } + +TInt CKeyLockHandler::LastLockKeyScanCode() const + { + return iLastLockKeyScanCode; + } + +TInt CKeyLockHandler::TimerElapsed(TAny* aSelf) + { + CKeyLockHandler* self = static_cast(aSelf); + if( self ) + { + self->iCurrentState->TimerElapsed( *self ); + } + return KErrNone; + } + +void CKeyLockHandler::TimerDone() + { + + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/keylockstates.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/keylockstates.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,346 @@ +/* +* Copyright (c) 2005-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: Keylock states implementation for Active Idle WS Plug-in +* +*/ + + +#include "keylockstates.h" +#include "keylockcontrol.h" +#include "keypadsettings.h" +#include "panic.h" +#include "activeidle2domainpskeys.h" + +#include +#include + +#include "debug.h" + + +namespace AiWsPlugin { + +const TInt KTenMilliSecondsInu = 10 * 1000; + +/** + * Helper macro for declaring internal state classes for CKeyLockHandler. + */ +#define AI_DECLARE_KEYLOCK_STATE(StateCls) \ + class StateCls { \ + public: \ + static const TKeylockState KState; \ + static const TKeylockState& DefaultNextState(); \ + static void FocusChanged( MKeyLockHandlerControl& aControl, TBool aState ); \ + static TBool OfferRawEvent( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ); \ + static void TimerElapsed( MKeyLockHandlerControl& aControl ); \ + } + +/** + * Inactive state class for CKeyLockHandler. + */ +AI_DECLARE_KEYLOCK_STATE(TKeylockStateInactive); + +/** + * Active state class for CKeyLockHandler. + */ +AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForFirstKeyDown); + +/** + * Keylock sequence in progress state class for CKeyLockHandler. + */ +AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForSecondKeyDown); + +/** + * Keylock sequence finalizer state class for CKeyLockHandler. + */ +AI_DECLARE_KEYLOCK_STATE(TKeylockStateWaitForSecondKeyUp); + +/** + * Helper macro for defining key lock state function tables. + */ +#define AI_DEFINE_KEYLOCK_STATE_FT(StateCls) \ + const TKeylockState StateCls::KState = { \ + &StateCls::DefaultNextState, \ + &StateCls::FocusChanged, \ + &StateCls::OfferRawEvent, \ + &StateCls::TimerElapsed } + +/// Defines function table for key lock inactive state +AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateInactive); + +/// Defines function table for key lock active state +AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForFirstKeyDown); + +/// Defines function table for key lock in progress state +AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForSecondKeyDown); + +/// Defines function table for key lock finalizing state +AI_DEFINE_KEYLOCK_STATE_FT(TKeylockStateWaitForSecondKeyUp); + +// TKeyLockState +const TKeylockState& TKeylockState::StartupState() + { + return TKeylockStateInactive::KState; + } + +// TKeylockStateInactive +const TKeylockState& TKeylockStateInactive::DefaultNextState() + { + return TKeylockStateWaitForFirstKeyDown::KState; + } + +void TKeylockStateInactive::FocusChanged + ( MKeyLockHandlerControl& aControl, TBool aState ) + { + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateInactive::FocusChanged(%d)"), aState ); + if ( aState ) + { + // Gained focus, switch to active state + aControl.ActivateNextState(); + } + } + +TBool TKeylockStateInactive::OfferRawEvent + ( MKeyLockHandlerControl& /*aControl*/, const TRawEvent& /*aRawEvent*/ ) + { + return EFalse; + } + +void TKeylockStateInactive::TimerElapsed + ( MKeyLockHandlerControl& aControl ) + { + // Illegal event in this state + aControl.KeypadLockTimeout(); +#ifndef NDEBUG + //Panic( EPanicInvalidKeylockEvent ); +#endif + } + +// TKeylockStateWaitForFirstLockKeyDown +const TKeylockState& TKeylockStateWaitForFirstKeyDown::DefaultNextState() + { + return TKeylockStateWaitForSecondKeyDown::KState; + } + +void TKeylockStateWaitForFirstKeyDown::FocusChanged + ( MKeyLockHandlerControl& aControl, TBool aState ) + { + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForFirstKeyDown::FocusChanged(%d)"), aState ); + if ( !aState ) + { + if( !aControl.TimeoutTimerActive() ) + { + // Lost focus, switch to inactive state + aControl.SetNextState( TKeylockStateInactive::KState ); + aControl.ActivateNextState(); + } + } + } + +TBool TKeylockStateWaitForFirstKeyDown::OfferRawEvent + ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) + { + switch ( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + const TInt scanCode = aRawEvent.ScanCode(); + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForFirstKeyDown::OfferRawEvent(EKeyDown,ScanCode=%d)" ), scanCode ); + if ( aControl.IsFirstLockKey( scanCode ) && aControl.HasFocus() ) + { + // First lock key was pressed down + aControl.SetLastLockKeyScanCode( scanCode ); + // (Re)activate the keylock timeout timer + aControl.StartTimeoutTimer(KTenMilliSecondsInu); + } + } + } + + // Never consume the event to enable its processing if keylock + // is not activated within the timeout + return EFalse; + } + +void TKeylockStateWaitForFirstKeyDown::TimerElapsed + ( MKeyLockHandlerControl& aControl ) + { + TInt value = EPSAiNotDisplayingMenuOrDialog; + TInt err = RProperty::Get( + KPSUidAiInformation, + KActiveIdlePopupState, + value ); + + if( value == EPSAiNotDisplayingMenuOrDialog && err == KErrNone ) + { + // (Re)activate the keylock timeout timer + aControl.StartTimeoutTimer(); + // Switch to wait for second lock key down (see constructor of this state) + aControl.ActivateNextState(); + } + else + { + if( aControl.HasFocus() ) + { + aControl.StopTimeoutTimer(); + } + else + { + // Lost focus, switch to inactive state + aControl.SetNextState( TKeylockStateInactive::KState ); + aControl.ActivateNextState(); + } + } + // Illegal event in this state +#ifndef NDEBUG + //Panic( EPanicInvalidKeylockEvent ); +#endif + } + +// TKeylockStateWaitForSecondKeyDown +const TKeylockState& TKeylockStateWaitForSecondKeyDown::DefaultNextState() + { + // Assume the keylock sequence is cancelled + return TKeylockStateWaitForFirstKeyDown::KState; + } + +void TKeylockStateWaitForSecondKeyDown::FocusChanged + ( MKeyLockHandlerControl& aControl, TBool aState ) + { + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyDown::FocusChanged(%d)"), aState ); + if ( aState ) + { + // Gained focus: return to active state if keylock sequence is cancelled + aControl.SetNextState( TKeylockStateWaitForFirstKeyDown::KState ); + } + else + { + // Lost focus: return to inactive state if keylock sequence is cancelled + aControl.SetNextState( TKeylockStateInactive::KState ); + } + } + +TBool TKeylockStateWaitForSecondKeyDown::OfferRawEvent + ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) + { + TBool consumedEvent = EFalse; + + switch ( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + const TInt scanCode = aRawEvent.ScanCode(); + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyDown::OfferRawEvent(EKeyDown,ScanCode=%d)" ), scanCode ); + if ( aControl.IsSecondLockKey( scanCode ) ) + { + // Second lock key was pressed down. Cancel keylock timer + // and switch to wait for key up event. + aControl.StopTimeoutTimer(); + aControl.SetLastLockKeyScanCode( scanCode ); + aControl.SetNextState( TKeylockStateWaitForSecondKeyUp::KState ); + aControl.ActivateNextState(); + consumedEvent = ETrue; + } + else + { + // Some other key than second lock key was pressed while + // keylock timer was running. Cancel the keylock sequence and + // switch to previous state. (Depending on focus status, + // see TKeylockStateWaitForFirstKeyDown::FocusChanged.) + aControl.CancelKeypadLock(); + aControl.ActivateNextState(); + consumedEvent = EFalse; + } + break; + } + } + + return consumedEvent; + } + +void TKeylockStateWaitForSecondKeyDown::TimerElapsed + ( MKeyLockHandlerControl& aControl ) + { + __PRINTS( "AiWsPlugin: TKeylockStateWaitForSecondKeyDown::TimerElapsed()" ); + aControl.KeypadLockTimeout(); + aControl.ActivateNextState(); + } + +// TKeylockStateWaitForSecondKeyUp +const TKeylockState& TKeylockStateWaitForSecondKeyUp::DefaultNextState() + { + // Idle must currently have focus so return to active state from this state + return TKeylockStateWaitForFirstKeyDown::KState; + } + +void TKeylockStateWaitForSecondKeyUp::FocusChanged + ( MKeyLockHandlerControl& aControl, TBool aState ) + { + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyUp::FocusChanged(%d)"), aState ); + if ( aState ) + { + // Gained focus: return to active state if keylock sequence is cancelled + aControl.SetNextState( + TKeylockStateWaitForFirstKeyDown::KState ); + } + else + { + // Lost focus: return to inactive state if keylock sequence is cancelled + aControl.SetNextState( TKeylockStateInactive::KState ); + } + } + +TBool TKeylockStateWaitForSecondKeyUp::OfferRawEvent + ( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) + { + TBool consumedEvent = EFalse; + + switch ( aRawEvent.Type() ) + { + case TRawEvent::EKeyUp: + { + const TInt scanCode = aRawEvent.ScanCode(); + __PRINT( __DBG_FORMAT("AiWsPlugin: TKeylockStateWaitForSecondKeyUp::OfferRawEvent(EKeyUp,ScanCode=%d)" ), scanCode ); + if ( scanCode == aControl.LastLockKeyScanCode() ) + { + // Second lock key was released. Activate the keypad lock and + // switch back to initial state. (Depending on focus status, + // see TKeylockStateWaitForSecondKeyUp::FocusChanged.) + aControl.ActivateKeypadLock(); + aControl.ActivateNextState(); + } + // Consume all key events until the keylock sequence is finalized + consumedEvent = ETrue; + break; + } + + case TRawEvent::EKeyDown: + { + // Consume all key events until the keylock sequence is finalized + consumedEvent = ETrue; + break; + } + } + + return consumedEvent; + } + +void TKeylockStateWaitForSecondKeyUp::TimerElapsed + ( MKeyLockHandlerControl& /*aControl*/ ) + { + // Illegal event in this state +#ifndef NDEBUG + //Panic( EPanicInvalidKeylockEvent ); +#endif + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/keypadsettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/keypadsettings.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2005-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: Keypad settings implmentation for Active Idle WS Plug-in. +* +*/ + + +#include "keypadsettings.h" + +#include +#include +#include + +#include + +#include "debug.h" + +namespace AiWsPlugin { + + +/** + * Maps selected numeric keypad scan codes to character. + * + * @param aScanCode scan code for which to find a character mapping. + * @return character mapping for aScanCode or -1 if no mapping is found. + */ +TInt16 TKeypadSettings::MapNkpScanCodeToChar( TInt aScanCode ) + { + TInt16 result; + switch( aScanCode ) + { + case EStdKeyHash: result = '#'; break; + case EStdKeyMinus: result = '-'; break; + case EStdKeyNkpAsterisk: result = '*'; break; + case EStdKeyNkpMinus: result = '-'; break; + case EStdKeyNkpPlus: result = '+'; break; + case EStdKeyNkp1: result = '1'; break; + case EStdKeyNkp2: result = '2'; break; + case EStdKeyNkp3: result = '3'; break; + case EStdKeyNkp4: result = '4'; break; + case EStdKeyNkp5: result = '5'; break; + case EStdKeyNkp6: result = '6'; break; + case EStdKeyNkp7: result = '7'; break; + case EStdKeyNkp8: result = '8'; break; + case EStdKeyNkp9: result = '9'; break; + case EStdKeyNkp0: result = '0'; break; + default: result = -1; break; + } + return result; + } + +void TKeypadSettings::ReadFromRepositoryL() + { + CRepository* repository = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); + TInt value; + + // KAIFirstKeyLockKey + User::LeaveIfError( repository->Get( KAIFirstKeyLockKey, value ) ); + iFirstLockKeyScanCode = TInt16( value ); + iFirstLockKeyChar = MapNkpScanCodeToChar( value ); + __PRINT( + __DBG_FORMAT("AiWsPlugin: KAIFirstKeyLockKey = %d, ch=%d"), + TInt(iFirstLockKeyScanCode), TInt(iFirstLockKeyChar) ); + + // KAISecondKeyLockKey + User::LeaveIfError( repository->Get( KAISecondKeyLockKey, value ) ); + iSecondLockKeyScanCode = TInt16( value ); + iSecondLockKeyChar = MapNkpScanCodeToChar( value ); + __PRINT( + __DBG_FORMAT("AiWsPlugin: KAISecondKeyLockKey = %d, ch=%d"), + TInt(iSecondLockKeyScanCode), TInt(iSecondLockKeyChar) ); + + // KAISecondKeyLockKey2 + User::LeaveIfError( repository->Get( KAISecondKeyLockKey2, value ) ); + iSecondLockKeyScanCode2 = TInt16( value ); + iSecondLockKeyChar2 = MapNkpScanCodeToChar( value ); + __PRINT( + __DBG_FORMAT("AiWsPlugin: KAISecondKeyLockKey2 = %d, ch=%d"), + TInt(iSecondLockKeyScanCode2), TInt(iSecondLockKeyChar2) ); + + // KAIKeyLockTimeout + User::LeaveIfError( repository->Get( KAIKeyLockTimeout, value ) ); + __PRINT( __DBG_FORMAT("AiWsPlugin: KAIKeyLockTimeout=%d ms"), value ); + // Convert timeout from milliseconds to microseconds + const TInt KUsInMs = 1000; + iKeylockTimeout = KUsInMs * value; + + // KAISINDKey + User::LeaveIfError( repository->Get( KAIVoiceDialLaunchKey, value ) ); + iSINDKeyScanCode = TInt16( value ); + iSINDKeyScanChar = MapNkpScanCodeToChar( value ); + __PRINT( + __DBG_FORMAT("AiWsPlugin: iSINDKey = %d, ch=%d"), + TInt(iSINDKeyScanCode), TInt(iSINDKeyScanChar) ); + + // KAISINDKeyTimeout + User::LeaveIfError( repository->Get( KAIVoiceDialKeyTimeout, value ) ); + __PRINT( __DBG_FORMAT("AiWsPlugin: KAISINDKeyTimeout=%d ms"), value ); + // Convert timeout from milliseconds to microseconds + iKeySINDTimeout = KUsInMs * value; + + CleanupStack::PopAndDestroy( repository ); + } + +TBool TKeypadSettings::IsFirstLockKey( TInt aScanCode ) const + { + return ( aScanCode == iFirstLockKeyScanCode || aScanCode == iFirstLockKeyChar ); + } + +TBool TKeypadSettings::IsSecondLockKey( TInt aScanCode ) const + { + return ( + ( aScanCode == iSecondLockKeyScanCode || aScanCode == iSecondLockKeyChar ) || + ( aScanCode == iSecondLockKeyScanCode2 || aScanCode == iSecondLockKeyChar2 ) ); + } + +TTimeIntervalMicroSeconds32 TKeypadSettings::KeylockTimeout() const + { + return iKeylockTimeout; + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/logslaunchhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/logslaunchhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2005-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: Logs app launch handler for Active Idle WS Plug-in. +* +*/ + + +#include "logslaunchhandler.h" +#include "uistate.h" +#include +#include +#include +#include +#include + +namespace AiWsPlugin { + + +CLogsLaunchHandler::CLogsLaunchHandler() + { + } + +void CLogsLaunchHandler::ConstructL() + { + // Read capability: ReadDeviceData. + _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); + // Write capability: WriteDeviceData. + _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); + + // Initialize Shortcut Plug-in command API + RProperty::Define( + KUidSystemCategory, + KPSUidShortcutCmd, + RProperty::EText, + KReadDevicePolicy, + KWriteDevicePolicy + ); + + iTimer = CKeyHandlerTimer::NewL( this ); + } + +CLogsLaunchHandler* CLogsLaunchHandler::NewLC() + { + CLogsLaunchHandler* self = new(ELeave) CLogsLaunchHandler; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CLogsLaunchHandler::~CLogsLaunchHandler() + { + if ( iTimer) + { + iTimer->Cancel(); + delete iTimer; + } + } + +void CLogsLaunchHandler::SetUiStateQuery( MUiState& aUiState ) + { + iUiState = &aUiState; + } + +void CLogsLaunchHandler::FocusChanged( TBool /*aState*/ ) + { + // Focus status is queried from iUiState + } + +TBool CLogsLaunchHandler::OfferRawEvent(const TRawEvent& aRawEvent) + { + TInt reactOnSendKey = 1; + TInt err = RProperty::Get( KPSUidAiInformation, KActiveIdleActOnSendKey, reactOnSendKey ); + if ( err != KErrNone ) + { + reactOnSendKey = 1; + } + + TBool consumed = EFalse; + + if ( reactOnSendKey ) + { + switch( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyYes ) + { + const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); + iTimer->Cancel(); + iTimer->After(KLongKeyPress); + consumed = ETrue; + } + break; + } + case TRawEvent::EKeyUp: + { + if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyYes && iTimer->IsActive() ) + { + iTimer->Cancel(); + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSLaunchLogs ); + consumed = ETrue; + } + break; + } + } + } + + return consumed; + } + +void CLogsLaunchHandler::TimerDone() + { + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSLaunchNameDialer ); + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/modifierkeytracker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/modifierkeytracker.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2005-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: Modifier key status tracker for Active Idle WS Plug-in. +* +*/ + + +#include "modifierkeytracker.h" +#include +#include + +//#define AI_ENABLE_RD_LOGGING +#define AI_RD_LOG_TO_DEBUG_OUTPUT +#include "debug.h" + +namespace AiWsPlugin { + + +// LOCAL FUNCTIONS + +TUint ModifierKeyToBit( TInt aScanCode ) + { + switch( aScanCode ) + { + case EStdKeyLeftShift: + return EModifierLeftShift; + + case EStdKeyRightShift: + return EModifierRightShift; + + case EStdKeyLeftAlt: + return EModifierLeftAlt; + + case EStdKeyRightAlt: + return EModifierRightAlt; + + case EStdKeyLeftCtrl: + return EModifierLeftCtrl; + + case EStdKeyRightCtrl: + return EModifierRightCtrl; + + case EStdKeyLeftFunc: + return EModifierLeftFunc; + + case EStdKeyRightFunc: + return EModifierRightFunc; + + default: + return 0; + } + } + +TUint UpdateCombinedIndicators(TUint aModifiers) + { + TUint result = aModifiers; + struct TModifierCombinations { TUint iModifiers; TUint iCombinedIndicator; }; + static const TModifierCombinations KModifierCombinations[] = + { + { EModifierLeftShift | EModifierRightShift, EModifierShift }, + { EModifierLeftAlt | EModifierRightAlt, EModifierAlt }, + { EModifierLeftCtrl | EModifierRightCtrl, EModifierCtrl }, + { EModifierLeftFunc | EModifierRightFunc, EModifierFunc } + }; + const TModifierCombinations* KModifierCombinationsEnd = + KModifierCombinations + sizeof( KModifierCombinations ) / sizeof( KModifierCombinations[0] ); + + for ( const TModifierCombinations* comb = KModifierCombinations; + comb != KModifierCombinationsEnd; + ++comb ) + { + if ( aModifiers & comb->iModifiers ) + { + result |= comb->iCombinedIndicator; + } + else + { + result &= ~comb->iCombinedIndicator; + } + } + + return result; + } + +// MEMBER FUNCTIONS + +TModifierKeyTracker::TModifierKeyTracker() : + iModifiers( 0 ) + { + } + +TBool TModifierKeyTracker::Update(const TRawEvent& aRawEvent) + { + TUint modifiers = iModifiers; + + switch( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + modifiers |= ModifierKeyToBit( aRawEvent.ScanCode() ); + modifiers = UpdateCombinedIndicators( modifiers ); + break; + } + + case TRawEvent::EKeyUp: + { + modifiers &= ~ModifierKeyToBit( aRawEvent.ScanCode() ); + modifiers = UpdateCombinedIndicators( modifiers ); + break; + } + + // DEBUG: Compare to what modifer update event would report + case TRawEvent::EUpdateModifiers: + { + __PRINT( + __DBG_FORMAT("AiWsPlugin: TModifierKeyTracker::Update(), iModifers=%d, TRawEvent::Modifiers()=%d"), + iModifiers, aRawEvent.Modifiers() ); + break; + } + + default: + { + // No operations.. + break; + } + } + + if( modifiers != iModifiers ) + { + iModifiers = modifiers; + return ETrue; + } + else + { + return EFalse; + } + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/numerickeyhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/numerickeyhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,314 @@ +/* +* Copyright (c) 2005-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: Numeric key forwarding handler implementation for Active Idle +* WS Plug-in. +* +*/ + + +#include "numerickeyhandler.h" +#include "uistate.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +namespace AiWsPlugin { + + +CNumericKeyHandler::CNumericKeyHandler + ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt ) : + iTargetWgId( aTargetWgId ), + iWindowExt( aWindowExt ) + { + } + +void CNumericKeyHandler::ConstructL() + { + // Read capability: ReadUserData. + _LIT_SECURITY_POLICY_C1( KReadUserPolicy, ECapabilityReadUserData ); + // Write capability: WriteDeviceData. + _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); + + RProperty::Define( + KPSUidAiInformation, + KActiveIdleState, + RProperty::EInt, + KReadUserPolicy, + KWriteDevicePolicy ); + + iQwertyObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleQwertyModeChanged, this ), + KCRUidAvkon, KAknQwertyInputModeActive ); + + iInputLanguageRepository = CRepository::NewL( KCRUidAknFep ); + iInputLanguageObserver = CCenRepNotifyHandler::NewL(*this, *iInputLanguageRepository); + iInputLanguageObserver->StartListeningL(); + + RProperty::Get(KCRUidAvkon, KAknQwertyInputModeActive, iQwertyMode); + iInputLanguageRepository->Get( KAknFepInputTxtLang, iInputLanguage ); + + // Load numeric keys mapping for qwerty + if ( iQwertyMode ) + { + LoadInputLanguageKeyBindings( iInputLanguage ); + } + } + +CNumericKeyHandler* CNumericKeyHandler::NewLC + ( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt ) + { + CNumericKeyHandler* self = new(ELeave) CNumericKeyHandler + ( aTargetWgId, aWindowExt ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CNumericKeyHandler::~CNumericKeyHandler() + { + if( iInputLanguageObserver ) + { + iInputLanguageObserver->StopListening(); + } + delete iInputLanguageObserver; + delete iInputLanguageRepository; + Release(iQwertyObserver); + iNumericKeys.Close(); + } + +void CNumericKeyHandler::SetUiStateQuery( MUiState& aUiState ) + { + iUiState = &aUiState; + } + +void CNumericKeyHandler::FocusChanged( TBool /*aState*/ ) + { + } + +TBool CNumericKeyHandler::OfferRawEvent(const TRawEvent& aRawEvent) + { + switch( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + if ( iUiState->HasFocus() && CheckPostToTarget( aRawEvent ) ) + { + TInt forwardKeys = EPSAiForwardNumericKeysToPhone; + + TInt err = RProperty::Get( + KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + forwardKeys); + // Key event forwarding disabled => Ignore the keys + if ( err == KErrNone && + forwardKeys == EPSAiDontForwardNumericKeysToPhone ) + { + return EFalse; + } + // Phone app is listening this key and knows that next + // focus event from window server is becuase key events + // are coming to it. + RProperty::Set( + KPSUidAiInformation, + KActiveIdleState, + EPSAiNumberEntry ); + + // Switch focus to Phone app + if( iWindowExt ) + { + iWindowExt->SetOrdinalPosition( iTargetWgId, 0, 0 ); + } + } + break; + } + } + + // Never consume the key event as we want target application to process it + return EFalse; + } + +/** + * Returns true if event should be forwarded to Phone app. + */ +TBool CNumericKeyHandler::CheckPostToTarget(const TRawEvent& aRawEvent ) const + { + const TInt scanCode = aRawEvent.ScanCode(); + + if ( iQwertyMode ) + { + // Don't pass the check if shift is pressed. + const TUint modifiers = iUiState->Modifiers(); + if(( modifiers & EModifierShift ) == 0 ) + { + TInt numericKeysCount = iNumericKeys.Count(); + while( numericKeysCount-- ) + { + TPtiNumericKeyBinding numKeyBind = iNumericKeys[numericKeysCount]; + if( numKeyBind.iKey == scanCode ) + { + return ETrue; + } + } + } + } + else + { + // Normal check ignore modifiers + static const TInt KIdPlgScanCodes[] = + { '1','2','3','4','5','6','7','8','9','0', + '*',EStdKeyNkpAsterisk,EStdKeyHash,EStdKeyNkpPlus }; + static const TInt KIdPlgScanCodeCount = + sizeof( KIdPlgScanCodes ) / sizeof( KIdPlgScanCodes[0] ); + TInt count = KIdPlgScanCodeCount; + while( count-- ) + { + const TInt refCode = KIdPlgScanCodes[ count ]; + // Is one of [0,1,2,3,4,5,6,7,8,9,*,#]? + if( refCode == scanCode ) + { + return ETrue; + } + } + } + return EFalse; + } + + +/** + * Load input locales. + */ +void CNumericKeyHandler::LoadInputLanguageKeyBindings( TInt aLanguage ) + { + iNumericKeys.Reset(); + + TRAPD( err, + { + CPtiEngine* ptiEngine = CPtiEngine::NewL(); + CleanupStack::PushL( ptiEngine ); + ptiEngine->GetNumericModeKeysForQwertyL( aLanguage, + iNumericKeys ); + CleanupStack::PopAndDestroy( ptiEngine ); + } ); // TRAP + + if ( err ) + { + iNumericKeys.Reset(); + iQwertyMode = 0; // To default mode + } + else + { + // remove numeric chars that not open number entry + TInt numericKeysCount = iNumericKeys.Count(); + while ( numericKeysCount-- ) + { + TPtiNumericKeyBinding numKeyBind = iNumericKeys[numericKeysCount]; + + if ( numKeyBind.iChar == 'w' || + numKeyBind.iChar == 'p' +#ifndef RD_INTELLIGENT_TEXT_INPUT + /* + * The following code is commented because + * For GQF requirement Space is mapped to "0" + */ + || numKeyBind.iKey == EPtiKeyQwertySpace +#endif + ) + { + iNumericKeys.Remove( numericKeysCount ); + } + } + } + } + +/** + * Handles qwerty mode change. + */ +TInt CNumericKeyHandler::HandleQwertyModeChanged( TAny *aPtr ) + { + CNumericKeyHandler* self = static_cast( aPtr ); + if( self ) + { + TInt value = self->iQwertyMode; + TInt err = self->iQwertyObserver->Get( value ); + + if( err == KErrNone ) + { + self->SetQwertyMode( value ); + } + // Load key bindings if not already loaded +#ifdef RD_INTELLIGENT_TEXT_INPUT + if ( self->iQwertyMode ) + { + self->iNumericKeys.Reset(); +#else + if ( self->iQwertyMode && !self->iNumericKeys.Count() ) + { +#endif + self->LoadInputLanguageKeyBindings( self->iInputLanguage ); + } + } + return KErrNone; + } + +/** + * Handles input language change. + */ +TInt CNumericKeyHandler::HandleInputLanguageChanged( TInt aNewValue ) + { + SetInputLanguage( aNewValue ); + LoadInputLanguageKeyBindings( aNewValue ); + return KErrNone; + } + +/** + * Set qwerty mode. + */ +void CNumericKeyHandler::SetQwertyMode( TInt aValue ) + { + iQwertyMode = aValue; + } + +/** + * Set input language. + */ +void CNumericKeyHandler::SetInputLanguage( TInt aValue ) + { + iInputLanguage = aValue; + } + +void CNumericKeyHandler::HandleNotifyGeneric(TUint32 aKey) + { + if( aKey == KAknFepInputTxtLang ) + { + TInt newValue = iInputLanguage; + iInputLanguageRepository->Get( KAknFepInputTxtLang, newValue ); + HandleInputLanguageChanged( newValue ); + } + } + +void CNumericKeyHandler::HandleNotifyError + (TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/) + { + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/panic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/panic.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2005-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: Panic helper function for Active Idle WS Plug-in. +* +*/ + + +#include "panic.h" +#include + +namespace AiWsPlugin { + + +#ifndef NDEBUG + +void Panic( TPanicCode aPanicCode ) + { + _LIT( KPanicText, "AiWsPlugin" ); + User::Panic( KPanicText, aPanicCode ); + } + +#endif // !NDEBUG + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/plugins/wsplugin/src/sindlaunchhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/plugins/wsplugin/src/sindlaunchhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2005-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: SIND app launch handler for Active Idle WS Plug-in. +* +*/ + + +#include "sindlaunchhandler.h" +#include "keyhandlertimer.h" +#include "uistate.h" +#include +#include +#include +#include + +//#define AI_ENABLE_RD_LOGGING +#define AI_RD_LOG_TO_DEBUG_OUTPUT + +#include "debug.h" + +namespace AiWsPlugin { + + +CSINDLaunchHandler::CSINDLaunchHandler() + { + } + +void CSINDLaunchHandler::ConstructL() + { + // Read capability: ReadDeviceData. + _LIT_SECURITY_POLICY_C1( KReadDevicePolicy, ECapabilityReadDeviceData ); + // Write capability: WriteDeviceData. + _LIT_SECURITY_POLICY_C1( KWriteDevicePolicy, ECapabilityWriteDeviceData ); + + // Initialize Shortcut Plug-in command API + RProperty::Define( + KUidSystemCategory, + KPSUidShortcutCmd, + RProperty::EText, + KReadDevicePolicy, + KWriteDevicePolicy + ); + + iTimer = CKeyHandlerTimer::NewL( this ); + + iSINDKeyDown = EFalse; + } + +CSINDLaunchHandler* CSINDLaunchHandler::NewLC() + { + CSINDLaunchHandler* self = new(ELeave) CSINDLaunchHandler; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +CSINDLaunchHandler::~CSINDLaunchHandler() + { + delete iTimer; + } + +void CSINDLaunchHandler::SetUiStateQuery( MUiState& aUiState ) + { + iUiState = &aUiState; + } + +void CSINDLaunchHandler::FocusChanged( TBool /*aState*/ ) + { + // Focus status is queried from iUiState + } + +TBool CSINDLaunchHandler::OfferRawEvent(const TRawEvent& aRawEvent) + { + switch( aRawEvent.Type() ) + { + case TRawEvent::EKeyDown: + { + if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyDevice1 ) + { + __PRINTS( "XAI: CSINDLaunchHandler: SIND key down, start timer"); + const TTimeIntervalMicroSeconds32 KLongKeyPress(600000); + iTimer->Cancel(); + iTimer->After(KLongKeyPress); + iSINDLaunched = EFalse; + iSINDKeyDown = ETrue; + } + else if( iUiState->HasFocus() && iSINDKeyDown ) + { + __PRINTS( "XAI: CSINDLaunchHandler: SIND key down, other key pressed, cancel timer"); + iTimer->Cancel(); + SkipVoiceDial(); + } + break; + } + case TRawEvent::EKeyUp: + { + if ( iUiState->HasFocus() && aRawEvent.ScanCode() == EStdKeyDevice1 && !iSINDLaunched && iTimer->IsActive() ) + { + __PRINTS( "XAI: SIND key up, cancel timer"); + iTimer->Cancel(); + SkipVoiceDial(); + } + break; + } + } + return EFalse; + } + +void CSINDLaunchHandler::SkipVoiceDial() + { + __PRINTS( "XAI: CSINDLaunchHandler::SkipVoiceDial()"); + // Handle skip scenario only if voice dial ui hasn't been launched + if( !iSINDLaunched ) + { + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSSkipNameDialer ); + } + iSINDKeyDown = EFalse; + } + +void CSINDLaunchHandler::TimerDone() + { + __PRINTS( "XAI: CSINDLaunchHandler::TimerDone()"); + __PRINTS( "XAI: Start Voice Dial UI"); + RProperty::Set( + KUidSystemCategory, + KPSUidShortcutCmd, + KAiPSLaunchNameDialer ); + iSINDLaunched = ETrue; + iSINDKeyDown = EFalse; + } + +} // namespace AiWsPlugin diff -r 000000000000 -r 79c6a41cd166 idlefw/rom/idlefw.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/rom/idlefw.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 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: Image description file for project ActiveIdle3 +* +*/ + + +#ifndef ACTIVEIDLE3_IBY +#define ACTIVEIDLE3_IBY + +#ifndef ACTIVEIDLE2_IBY +#define ACTIVEIDLE2_IBY +// Active Idle application and registration file +S60_APP_EXE( ailaunch ) +S60_APP_AIF_RSC( ailaunch ) +S60_APP_AIF_ICONS( ailaunch ) +//S60_APP_RESOURCE( ailaunch ) + +file=ABI_DIR\BUILD_DIR\aiutils.dll SHARED_LIB_DIR\aiutils.dll +file=ABI_DIR\BUILD_DIR\aiidleint.dll SHARED_LIB_DIR\aiidleint.dll +file=ABI_DIR\BUILD_DIR\aifw.dll SHARED_LIB_DIR\aifw.dll + +// Content publishing plug-ins +ECOM_PLUGIN( aidevstaplg.dll, aidevstaplg.rsc ) +#endif // ACTIVEIDLE2_IBY + +//data=\epoc32\release\winscw\udeb\z\private\10202be9\2001952b.txt private\10202be9\2001952b.txt + +#endif // ACTIVEIDLE3_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/rom/idlefw_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/rom/idlefw_resources.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 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: Image description file for ActiveIdle2 localisable resources. +* +*/ + + +#ifndef ACTIVEIDLE3_RESOURCES_IBY +#define ACTIVEIDLE3_RESOURCES_IBY + +#ifdef RD_CUSTOMIZABLE_AI + +#ifndef ACTIVEIDLE2_RESOURCES_IBY +#define ACTIVEIDLE2_RESOURCES_IBY + +#include + +data=DATAZ_\APP_RESOURCE_DIR\ailaunch.rsc APP_RESOURCE_DIR\ailaunch.rsc + +// Content publishing plug-in resources +data=DATAZ_\APP_RESOURCE_DIR\aidevstaplgres.rsc APP_RESOURCE_DIR\aidevstaplgres.rsc + +#endif // ACTIVEIDLE2_RESOURCES_IBY + +#endif // RD_CUSTOMIZABLE_AI + +#endif // ACTIVEIDLE3_RESOURCES_IBY diff -r 000000000000 -r 79c6a41cd166 idlefw/src/common/aifwpanic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/common/aifwpanic.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2005-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: Panic utility for AI2 +* +*/ + + +#include "aifwpanic.h" +#include + +#ifdef _DEBUG + +void AiFwPanic::Panic(AiFwPanic::TAiPanicCodes aPanicCode) + { + _LIT(KPanicText, "AiFw"); + User::Panic( KPanicText, aPanicCode ); + + + } + +#endif // _DEBUG + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aibackuprestorestatusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aibackuprestorestatusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: Backup/restore status observer for AI2 +* +*/ + + +#include +#include +#include "aistatemanager.h" +#include "aibackuprestorestatusobserver.h" +#include "aifwpanic.h" +#include "debug.h" + +const TUint KAI2BackupMask( conn::KBURPartTypeMask ^ conn::EBURNormal ); + +CAiBackupRestoreStatusObserver::CAiBackupRestoreStatusObserver() + { + } + +CAiBackupRestoreStatusObserver::~CAiBackupRestoreStatusObserver() + { + } + +CAiBackupRestoreStatusObserver* CAiBackupRestoreStatusObserver::NewL( + MAiStateManager* aStateManager ) + { + CAiBackupRestoreStatusObserver* self = new (ELeave) CAiBackupRestoreStatusObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiBackupRestoreStatusObserver::ConstructL( MAiStateManager* aStateManager ) + { + BaseConstructL( TCallBack( HandleBackupOperationEvent, this ), + KUidSystemCategory, + conn::KUidBackupRestoreKey, + aStateManager ); + } + +TAiStateChanges CAiBackupRestoreStatusObserver::Status() + { + TInt value = 0; + TInt err = iObserver->Get( value ); + if( ( value & KAI2BackupMask ) && + ( err == KErrNone ) ) // any type of backup or restore operation + { + return ESMAIBackupOn; + } + else + { + return ESMAIBackupOff; + } + } + +TInt CAiBackupRestoreStatusObserver::HandleBackupOperationEvent( TAny* aPtr ) + { + // see \epoc32\include\connect\sbdefs.h for enum descriptions + CAiBackupRestoreStatusObserver* self = + static_cast( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + TInt value = 0; + TInt err = self->iObserver->Get( value ); + + if( ( value & KAI2BackupMask ) && + ( err == KErrNone ) ) // any type of backup or restore operation + { + __PRINTS("XAI: Backup = ON"); + self->iStateManager->ReportStateChange( ESMAIBackupOn ); + } + else // aValue == conn::EBURUnset || aValue & conn::EBURNormal + { + // back operation finished -> return to previous state + __PRINTS("XAI: Backup = OFF"); + self->iStateManager->ReportStateChange( ESMAIBackupOff ); + } + return KErrNone; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aicallstatusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aicallstatusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,89 @@ +/* +* 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: Call status observer for AI2 +* +*/ + + +#include +#include +#include "aicallstatusobserver.h" +#include "aistatemanager.h" +#include "aifwpanic.h" +#include "debug.h" + +CAiCallStatusObserver::CAiCallStatusObserver() + { + } + +CAiCallStatusObserver::~CAiCallStatusObserver() + { + } + +CAiCallStatusObserver* CAiCallStatusObserver::NewL( MAiStateManager* aStateManager ) + { + CAiCallStatusObserver* self = new (ELeave) CAiCallStatusObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiCallStatusObserver::ConstructL( MAiStateManager* aStateManager ) + { + BaseConstructL( TCallBack( HandleCallStateChange, this ), + KPSUidCtsyCallInformation, + KCTsyCallState, + aStateManager ); + } + +TAiStateChanges CAiCallStatusObserver::Status() + { + TInt value = 0; + TInt err = iObserver->Get( value ); + if( ( value > EPSCTsyCallStateNone ) && + ( err == KErrNone ) ) + { + return ESMAIInCall; + } + else + { + return ESMAINoCall; + } + } + +TInt CAiCallStatusObserver::HandleCallStateChange( TAny* aPtr ) + { + CAiCallStatusObserver* self = reinterpret_cast< CAiCallStatusObserver* >( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + TInt value = 0; + TInt err = self->iObserver->Get( value ); + + if( ( value > EPSCTsyCallStateNone ) && + ( err == KErrNone ) ) + { + __PRINTS("XAI: Call = ON"); + self->iStateManager->ReportStateChange( ESMAIInCall ); + } + else + { + __PRINTS("XAI: Call = OFF"); + self->iStateManager->ReportStateChange( ESMAINoCall ); + } + return KErrNone; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aicontentpluginmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aicontentpluginmanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,391 @@ +/* +* 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: Content plugin error manager class +* +*/ + + +#include +#include +#include +#include + +#include +#include + +#include "aicontentpluginmanager.h" +#include "aipluginstatemanager.h" +#include "aifweventhandler.h" +#include "aicontentpublisher.h" +#include "aipropertyextension.h" +#include +#include "aieventhandlerextension.h" +#include "aiuicontroller.h" +#include "aiconsts.h" +#include "debug.h" + +// CONSTANTS +const TInt KAILenOfParenthesis( 2 ); + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::NewL() +// ---------------------------------------------------------------------------- +// +CAiContentPluginManager* CAiContentPluginManager::NewL() + { + CAiContentPluginManager* self = new ( ELeave ) CAiContentPluginManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiContentPluginManager::ConstructL() + { + iPluginFactory = CAiPluginFactory::NewL( iPlugins, *this ); + + iStateManager = CAiPluginStateManager::NewL(); + + iPluginFactory->AddLifecycleObserverL( *iStateManager ); + + iPluginTool = AiUtility::CreatePluginToolL(); + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::~CAiContentPluginManager() +// ---------------------------------------------------------------------------- +// +CAiContentPluginManager::~CAiContentPluginManager() + { + iPlugins.ResetAndDestroy(); + + delete iPluginFactory; + delete iStateManager; + + Release( iPluginTool ); + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::CAiContentPluginManager() +// ---------------------------------------------------------------------------- +// +CAiContentPluginManager::CAiContentPluginManager() + { + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::HandlePluginEvent() +// ---------------------------------------------------------------------------- +// +void CAiContentPluginManager::HandlePluginEvent( const TDesC& aParam ) + { + const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); + + if( separatorPos == KErrNotFound ) + { + return; + } + + // Extract plugin name + TPtrC pluginName( aParam.Left( separatorPos ) ); + + // Extract event and parameter string + TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); + + // Find parameter string position + const TInt paramsPos( + eventNameAndParams.Locate( KEventParameterSeparator ) ); + + // Extract event name + TPtrC eventName( paramsPos < 0 ? eventNameAndParams : + eventNameAndParams.Left( paramsPos ) ); + + // Calculate actual parameter string length by ignoring parenthesis + TInt paramsLength( + eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); + + // Extract paramenters + TPtrC param( paramsPos < 0 ? KNullDesC() : + eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); + + // Resolve plugin + CAiContentPublisher* target = NULL; + + __TIME( "FW: Lookup plug-in by name", + + TRAP_IGNORE( target = iPluginFactory->PluginByNameL( pluginName ) ); + + ); + + __PRINT( __DBG_FORMAT( + "\t[I]\t Event: %S to plug-in by addr 0x%x" ), &aParam, target ); + + if( target ) + { + // Resolve plugin specific event id + TInt eventId( KErrNotFound ); + + TRAP_IGNORE( GetIdL( *target, EAiPublisherEvents, eventName, eventId ) ); + + // Forward event to plugin + MAiEventHandlerExtension* ext( + iPluginTool->EventHandlerExt( *target ) ); + + if( ext ) + { + if( eventId != KErrNotFound ) + { + ext->HandleEvent( eventId, param ); + } + else + { + ext->HandleEvent( eventName, param ); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::HandlePluginEventL() +// ---------------------------------------------------------------------------- +// +void CAiContentPluginManager::HandlePluginEventL( + const TAiPublisherInfo& aPublisherInfo, const TDesC& aParam ) + { + // Resolve plugin + CAiContentPublisher* target( + iPluginFactory->PluginByInfoL( aPublisherInfo ) ); + + if( target ) + { + const TInt separatorPos( aParam.Locate( KPluginEventSeparator ) ); + + // Extract event and parameter string + TPtrC eventNameAndParams( aParam.Mid( separatorPos + 1 ) ); + + // Find parameter string position + const TInt paramsPos( + eventNameAndParams.Locate( KEventParameterSeparator ) ); + + // Extract event name + TPtrC eventName( paramsPos < 0 ? + eventNameAndParams : eventNameAndParams.Left( paramsPos ) ); + + // Calculate actual parameter string length by ignoring parenthesis + TInt paramsLength( + eventNameAndParams.Length() - paramsPos - KAILenOfParenthesis ); + + // Extract paramenters + TPtrC param( paramsPos < 0 ? KNullDesC() : + eventNameAndParams.Mid( paramsPos + 1, Max( 0, paramsLength ) ) ); + + // Resolve plugin specific event id + TInt eventId( KErrNotFound ); + + GetIdL( *target, EAiPublisherEvents, eventName, eventId ); + + // Forward event to plugin + MAiEventHandlerExtension* ext( + iPluginTool->EventHandlerExt( *target ) ); + + if( ext ) + { + if( eventId != KErrNotFound ) + { + ext->HandleEvent( eventId, param ); + } + else + { + ext->HandleEvent( eventName, param ); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::HasMenuItemL() +// ---------------------------------------------------------------------------- +// +TBool CAiContentPluginManager::HasMenuItemL( + const TAiPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ) + { + // Resolve plugin + CAiContentPublisher* target( + iPluginFactory->PluginByInfoL( aPublisherInfo ) ); + + if( target ) + { + // Forward query to plugin + MAiEventHandlerExtension* ext( + iPluginTool->EventHandlerExt( *target ) ); + + if ( ext ) + { + return ext->HasMenuItem( aMenuItem ); + } + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::RefreshContentL() +// ---------------------------------------------------------------------------- +// +TBool CAiContentPluginManager::RefreshContent( const TDesC& aContentCid ) + { + TRAPD( error, RefreshContentL( aContentCid ) ); + + return ( error == KErrNone ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::ProcessOnlineState() +// ---------------------------------------------------------------------------- +// +void CAiContentPluginManager::ProcessOnlineState( TBool aOnline ) + { + _LIT( KOnlineOffline, "online_offline" ); + + for( TInt i = 0; i < iPlugins.Count(); i++ ) + { + MAiEventHandlerExtension* ext( + iPluginTool->EventHandlerExt( *iPlugins[i] ) ); + + // If plugin understands online/offline run state change + if( ext && ext->HasMenuItem( KOnlineOffline ) ) + { + if( aOnline ) + { + iStateManager->ProcessOnlineState( *iPlugins[i] ); + } + else + { + iStateManager->ProcessOfflineState( *iPlugins[i] ); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::StateManager() +// ---------------------------------------------------------------------------- +// +CAiPluginStateManager& CAiContentPluginManager::StateManager() const + { + return *iStateManager; + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::PluginFactory() +// ---------------------------------------------------------------------------- +// +CAiPluginFactory& CAiContentPluginManager::PluginFactory() const + { + return *iPluginFactory; + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::GetIdL() +// ---------------------------------------------------------------------------- +// +void CAiContentPluginManager::GetIdL( CAiContentPublisher& aContentPublisher, + TAiPublisherProperty aProperty, const TDesC& aName, TInt& aId ) + { + MAiContentItemIterator* iterator = + iPluginTool->ContentItemIteratorL( aContentPublisher, aProperty ); + + if( iterator ) + { + const TAiContentItem& ci( iterator->ItemL( aName ) ); + aId = ci.id; + } + else + { + aId = KErrNotFound; + } + } + +// ---------------------------------------------------------------------------- +// CAiContentPluginManager::RefreshContentL() +// ---------------------------------------------------------------------------- +// +TInt CAiContentPluginManager::RefreshContentL( const TDesC& aContentCid ) + { + TInt retval( KErrNotFound ); + + // Look up plug-in and content item and delegate to plug-in's + // MAiContentRequest implementation. + + // Find plugin name + TInt pos( aContentCid.Locate( KPluginEventSeparator ) ); + + if( pos == KErrNotFound ) + { + return retval; + } + + TPtrC pluginName( aContentCid.Left( pos ) ); + + CAiContentPublisher* plugin( iPluginFactory->PluginByNameL( pluginName ) ); + + if( !plugin ) + { + return retval; + } + + MAiPropertyExtension* ext( iPluginTool->PropertyExt( *plugin ) ); + + if( !ext ) + { + return retval; + } + + // Extract content id + TPtrC cid( aContentCid.Mid( ++pos ) ); + TInt id( 0 ); + + MAiContentRequest* handler( NULL ); + + TRAPD( error, GetIdL( *plugin, EAiPublisherContent, cid, id ) ); + + if ( !error ) + { + handler = static_cast< MAiContentRequest* >( + ext->GetPropertyL( EAiContentRequest ) ); + } + else + { + GetIdL( *plugin, EAiPublisherResources, cid, id ); + + handler = static_cast< MAiContentRequest* >( + ext->GetPropertyL( EAiResourceRequest ) ); + } + + // Forward event to plugin + if( handler && handler->RefreshContent( id ) ) + { + retval = KErrNone; + } + + return retval; + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aienvironmentchangeobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aienvironmentchangeobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,93 @@ +/* +* 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: Environment change observer for AI2 +* +*/ + + +#include // for CEnvironmentChangeNotifier +#include +#include // for KEikDynamicLayoutVariantSwitch +#include "aienvironmentchangeobserver.h" +#include "aistatemanager.h" +#include "aifwpanic.h" +#include "debug.h" + +CAiEnvironmentChangeObserver::CAiEnvironmentChangeObserver() + { + } + +CAiEnvironmentChangeObserver::~CAiEnvironmentChangeObserver() + { + if( iEnvironmentChangeNotifier ) + { + iEnvironmentChangeNotifier->Cancel(); + delete iEnvironmentChangeNotifier; + } + } + +CAiEnvironmentChangeObserver* CAiEnvironmentChangeObserver::NewL( MAiStateManager* aStateManager ) + { + CAiEnvironmentChangeObserver* self = new (ELeave) CAiEnvironmentChangeObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiEnvironmentChangeObserver::ConstructL( MAiStateManager* aStateManager ) + { + iStateManager = aStateManager; + iEnvironmentChangeNotifier = CEnvironmentChangeNotifier::NewL( + EActivePriorityLogonA, + TCallBack( EnvironmentChangeCallBack, this ) ); + iEnvironmentChangeNotifier->Start(); + } + +TAiStateChanges CAiEnvironmentChangeObserver::Status() + { + // No statuses to report + return ESMAIUnknownState; + } + +TInt CAiEnvironmentChangeObserver::EnvironmentChangeCallBack(TAny* aPtr) + { + CAiEnvironmentChangeObserver* self = + static_cast( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + const TInt changes( self->iEnvironmentChangeNotifier->Change() ); + + // report environment changes + if( changes & EChangesMidnightCrossover ) + { + __PRINTS("XAI: Event: Midnight crossover"); + self->iStateManager->ReportStateChange( ESMAIMidnightCrossover ); + } + if( changes & EChangesSystemTime ) + { + __PRINTS("XAI: Event: Time changed"); + self->iStateManager->ReportStateChange( ESMAITimeChanged ); + } + if( changes & EChangesLocale ) + { + __PRINTS("XAI: Event: Locale setting changed"); + self->iStateManager->ReportStateChange( ESMAILocaleChanged ); + } + + return EFalse; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aifocusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aifocusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,157 @@ +/* +* 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: Focus observer for Active idle 2 +* +*/ + + +#include +#include +#include "aistatemanager.h" +#include "aifocusobserver.h" +#include "aifwpanic.h" +#include "debug.h" + +CAiFocusObserver::CAiFocusObserver() + { + } + +CAiFocusObserver::~CAiFocusObserver() + { + } + +CAiFocusObserver* CAiFocusObserver::NewL( + MAiStateManager* aStateManager ) + { + CAiFocusObserver* self = new (ELeave) CAiFocusObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiFocusObserver::ConstructL( MAiStateManager* aStateManager ) + { + //++HV + BaseConstructL( TCallBack( StaticHandleFocusChangeEvent, this ), + KPSUidAiInformation, + KActiveIdleState, + aStateManager ); +//--HV + } + +TAiStateChanges CAiFocusObserver::Status() + { + TInt value = 0; + TInt err = iObserver->Get( value ); + if( ( value == EPSAiForeground ) && + ( err == KErrNone ) ) + { + return ESMAIIdleForeground; + } + else + { + return ESMAIIdleBackground; + } + } + + //++HV + + TInt CAiFocusObserver::StaticHandleFocusChangeEvent( TAny* aPtr ) + { + CAiFocusObserver* self = + static_cast( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + return( self->HandleFocusChangeEvent() ); + } + + +TInt CAiFocusObserver::HandleFocusChangeEvent() + { + if( iTfxEffectActive ) + { + return KErrNone; + } + + TInt value = 0; + TInt err = iObserver->Get( value ); + + // Check the PS keys value and call manager with approriate parameter. + // Repowrt either "idle foreground" or "idle background" + if( ( value == EPSAiForeground ) && + ( err == KErrNone ) ) + { + // Check if the transition effect is active + + // This has to be called first, otherwise the state might not be valid. + CAknTransitionUtils::AddObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); + + TInt redirState = 0; + CAknTransitionUtils::GetState( CAknTransitionUtils::EEventWsBufferRedirection, &redirState ); + if ( (TBool)redirState ) + { + // The effect is on-going. Prevent view refresh until the effect is finished. + iTfxEffectActive = ETrue; + } + else + { + // No effect on-going. Observer is not needed. + CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); + iStateManager->ReportStateChange( ESMAIIdleForeground ); + } + } + else if( value == EPSAiBackground ) + { + // Do not receive callbacks in background. Remove observer if it still exists. + CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); + iTfxEffectActive = EFalse; + + iStateManager->ReportStateChange( ESMAIIdleBackground ); + } + + return KErrNone; + } + + +TInt CAiFocusObserver::AknTransitionCallback( TInt aEvent, TInt aState, const TDesC8* /*aParams*/ ) + { + if ( ( aEvent & CAknTransitionUtils::EEventWsBufferRedirection ) && ( !(TBool)aState ) ) + { + // The effect has been finished + iTfxEffectActive = EFalse; + // Observer is not needed any more. + CAknTransitionUtils::RemoveObserver( this, CAknTransitionUtils::EEventWsBufferRedirection ); + + // Issue one focus change event + TInt value = 0; + TInt err = iObserver->Get( value ); + if( ( value == EPSAiForeground ) && + ( err == KErrNone ) ) + { + iStateManager->ReportStateChange( ESMAIIdleForeground ); + } + else if( value == EPSAiBackground ) + { + iStateManager->ReportStateChange( ESMAIIdleBackground ); + } + } + + return 0; + } + + +//--HV diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aifw.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aifw.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,542 @@ +/* +* Copyright (c) 2005-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: Main AI framework class +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +#include +#include + +#include "aifw.h" +#include "aifwpanic.h" +#include "aiutility.h" +#include "aiuicontrollermanager.h" +#include "aiuicontroller.h" +#include "aicontentmodel.h" +#include "aicontentpluginmanager.h" +#include "aiwspluginmanager.h" +#include "aipluginstatemanager.h" +#include "aiidleappregister.h" +#include "debug.h" + +#include +#include +#include "ainetworklistener.h" + + +#include + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiFw::NewL() +// ---------------------------------------------------------------------------- +// +CAiFw::CAiFw() + { + } + +// ---------------------------------------------------------------------------- +// CAiFw::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiFw::ConstructL() + { +#if 0 + // For AI3_test + RProcess proc; + // 0x102750F0 in AI3, 0x2001CB4F in AI3_Test + TSecureId secId( proc.SecureId() ); + + if( secId == 0x2001CB4F ) + { + iAIRepository = CRepository::NewL( TUid::Uid( 0x2001952B ) ); + } + else + { + iAIRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + } +#else + iAIRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); +#endif + + TInt value( 0 ); + + iAIRepository->Get( KAiMainUIController, value ); + + if( !( value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + value == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE || + value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + value == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ) ) + { + // Someone wrote an invalid configuration! Reset repository. + iAIRepository->Reset( KAiMainUIController ); + iAIRepository->Reset( KAiFirstUIController ); + iAIRepository->Delete( KAiFirstUIController + 1 ); + } + + iUiControllerManager = CAiUiControllerManager::NewL(); + + iPluginManager = CAiContentPluginManager::NewL(); + + // Hook framework as UI event observer + iUiControllerManager->SetEventHandler( *this ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::NewLC() +// ---------------------------------------------------------------------------- +// +EXPORT_C CAiFw* CAiFw::NewLC() + { + CAiFw* self = new ( ELeave ) CAiFw; + CleanupStack::PushL( self ); + self->ConstructL(); + + __TICK( "FW: Core FW constructed" ); + __HEAP( "FW: Core FW constructed" ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiFw::~CAiFw() +// ---------------------------------------------------------------------------- +// +CAiFw::~CAiFw() + { + if( iPluginManager ) + { + delete iPluginManager; + iPluginManager = NULL; + } + + if( iIdleRestartObserver ) + { + Release( iIdleRestartObserver ); + iIdleRestartObserver = NULL; + } + + if( iWsPluginManager ) + { + delete iWsPluginManager; + iWsPluginManager = NULL; + } + + if( iUiControllerManager ) + { + delete iUiControllerManager; + iUiControllerManager = NULL; + } + + if( iNotifyHandler ) + { + iNotifyHandler->StopListening(); + delete iNotifyHandler; + iNotifyHandler = NULL; + } + + if( iNotifyHandlerESS ) + { + iNotifyHandlerESS->StopListening(); + delete iNotifyHandlerESS; + iNotifyHandlerESS = NULL; + } + + if( iAIRepository ) + { + delete iAIRepository; + iAIRepository = NULL; + } + + iLibrary1.Close(); + iLibrary2.Close(); + iLibrary3.Close(); + } + +// ---------------------------------------------------------------------------- +// CAiFw::RunL() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CAiFw::RunL() + { + CAiIdleAppRegister* idleReg = CAiIdleAppRegister::NewLC(); + idleReg->RegisterL(); + CleanupStack::PopAndDestroy( idleReg ); + + // Tell UI controller manager to start application framework and event loop. + // This function returns only when the application is shut down. + // See in CAiFw::HandleUiReadyEventL how the framework initialization continues. + iUiControllerManager->RunApplicationL(); + } + +// ---------------------------------------------------------------------------- +// CAiFw::AppEnvReadyL() +// ---------------------------------------------------------------------------- +// +void CAiFw::AppEnvReadyL() + { + // Initialize members which need to be connected to the app environment's + // active scheduler or depend on the app environment being initialized. + + // Create state managers system state observers + CAiPluginStateManager& stateManager( iPluginManager->StateManager() ); + + stateManager.CreateSystemStateObserversL(); + + // Connect state managers UI observer to UI controllers + MAiUiFrameworkObserver* fwObserver( stateManager.UiFwObserver() ); + + if ( fwObserver ) + { + iUiControllerManager->AddObserverL( *fwObserver ); + } + + // Create WS pluign manager + iWsPluginManager = CAiWsPluginManager::NewL + ( iUiControllerManager->CoeEnv() ); + + // CenRep notifier to listen key changes in cenrep. Application is restarted + // if key value is changed. + iNotifyHandler = CCenRepNotifyHandler::NewL( *this, + *iAIRepository, + CCenRepNotifyHandler::EIntKey, + KAiMainUIController ); + iNotifyHandler->StartListeningL(); + + // Cenrep notifier to listen ESS changes in cenrep + // + iNotifyHandlerESS = CCenRepNotifyHandler::NewL( *this, + *iAIRepository, + CCenRepNotifyHandler::EIntKey, + KAIExternalStatusScreen ); + iNotifyHandlerESS->StartListeningL(); + + iIdleRestartObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleRestartEvent, this ), + KPSUidAiInformation, + KActiveIdleRestartAI2 ); + + stateManager.ReportStateChange( ESMAISystemBoot ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandleUiReadyEventL() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleUiReadyEventL( CAiUiController& aUiController ) + { + if( iUiControllerManager->IsMainUiController( aUiController ) ) + { + iUiControllerManager->LoadUIDefinition(); + + TInt value( EIdlePhase1Ok ); + + RProperty::Get( KPSUidStartup, + KPSIdlePhase1Ok, + value ); + + if( value == EIdlePhase1NOK ) + { + RProperty::Set( KPSUidStartup, + KPSIdlePhase1Ok, + EIdlePhase1Ok ); + } + + if( !iLibrariesLoaded ) + { + _LIT( KAIVoiceUIDialer, "VoiceUiNameDialer.dll" ); + _LIT( KAIVoiceUIRecog, "VoiceUiRecognition.dll" ); + _LIT( KAIVCommandHandler, "vcommandhandler.dll" ); + + iLibrary1.Load( KAIVoiceUIDialer ); + iLibrary2.Load( KAIVoiceUIRecog ); + iLibrary3.Load( KAIVCommandHandler ); + + iLibrariesLoaded = ETrue; + } + + } + } + +// --------------------------------------------------------------------------- +// CAiFw::HandleActivateUI() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleActivateUI() + { + iUiControllerManager->ActivateUI(); + } + +// --------------------------------------------------------------------------- +// CAiFw::HandleUiShutdown() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleUiShutdown( CAiUiController& aUiController ) + { + if( iUiControllerManager->IsMainUiController( aUiController ) ) + { + if( iNotifyHandler ) + { + iNotifyHandler->StopListening(); + delete iNotifyHandler; + iNotifyHandler = NULL; + } + + if( iNotifyHandlerESS ) + { + iNotifyHandlerESS->StopListening(); + delete iNotifyHandlerESS; + iNotifyHandlerESS = NULL; + } + + iPluginManager->PluginFactory().DestroyPlugins(); + + iPluginManager->StateManager().DestroySystemStateObservers(); + + iUiControllerManager->DestroySecondaryUiControllers(); + + iUiControllerManager->RemoveObserver( + *iPluginManager->StateManager().UiFwObserver() ); + + if( iWsPluginManager ) + { + delete iWsPluginManager; + iWsPluginManager = NULL; + } + + if( iIdleRestartObserver ) + { + Release( iIdleRestartObserver ); + iIdleRestartObserver = NULL; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandleLoadPluginL() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleLoadPluginL( const TAiPublisherInfo& aPublisherInfo ) + { + iPluginManager->PluginFactory().CreatePluginL( + aPublisherInfo, iUiControllerManager->UiControllers() ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandleDestroyPluginL() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleDestroyPluginL( const TAiPublisherInfo& aPublisherInfo ) + { + iPluginManager->PluginFactory().DestroyPluginL( + aPublisherInfo, iUiControllerManager->UiControllers() ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandlePluginEvent() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandlePluginEvent( const TDesC& aParam ) + { + iPluginManager->HandlePluginEvent( aParam ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandlePluginEventL() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandlePluginEventL( const TAiPublisherInfo& aPublisherInfo, + const TDesC& aParam ) + { + iPluginManager->HandlePluginEventL( aPublisherInfo, aParam ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HasMenuItemL() +// ---------------------------------------------------------------------------- +// +TBool CAiFw::HasMenuItemL( const TAiPublisherInfo& aPublisherInfo, + const TDesC& aMenuItem ) + { + return iPluginManager->HasMenuItemL( aPublisherInfo, aMenuItem ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::RefreshContent() +// ---------------------------------------------------------------------------- +// +TBool CAiFw::RefreshContent( const TDesC& aContentCid ) + { + return iPluginManager->RefreshContent( aContentCid ); + } + +// ---------------------------------------------------------------------------- +// CAiFw::ProcessStateChange() +// ---------------------------------------------------------------------------- +// +void CAiFw::ProcessStateChange( TAifwStates aState ) + { + switch ( aState ) + { + case EAifwOnline : + { + iPluginManager->ProcessOnlineState( ETrue ); + } + break; + case EAifwOffline : + { + iPluginManager->ProcessOnlineState( EFalse ); + } + break; + case EAifwPageSwitch: + { + iPluginManager->StateManager().ReportStateChange( ESMAIPageSwitch ); + } + break; + default : + break; + } + + } + +// ---------------------------------------------------------------------------- +// CAiFw::QueryIsMenuOpen() +// ---------------------------------------------------------------------------- +// +TBool CAiFw::QueryIsMenuOpen() + { + return iUiControllerManager->MainUiController().IsMenuOpen(); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandleNotifyInt() +// ---------------------------------------------------------------------------- +// +void CAiFw::HandleNotifyInt( TUint32 aId, TInt aNewValue ) + { + switch( aId ) + { + case KAiMainUIController: + if( aNewValue == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + aNewValue == AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE || + aNewValue == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML || + aNewValue == AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ) + { + iUiControllerManager->ExitMainController(); + } + else + { + // Someone wrote an invalid configuration! Reset repository. + if( iAIRepository ) + { + iAIRepository->Reset( KAiMainUIController ); + iAIRepository->Reset( KAiFirstUIController ); + iAIRepository->Delete( KAiFirstUIController + 1 ); + } + } + break; + case KAIExternalStatusScreen: + if( ( aNewValue & 0x7FFFFFFF ) != 0 ) + { + TRAP_IGNORE( SwapUiControllerL( EFalse ) ); + } + else + { + TRAP_IGNORE( SwapUiControllerL( ETrue ) ); + } + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CAiFw::SwapUiControllerL() +// ---------------------------------------------------------------------------- +// +void CAiFw::SwapUiControllerL( TBool aToExtHS ) + { + TUid uid = { KCRUidActiveIdleLV }; + CRepository* cenRep = CRepository::NewL( uid ); + + if( !aToExtHS ) // Switch to XML UI + { + cenRep->Create( KAiFirstUIController, + AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); + + cenRep->Set( KAiFirstUIController, + AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); + cenRep->Delete( KAiFirstUIController + 1 ); + + cenRep->Set( KAiMainUIController, + AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML ); + } + else // Switch to ExtHS + { + cenRep->Delete( KAiFirstUIController ); + cenRep->Delete( KAiFirstUIController + 1 ); + cenRep->Set( KAiMainUIController, + AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE ); + } + + delete cenRep; + + // Restart + iUiControllerManager->ExitMainController(); + } + +// ---------------------------------------------------------------------------- +// CAiFw::HandleRestartEvent() +// ---------------------------------------------------------------------------- +// +TInt CAiFw::HandleRestartEvent( TAny* aSelf ) + { + CAiFw* self = static_cast( aSelf ); + + TInt value( 0 ); + + if( self->iIdleRestartObserver ) + { + TInt err( self->iIdleRestartObserver->Get( value ) ); + + // Check the PS keys value and call manager with approriate parameter. + // Report either "idle foreground" or "idle background" + if( value == KActiveIdleRestartCode ) + { + self->iUiControllerManager->ExitMainController(); + } + } + + return KErrNone; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aifwstartupscheduler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aifwstartupscheduler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: AvtiveIdle2 startup scheduler +* +*/ + + +#include "aifwstartupscheduler.h" + +CAiFwStartupScheduler::CAiFwStartupScheduler() + : iResult(KErrNone) + { + } + +CAiFwStartupScheduler* CAiFwStartupScheduler::NewLC() + { + CAiFwStartupScheduler* self = new(ELeave) CAiFwStartupScheduler; + CleanupStack::PushL(self); + return self; + } + +CAiFwStartupScheduler::~CAiFwStartupScheduler() + { + } + +TInt CAiFwStartupScheduler::Result() + { + return iResult; + } + +// All RunL leaves from active objects which execute during Active Idle +// Framework startup end up here +void CAiFwStartupScheduler::Error(TInt aError) const + { + // Store any error code + if (aError != KErrNone && iResult == KErrNone) + { + iResult = aError; + } + + // Stop the scheduler as all errors during Active Idle Framework startup + // are fatal + Stop(); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aikeylockobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aikeylockobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,89 @@ +/* +* 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: Focus observer for Active idle 2 +* +*/ + + +#include +#include +#include // KPSUidAvkonDomain, KAknKeyguardStatus, TAknKeyguardStatus +#include "aistatemanager.h" +#include "aikeylockobserver.h" +#include "aifwpanic.h" +#include "debug.h" + +CAiKeylockObserver::CAiKeylockObserver() + { + } + +CAiKeylockObserver::~CAiKeylockObserver() + { + } + +CAiKeylockObserver* CAiKeylockObserver::NewL( + MAiStateManager* aStateManager ) + { + CAiKeylockObserver* self = new (ELeave) CAiKeylockObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiKeylockObserver::ConstructL( MAiStateManager* aStateManager ) + { + BaseConstructL( TCallBack( HandleKeylockStatusEvent, this ), + KPSUidAvkonDomain, + KAknKeyguardStatus, + aStateManager ); + } + +TAiStateChanges CAiKeylockObserver::Status() + { + TInt value; + TInt err = iObserver->Get( value ); + if( err != KErrNone ) + { + return ESMAIKeylockDisabled; + } + + switch( value ) + { + case EKeyguardLocked: + case EKeyguardAutolockEmulation: // fallthorugh + { + return ESMAIKeylockEnabled; + } + case EKeyguardNotActive: + default: // fallthorugh + { + return ESMAIKeylockDisabled; + } + } + } + +TInt CAiKeylockObserver::HandleKeylockStatusEvent( TAny* aPtr ) + { + CAiKeylockObserver* self = + static_cast( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + TAiStateChanges stateChange = self->Status(); + self->iStateManager->ReportStateChange( stateChange ); + return KErrNone; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/ailaunch.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/ailaunch.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 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: Resource definitions for project ailaunch +* +*/ + + +NAME AIFW + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf=""; } + +// --------------------------------------------------------------------------- +// r_ailaunch_localisable_app_info +// It defines localisable app info of Active Idle 2 +// --------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_ailaunch_localisable_app_info + { + short_caption = qtn_apps_idle_grid; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = qtn_apps_idle_grid; + +#ifdef __SCALABLE_ICONS + + number_of_icons = 1; + icon_file = APP_RESOURCE_DIR"\\ailaunch_aif.mif"; + +#else + + number_of_icons = 1; + icon_file = APP_RESOURCE_DIR"\\ailaunch_aif.mbm"; + +#endif // __SCALABLE_ICONS + }; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/ailaunch_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/ailaunch_reg.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// ========== INCLUDE FILES =================================================== + +#include +#include +#include +#include + +// ========== CONSTANTS ======================================================= + +UID2 KUidAppRegistrationResourceFile +UID3 AI_UID3_AIFW_EXE // Define your application UID here + +// ========== RESOURCE DEFINITIONS ============================================ + +// ---------------------------------------------------------------------------- +// +// +// ---------------------------------------------------------------------------- +// +RESOURCE APP_REGISTRATION_INFO + { + app_file = "ailaunch"; + localisable_resource_file = APP_RESOURCE_DIR"\\ailaunch"; + localisable_resource_id = R_AILAUNCH_LOCALISABLE_APP_INFO; + +#ifdef RD_BOOT_CUSTOMIZABLE_AI + // When Active Idle starts in boot, hide the app icon from Application Shell + hidden = KAppIsHidden; +#endif + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/ailightstatusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/ailightstatusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* 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: Light status observer for AI2 +* +*/ + + +#include +#include "ailightstatusobserver.h" +#include "aistatemanager.h" +#include "debug.h" + +CAiLightStatusObserver::CAiLightStatusObserver() + { + } + +CAiLightStatusObserver::~CAiLightStatusObserver() + { + delete iLight; + } + +CAiLightStatusObserver* CAiLightStatusObserver::NewL( MAiStateManager* aStateManager ) + { + CAiLightStatusObserver* self = new (ELeave) CAiLightStatusObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiLightStatusObserver::ConstructL( MAiStateManager* aStateManager ) + { + iStateManager = aStateManager; + iLight = CHWRMLight::NewL( this ); + } + +TAiStateChanges CAiLightStatusObserver::Status() + { + // In future handle other screen lights here also.. + CHWRMLight::TLightStatus status = iLight->LightStatus( CHWRMLight::EPrimaryDisplay ); + if( status == CHWRMLight::ELightOn ) + { + return ESMAIBacklightOn; + } + else if( status == CHWRMLight::ELightOff ) + { + return ESMAIBacklightOff; + } + return ESMAIBacklightOn; + } + +void CAiLightStatusObserver::LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus ) + { + if( aTarget == CHWRMLight::EPrimaryDisplay || + aTarget == CHWRMLight::EPrimaryDisplayAndKeyboard ) + { + if( aStatus == CHWRMLight::ELightOn ) + { + __PRINTS("XAI: Light = ON"); + iStateManager->ReportStateChange( ESMAIBacklightOn ); + } + else if( aStatus == CHWRMLight::ELightOff ) + { + __PRINTS("XAI: Light = OFF"); + iStateManager->ReportStateChange( ESMAIBacklightOff ); + } + } + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/ainetworklistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/ainetworklistener.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 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: Network info listener +* +*/ + +#include +#include +#include "ainetworklistener.h" +#include "ainetworkobserver.h" + +/// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. Can leave. +// ----------------------------------------------------------------------------- +// +CAiNetworkListener* CAiNetworkListener::NewL(MAiNetworkObserver& aNetworkObserver) + { + CAiNetworkListener* self = new (ELeave) CAiNetworkListener(aNetworkObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +CAiNetworkListener::CAiNetworkListener(MAiNetworkObserver& aNetworkObserver) +:iObserver(aNetworkObserver) + { + } + +void CAiNetworkListener::ConstructL() + { + //Create network handling engine session. + iSession = CreateL( *this, iInfo ); + iCurrentNwState = MAiNetworkObserver::ENone; + } + +CAiNetworkListener::~CAiNetworkListener() + { + delete iSession; + } + +void CAiNetworkListener::HandleNetworkMessage( const TNWMessages aMessage ) + { + TBool hasNetInfoChanged = HasNetworkInfoChanged( aMessage ); + if ( !hasNetInfoChanged ) + { + return; + } + + // Interpret new nw state + MAiNetworkObserver::TNetworkState newState; + newState= InterpretNWMessage(aMessage,iInfo); + + // Inform observer of only new nw states (TNetworkState) + if (newState != iCurrentNwState) + { + iObserver.HandleNetworkStateChange(newState); + } + + // Store new nw state + iCurrentNwState= newState; + + } + +MAiNetworkObserver::TNetworkState CAiNetworkListener::InterpretNWMessage(const TNWMessages aMessage, const TNWInfo aNWInfo) + { + MAiNetworkObserver::TNetworkState nwstate = MAiNetworkObserver::ENone; + + switch (aMessage) + { + case MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange: + case MNWMessageObserver::ENWMessageCurrentHomeZoneMessage: + { + switch (aNWInfo.iRegistrationStatus) + { + case ENWRegisteredRoaming: + nwstate = MAiNetworkObserver::ERoaming; + break; + case ENWRegisteredOnHomeNetwork: + nwstate = MAiNetworkObserver::EHomeNetwork; + break; + + default: + // unknown state + break; + } + } + } + + return nwstate; + } + +void CAiNetworkListener::HandleNetworkError( const TNWOperation aOperation, TInt /*aErrorCode*/ ) + { + switch ( aOperation ) + { + case MNWMessageObserver::ENWGetNetworkProviderName: + iReceivedMessageFlags |= ENetworkProviderNameReceived; + iReceivedMessageFlags &= ~ENetworkProviderNameOk; + iInfo.iNPName.Zero(); + break; + case MNWMessageObserver::ENWGetProgrammableOperatorName: + iReceivedMessageFlags |= EProgrammableOperatorInfoReceived; + iReceivedMessageFlags &= ~EProgrammableOperatorInfoReceivedOk; + iInfo.iOperatorNameInfo.iName.Zero(); + break; + case MNWMessageObserver::ENWGetServiceProviderName: + iReceivedMessageFlags |= EServiceProviderNameReceived; + iReceivedMessageFlags &= ~EServiceProviderNameOk; + iInfo.iServiceProviderNameDisplayReq = RMobilePhone::KDisplaySPNNotRequired; + iInfo.iSPName.Zero(); + iInfo.iPLMNField.Zero(); + break; + default: + break; + } + + HandleNetworkMessage( TNWMessages( KErrGeneral ) ); + } + +TBool CAiNetworkListener::HasNetworkInfoChanged( const TNWMessages aMessage ) + { + TBool result = ETrue; + + // pass through + if ( aMessage == MNWMessageObserver::ENWMessageCurrentHomeZoneMessage || + aMessage == MNWMessageObserver::ENWMessageNetworkConnectionFailure || + aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage || + aMessage == MNWMessageObserver::ENWMessageNetworkRegistrationStatusChange ) + { + return result; + } + + result = ( iReceivedMessageFlags != iOldReceivedMessageFlags ); + + if ( !result ) + { + result = + iInfo.iRegistrationStatus != iOldInfo.iRegistrationStatus; + } + + iOldReceivedMessageFlags = iReceivedMessageFlags; + iOldInfo = iInfo; + + return result; + } + +MAiNetworkObserver::TNetworkState CAiNetworkListener::NetworkState() + { + return iCurrentNwState; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/ainwsdlgcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/ainwsdlgcontroller.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,183 @@ +/* +* 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: Network selection dialog controller +* +*/ + + +#include +#include +#include +#include + +#include +#include + +#include "ainwsdlgcontroller.h" +#include "debug.h" + + +// 1-minute timeout before showing soft notification +const TInt KPhoneNetworkLostTimeout = 60*1000000; + +// Offline profile, from ProfileEngineSDKCRKeys.h +const TInt KOfflineProfileId = 5; + + +CAiNwSDlgController* CAiNwSDlgController::NewL() + { + CAiNwSDlgController* self = new(ELeave) CAiNwSDlgController(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +CAiNwSDlgController::CAiNwSDlgController() + { + iRegistered = ETrue; + } + +void CAiNwSDlgController::ConstructL() + { + __PRINTS( "XAI: CAiNwSDlgController is initializing" ); + + iSoftNotifier = CAknSoftNotifier::NewL(); + iSession = CreateL( *this, iInfo ); + iProfileApi = CRepository::NewL( KCRUidProfileEngine ); + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + HandleStateChange(); + + __PRINTS( "XAI: CAiNwSDlgController initialized succesfully" ); + } + +CAiNwSDlgController::~CAiNwSDlgController() + { + delete iPeriodic; + delete iProfileApi; + delete iSession; + delete iSoftNotifier; + } + +void CAiNwSDlgController::HandleStateChange() + { + switch( iInfo.iRegistrationStatus ) + { + case ENWNotRegisteredNoService: + // Fall-through + case ENWNotRegisteredEmergencyOnly: + // Fall-through + case ENWNotRegisteredSearching: + // Fall-through + case ENWRegistrationDenied: + HandleNetworkLost(); + break; + + case ENWRegisteredBusy: + // Fall-through + case ENWRegisteredOnHomeNetwork: + // Fall-through + case ENWRegisteredRoaming: + HandleNetworkFound(); + break; + + case ENWRegistrationUnknown: + // Take no action + default: + break; + } + } + +void CAiNwSDlgController::HandleNetworkFound() + { + __PRINTS( "XAI: Network found" ); + iRegistered = ETrue; + iPeriodic->Cancel(); + CancelDialog(); + } + +void CAiNwSDlgController::HandleNetworkLost() + { + if( iInfo.iSelectionSetting == ENWNetworkSelectionManual ) + { + // See if we were registered before + if( iRegistered ) + { + iRegistered = EFalse; + + if(!IsOffLineMode() && !IsBluetoothSAPConnected()) + { + __PRINTS( "XAI: Network lost, show dialog in 1 minute" ); + iPeriodic->Start( KPhoneNetworkLostTimeout, + KPhoneNetworkLostTimeout, TCallBack( DelayCallBack, this )); + } + } + } + } + +void CAiNwSDlgController::LaunchDialog() + { + iPeriodic->Cancel(); + TRAP_IGNORE( iSoftNotifier->AddNotificationL( ESelectNetworkNotification, 1 ); ); + } + +void CAiNwSDlgController::CancelDialog() + { + TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( ESelectNetworkNotification ); ); + } + +TInt CAiNwSDlgController::DelayCallBack(TAny* aParam) + { + CAiNwSDlgController* self = (CAiNwSDlgController*) aParam; + self->LaunchDialog(); + return KErrNone; + } + +void CAiNwSDlgController::HandleNetworkMessage( const TNWMessages aMessage ) + { + switch(aMessage) + { + case ENWMessageNetworkRegistrationStatusChange: + HandleStateChange(); + break; + + default: + break; + } + } + +void CAiNwSDlgController::HandleNetworkError( const TNWOperation /*aOperation*/, + TInt /*aErrorCode*/ ) + { + // Take no action. + } + +TBool CAiNwSDlgController::IsOffLineMode() const + { + TInt profileId; + TInt err = iProfileApi->Get( KProEngActiveProfile, profileId ); + return profileId == KOfflineProfileId && err == KErrNone; + } + +TBool CAiNwSDlgController::IsBluetoothSAPConnected() const + { + TInt btSapState( EBTSapNotConnected ); + TInt err = RProperty::Get( KPSUidBluetoothSapConnectionState, + KBTSapConnectionState, + btSapState ); + return btSapState != EBTSapNotConnected && err == KErrNone; + } + +// End of file. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aipluginactivitypstool.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aipluginactivitypstool.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,223 @@ +/* +* 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: Plugin activity PS tool +* +*/ + + +#include "aipluginactivitypstool.h" +#include "aipropertyextension.h" +#include +#include // for User +#include // for RProperty +#include + +// Unnamed namespace for local definitions +namespace + { + + const TInt KStartOrdinal( KAIActivePluginRangeStart ); + + // All reads are allowed. + _LIT_SECURITY_POLICY_PASS( KPluginActivityRegistryReadPolicy ); + + // Write requires WriteDeviceData capability + _LIT_SECURITY_POLICY_C1( KPluginActivityRegistryWritePolicy, ECapabilityWriteDeviceData ); + + } + +CAiPluginActivityRegistry::CAiPluginActivityRegistry() + : iRegistryOrdinal( KStartOrdinal ) + { + } + +CAiPluginActivityRegistry* CAiPluginActivityRegistry::NewL() + { + CAiPluginActivityRegistry* self = + new (ELeave) CAiPluginActivityRegistry(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +void CAiPluginActivityRegistry::ConstructL() + { + } + +CAiPluginActivityRegistry::~CAiPluginActivityRegistry() + { + CleanRegistry(); + } + +TInt CAiPluginActivityRegistry::SetPluginActive( const TAiPublisherInfo& aPubInfo ) + { + TInt psErr = KErrArgument; + TInt uid = aPubInfo.iUid.iUid; + + // Make sure the keys are within their assigned ranges + if( uid >= KAIPluginNameRangeStart && + uid <= KAIPluginNameRangeEnd && + iRegistryOrdinal >= KAIActivePluginRangeStart && + iRegistryOrdinal <= KAIActivePluginRangeEnd ) + { + psErr = UpdateOrdinalRegister( uid ); + + ++iPluginCount; // now there is partial data in registry for next item + // so update count allready here, so that + // the data may be cleaned in case on error + + psErr |= UpdateNameRegister( uid, aPubInfo.iName ); + + psErr |= UpdateCountRegister(); + + if( psErr != KErrNone ) + { + CleanLastEntry( uid, + iRegistryOrdinal, + iPluginCount - 1 ); + // Decrement only after rollback so failures may be cleaned properly + // in case there is interrupting error situations + --iPluginCount; + return psErr; + } + + ++iRegistryOrdinal; + } + + return psErr; + } + +void CAiPluginActivityRegistry::CleanRegistry() + { + // The count in p&s might not be updated before + // we end up here that why we use iPluginCount for count. + for( TInt i = 0; i < iPluginCount; ++i ) + { + TInt categoryKey = i + KStartOrdinal; + TInt pluginUid = 0; + TInt err = RProperty::Get( + KPSUidActiveIdle2, + categoryKey, + pluginUid ); + if( err == KErrNone ) + { + // Delete name + RProperty::Delete( KPSUidActiveIdle2, pluginUid ); + } + // Delete ordinal + RProperty::Delete( KPSUidActiveIdle2, categoryKey ); + } + // Delete count + RProperty::Delete( KPSUidActiveIdle2, KAIActivePluginCount ); + iRegistryOrdinal = KStartOrdinal; + } + +TInt CAiPluginActivityRegistry::UpdateCountRegister() + { + TInt err = RProperty::Define( + KPSUidActiveIdle2, + KAIActivePluginCount, + RProperty::EInt, + KPluginActivityRegistryReadPolicy, + KPluginActivityRegistryWritePolicy ); + if( err == KErrAlreadyExists && + iRegistryOrdinal == KStartOrdinal ) + { + // Some error has occured + CleanRegistry(); + err = RProperty::Define( + KPSUidActiveIdle2, + KAIActivePluginCount, + RProperty::EInt, + KPluginActivityRegistryReadPolicy, + KPluginActivityRegistryWritePolicy ); + } + if( err != KErrAlreadyExists && + err != KErrNone ) + { + return err; + } + + // iRegistryOrdinal starts from 1, so it can be used as count, but only + // before incrementation. + err = RProperty::Set( + KPSUidActiveIdle2, + KAIActivePluginCount, + iPluginCount ); + return err; + } + +TInt CAiPluginActivityRegistry::UpdateOrdinalRegister( TInt aPluginUid ) + { + TInt categoryKey = iRegistryOrdinal; + TInt err = RProperty::Define( + KPSUidActiveIdle2, + categoryKey, + RProperty::EInt, + KPluginActivityRegistryReadPolicy, + KPluginActivityRegistryWritePolicy ); + + if( err == KErrNone || + err == KErrAlreadyExists ) + { + // Set plugin uid to ordinal key + err = RProperty::Set( + KPSUidActiveIdle2, + categoryKey, + aPluginUid ); + } + return err; + } + +TInt CAiPluginActivityRegistry::UpdateNameRegister( TInt aPluginUid, + const TDesC& aName ) + { + TInt err = RProperty::Define( + KPSUidActiveIdle2, + aPluginUid, + RProperty::EText, + KPluginActivityRegistryReadPolicy, + KPluginActivityRegistryWritePolicy ); + + if( err == KErrNone || + err == KErrAlreadyExists ) + { + // Set plugin uid to ordinal key + err = RProperty::Set( + KPSUidActiveIdle2, + aPluginUid, + aName ); + } + return err; + } + +void CAiPluginActivityRegistry::CleanLastEntry( TInt aPluginUid, + TInt aOrdinal, + TInt aLastCount ) + { + RProperty::Delete( KPSUidActiveIdle2, aOrdinal ); + RProperty::Delete( KPSUidActiveIdle2, aPluginUid ); + if( aLastCount == 0 ) + { + RProperty::Delete( KPSUidActiveIdle2, KAIActivePluginCount ); + } + else + { + RProperty::Set( + KPSUidActiveIdle2, + KAIActivePluginCount, + aLastCount ); + } + } diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aipluginfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aipluginfactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,403 @@ +/* +* 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: Content plugin manager class for Active idle framework. +* +*/ + +// System includes +#include +#include +#include +#include +#include // For RProperty + +// User includes +#include +#include +#include +#include // PubSub category +#include // PubSub category key and values + +#include "aipluginfactory.h" +#include "aicontentpluginmanager.h" +#include "aipluginlifecycleobserver.h" + +#include "aiuicontroller.h" +#include "aifwpanic.h" +#include "debug.h" + + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroy() +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroy( TAny* aObj ) + { + if( aObj ) + { + static_cast( aObj )->ResetAndDestroy(); + } + } + +// ---------------------------------------------------------------------------- +// CleanupResetAndDestroyPushL() +// ---------------------------------------------------------------------------- +// +template +static void CleanupResetAndDestroyPushL(T& aArray) + { + CleanupStack::PushL( TCleanupItem( &CleanupResetAndDestroy, &aArray ) ); + } + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CAiPluginFactory() +// ---------------------------------------------------------------------------- +// +CAiPluginFactory::CAiPluginFactory( + RPointerArray& aPlugins, + CAiContentPluginManager& aManager ) + : iPlugins( aPlugins ), iManager( aManager ) + { + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::~CAiPluginFactory() +// ---------------------------------------------------------------------------- +// +CAiPluginFactory::~CAiPluginFactory() + { + Release( iPluginTool ); + + iEComPlugins.ResetAndDestroy(); + + iLifecycleObservers.Reset(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::NewL() +// ---------------------------------------------------------------------------- +// +CAiPluginFactory* CAiPluginFactory::NewL( + RPointerArray& aPlugins, + CAiContentPluginManager& aManager ) + { + CAiPluginFactory* self = + new ( ELeave ) CAiPluginFactory( aPlugins, aManager ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::ConstructL() + { + iPluginTool = AiUtility::CreatePluginToolL(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::AddLifecycleObserverL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::AddLifecycleObserverL( + MAiPluginLifecycleObserver& aObserver ) + { + if( iLifecycleObservers.Find( &aObserver ) == KErrNotFound ) + { + iLifecycleObservers.AppendL( &aObserver ); + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CreatePluginL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::CreatePluginL( + const TAiPublisherInfo& aPublisherInfo, + RPointerArray& aControllerArray ) + { + iEComPlugins.ResetAndDestroy(); + + // Discover Plugin implementations. + __TIME_MARK( ecomOverhead ); + + REComSession::ListImplementationsL( + KInterfaceUidContentPlugin, iEComPlugins ); + + __TIME_ENDMARK( "FW: ECom Discover plug-ins", ecomOverhead ); + + iPlugins.ReserveL( iPlugins.Count() + 1 ); + + TBool implFound( EFalse ); + + for( TInt i = 0; i < iEComPlugins.Count(); i++ ) + { + CImplementationInformation* information( iEComPlugins[i] ); + + if( information->ImplementationUid().iUid == aPublisherInfo.iUid.iUid ) + { + implFound = ETrue; + break; + } + } + + if( aPublisherInfo.iNamespace == KNullDesC8 || !implFound ) + { + // No namespace available or no ecom implementation available + User::Leave( KErrNotSupported ); + } + + CAiContentPublisher* plugin( PluginByInfoL( aPublisherInfo ) ); + + if( plugin ) + { + User::Leave( KErrAlreadyExists ); + } + + __PRINT( __DBG_FORMAT( "\t[I]\t Loading plug-in uid=%x name=%S"), + aPublisherInfo.iUid, &(aPublisherInfo.iName) ); + + __TIME( "FW: Create plug-in:", + plugin = CreatePluginLC( aPublisherInfo ); + ) // __TIME + + __TIME( "FW: Subscribe content observers", + SubscribeContentObserversL( *plugin, + aPublisherInfo, aControllerArray ); + ) // __TIME + + // Plug-in settings + __TIME( "FW: Configure Plugin", + ConfigurePluginL( aControllerArray, *plugin, aPublisherInfo ); + ) // __TIME + + __PRINTS( "*** FW: Done - Load Plug-in ***" ); + + // This might fail and the plugin ends up destroyed + for( TInt i = 0; i < iLifecycleObservers.Count(); ++i ) + { + iLifecycleObservers[i]->PluginCreatedL( *plugin ); + } + + for( TInt i = 0; i < iLifecycleObservers.Count(); ++i ) + { + iLifecycleObservers[i]->AllPluginsCreated(); + } + + // Move plugins to manager + iPlugins.Append( plugin ); + CleanupStack::Pop( plugin ); + + iEComPlugins.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DestroyPluginL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DestroyPluginL( + const TAiPublisherInfo& aPublisherInfo, + RPointerArray< CAiUiController >& /*aControllerArray*/ ) + { + // TODO: check is there need to call + // iUiControllerManager->RemovePluginFromUI( aPlugin ); + // it will clean the published content. + + if( iPlugins.Count() == 0 ) + { + return; + } + + CAiContentPublisher* plugin( PluginByInfoL( aPublisherInfo ) ); + + TInt index( iPlugins.Find( plugin ) ); + + if( plugin && index != KErrNotFound ) + { + for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) + { + iLifecycleObservers[i]->PluginDestroyed( *plugin ); + } + + iPlugins.Remove( index ); + + delete plugin; + plugin = NULL; + } + + if( iPlugins.Count() == 0 ) + { + for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) + { + iLifecycleObservers[i]->AllPluginsDestroyed(); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::DestroyPlugins() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::DestroyPlugins() + { + for( TInt i = 0; i < iPlugins.Count(); i++ ) + { + CAiContentPublisher* plugin( iPlugins[i] ); + + for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) + { + iLifecycleObservers[i]->PluginDestroyed( *plugin ); + } + } + + iPlugins.ResetAndDestroy(); + + for( TInt i = 0; i < iLifecycleObservers.Count(); i++ ) + { + iLifecycleObservers[i]->AllPluginsDestroyed(); + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::CreatePluginLC() +// ---------------------------------------------------------------------------- +// +CAiContentPublisher* CAiPluginFactory::CreatePluginLC( + const TAiPublisherInfo& aPluginInfo ) + { + CAiContentPublisher* plugin = + CAiContentPublisher::NewL( aPluginInfo.iUid ); + + CleanupStack::PushL( plugin ); + + MAiPropertyExtension* ext( iPluginTool->PropertyExt( *plugin ) ); + + if( !ext ) + { + User::Leave( KErrNotFound ); + } + + ext->SetPropertyL( EAiPublisherInfo, (TAny*)&aPluginInfo ); + + const TAiPublisherInfo* info( ext->PublisherInfoL() ); + + if( info->iNamespace != aPluginInfo.iNamespace ) + { + // SetPropertyL is not implemented correctly + User::Leave( KErrNotSupported ); + } + + return plugin; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::SubscribeContentObserversL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::SubscribeContentObserversL( + CAiContentPublisher& aContentPublisher, + const TAiPublisherInfo& aPublisherInfo, + RPointerArray& aControllerArray ) + { + + for( TInt i = 0; i < aControllerArray.Count(); i++ ) + { + MAiContentObserver& observer( + aControllerArray[i]->GetContentObserver() ); + + if ( observer.RequiresSubscription( aPublisherInfo ) ) + { + // Subscribe observer only if it understands the plugin + aContentPublisher.SubscribeL( observer ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::ConfigurePluginL() +// ---------------------------------------------------------------------------- +// +void CAiPluginFactory::ConfigurePluginL( + RPointerArray& aControllerArray, + CAiContentPublisher& aContentPublisher, + const TAiPublisherInfo& aPubInfo ) + { + RAiSettingsItemArray pluginSettings; + CleanupResetAndDestroyPushL( pluginSettings ); + + for( TInt i = 0; i < aControllerArray.Count(); i++ ) + { + // Get settings for plug-in + aControllerArray[i]->GetSettingsL( aPubInfo, pluginSettings ); + } + + // Configure plug-in with its settings + aContentPublisher.ConfigureL( pluginSettings ); + + CleanupStack::PopAndDestroy( &pluginSettings ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByInfoL() +// ---------------------------------------------------------------------------- +// +CAiContentPublisher* CAiPluginFactory::PluginByInfoL( + const TAiPublisherInfo& aInfo ) const + { + for( TInt i = 0; i < iPlugins.Count(); i++ ) + { + const TAiPublisherInfo* info( NULL ); + + info = iPluginTool->PublisherInfoL( *iPlugins[i] ); + + if( info && ( aInfo == *info ) ) + { + return iPlugins[i]; + } + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginFactory::PluginByNameL() +// ---------------------------------------------------------------------------- +// +CAiContentPublisher* CAiPluginFactory::PluginByNameL( + const TDesC& aName ) const + { + for( TInt i = 0; i < iPlugins.Count(); i++ ) + { + const TAiPublisherInfo* info( NULL ); + + TRAP_IGNORE( info = iPluginTool->PublisherInfoL( *iPlugins[i] ) ); + + if( info && info->iName == aName ) + { + return iPlugins[i]; + } + } + + return NULL; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aipluginstatemachineimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aipluginstatemachineimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,220 @@ +/* +* 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: Plugin state machine impl +* +*/ + + +#include "aipluginstatemachineimpl.h" +#include "aipluginstatemachine.h" +#include "aipluginlifecycleobserver.h" +#include "aipluginstate.h" +#include "aifwpanic.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::CAiPluginStateMachine() +// ---------------------------------------------------------------------------- +// +CAiPluginStateMachine::CAiPluginStateMachine( + MAiPluginStateResources& aPluginStateResource, + CAiContentPublisher& aPlugin ) + : iAlive( *this ), + iCurrentState( NULL ), + iPluginStateResource( aPluginStateResource ), + iPlugin( aPlugin ) + { + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::SwitchToState() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateMachine::SwitchToState( TAiState aState, + TAiStateChanges aStateChange ) + { + // Store previous state + MAiPluginState* previousState( iCurrentState ); + + // Determine new current state + switch( aState ) + { + case EAiAlive: + { + iCurrentState = &iAlive; + break; + } + case EAiSuspended: + { + iCurrentState = &iSuspended; + break; + } + case EAiIdle: + { + iCurrentState = &iIdle; + break; + } + default: + { +#ifdef _DEBUG + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_IllegalPluginStateChange ); +#endif + break; + } + } + + if( previousState != iCurrentState ) + { + if( previousState ) + { + // Exit the previous state + previousState->Exit( *this, aStateChange ); + } + + if( iCurrentState ) + { + // Enter the new state + iCurrentState->Enter( *this, aStateChange ); + } + } + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::StateVariable() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateMachine::StateVariable( TAiStateVariable aStateVariable ) + { + return iPluginStateResource.StateVariable( aStateVariable ); + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::Plugin() +// ---------------------------------------------------------------------------- +// +CAiContentPublisher& CAiPluginStateMachine::Plugin() const + { + return iPlugin; + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateMachine::HandleEvent( TAiStateChanges aStateChange ) + { + // State machine handles some state changes directly. + switch( aStateChange ) + { + case ESMAISystemBoot: + { + // State machine handles startup event(boot/theme change). + // Check if backup is ongoing + if( iPluginStateResource.StateVariable( ESMAIBackupRestoreStatus ) ) + { + SwitchToState( EAiIdle, aStateChange ); + } + else + { + SwitchToState( EAiAlive, aStateChange ); + } + break; + } + case ESMAIBackupOn: + { + // Backup/restore directs straight to idle state. + SwitchToState( EAiIdle, aStateChange ); + break; + } + case ESMAIReportThemeChangeStarted: + case ESMAISystemShutdown: + { + // Shutdown drives directly to idle state. + ChangePluginState( iPluginStateResource.TranslateReason( aStateChange ), + CAiContentPublisher::Stop ); + break; + } + case ESMAIOnLine: + { + if( !iOnline && iCurrentState ) + { + iOnline = ETrue; + + return iCurrentState->HandleEvent( *this, aStateChange ); + } + break; + } + case ESMAIOffLine: + { + if( iCurrentState ) + { + iOnline = EFalse; + + return iCurrentState->HandleEvent( *this, aStateChange ); + } + break; + } + default: + { + if( ( aStateChange == ESMAIBacklightOn ) && + !iPluginStateResource.StateVariable( ESMAIIdleFocusStatus ) ) + { + // Ignore lights on when on background + return ETrue; + } + + if( iCurrentState ) + { + // Other events are handled by the current set state. + // Current state determines return value. + return iCurrentState->HandleEvent( *this, aStateChange ); + } + } + } + + // Return event handled. + return ETrue; + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::TranslateReason() +// ---------------------------------------------------------------------------- +// +TAiTransitionReason CAiPluginStateMachine::TranslateReason( + TAiStateChanges aStateChange ) + { + return iPluginStateResource.TranslateReason( aStateChange ); + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::RestartSuspendTimer() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateMachine::RestartSuspendTimer() + { + iPluginStateResource.RestartSuspendTimer(); + } + +// --------------------------------------------------------------------------- +// CAiPluginStateMachine::ChangePluginState() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateMachine::ChangePluginState( TAiTransitionReason aReason, + void (CAiContentPublisher::*aStateChangeMethod)( TAiTransitionReason ) ) + { + TRAP_IGNORE( ( iPlugin.*aStateChangeMethod)( aReason ) ); + } + +// End of file. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aipluginstatemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aipluginstatemanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,549 @@ +/* +* 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: System state observer and notifier +* +*/ + + +#include +#include +#include // for KSettingsScreenSaverPeriod +#include +#include +#include +#include +#include +#include "aifwpanic.h" +#include "aipluginstatemanager.h" +#include "aipluginstatemachineimpl.h" +#include "ailightstatusobserver.h" +#include "aicallstatusobserver.h" +#include "aifocusobserver.h" +#include "aikeylockobserver.h" +#include "aibackuprestorestatusobserver.h" +#include "aienvironmentchangeobserver.h" +#include "aiuiframeworkobserverimpl.h" + +#include // this include needs to be last + +#include "debug.h" + +const TInt KMinuteInSeconds( 60 ); +const TInt KSecondInMikroSeconds( 1000*1000 ); +const TInt KAIFadeOutEstimateMikroSeconds( 10 * KSecondInMikroSeconds ); +const TInt KTwoMinutesInMikroSeconds( 2 * KMinuteInSeconds * KSecondInMikroSeconds ); + +#define AI2_OPTION_RESUME_AT_CREATION + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::NewL() +// ---------------------------------------------------------------------------- +// +CAiPluginStateManager* CAiPluginStateManager::NewL() + { + CAiPluginStateManager* self = new (ELeave) CAiPluginStateManager; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::~CAiPluginStateManager() +// ---------------------------------------------------------------------------- +// +CAiPluginStateManager::~CAiPluginStateManager() + { + iStateMachines.ResetAndDestroy(); + + DestroySystemStateObservers(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::CAiPluginStateManager() +// ---------------------------------------------------------------------------- +// +CAiPluginStateManager::CAiPluginStateManager() + { + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ConstructL() + { + TInt value( 0 ); + + TInt err( RProperty::Get( KCRUidPersonalizationSettings, + KSettingsScreenSaverPeriod, value ) ); + + if( err == KErrNone ) + { + iT1Delay = ( value * KMinuteInSeconds * KSecondInMikroSeconds ) + + KAIFadeOutEstimateMikroSeconds; + } + else + { + // default when error to 2 minutes + iT1Delay = KTwoMinutesInMikroSeconds; + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::CreateSystemStateObserversL() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::CreateSystemStateObserversL() + { + iT1Timer = CPeriodic::NewL( CActive::EPriorityStandard ); + + iBackupOperationObserver = CAiBackupRestoreStatusObserver::NewL( this ); + + iCallStateObserver = CAiCallStatusObserver::NewL( this ); + + iLightStateObserver = CAiLightStatusObserver::NewL( this ); + + iFocusObserver = CAiFocusObserver::NewL( this ); + + iKeylockObserver = CAiKeylockObserver::NewL( this ); + + // Environment change observer notifies time/date/midnight/language + // changes + iEnvironmentObserver = CAiEnvironmentChangeObserver::NewL( this ); + + // Ui framework observer notifies currently general theme changes + iFrameworkObserver = CAiUiFrameworkObserverImpl::NewL( *this ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::DestroySystemStateObservers() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::DestroySystemStateObservers() + { + if( iT1Timer ) + { + iT1Timer->Cancel(); + + delete iT1Timer; + iT1Timer = NULL; + } + + delete iBackupOperationObserver; + iBackupOperationObserver = NULL; + + delete iCallStateObserver; + iCallStateObserver = NULL; + + delete iLightStateObserver; + iLightStateObserver = NULL; + + delete iFocusObserver; + iFocusObserver = NULL; + + delete iKeylockObserver; + iKeylockObserver = NULL; + + delete iEnvironmentObserver; + iEnvironmentObserver = NULL; + + delete iFrameworkObserver; + iFrameworkObserver = NULL; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::UiFwObserver() +// ---------------------------------------------------------------------------- +// +MAiUiFrameworkObserver* CAiPluginStateManager::UiFwObserver() const + { + return iFrameworkObserver; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ReportStateChange() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ReportStateChange( TAiStateChanges aState ) + { + if( !iIsDeviceStarted ) + { + if( aState == ESMAISystemBoot ) + { + iIsDeviceStarted = ETrue; + } + } + + if( aState == ESMAISystemBoot ) + { + return; + } + + ProcessStateChangeForAll( aState ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::StateVariable() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateManager::StateVariable( TAiStateVariable aStateChange ) + { + switch ( aStateChange ) + { + case ESMAICallStatus: + { + return CallOngoing(); + } + case ESMAILightStatus: + { + return LightsOn(); + } + case ESMAIBackupRestoreStatus: + { + return BackupOngoing(); + } + case ESMAIIdleFocusStatus: + { + return IdleFocused(); + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::RestartSuspendTimer() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::RestartSuspendTimer() + { + if( iT1Timer ) + { + iT1Timer->Cancel(); + + iT1Timer->Start( iT1Delay, iT1Delay, + TCallBack( T1TimerCallback, this ) ); + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::PluginCreatedL() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::PluginCreatedL( CAiContentPublisher& aPlugin ) + { + // Create a new state machine for the plugin from the heap + // and append the machine to our local array. + CAiPluginStateMachine* machine = + new ( ELeave ) CAiPluginStateMachine( *this, aPlugin ); + + // Important to append first so failure will be handled properly + CleanupStack::PushL( machine ); + iStateMachines.AppendL( machine ); + CleanupStack::Pop( machine ); + + // This will effectively resume the plugin NOW. + ProcessStateChange( ESMAISystemBoot, *machine ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::PluginDestroyed() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::PluginDestroyed( CAiContentPublisher& aPlugin ) + { + // plugin has beed destroyed, remove the state machine also + for( TInt i = 0; i < iStateMachines.Count(); i++ ) + { + if( &iStateMachines[i]->Plugin() == &aPlugin ) + { + iStateMachines[i]->HandleEvent( ESMAISystemShutdown ); + delete iStateMachines[i]; + + iStateMachines.Remove( i ); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::AllPluginsCreated() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::AllPluginsCreated() + { + // Currently we get this event via pluginmanager -> aifw -> EAISMSystemBoot event + // so no implementation required. We might want to handle this locally in the + // future though. Current impl is such because RefreshUI for ui controller + // needs to after the plugins are resumed -> If we handle this here it is not + // garanteed. + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::AllPluginsDestroyed() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::AllPluginsDestroyed() + { + // Plugins have been destroyed, so destroy the state machines also. + iStateMachines.ResetAndDestroy(); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::TranslateReason() +// ---------------------------------------------------------------------------- +// +TAiTransitionReason CAiPluginStateManager::TranslateReason( + TAiStateChanges aStateChange ) + { + switch ( aStateChange ) + { + case ESMAIBacklightOn: + { + return EAiBacklightOn; + } + case ESMAIBacklightOff: + { + return EAiBacklightOff; + } + case ESMAIBackupOn: + { + return EAiBackupRestoreStarted; + } + case ESMAIBackupOff: + { + return EAiBackupRestoreEnded; + } + case ESMAIInCall: + { + return EAiPhoneCallStarted; + } + case ESMAINoCall: + { + return EAiPhoneCallEnded; + } + case ESMAISystemBoot: + { + return EAiSystemStartup; + } + case ESMAILocaleChanged: + { + return EAiLanguageChanged; + } + case ESMAIIdleForeground: + { + return EAiIdleForeground; + } + case ESMAIIdleBackground: + { + return EAiIdleBackground; + } + case ESMAITimeChanged: + { + return EAiTimeChanged; + } + case ESMAIMidnightCrossover: + { + return EAiMidnightPassed; + } + case ESMAIRelayoutScreen: + { + return EAiScreenLayoutChanged; + } + case ESMAIReportThemeChangeStarted: + { + return EAiUiDefinitionChangeStarted; + } + case ESMAIReportThemeChangeReady: + { + return EAiUiDefinitionChangeEnded; + } + case ESMAIGeneralThemeChanged: + { + return EAiGeneralThemeChanged; + } + case ESMAISystemShutdown: + { + return EAiSystemShutdown; + } + case ESMAIT1Timeout: + { + return EAiSuspendPlugins; + } + case ESMAIKeylockEnabled: + { + return EAiKeylockEnabled; + } + case ESMAIKeylockDisabled: + { + return EAiKeylockDisabled; + } + case ESMAIOffLine: + { + return EAiIdleOffLine; + } + case ESMAIOnLine: + { + return EAiIdleOnLine; + } + case ESMAIPageSwitch: + { + return EAiIdlePageSwitch; + } + case ESMAIUnknownState: // fallthrough + default: + { + return EAiUnknownTransitionReason; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ProcessStateChange() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ProcessStateChange( TAiStateChanges aState, + CAiPluginStateMachine& aMachine ) + { + aMachine.HandleEvent( aState ); + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ProcessOnlineState() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ProcessOnlineState( CAiContentPublisher& aPlugin ) + { + for ( TInt i = 0; i < iStateMachines.Count(); i++ ) + { + if( &iStateMachines[i]->Plugin() == &aPlugin ) + { + iStateMachines[i]->HandleEvent( ESMAIOnLine ); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ProcessOfflineState() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ProcessOfflineState( CAiContentPublisher& aPlugin ) + { + for ( TInt i = 0; i < iStateMachines.Count(); i++ ) + { + if( &iStateMachines[i]->Plugin() == &aPlugin ) + { + iStateMachines[i]->HandleEvent( ESMAIOffLine ); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::ProcessStateChangeForAll() +// ---------------------------------------------------------------------------- +// +void CAiPluginStateManager::ProcessStateChangeForAll( TAiStateChanges aState ) + { + for ( TInt i = 0; i < iStateMachines.Count(); ++i ) + { + iStateMachines[i]->HandleEvent( aState ); + } + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::IdleFocused() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateManager::IdleFocused() const + { + if ( iFocusObserver ) + { + return ( iFocusObserver->Status() == ESMAIIdleForeground ); + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::BackupOngoing() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateManager::BackupOngoing() const + { + if ( iBackupOperationObserver ) + { + return ( iBackupOperationObserver->Status() == ESMAIBackupOn ); + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::LightsOn() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateManager::LightsOn() const + { + if ( iLightStateObserver ) + { + return ( iLightStateObserver->Status() == ESMAIBacklightOn ); + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::CallOngoing() +// ---------------------------------------------------------------------------- +// +TBool CAiPluginStateManager::CallOngoing() const + { + if ( iCallStateObserver ) + { + return ( iCallStateObserver->Status() == ESMAIInCall ); + } + + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CAiPluginStateManager::T1TimerCallback() +// ---------------------------------------------------------------------------- +// +TInt CAiPluginStateManager::T1TimerCallback( TAny* aPtr ) + { + CAiPluginStateManager* self = + static_cast< CAiPluginStateManager* >( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + self->iT1Timer->Cancel(); + +// self->ProcessStateChangeForAll( ESMAIT1Timeout ); + + return KErrNone; + } + +// End of file + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aipsstatusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aipsstatusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,47 @@ +/* +* 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: Generic PS observer base class +* +*/ + + +#include +#include +#include "aipsstatusobserver.h" + +CAiPSStatusObserver::~CAiPSStatusObserver() + { + if( iObserver ) + iObserver->Release(); + } + +TAiStateChanges CAiPSStatusObserver::Status() + { + return ESMAIUnknownState; + } + +CAiPSStatusObserver::CAiPSStatusObserver() + { + } + +void CAiPSStatusObserver::BaseConstructL( TCallBack aCallBack, + TUid aCategory, + TInt aKey, + MAiStateManager* aStateManager ) + { + iStateManager = aStateManager; + iObserver = AiUtility::CreatePSPropertyObserverL( aCallBack, aCategory, aKey ); + } + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aissaverstatusobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aissaverstatusobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + +#include +#include "aissaverstatusobserver.h" +#include // this include needs to be last +#include "aifwpanic.h" +#include "debug.h" + +CAiSSaverStatusObserver::CAiSSaverStatusObserver() + { + } + +CAiSSaverStatusObserver::~CAiSSaverStatusObserver() + { + } + +CAiSSaverStatusObserver* CAiSSaverStatusObserver::NewL( MAiStateManager* aStateManager ) + { + CAiSSaverStatusObserver* self = new (ELeave) CAiSSaverStatusObserver(); + CleanupStack::PushL(self); + self->ConstructL( aStateManager ); + CleanupStack::Pop(self); + return self; + } + +void CAiSSaverStatusObserver::ConstructL( MAiStateManager* aStateManager ) + { + BaseConstructL( TCallBack( HandleScreenSaverStateChanged, this ), + KPSUidScreenSaver, + KScreenSaverOn, + aStateManager ); + } + +TAiStateChanges CAiSSaverStatusObserver::Status() + { + TInt value = 0; + Tint err = iObserver->Get( value ); + if( ( value == 0 ) || + ( err != KErrNone ) ) + { + return ESMAIScreensaverInactive; + } + else + { + return ESMAIScreensaverActive; + } + } + +TInt CAiSSaverStatusObserver::HandleScreenSaverStateChanged( TAny* aPtr ) + { + CAiSSaverStatusObserver* self = + static_cast( aPtr ); + + __ASSERT_DEBUG( self, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + TInt value = 0; + TInt err = self->iObserver->Get( value ); + + if ( ( value == 0 ) || + ( err != KErrNone ) ) + { + // screensaver off + __PRINTS("XAI: Screen saver = OFF"); + self->iStateManager->ReportStateChange( ESMAIScreensaverInactive ); + } + else + { + // screensaver on + __PRINTS("XAI: Screen saver = ON"); + self->iStateManager->ReportStateChange( ESMAIScreensaverActive ); + } + + return KErrNone; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aistatealive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aistatealive.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,387 @@ +/* +* 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: State class for alive states +* +*/ + + +#include "aistatealive.h" +#include "aipluginstatemachine.h" +#include "debug.h" + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateAliveActive::TAiStateAliveActive() +// ---------------------------------------------------------------------------- +// +TAiStateAliveActive::TAiStateAliveActive() + { + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveActive::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveActive::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Enter Alive active" ); + + const TAiTransitionReason reason( + aStateMachine.TranslateReason( aStateChange ) ); + + aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveActive::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateAliveActive::HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Alive active handles event" ); + switch( aStateChange ) + { + case ESMAIBacklightOff: + { + aStateMachine.SwitchToState( EAiAliveInactive, aStateChange ); + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveActive::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveActive::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges /*aStateChange*/ ) + { + __PRINTS( "XAI: Exit alive active" ); + } + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateAliveInactive::TAiStateAliveInactive() +// ---------------------------------------------------------------------------- +// +TAiStateAliveInactive::TAiStateAliveInactive() + { + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveInactive::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveInactive::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Enter alive inactive" ); + const TAiTransitionReason reason( + aStateMachine.TranslateReason( aStateChange ) ); + + aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); + + aStateMachine.RestartSuspendTimer(); + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveInactive::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateAliveInactive::HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: alive inactive handles event" ); + switch( aStateChange ) + { + case ESMAIIdleForeground: + case ESMAIBacklightOn: + { + aStateMachine.SwitchToState( EAiAliveActive, aStateChange ); + return ETrue; + } + case ESMAIT1Timeout: + { + aStateMachine.SwitchToState( EAiSuspended, aStateChange ); + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveInactive::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveInactive::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges /*aStateChange*/ ) + { + __PRINTS( "XAI: Exit alive inactive" ); + } + + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateAliveIncall::TAiStateAliveIncall() +// ---------------------------------------------------------------------------- +// +TAiStateAliveIncall::TAiStateAliveIncall() + { + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveIncall::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveIncall::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Enter alive incall" ); + + const TAiTransitionReason reason( + aStateMachine.TranslateReason( aStateChange ) ); + + aStateMachine.ChangePluginState( reason, CAiContentPublisher::Resume ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveIncall::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateAliveIncall::HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: alive incall handles event" ); + switch( aStateChange ) + { + case ESMAINoCall: + { + // To alive switch + aStateMachine.SwitchToState( EAiAlive, aStateChange ); + return ETrue; + } + case ESMAIInCall: + { + // prevent master state from handling this + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// TAiStateAliveIncall::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateAliveIncall::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges /*aStateChange*/ ) + { + __PRINTS( "XAI: Exit alive incall" ); + } + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateAlive::TAiStateAlive() +// ---------------------------------------------------------------------------- +// +TAiStateAlive::TAiStateAlive( MAiPluginStateMachine& aParentStateMachine ) + : iCurrentState( &iStateAliveInactive ), + iParentStateMachine( &aParentStateMachine ) + { + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::SwitchToState() +// ---------------------------------------------------------------------------- +// +void TAiStateAlive::SwitchToState( TAiState aState, + TAiStateChanges aStateChange ) + { + switch( aState ) + { + case EAiAliveInactive: + { + iCurrentState = &iStateAliveInactive; + break; + } + case EAiAliveActive: + { + iCurrentState = &iStateAliveActive; + break; + } + case EAiAliveIncall: + { + iCurrentState = &iStateAliveIncall; + break; + } + default: + { + iParentStateMachine->SwitchToState( aState, aStateChange ); + return; + } + } + iCurrentState->Enter( *this, aStateChange ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::StateVariable() +// ---------------------------------------------------------------------------- +// +TBool TAiStateAlive::StateVariable( TAiStateVariable aStateVariable ) + { + return iParentStateMachine->StateVariable( aStateVariable ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::Plugin() +// ---------------------------------------------------------------------------- +// +CAiContentPublisher& TAiStateAlive::Plugin() const + { + return iParentStateMachine->Plugin(); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::TranslateReason() +// ---------------------------------------------------------------------------- +// +TAiTransitionReason TAiStateAlive::TranslateReason( + TAiStateChanges aStateChange ) + { + return iParentStateMachine->TranslateReason( aStateChange ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::RestartSuspendTimer() +// ---------------------------------------------------------------------------- +// +void TAiStateAlive::RestartSuspendTimer() + { + iParentStateMachine->RestartSuspendTimer(); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateAlive::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Alive switch - enter" ); + if( aStateMachine.StateVariable( ESMAICallStatus ) ) + { + // If call is ongoing enter alive in call + iCurrentState = &iStateAliveIncall; + } + else if( !aStateMachine.StateVariable( ESMAILightStatus ) ) + { + // If light is off enter alive inactive + iCurrentState = &iStateAliveInactive; + } + else + { + // Otherwise alive active + iCurrentState = &iStateAliveActive; + } + // finally call the Enter() method + iCurrentState->Enter( *this, aStateChange ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateAlive::HandleEvent( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Alive switch handle event" ); + + if( !iCurrentState->HandleEvent( *this, aStateChange ) ) + { + // Only master state machine handles the "backup/restore on" and + // screen layout changed cases. + // Other event are forwarded to the currently active sub state. + // Other common events may be added here in the future also. + switch( aStateChange ) + { + case ESMAIOffLine: + case ESMAIOnLine: + case ESMAIKeylockEnabled: + case ESMAIKeylockDisabled: + case ESMAIRelayoutScreen: + case ESMAIIdleForeground: + case ESMAIIdleBackground: + case ESMAIPageSwitch: + case ESMAIGeneralThemeChanged: // fallthrough + { + iCurrentState->Enter( *this, aStateChange ); + // Handled the event ok + break; + } + case ESMAIInCall: + { + SwitchToState( EAiAliveIncall, aStateChange ); + // Handled the event ok + break; + } + default: + { + // Neither current state or master handled this event + return EFalse; + } + } + } + // Current state handled the event + return ETrue; + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateAlive::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Alive switch exit" ); + iCurrentState->Exit( *this, aStateChange ); + } + +// ---------------------------------------------------------------------------- +// TAiStateAlive::ChangePluginState() +// ---------------------------------------------------------------------------- +// +void TAiStateAlive::ChangePluginState( TAiTransitionReason aReason, + void (CAiContentPublisher::*aStateChangeMethod)(TAiTransitionReason) ) + { + iParentStateMachine->ChangePluginState( aReason, aStateChangeMethod ); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aistateidle.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aistateidle.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2005-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: State class for idle state +* +*/ + + +#include "aistateidle.h" +#include "aipluginstatemachine.h" +#include "debug.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateIdle::TAiStateIdle() +// ---------------------------------------------------------------------------- +// +TAiStateIdle::TAiStateIdle() + { + } + +// ---------------------------------------------------------------------------- +// TAiStateIdle::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateIdle::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Enter idle backup restore" ); + const TAiTransitionReason reason( + aStateMachine.TranslateReason( aStateChange ) ); + + aStateMachine.ChangePluginState( reason, CAiContentPublisher::Stop ); + } + +// ---------------------------------------------------------------------------- +// TAiStateIdle::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateIdle::HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Idle backup restore handle event" ); + switch( aStateChange ) + { + case ESMAIBackupOff: + { + aStateMachine.SwitchToState( EAiAlive, aStateChange ); + return ETrue; + } + case ESMAIKeylockEnabled: + case ESMAIKeylockDisabled: // fallthrough + { + Enter( aStateMachine, aStateChange ); + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// TAiStateIdle::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateIdle::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges /*aStateChange*/ ) + { + __PRINTS( "XAI: Exit idle backup restore" ); + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aistatesuspended.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aistatesuspended.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2005-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: State class for suspended state +* +*/ + + +#include "aistatesuspended.h" +#include "aipluginstatemachine.h" +#include "debug.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// TAiStateSuspended::TAiStateSuspended() +// ---------------------------------------------------------------------------- +// +TAiStateSuspended::TAiStateSuspended() + { + } + +// ---------------------------------------------------------------------------- +// TAiStateSuspended::Enter() +// ---------------------------------------------------------------------------- +// +void TAiStateSuspended::Enter( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Enter Suspended" ); + const TAiTransitionReason reason( + aStateMachine.TranslateReason( aStateChange ) ); + + aStateMachine.ChangePluginState( reason, &CAiContentPublisher::Suspend ); + } + +// ---------------------------------------------------------------------------- +// TAiStateSuspended::HandleEvent() +// ---------------------------------------------------------------------------- +// +TBool TAiStateSuspended::HandleEvent( MAiPluginStateMachine& aStateMachine, + TAiStateChanges aStateChange ) + { + __PRINTS( "XAI: Suspended handle event" ); + switch( aStateChange ) + { + case ESMAIIdleForeground: + case ESMAIBacklightOn: + case ESMAILocaleChanged: + case ESMAITimeChanged: + case ESMAIMidnightCrossover: + case ESMAIRelayoutScreen: + case ESMAIGeneralThemeChanged: + case ESMAIInCall: // fallthrough + { + aStateMachine.SwitchToState( EAiAlive, aStateChange ); + return ETrue; + } + case ESMAIKeylockEnabled: + case ESMAIKeylockDisabled: + { + Enter( aStateMachine, aStateChange ); + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// ---------------------------------------------------------------------------- +// TAiStateSuspended::Exit() +// ---------------------------------------------------------------------------- +// +void TAiStateSuspended::Exit( MAiPluginStateMachine& /*aStateMachine*/, + TAiStateChanges /*aStateChange*/ ) + { + __PRINTS( "XAI: Exit Suspended" ); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aiuicontrollermanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aiuicontrollermanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,409 @@ +/* +* Copyright (c) 2005-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: UI controller manager class +* +*/ + + +#include "aiuicontrollermanager.h" +#include "aiuicontroller.h" +#include "aicontentpublisher.h" +#include "aicontentobserver.h" +#include "activeidle2domaincrkeys.h" +#include "aifwpanic.h" +#include +#include +#include + +#include + +#include "debug.h" + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::CAiUiControllerManager() +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager::CAiUiControllerManager() + { + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadMainControllerL() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::LoadMainControllerL( + CRepository& aCenRepConfig ) + { + TInt value( 0 ); + + // Main UI Controller must be configured correctly + User::LeaveIfError( aCenRepConfig.Get( KAiMainUIController, value ) ); + + CAiUiController* controller = CAiUiController::NewL( TUid::Uid( value ) ); + + iCreatedUICList.Append( value ); + CleanupStack::PushL( controller ); + + iMainUiController = controller->MainInterface(); + + // Main UI controller must be configured correctly + if( !iMainUiController ) + { + __PRINT( __DBG_FORMAT("Main UI controller interface not found from controller 0x%x"), value ); + User::Leave( KErrNotFound ); + } + + iUiControllerArray.AppendL( controller ); + CleanupStack::Pop( controller ); + + // Register this as a UI framework observer of the main UI controller + iMainUiController->SetUiFrameworkObserver( *this ); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadSecondaryControllersL() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::LoadSecondaryControllersL( + CRepository& aCenRepConfig ) + { + TInt value( 0 ); + + // Instantiate rest of the UI controllers. + for( TInt key = KAiFirstUIController; + key <= KAiLastUIController && aCenRepConfig.Get( key, value ) == KErrNone; + ++key ) + { + // skip empty entries + if( value == 0 ) + { + continue; + } + + if( iCreatedUICList.Find( value ) != KErrNotFound ) + { + continue; + } + + iCreatedUICList.Append( value ); + + CAiUiController* controller = + CAiUiController::NewL( TUid::Uid( value ) ); + + CleanupStack::PushL( controller ); + + iUiControllerArray.AppendL( controller ); + CleanupStack::Pop( controller ); + + // Get the secondary interface + MAiSecondaryUiController* secController( + controller->SecondaryInterface() ); + + if( secController ) + { + MAiUiFrameworkObserver* uiFwObserver( + secController->UiFrameworkObserver() ); + + if( uiFwObserver ) + { + // Add secondary controller as UI framework event observer. + User::LeaveIfError( + iUiFrameworkObservers.InsertInAddressOrder( uiFwObserver ) ); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::ConstructL() + { + __HEAP("FW: Init - Create UI Ctrls"); + __TIME_MARK(t); + + CRepository* cenRep( NULL ); + +#if 0 + // For AI3_test + RProcess proc; + // 0x102750F0 in AI3, 0x2001CB4F in AI3_Test + TSecureId secId( proc.SecureId() ); + + if( secId == 0x2001CB4F ) + { + cenRep = CRepository::NewL( TUid::Uid( 0x2001952B ) ); + } + else + { + cenRep = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); + } +#else + cenRep = CRepository::NewLC( TUid::Uid( KCRUidActiveIdleLV ) ); +#endif + + LoadMainControllerL( *cenRep ); + + // Failing on secondary is not fatal. Ignore leaves. + TRAP_IGNORE( LoadSecondaryControllersL( *cenRep ) ); + + CleanupStack::PopAndDestroy( cenRep ); + + __TIME_ENDMARK("FW: Create UI Ctrls", t); + __HEAP("FW: Done - Create UI Ctrls"); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::NewL() +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager* CAiUiControllerManager::NewL() + { + CAiUiControllerManager* self = new (ELeave) CAiUiControllerManager; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); // self + + return self; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::~CAiUiControllerManager() +// ---------------------------------------------------------------------------- +// +CAiUiControllerManager::~CAiUiControllerManager() + { + iUiControllerArray.ResetAndDestroy(); + + iUiFrameworkObservers.Reset(); + + iCreatedUICList.Reset(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::UiControllers() +// ---------------------------------------------------------------------------- +// +RPointerArray< CAiUiController >& CAiUiControllerManager::UiControllers() const + { + return iUiControllerArray; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::IsMainUiController() +// ---------------------------------------------------------------------------- +// +TBool CAiUiControllerManager::IsMainUiController( + CAiUiController& aUiController ) const + { + return ( aUiController.MainInterface() == iMainUiController ); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::SetEventHandler() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::SetEventHandler( + MAiFwEventHandler& aEventHandler ) + { + for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->SetEventHandler( aEventHandler ); + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::RunApplicationL() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::RunApplicationL() + { + iMainUiController->RunApplicationL(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ActivateUI() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::ActivateUI() + { + for( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->ActivateUI(); + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::LoadUIDefinition() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::LoadUIDefinition() + { + for( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + CAiUiController* uiCtl( iUiControllerArray[i] ); + + MAiSecondaryUiController* secIntr( uiCtl->SecondaryInterface() ); + + if( secIntr ) + { + secIntr->SetCoeEnv( CoeEnv() ); + } + + TRAPD( err, uiCtl->LoadUIDefinitionL() ); + + if( err != KErrNone ) + { + if( IsMainUiController( *uiCtl ) ) + { + // Main ui controller failing is fatal + _LIT(KAIFWStartupFailed, "FW startup failed."); + + User::Panic( KAIFWStartupFailed, 0 ); + } + else + { + // Secondary UI controller failed, delete it + delete uiCtl; + uiCtl = NULL; + + iUiControllerArray.Remove( i ); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::CoeEnv() +// ---------------------------------------------------------------------------- +// +CCoeEnv& CAiUiControllerManager::CoeEnv() const + { + return iMainUiController->CoeEnv(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::MainUiController() +// ---------------------------------------------------------------------------- +// +MAiMainUiController& CAiUiControllerManager::MainUiController() const + { + return *iMainUiController; + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::DestroySecondaryUiControllers() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::DestroySecondaryUiControllers() + { + for( TInt i = iUiControllerArray.Count() - 1; i >= 0; --i ) + { + CAiUiController* uiController = iUiControllerArray[i]; + + if( !IsMainUiController( *uiController ) ) + { + delete uiController; + uiController = NULL; + + iUiControllerArray.Remove(i); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::ExitMainController() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::ExitMainController() + { + iMainUiController->Exit(); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::AddObserverL() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::AddObserverL( + MAiUiFrameworkObserver& aUiFwObserver ) + { + User::LeaveIfError( + iUiFrameworkObservers.InsertInAddressOrder( &aUiFwObserver ) ); + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::RemoveObserver() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::RemoveObserver( + MAiUiFrameworkObserver& aUiFwObserver ) + { + TInt index( iUiFrameworkObservers.FindInAddressOrder( &aUiFwObserver ) ); + + if( index != KErrNotFound ) + { + iUiFrameworkObservers.Remove( index ); + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::RemovePluginFromUI() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::RemovePluginFromUI( CAiContentPublisher& aPlugin ) + { + // Get MAiPropertyExtension from plugin + MAiPropertyExtension* plugin = + static_cast< MAiPropertyExtension* >( + aPlugin.Extension( KExtensionUidProperty ) ); + + // Inform all UI controller that this plugin need to be removed from UI. + if( plugin ) + { + for ( TInt i = 0; i < iUiControllerArray.Count(); i++ ) + { + iUiControllerArray[i]->RemovePluginFromUI( *plugin ); + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::HandleResourceChange() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::HandleResourceChange( TInt aType ) + { + for( TInt i = 0; i < iUiFrameworkObservers.Count(); i++ ) + { + iUiFrameworkObservers[i]->HandleResourceChange( aType ); + } + } + +// ---------------------------------------------------------------------------- +// CAiUiControllerManager::HandleForegroundEvent() +// ---------------------------------------------------------------------------- +// +void CAiUiControllerManager::HandleForegroundEvent( TBool aForeground ) + { + for( TInt i = 0; i < iUiFrameworkObservers.Count(); i++ ) + { + iUiFrameworkObservers[i]->HandleForegroundEvent( aForeground ); + } + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/aiuiframeworkobserverimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/aiuiframeworkobserverimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,89 @@ +/* +* 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: UI framework observer for Active Idle framework +* +*/ + + +#include // for KAknsMessageSkinChange equal general theme changed +#include "aiuiframeworkobserverimpl.h" +#include "debug.h" + +CAiUiFrameworkObserverImpl::CAiUiFrameworkObserverImpl( MAiStateManager& aManager ) + : iManager( aManager ) + { + } + +void CAiUiFrameworkObserverImpl::ConstructL() + { + } + +CAiUiFrameworkObserverImpl* CAiUiFrameworkObserverImpl::NewL( MAiStateManager& aManager ) + + { + CAiUiFrameworkObserverImpl* self = + new(ELeave) CAiUiFrameworkObserverImpl( aManager ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CAiUiFrameworkObserverImpl::~CAiUiFrameworkObserverImpl() + { + } + +// --------------------------------------------------------------------------- +// From class MAiUiFrameworkObserver. +// +// --------------------------------------------------------------------------- +// +void CAiUiFrameworkObserverImpl::HandleResourceChange( TInt aType ) + { + switch( aType ) + { + case KAknsMessageSkinChange: + { + iManager.ReportStateChange( ESMAIGeneralThemeChanged ); + break; + } + default: + { + // Do nothing + break; + } + } + } + +// --------------------------------------------------------------------------- +// From class MAiUiFrameworkObserver. +// +// --------------------------------------------------------------------------- +// +void CAiUiFrameworkObserverImpl::HandleForegroundEvent( TBool /*aForeground*/ ) + { + // Focus observer disabled from this location + } + +// --------------------------------------------------------------------------- +// From class MAiDeviceStatusObserver. +// +// --------------------------------------------------------------------------- +// +TAiStateChanges CAiUiFrameworkObserverImpl::Status() + { + // Resource change event are by nature single shot, so no status can + // be defined for them. + return ESMAIUnknownState; + } diff -r 000000000000 -r 79c6a41cd166 idlefw/src/framework/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/framework/main.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,66 @@ +/* +* 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: Entry point of Active Idle process. +* +*/ + + +#include "ecom/ecom.h" +#include "aifw.h" +#include "debug.h" + +GLDEF_C TInt E32Main() + { + __TICK("FW: Entry point"); + __UHEAP_MARK; +#ifdef _DEBUG + // Check heap and handle count balance in debug builds + TInt initPhc, initThc; + RThread().HandleCount(initPhc, initThc); +#endif + + // Create cleaup stack + CTrapCleanup* cleanupStack = CTrapCleanup::New(); + if (!cleanupStack) + { + return KErrNoMemory; + } + + // Create and run the Active Idle Framework + TInt aiFwResult = KErrNone; + TRAP( aiFwResult, + CAiFw* fw = CAiFw::NewLC(); + fw->RunL(); + CleanupStack::PopAndDestroy( fw ); + ); + + // Clean up before exit + delete cleanupStack; + REComSession::FinalClose(); + +#ifdef _DEBUG + // Check heap and handle count balance in debug builds + TInt exitPhc, exitThc; + RThread().HandleCount(exitPhc, exitThc); + if ( exitThc != initThc ) + { + __PRINT(__DBG_FORMAT("FW: Handle count mismatch %d at exit"), exitThc - initThc); + } +#endif + + __UHEAP_MARKEND; + __PRINT_IF_ERROR(aiFwResult, "FW: Framework exit with error %d"); + return aiFwResult; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiidleappregister.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiidleappregister.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,197 @@ +/* +* Copyright (c) 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: Active Idle <-> Phone app synchronizer implementation. +* +*/ + + +#include "aiidleappregisterimpl.h" +#include +#include +#include + +namespace + { + _LIT_SECURITY_POLICY_C1( KTelephonyInformationReadPolicy, ECapabilityReadDeviceData ); + _LIT_SECURITY_POLICY_C1( KTelephonyInformationWritePolicy, ECapabilityWriteDeviceData ); + _LIT_SECURITY_POLICY_PASS( KTelephonyInformationPolicyAlwaysPass ); + + const TInt KActOnSendKey = 1; + + TInt SetIdleAppPS() + { + return RProperty::Set( + KPSUidAiInformation, + KActiveIdleUid, + AI_UID3_AIFW_EXE ); + } + + TInt DefineIdleAppPS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleUid, + RProperty::EInt, + KTelephonyInformationReadPolicy, + KTelephonyInformationWritePolicy ); + } + + TInt DefineIdleStatePS() + { + RProperty::Define( + KPSUidAiInformation, + KActiveIdlePopupState, + RProperty::EInt, + KTelephonyInformationPolicyAlwaysPass, + KTelephonyInformationWritePolicy ); + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleState, + RProperty::EInt, + KTelephonyInformationPolicyAlwaysPass, + KTelephonyInformationWritePolicy ); + } + + TInt DefineIdleSendKeyPS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleActOnSendKey, + RProperty::EInt, + KTelephonyInformationReadPolicy, + KTelephonyInformationWritePolicy ); + } + TInt SetIdleSendKeyPS() + { + return RProperty::Set( + KPSUidAiInformation, + KActiveIdleActOnSendKey, + KActOnSendKey ); + } + + TInt DefineIdleSimRegFailedReceivedPS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleSimRegFailedReceived, + RProperty::EInt, + KTelephonyInformationReadPolicy, + KTelephonyInformationWritePolicy ); + } + + TInt DefineIdleAI2RestartPS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleRestartAI2, + RProperty::EInt, + KTelephonyInformationReadPolicy, + KTelephonyInformationWritePolicy ); + } + TInt SetIdleAI2RestartPS() + { + return RProperty::Set( + KPSUidAiInformation, + KActiveIdleRestartAI2, + 0 ); + } + + TInt DefineIdleLaunchPS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleLaunch, + RProperty::EInt, + ECapabilityReadDeviceData, + ECapabilityWriteDeviceData ); + } + + TInt DefineIdleSendNumKeysToPhonePS() + { + return RProperty::Define( + KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + RProperty::EInt, + ECapabilityReadDeviceData, + ECapabilityWriteDeviceData ); + + } + + TInt SetIdleSendNumKeysToPhonePS() + { + return RProperty::Set(KPSUidAiInformation, + KActiveIdleForwardNumericKeysToPhone, + EPSAiForwardNumericKeysToPhone); + } + } + +CAiIdleAppRegisterImpl* CAiIdleAppRegisterImpl::NewLC() + { + CAiIdleAppRegisterImpl* self = new(ELeave) CAiIdleAppRegisterImpl; + CleanupStack::PushL( self ); + return self; + } + +CAiIdleAppRegisterImpl::~CAiIdleAppRegisterImpl() + { + } + +void CAiIdleAppRegisterImpl::RegisterL() + { + // Give own uid for phone. + TInt setPSResult = SetIdleAppPS(); + if ( setPSResult == KErrNotFound ) + { + // Key not defined yet -> try to define + const TInt err = DefineIdleAppPS(); + if( err == KErrNone || err == KErrAlreadyExists ) + { + // Try setting again + setPSResult = SetIdleAppPS(); + } + } + + DefineIdleSendKeyPS(); + + DefineIdleSimRegFailedReceivedPS(); + + DefineIdleLaunchPS(); + + // Set the default value to 1 so the send key press is reacted + SetIdleSendKeyPS(); + + // Failure to set the telephony P&S key is fatal + User::LeaveIfError( setPSResult ); + + // Define idle state key + DefineIdleStatePS(); + + DefineIdleAI2RestartPS(); + + SetIdleAI2RestartPS(); + + DefineIdleSendNumKeysToPhonePS(); + + SetIdleSendNumKeysToPhonePS(); + } + +CAiIdleAppRegisterImpl::CAiIdleAppRegisterImpl() + { + } + +EXPORT_C CAiIdleAppRegister* CAiIdleAppRegister::NewLC() + { + return CAiIdleAppRegisterImpl::NewLC(); + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiidleappregisterimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiidleappregisterimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 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: Active Idle <-> Phone app synchronizer implementation. +* +*/ + + +#ifndef C_AIIDLEAPPREGISTERIMPL_H +#define C_AIIDLEAPPREGISTERIMPL_H + +#include "aiidleappregister.h" + +/** + * Idle application registration interface. + */ +NONSHARABLE_CLASS( CAiIdleAppRegisterImpl ) : public CAiIdleAppRegister + { +public: + static CAiIdleAppRegisterImpl* NewLC(); + ~CAiIdleAppRegisterImpl(); + +// from CAiIdleAppRegister + void RegisterL(); + +private: +// Construction + CAiIdleAppRegisterImpl(); + }; + + +#endif // C_AIIDLEAPPREGISTERIMPL_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aistate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aistate.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "aistate.h" +#include "aifwpanic.h" +#include +#include +#include "debug.h" + +CActiveIdleState::CActiveIdleState() + { + } + +void CActiveIdleState::ConstructL() + { + iUpdater = + CIdle::NewL( CActive::EPriorityStandard ); + + //for the sake of safe, this function is called here + UpdateStateAsync(); + } + +CActiveIdleState* CActiveIdleState::NewL() + { + CActiveIdleState* self = + new (ELeave) CActiveIdleState(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +CActiveIdleState::~CActiveIdleState() + { + delete iUpdater; + } + +// ----------------------------------------------------------------------------- +// CActiveIdleState::UpdateState +// ----------------------------------------------------------------------------- +// +void CActiveIdleState::SetIsIdleForeground( + TBool aIsForeground ) + { + __PRINT( __DBG_FORMAT("XAI: CActiveIdleState::SetIsIdleForeground(%d), iIsIdleForeground=%d"), + aIsForeground, iIsIdleForeground ); + if ( iIsIdleForeground != aIsForeground ) + { + iIsIdleForeground = aIsForeground; + UpdateStateAsync(); + } + } + +// ----------------------------------------------------------------------------- +// CActiveIdleState::UpdateStateAsync +// ----------------------------------------------------------------------------- +// +void CActiveIdleState::UpdateStateAsync() + { + // Asynchronous change is done only when going to idle state. + if ( iIsIdleForeground ) + { + if ( !iUpdater->IsActive() ) + { + iUpdater->Start( + TCallBack( DoUpdateState, this ) ); + } + } + else + { + iUpdater->Cancel(); + UpdateActiveIdleState(); + } + } + +// ----------------------------------------------------------------------------- +// CActiveIdleState::UpdateActiveIdleState +// ----------------------------------------------------------------------------- +// +void CActiveIdleState::UpdateActiveIdleState() + { + const EPSActiveIdleState state = + iIsIdleForeground ? EPSAiForeground : EPSAiBackground; + + TInt setResult = + RProperty::Set( + KPSUidAiInformation, + KActiveIdleState, + state ); + + __PRINT( __DBG_FORMAT( "XAI: Set CActiveIdleState::UpdateActiveIdleState: KTelephonyIdleStatus=%d, P&S result=%d" ), + TInt(state), setResult ); + } + +// ----------------------------------------------------------------------------- +// CActiveIdleState::DoUpdateSaSetting +// ----------------------------------------------------------------------------- +// +TInt CActiveIdleState::DoUpdateState( TAny* aAny ) + { + __ASSERT_DEBUG( aAny, AiFwPanic::Panic(AiFwPanic::EAiFwPanic_NullPointerReference ) ); + static_cast< CActiveIdleState* >( aAny )->UpdateActiveIdleState(); + return KErrNone; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aistate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aistate.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef C_ACTIVEIDLESTATE_H +#define C_ACTIVEIDLESTATE_H + +#include + +/** +* @ingroup group_aiidleint +* +* Update idle state flag in system agent +* +* @since Series 60 2.8 +*/ +NONSHARABLE_CLASS(CActiveIdleState) : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aSystemAgentProxy System Agent object. + * @return Idle state monitor object. + */ + static CActiveIdleState* NewL(); + + /** + * Destructor. + */ + ~CActiveIdleState(); + + public: // new function + + /** + * Update the Idle state + */ + void SetIsIdleForeground( TBool aIsForeground ); + + private: + + /** + * C++ default constructor. + */ + CActiveIdleState( ); + + /** + * Symbian OS constructor. + */ + void ConstructL( ); + + /** + * Update setting asynchronously. + */ + void UpdateStateAsync(); + + /** + * Update settings in System Agent. + */ + void UpdateActiveIdleState(); + + /** + * Callback method, updates system agent setting. + */ + static TInt DoUpdateState( TAny* aAny ); + + private: // Data + // ETrue if system is in Idle state + TBool iIsIdleForeground; + + // Owned idle callback to update. + CIdle* iUpdater; + + }; + +#endif // C_ACTIVEIDLESTATE_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiuiidleintegration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiuiidleintegration.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,401 @@ +/* +* Copyright (c) 2006-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: Window server plug-in manager. +* +*/ + + +#include "aiuiidleintegrationimpl.h" +#include "aifweventhandler.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "aistate.h" +#include "aifwpanic.h" +#include "activeidle2domainpskeys.h" + +#include + +#include + +// ======== MEMBER FUNCTIONS ======== + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::NewL() +// ---------------------------------------------------------------------------- +// +CAiUiIdleIntegrationImpl* CAiUiIdleIntegrationImpl::NewL( CEikonEnv& aEikEnv, + const TAiIdleKeySoundConfig& aKeySoundConfig, + MAiFwEventHandler* aAiFwEventHandler ) + { + CAiUiIdleIntegrationImpl* self = + new ( ELeave ) CAiUiIdleIntegrationImpl( aEikEnv, aAiFwEventHandler ); + + CleanupStack::PushL( self ); + self->ConstructL( aKeySoundConfig ); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::~CAiUiIdleIntegrationImpl() +// ---------------------------------------------------------------------------- +// +CAiUiIdleIntegrationImpl::~CAiUiIdleIntegrationImpl() + { + delete iActiveIdleState; + + delete iIncallBubble; + + Release( iSystemStateObserver ); + + Release( iUiStartupStateObserver ); + + Release( iCallStatusObserver ); + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::CAiUiIdleIntegrationImpl() +// ---------------------------------------------------------------------------- +// +CAiUiIdleIntegrationImpl::CAiUiIdleIntegrationImpl( CEikonEnv& aEikEnv, + MAiFwEventHandler* aAiFwEventHandler ) + : iEikEnv( aEikEnv ), + iAiFwEventHandler( aAiFwEventHandler ) + { + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::ConstructL() +// ---------------------------------------------------------------------------- +// +void CAiUiIdleIntegrationImpl::ConstructL( + const TAiIdleKeySoundConfig& aKeySoundConfig ) + { + iIncallBubble = CAknIncallBubble::NewL(); + + iActiveIdleState = CActiveIdleState::NewL(); + + // Set up keysounds + if( aKeySoundConfig.iKeySounds ) + { + aKeySoundConfig.iKeySounds + ->PushContextL( aKeySoundConfig.iContextResId ); + } + + // Set Active Idle application to be system application and disable + // priority switching performed by window server. + iEikEnv.SetSystem( ETrue ); + iEikEnv.WsSession().ComputeMode( RWsSession::EPriorityControlDisabled ); + + // Eikon server window group + iThisApplicationWgId = iEikEnv.RootWin().Identifier(); + + iEikEnv.RootWin().EnableFocusChangeEvents(); + iEikEnv.RootWin().EnableGroupChangeEvents(); + + CApaWindowGroupName::FindByAppUid( KAknCapServerUid, + iEikEnv.WsSession(), + iEikonServerWgId ); + + iActiveIdleState->SetIsIdleForeground( iThisApplicationForeground ); + + iSystemStateObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleSystemStateChange, this ), + KPSUidStartup, + KPSGlobalSystemState ); + + iUiStartupStateObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleUiStartupStateChange, this ), + KPSUidStartup, + KPSStartupUiPhase ); + + iCallStatusObserver = AiUtility::CreatePSPropertyObserverL( + TCallBack( HandleCallEvent, this ), + KPSUidCtsyCallInformation, + KCTsyCallState ); + + // Update state flags. + CAiUiIdleIntegrationImpl::HandleSystemStateChange( this ); + CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( this ); + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::ActivateUI() +// ---------------------------------------------------------------------------- +// +void CAiUiIdleIntegrationImpl::ActivateUI() + { + if( iUiStartupPhaseOk && iSystemStateOk ) + { + RWsSession& wsSession( iEikEnv.WsSession() ); + + TInt focusWgId( wsSession.GetFocusWindowGroup() ); + + if( iThisApplicationWgId != focusWgId ) + { + TApaTaskList taskList( wsSession ); + + TApaTask task( taskList.FindApp( TUid::Uid( AI_UID3_AIFW_EXE ) ) ); + + task.SendSystemEvent( EApaSystemEventBroughtToForeground ); + } + + iAiFwEventHandler->HandleActivateUI(); + } + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::HandleWsEventL() +// ---------------------------------------------------------------------------- +// +void CAiUiIdleIntegrationImpl::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* /*aDestination*/ ) + { + if( !iSystemStateOk || !iUiStartupPhaseOk ) + { + return; + } + + switch ( aEvent.Type() ) + { + case KAknFullOrPartialForegroundGained: + { + if ( !iThisApplicationForeground ) + { + iThisApplicationForeground = ETrue; + iActiveIdleState->SetIsIdleForeground( ETrue ); + SetCallBubbleIfNeededL(); + } + break; + } + + case KAknFullOrPartialForegroundLost: + { + if ( iThisApplicationForeground ) + { + iThisApplicationForeground = EFalse; + iActiveIdleState->SetIsIdleForeground( EFalse ); + ClearCallBubbleL(); + } + break; + } + + case EEventKeyDown: + { + if( aEvent.Key()->iScanCode == EStdKeyDevice0 ) + { + TBool isDialog( iEikEnv.AppUi()->IsDisplayingMenuOrDialog() ); + + if( isDialog || iAiFwEventHandler->QueryIsMenuOpen() ) + { + RProperty::Set( + KPSUidAiInformation, + KActiveIdlePopupState, + EPSAiDisplayingMenuOrDialog ); + } + else + { + RProperty::Set( + KPSUidAiInformation, + KActiveIdlePopupState, + EPSAiNotDisplayingMenuOrDialog ); + } + } + break; + } + + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() +// ---------------------------------------------------------------------------- +// +void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() + { + if( !iIncallBubbleAllowed ) + { + TInt callStatus( 0 ); + + TInt err( RProperty::Get( KPSUidCtsyCallInformation, + KCTsyCallState, + callStatus ) ); + + // Call ongoing => show bubble + if( err == KErrNone && callStatus > EPSCTsyCallStateNone ) + { + iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue ); + iIncallBubbleAllowed = ETrue; + } + } + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::ClearCallBubbleL() +// ---------------------------------------------------------------------------- +// +void CAiUiIdleIntegrationImpl::ClearCallBubbleL() + { + if( iIncallBubbleAllowed ) + { + iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse ); + iIncallBubbleAllowed = EFalse; + } + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegration::NewL() +// ---------------------------------------------------------------------------- +// +EXPORT_C CAiUiIdleIntegration* CAiUiIdleIntegration::NewL( CEikonEnv& aEikEnv, + const TAiIdleKeySoundConfig& aKeySoundConfig, + MAiFwEventHandler* aAiFwEventHandler ) + { + return CAiUiIdleIntegrationImpl::NewL( aEikEnv, aKeySoundConfig, + aAiFwEventHandler ); + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::HandleSystemStateChange() +// ---------------------------------------------------------------------------- +// +TInt CAiUiIdleIntegrationImpl::HandleSystemStateChange( TAny* aPtr ) + { + __ASSERT_DEBUG( aPtr, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + CAiUiIdleIntegrationImpl* self = + static_cast( aPtr ); + + if( !self->iSystemStateOk ) + { + TInt state( 0 ); + + self->iSystemStateObserver->Get( state ); + + if ( state == ESwStateCriticalPhaseOK || + state == ESwStateNormalRfOn || + state == ESwStateNormalRfOff || + state == ESwStateNormalBTSap ) + { + self->iSystemStateOk = ETrue; + self->ActivateUI(); + } + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::HandleUiStartupStateChange() +// ---------------------------------------------------------------------------- +// +TInt CAiUiIdleIntegrationImpl::HandleUiStartupStateChange( TAny *aPtr ) + { + __ASSERT_DEBUG( aPtr, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + CAiUiIdleIntegrationImpl* self = + static_cast( aPtr ); + + if( !self->iUiStartupPhaseOk ) + { + TInt state( 0 ); + + self->iUiStartupStateObserver->Get( state ); + + if( state == EStartupUiPhaseAllDone ) + { + self->iUiStartupPhaseOk = ETrue; + + self->ActivateUI(); + } + } + + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CAiUiIdleIntegrationImpl::HandleCallEvent() +// ---------------------------------------------------------------------------- +// +TInt CAiUiIdleIntegrationImpl::HandleCallEvent( TAny* aPtr ) + { + __ASSERT_DEBUG( aPtr, + AiFwPanic::Panic( AiFwPanic::EAiFwPanic_NullPointerReference ) ); + + CAiUiIdleIntegrationImpl* self = + static_cast( aPtr ); + + TInt callStatus( EPSCTsyCallStateNone ); + + TInt err( self->iCallStatusObserver->Get( callStatus ) ); + + if( err == KErrNone ) + { + // Call ongoing => show bubble if not showing already + TBool allowed = EFalse; + + if( !self->iIncallBubbleAllowed && + self->iThisApplicationForeground && + ( callStatus > EPSCTsyCallStateNone ) ) + { + allowed = ETrue; + + TRAP( err, + self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); + + + if( err == KErrNone ) + { + self->iIncallBubbleAllowed = allowed; + } + } + // No call ongoing => hide if bubble is visible + else if( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) + { + allowed = EFalse; + + TRAP( err, + self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); + + if( err == KErrNone ) + { + self->iIncallBubbleAllowed = allowed; + } + } + } + + return err; + } + +// End of file. + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiuiidleintegrationimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiuiidleintegrationimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 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: Active Idle main UI Controller idle integration. +* +*/ + + +#ifndef C_AIUIIDLEINTEGRATIONIMPL_H +#define C_AIUIIDLEINTEGRATIONIMPL_H + +#include "aiuiidleintegration.h" +#include + +class CActiveIdleState; +class CAknIncallBubble; +class MAiPSPropertyObserver; +class MAiFwEventHandler; + +/** + * CAiUiIdleIntegration implementation. + */ +NONSHARABLE_CLASS( CAiUiIdleIntegrationImpl ) : public CAiUiIdleIntegration + { +public: // constructor and destructor + + static CAiUiIdleIntegrationImpl* NewL( CEikonEnv& aEikEnv, + const TAiIdleKeySoundConfig& aKeySoundConfig, + MAiFwEventHandler* aAiFwEventHandler ); + + ~CAiUiIdleIntegrationImpl(); + +public: // new functions + + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + +private: // constructors + + CAiUiIdleIntegrationImpl(CEikonEnv& aEikEnv, + MAiFwEventHandler* aAiFwEventHandler); + void ConstructL(const TAiIdleKeySoundConfig& aKeySoundConfig); + +private: // new functions + + void ActivateUI(); + + void SetCallBubbleIfNeededL(); + void ClearCallBubbleL(); + + static TInt HandleSystemStateChange( TAny *aPtr ); + static TInt HandleUiStartupStateChange( TAny *aPtr ); + static TInt HandleCallEvent( TAny *aPtr ); + +private: // data + + CEikonEnv& iEikEnv; + CActiveIdleState* iActiveIdleState; + TBool iThisApplicationForeground; + TBool iIncallBubbleAllowed; + TInt iThisApplicationWgId; + TInt iEikonServerWgId; + CAknIncallBubble* iIncallBubble; + + /** + * Observer for system state Publish&Subscribe key. + * Owned. + */ + MAiPSPropertyObserver* iSystemStateObserver; + + /** + * Observer for system state Publish&Subscribe key. + * Owned. + */ + MAiPSPropertyObserver* iUiStartupStateObserver; + + /** + * Observer telephony state + * Owned + */ + MAiPSPropertyObserver* iCallStatusObserver; + /** + * Framework event handler. For notifying critical startup over. + * Not owned. + */ + MAiFwEventHandler* iAiFwEventHandler; + + TBool iSystemStateOk; + TBool iUiStartupPhaseOk; + }; + + +#endif // C_AIUIIDLEINTEGRATION_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiwspluginanim.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiwspluginanim.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 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: Inline implementation for Window server plug-in manager. +* +*/ + + + +#ifndef AIWSPLUGINANIM_H +#define AIWSPLUGINANIM_H + +#include +#include "aiwspluginanimdef.h" + +class RAiWsPluginAnim : public RAnim + { + public: // constructor + + /** + * c++ constructor + * @param aDll + */ + inline RAiWsPluginAnim( RAnimDll &aDll ) : RAnim( aDll ) {} + + + /** + * Constructor + * @param aDevice a window device + * @param aIdleWg window group id of idle application + * @param aConsumerWg window group id of the application handling + * numeric keys on behalf of idle. + */ + inline TInt Construct( + const RWindowBase& aDevice, + TInt aIdleWg, + TInt aConsumerWg ) + { + TPckgBuf init; + init().iAiWgId = aIdleWg; + init().iTargetWgId = aConsumerWg; + + return RAnim::Construct( aDevice, EAnimKeyForward, init ); + } + + }; + +#endif // AIWSPLUGINANIM_H diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiwspluginmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiwspluginmanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 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: Window server plug-in manager. +* +*/ + + +#include "aiwspluginmanagerimpl.h" +#include +#include +#include +#include +#include + +CAiWsPluginManagerImpl::CAiWsPluginManagerImpl(RWsSession& aWsSession) : + iAnimDll( aWsSession ), + iWnd( aWsSession ), + iAnim( iAnimDll ) + { + } + +void CAiWsPluginManagerImpl::ConstructL(CCoeEnv& aCoeEnv) + { + User::LeaveIfError( iAnimDll.Load( KAiWsPluginAnimDllName ) ); + iCoeEnv = &aCoeEnv; + iPhoneStatusObserver = AiUtility::CreatePSPropertyObserverL + ( TCallBack( HandlePhoneEvent, this ), + KPSUidTelInformation, KTelPhoneUid ); + TryLoadWsPluginL(); + } + +CAiWsPluginManagerImpl* CAiWsPluginManagerImpl::NewL( CCoeEnv& aCoeEnv ) + { + CAiWsPluginManagerImpl* self = + new(ELeave) CAiWsPluginManagerImpl( aCoeEnv.WsSession() ); + CleanupStack::PushL( self ); + self->ConstructL( aCoeEnv ); + CleanupStack::Pop( self ); + return self; + } + +CAiWsPluginManagerImpl::~CAiWsPluginManagerImpl() + { + iAnim.Close(); + iWnd.Close(); + Release( iPhoneStatusObserver ); + iAnimDll.Close(); + } + +EXPORT_C CAiWsPluginManager* CAiWsPluginManager::NewL + (CCoeEnv& aCoeEnv) + { + return CAiWsPluginManagerImpl::NewL(aCoeEnv); + } + +TInt CAiWsPluginManagerImpl::HandlePhoneEvent( TAny* aPtr ) + { + CAiWsPluginManagerImpl* self = + static_cast( aPtr ); + TInt err = KErrNone; + if( self ) + { + TRAP( err, self->TryLoadWsPluginL() ); + } + return err; + } + +void CAiWsPluginManagerImpl::TryLoadWsPluginL() + { + TInt phoneUidVal; + iPhoneStatusObserver->Get( phoneUidVal ); + const TUid phoneUid = TUid::Uid( phoneUidVal ); + + if ( phoneUid != KNullUid ) + { + RWsSession& wsSession = iCoeEnv->WsSession(); + TApaTaskList taskList( wsSession ); + TApaTask phoneTask( taskList.FindApp( phoneUid ) ); + if ( phoneTask.Exists() ) + { + iAnim.Close(); + iWnd.Close(); + + RWindowGroup& aiRootWg = iCoeEnv->RootWin(); + // RWindow::Construct requires a unique non-null handle. Active Idle + // does not care about the handle value and just uses this pointer to have + // something non-null. + const TUint32 dummyHandle = reinterpret_cast(this); + User::LeaveIfError( iWnd.Construct(aiRootWg, dummyHandle ) ); + + const TInt aiWgId = aiRootWg.Identifier(); + const TInt phoneWgId = phoneTask.WgId(); + User::LeaveIfError( iAnim.Construct( iWnd, aiWgId, phoneWgId ) ); + + // No need to monitor Phone app status anymore + Release( iPhoneStatusObserver ); + iPhoneStatusObserver = NULL; + } + } + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/idleint/aiwspluginmanagerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/idleint/aiwspluginmanagerimpl.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 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: Window server plug-in manager. +* +*/ + + +#ifndef C_AIWSPLUGINMANAGERIMPL_H +#define C_AIWSPLUGINMANAGERIMPL_H + +#include "aiwspluginmanager.h" +#include "aiwspluginanimdef.h" +#include "aiwspluginanim.inl" + +class CCoeEnv; +class RWsSession; +class MAiPSPropertyObserver; + +/** + * Attaches Active Idle as the default idle app for Phone application. + */ +NONSHARABLE_CLASS( CAiWsPluginManagerImpl ) : public CAiWsPluginManager + { +public: + static CAiWsPluginManagerImpl* NewL(CCoeEnv& aCoeEnv); + ~CAiWsPluginManagerImpl(); + +private: +// Construction + CAiWsPluginManagerImpl(RWsSession& aWsSession); + void ConstructL(CCoeEnv& aCoeEnv); + +private: + void TryLoadWsPluginL(); + static TInt HandlePhoneEvent( TAny* aPtr ); + +private: // data + RAnimDll iAnimDll; + RWindow iWnd; + RAiWsPluginAnim iAnim; + CCoeEnv* iCoeEnv; + MAiPSPropertyObserver* iPhoneStatusObserver; + }; + + +#endif // C_AIWSPLUGINMANAGERIMPL_H + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/aipluginsettingsimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/aipluginsettingsimpl.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "aipluginsettingsimpl.h" +#include "aipluginsettingsitemimpl.h" + +// ============================================================================ +// Class CAiPluginSettings +// ============================================================================ + +CAiPluginSettings* CAiPluginSettings::NewL() + { + CAiPluginSettings* self = new (ELeave) CAiPluginSettings(); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +MAiPluginSettingsItem& CAiPluginSettings::AiPluginSettingsItem() + { + iItemType = 0; + return *iSettingsItem; + } + +void CAiPluginSettings::ConstructL() + { + iSettingsItem = new (ELeave) CAiPluginSettingsItem(); + iSettingsItem->ConstructL(); + } + +CAiPluginSettings::CAiPluginSettings(): iItemType( 0 ) + { + } + +CAiPluginSettings::~CAiPluginSettings() + { + delete iSettingsItem; + } + +TInt CAiPluginSettings::AiPluginItemType() + { + return iItemType; + } + +MAiPluginContentItem& CAiPluginSettings::AiPluginContentItem() + { + iItemType = 1; + return *iSettingsItem; + } + +MAiPluginConfigurationItem& CAiPluginSettings::AiPluginConfigurationItem() + { + iItemType = 2; + return *iSettingsItem; + } + +// ============================================================================ +// Class CAiPluginSettingsItem +// ============================================================================ + +CAiPluginSettingsItem::CAiPluginSettingsItem() + : iKey( KErrNotFound ) + { + } + +void CAiPluginSettingsItem::ConstructL() + { + iValue = HBufC::NewL(KMaxSettingsValueStringLength); + } + +CAiPluginSettingsItem::~CAiPluginSettingsItem() + { + delete iValue; + delete iName; + delete iType; + delete iOwner; + } + +TPtrC CAiPluginSettingsItem::Value() + { + if (iValue) + { + return TPtrC(*iValue); + } + else + { + return TPtrC(); + } + } + +void CAiPluginSettingsItem::SetValueL(const TDesC& aValue, TBool /*aSaveToStore*/) + { + + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + } + +const TUid& CAiPluginSettingsItem::PublisherId() const + { + return iPublisherId; + } + +void CAiPluginSettingsItem::SetPublisherId(const TUid& aUid) + { + iPublisherId = aUid; + } + +TInt32 CAiPluginSettingsItem::Key() const + { + return iKey; + } + +void CAiPluginSettingsItem::SetKey(TInt32 aKey) + { + iKey = aKey; + } + +void CAiPluginSettingsItem::SetStorer(MAiPluginSettingsStorer* aStorer) + { + iStorer = aStorer; + } + +void CAiPluginSettingsItem::ReadFromStoreL() + { + if (iStorer) + { + TPtr ptr = iValue->Des(); + iStorer->ReadL(iKey, ptr); + } + } + +void CAiPluginSettingsItem::SaveToStoreL() + { + if (iStorer) + { + iStorer->SaveL(iKey, *iValue); + } + } + + +void CAiPluginSettingsItem::SetValueL( const TDesC& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + } + +void CAiPluginSettingsItem::SetNameL( const TDesC& aName ) + { + delete iName; + iName = NULL; + iName = aName.AllocL(); + } + +void CAiPluginSettingsItem::SetTypeL( const TDesC& aType ) + { + delete iType; + iType = NULL; + iType = aType.AllocL(); + } + +TPtrC CAiPluginSettingsItem::Name() + { + if ( iName ) + { + return TPtrC( *iName ); + } + else + { + return TPtrC(); + } + } + +TPtrC CAiPluginSettingsItem::Type() + { + if ( iType ) + { + return TPtrC( *iType ); + } + else + { + return TPtrC(); + } + } + +TPtrC CAiPluginSettingsItem::Owner() + { + if ( iOwner ) + { + return TPtrC( *iOwner ); + } + else + { + return TPtrC(); + } + } + +void CAiPluginSettingsItem::SetOwnerL( const TDesC& aOwner ) + { + delete iOwner; + iOwner = NULL; + iOwner = aOwner.AllocL(); + } diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/aiutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/aiutility.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ + + +#include "aiutility.h" +#include "caipspropertyobserver.h" +#include "caistrparser.h" +#include "caicontentitemarrayiterator.h" +#include "aipluginsettingsimpl.h" +#include "caiplugintool.h" + +EXPORT_C MAiPSPropertyObserver* AiUtility::CreatePSPropertyObserverL( + TCallBack aCallBack, + TUid aCategory, + TInt aKey ) + { + return CPSPropertyObserver::NewL( aCallBack, aCategory, aKey ); + } + +EXPORT_C MAiStrParser* AiUtility::CreateStrParserL() + { + return CStrParser::NewL(); + } + +EXPORT_C MAiContentItemIterator* AiUtility::CreateContentItemArrayIteratorL( + const TAiContentItem* aArray, + TInt aCount ) + { + return CAiContentItemArrayIterator::NewL( aArray, aCount ); + } + +EXPORT_C MAiPluginSettings* AiUtility::CreatePluginSettingsL() + { + return CAiPluginSettings::NewL(); + } + +EXPORT_C MAiPluginTool* AiUtility::CreatePluginToolL() + { + return CAiPluginTool::NewL(); + } + + + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/caicontentitemarrayiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/caicontentitemarrayiterator.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,109 @@ +/* +* 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: +* +*/ + + +#include "caicontentitemarrayiterator.h" + +CAiContentItemArrayIterator::CAiContentItemArrayIterator( + const TAiContentItem* aArray, + TInt aCount ) + : iArray( aArray ), + iCount( aCount ), + iIndex( 0 ) + { + } + +CAiContentItemArrayIterator* CAiContentItemArrayIterator::NewL( + const TAiContentItem* aArray, + TInt aCount ) + { + CAiContentItemArrayIterator* self = + new( ELeave ) CAiContentItemArrayIterator( aArray, aCount ); + return self; + } + +CAiContentItemArrayIterator::~CAiContentItemArrayIterator() + { + } + +void CAiContentItemArrayIterator::Release() + { + delete this; + } + +TBool CAiContentItemArrayIterator::HasNext() const + { + return ( iIndex < iCount ); + } + +const TAiContentItem& CAiContentItemArrayIterator::NextL() + { + if ( iIndex >= iCount ) + { + User::Leave( KErrOverflow ); + } + + return iArray[iIndex++]; + } + + +const TAiContentItem& CAiContentItemArrayIterator::ItemL( TInt aId ) const + { + TInt i; + + for ( i = 0; i < iCount; ++i ) + { + if ( iArray[i].id == aId ) + { + break; + } + } + + if ( i >= iCount ) + { + User::Leave( KErrNotFound ); + } + + return iArray[i]; + } + +const TAiContentItem& CAiContentItemArrayIterator::ItemL( const TDesC& aCid ) const + { + TInt i; + + for ( i = 0; i < iCount; ++i ) + { + if ( ContentCid( iArray[i] ) == aCid ) + { + break; + } + } + + if ( i >= iCount ) + { + User::Leave( KErrNotFound ); + } + + return iArray[i]; + } + + +void CAiContentItemArrayIterator::Reset() + { + iIndex = 0; + } + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/caiplugintool.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/caiplugintool.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 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: Collection of content plugin helper functions +* +*/ + + +#include +#include "caiplugintool.h" + +CAiPluginTool::CAiPluginTool() + { + } + +CAiPluginTool* CAiPluginTool::NewL() + { + CAiPluginTool* self = new ( ELeave ) CAiPluginTool(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +void CAiPluginTool::ConstructL() + { + } + +void CAiPluginTool::Release() + { + delete this; + } + +const TAiPublisherInfo* CAiPluginTool::PublisherInfoL( + CAiContentPublisher& aContentPublisher ) + { + const TAiPublisherInfo* result = NULL; + MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); + if ( propExt ) + { + result = propExt->PublisherInfoL(); + } + return result; + } + +MAiContentItemIterator* CAiPluginTool::ContentItemIteratorL( + CAiContentPublisher& aContentPublisher, + TInt aContentType ) + { + MAiContentItemIterator* result = NULL; + MAiPropertyExtension* propExt = PropertyExt( aContentPublisher ); + if ( propExt ) + { + TAny* prop = NULL; + prop = propExt->GetPropertyL( aContentType ); + if ( prop ) + { + result = static_cast( prop ); + } + } + return result; + } + +MAiPropertyExtension* CAiPluginTool::PropertyExt( + CAiContentPublisher& aContentPublisher ) + { + return static_cast( + aContentPublisher.Extension( KExtensionUidProperty ) ); + } + +MAiEventHandlerExtension* CAiPluginTool::EventHandlerExt( + CAiContentPublisher& aContentPublisher ) + { + return static_cast( + aContentPublisher.Extension( KExtensionUidEventHandler ) ); + } + + // End of File. + + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/caipspropertyobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/caipspropertyobserver.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,147 @@ +/* +* 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: Publish and subscribe parameter observer implementation. +* +*/ + + +#include "caipspropertyobserver.h" + +// --------------------------------------------------------------------------- +// void ConstructL( TCallBack aCallBack, TUid aCategory, TInt aKey ) +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::ConstructL() + { + User::LeaveIfError( iProperty.Attach( iCategory, iKey ) ); + CActiveScheduler::Add( this ); + + iProperty.Subscribe( iStatus ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// CPSPropertyObserver() +// --------------------------------------------------------------------------- +// +CPSPropertyObserver::CPSPropertyObserver( TCallBack aCallBack, + TUid aCategory, + TInt aKey ) + : CActive( EPriorityStandard ), + iCallBack( aCallBack ), + iCategory( aCategory ), + iKey( aKey ) + { + } + +// --------------------------------------------------------------------------- +// CPSPropertyObserver* NewL( TCallBack aCallBack, TUid aCategory, TInt aKey ) +// --------------------------------------------------------------------------- +// +CPSPropertyObserver* CPSPropertyObserver::NewL( TCallBack aCallBack, + TUid aCategory, + TInt aKey ) + { + CPSPropertyObserver* self = new ( ELeave ) CPSPropertyObserver( aCallBack, + aCategory, + aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// ~CPSPropertyObserver() +// --------------------------------------------------------------------------- +// +CPSPropertyObserver::~CPSPropertyObserver() + { + if( IsAdded() ) + { + Deque(); + } + iProperty.Close(); + } + +// --------------------------------------------------------------------------- +// void Release() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::Release() + { + delete this; + } + +// --------------------------------------------------------------------------- +// void RunL() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::RunL() + { + // resubscribe before processing new value to prevent missing updates. + iProperty.Subscribe( iStatus ); + SetActive(); + + // property updated, get new value. + TInt propval; + if ( iProperty.Get( iCategory, iKey, propval ) != KErrNotFound ) + { + iCallBack.CallBack(); + } + } + +// --------------------------------------------------------------------------- +// void DoCancel() +// --------------------------------------------------------------------------- +// +void CPSPropertyObserver::DoCancel() + { + iProperty.Cancel(); + } + +// --------------------------------------------------------------------------- +// TInt Get( TInt& aValue ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TInt& aValue ) + { + TInt error = iProperty.Get( iCategory, iKey, aValue ); + + return error; + } + +// --------------------------------------------------------------------------- +// TInt Get( TDes8& aString ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TDes8& aString ) + { + TInt error = iProperty.Get( iCategory, iKey, aString ); + return error; + } + +// --------------------------------------------------------------------------- +// TInt Get( TDes16& aString ) +// --------------------------------------------------------------------------- +// +TInt CPSPropertyObserver::Get( TDes16& aString ) + { + TInt error = iProperty.Get( iCategory, iKey, aString ); + return error; + } + +// ========== OTHER EXPORTED FUNCTIONS ======================================== + +// End of File. diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/caistrparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/caistrparser.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 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: Collection of string parsing methods. +* +*/ + + +#include "caistrparser.h" +#include "aistrcnv.h" + +// CONSTANTS + +const TInt KThreeOctets = 3; +const TInt KTwoOctets = 2; + +namespace + { + + _LIT8( KHexPrefix8, "0x" ); + _LIT16( KHexPrefix16, "0x" ); + + const TInt KMaxOneOctetValue = 0x007F; + const TInt KMaxTwoOctetValue = 0x07FF; + + TInt Utf8OctetCount( const TDesC16& aString ) + { + TInt numOctets(0); + TInt length(aString.Length()); + const TUint16* stringData = aString.Ptr(); + + for ( TInt i = 0; i < length; ++i) + { + if (stringData[i] > KMaxOneOctetValue) + { + if (stringData[i] > KMaxTwoOctetValue) + { + numOctets += KThreeOctets; + } + else + { + numOctets += KTwoOctets; + } + } + else + { + ++numOctets; + } + } + + return numOctets; + } + + TPtr8 EnsureBufMaxLengthL(HBufC8*& aBuffer, TInt aMaxLength ) + { + if ( !aBuffer ) + { + aBuffer = HBufC8::NewL( aMaxLength ); + } + else if ( aBuffer->Des().MaxLength() < aMaxLength ) + { + aBuffer = aBuffer->ReAllocL( aMaxLength ); + } + + return aBuffer->Des(); + } + + } + +namespace AiUtility + { + +template< class DescType, class LexType > inline +TInt ParseIntImpl + ( TInt32& aValue, const DescType& aStringValue, + const DescType& aHexPrefix ) + { + const TInt pos = aStringValue.FindF( aHexPrefix ); + if (pos != KErrNotFound) + { + LexType lex( aStringValue.Mid( pos + aHexPrefix.Length() ) ); + // Hex parsing needs unsigned int + TUint32 value = 0; + const TInt parseResult = lex.Val( value, EHex ); + if ( parseResult == KErrNone ) + { + aValue = value; + } + return parseResult; + } + else + { + LexType lex( aStringValue ); + return lex.Val(aValue); + } + } + +EXPORT_C TInt ParseInt( TInt32& aResult, const TDesC8& aSourceString ) + { + return ParseIntImpl< TDesC8, TLex8 > + ( aResult, aSourceString, KHexPrefix8 ); + } + +EXPORT_C TInt ParseInt( TInt32& aResult, const TDesC16& aSourceString ) + { + return ParseIntImpl< TDesC16, TLex16 > + ( aResult, aSourceString, KHexPrefix16 ); + } + +EXPORT_C HBufC16* CopyToBufferL(HBufC16* aTargetBuffer, const TDesC16& aSourceText) + { + EnsureBufMaxLengthL( aTargetBuffer, aSourceText.Length() ).Copy( aSourceText ); + + return aTargetBuffer; + } + +EXPORT_C HBufC16* CopyToBufferL(HBufC16* aTargetBuffer, const TDesC8& aSourceText) + { + if (!aTargetBuffer) + { + return CnvUtfConverter::ConvertToUnicodeFromUtf8L( aSourceText ); + } + + TPtr16 des( EnsureBufMaxLengthL( aTargetBuffer, aSourceText.Length() ) ); + + CnvUtfConverter::ConvertToUnicodeFromUtf8( des, aSourceText ); + + return aTargetBuffer; + } + +EXPORT_C HBufC8* CopyToBufferL(HBufC8* aTargetBuffer, const TDesC8& aSourceText) + { + ::EnsureBufMaxLengthL( aTargetBuffer, aSourceText.Length() ).Copy( aSourceText ); + return aTargetBuffer; + } + +EXPORT_C HBufC8* CopyToBufferL(HBufC8* aTargetBuffer, const TDesC16& aSourceText) + { + if ( !aTargetBuffer ) + { + return CnvUtfConverter::ConvertFromUnicodeToUtf8L( aSourceText ); + } + + TInt length = Utf8OctetCount( aSourceText ); + + TPtr8 des( ::EnsureBufMaxLengthL( aTargetBuffer, length ) ); + CnvUtfConverter::ConvertFromUnicodeToUtf8( des, aSourceText ); + return aTargetBuffer; + } + +EXPORT_C TPtr16 EnsureBufMaxLengthL(HBufC16*& aTargetBuffer, TInt aMaxLength ) + { + if ( !aTargetBuffer ) + { + aTargetBuffer = HBufC16::NewL( aMaxLength ); + } + else + { + if ( aTargetBuffer->Des().MaxLength() < aMaxLength ) + { + aTargetBuffer = aTargetBuffer->ReAllocL( aMaxLength ); + } + } + + return aTargetBuffer->Des(); + } + + } + + +// --------------------------------------------------------------------------- +// CStrParser() +// --------------------------------------------------------------------------- +// +CStrParser::CStrParser() + { + } + +// --------------------------------------------------------------------------- +// CStrParser* NewL() +// --------------------------------------------------------------------------- +// +CStrParser* CStrParser::NewL() + { + CStrParser* self = new ( ELeave ) CStrParser(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// void ConstructL() +// --------------------------------------------------------------------------- +// +void CStrParser::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// void Release() +// --------------------------------------------------------------------------- +// +void CStrParser::Release() + { + delete this; + } + +// --------------------------------------------------------------------------- +// TInt ParseInt( TInt32& aValue, const TDesC8& aStringValue ) +// --------------------------------------------------------------------------- +// +TInt CStrParser::ParseInt( TInt32& aResult, const TDesC8& aSourceString ) + { + return AiUtility::ParseInt( aResult, aSourceString ); + } + +// --------------------------------------------------------------------------- +// HBufC16* CopyToBufferL( HBufC16* aTargetBuffer, const TDesC16& aSourceText ) +// --------------------------------------------------------------------------- +// +HBufC16* CStrParser::CopyToBufferL( HBufC16* aTargetBuffer, const TDesC16& aSourceText ) + { + return AiUtility::CopyToBufferL( aTargetBuffer, aSourceText ); + } + +// --------------------------------------------------------------------------- +// HBufC16* CopyToBufferL( HBufC16* aTargetBuffer, const TDesC8& aSourceText ) +// --------------------------------------------------------------------------- +// +HBufC16* CStrParser::CopyToBufferL( HBufC16* aTargetBuffer, const TDesC8& aSourceText ) + { + return AiUtility::CopyToBufferL( aTargetBuffer, aSourceText ); + } + +// --------------------------------------------------------------------------- +// HBufC8* CopyToBufferL( HBufC8* aTargetBuffer, const TDesC8& aSourceText ) +// --------------------------------------------------------------------------- +// +HBufC8* CStrParser::CopyToBufferL( HBufC8* aTargetBuffer, const TDesC8& aSourceText ) + { + return AiUtility::CopyToBufferL( aTargetBuffer, aSourceText ); + } + +// --------------------------------------------------------------------------- +// HBufC8* CopyToBufferL( HBufC8* aTargetBuffer, const TDesC16& aSourceText ) +// --------------------------------------------------------------------------- +// +HBufC8* CStrParser::CopyToBufferL( HBufC8* aTargetBuffer, const TDesC16& aSourceText ) + { + return AiUtility::CopyToBufferL( aTargetBuffer, aSourceText ); + } + +// End of File. + + diff -r 000000000000 -r 79c6a41cd166 idlefw/src/utility/contentprioritymap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/src/utility/contentprioritymap.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "contentprioritymap.h" + +using namespace AiUtility; + + +// ======== MEMBER FUNCTIONS ======== + +CContentPriorityMap::CContentPriorityMap() + { + } + +EXPORT_C CContentPriorityMap* CContentPriorityMap::NewL() + { + CContentPriorityMap* self = new( ELeave ) CContentPriorityMap; + return self; + } + +CContentPriorityMap::~CContentPriorityMap() + { + iPriorityMap.ResetAndDestroy(); + } + + +EXPORT_C TInt CContentPriorityMap::CurrentPriority( const TDesC8& aUiElementId ) const + { + // Find current priority value for aUiElementId + const TInt* currentPriority = iPriorityMap.Find( aUiElementId ); + + // Return current priority value or KErrNotFound if it has not been set + return currentPriority ? *currentPriority : KErrNotFound; + } + +EXPORT_C TInt CContentPriorityMap::SetCurrentPriority( const TDesC8& aUiElementId, + TInt aPriority ) + { + TInt error = KErrNone; + TInt* currentPriority = iPriorityMap.Find( aUiElementId ); + + if ( currentPriority ) + { + // Update old value + *currentPriority = aPriority; + } + else + { + // Insert new pair + TRAP( error, + { + HBufC8* key = aUiElementId.AllocLC(); + TInt* value = new( ELeave ) TInt( aPriority ); + CleanupStack::PushL( value ); + iPriorityMap.InsertL( key, value ); + CleanupStack::Pop( 2, key ); + } ); + } + + return error; + } + +EXPORT_C void CContentPriorityMap::ClearPriority( const TDesC8& aUiElementId ) + { + TInt* currentPriority = iPriorityMap.Find( aUiElementId ); + + if ( currentPriority ) + { + // Clear old value. Use KErrNotFound to avoid future reallocations of + // the same key. + *currentPriority = KErrNotFound; + } + } + +EXPORT_C void CContentPriorityMap::Reset() + { + iPriorityMap.ResetAndDestroy(); + } + +EXPORT_C TBool CContentPriorityMap::OverrideContent( const TDesC8& aUiElementId, + TInt aNewPriority ) const + { + return ( aNewPriority >= CurrentPriority( aUiElementId ) ); + } + diff -r 000000000000 -r 79c6a41cd166 inc/aisystemuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/aisystemuids.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UIDs for the Active Idle subsystem components. +* +*/ + + +#ifndef AISYSTEMUIDS_HRH +#define AISYSTEMUIDS_HRH + +/** + * AI3 Test Application. + */ +#define AI3_UID_EXE_TEST_APPLICATION 0x2001CB4F + +/** + * Ecom implementation uid for XML UI controller. + */ +#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x2001952C +#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x102750F2 + +/** + * Ecom implementation uid for native UI controller. + */ +#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x2001952E +#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x102750F4 + +/** + * Ecom implementation uid for Device Status plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F8 + +/** + * Ecom implementation uid for Device Status plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN 0x102750FA + +/** + * Ecom implementation uid for AI Profile plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN 0x10275101 + +/** + * Ecom implementation uid for sat plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SATPLUGIN 0x102078EB + +/** + * Ecom dll uid for XML UI controller. + */ +#define AI3_UID_ECOM_DLL_UICONTROLLER_XML 0x2001952A +#define AI_UID_ECOM_DLL_UICONTROLLER_XML 0x102750F1 + + +/** + * Ecom dll uid for native UI controller. + */ +#define AI3_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x2001952D +#define AI_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x102750F3 + +/** + * Ecom dll uid for device status plugin. + */ +#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F7 + +/** + * Common UID3 for Active Idle framework components. + */ +#define AI_UID3_AIFW_COMMON 0x102750F0 + +/** + * Uid3 for AI framework dll. + */ +#define AI_UID3_AIFW_DLL AI_UID3_AIFW_COMMON + +/** + * Uid3 for AI framework launcher exe. + */ +#define AI_UID3_AIFW_EXE AI_UID3_AIFW_COMMON + +/** + * SID for aifw launcher exe. + */ +#define AI_SID_AIFW_EXE AI_UID3_AIFW_EXE + +/** + * Uid3 for AI Voice Dial UI. + */ +#define AI_UID3_VOICE_DIAL_UI 0x101F8543 + +/** + * Uid3 for ai3 layoutengine + */ +#define AI3_UID_LAYOUT_ENGINE 0x2001CB50 + +/** + * Uid3 for ai3 utils + */ +#define AI3_UID_UTILS 0x2001CB51 + +/** + * Uids for rendering plugins + */ +#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY 0x2001952F +#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION 0x20019530 + +#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY 0x20019582 +#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION 0x20019583 + +#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY 0x20019584 +#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION 0x20019585 + +#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY 0x20019586 +#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION 0x20019587 + +#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY 0x20019588 +#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION 0x20019589 + +#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY 0x2001958A +#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION 0x2001958B + +#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY 0x2001CB52 +#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY_IMPLEMENTATION 0x2001CB52 + +#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY 0x2001958E +#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION 0x2001958F + +#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY 0x20019590 +#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION 0x20019591 + +#define AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID 0x20019592 + +#define AI3_EXTERNAL_RENDERING_PLUGIN_ECOM_UID 0x200286DF + +#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY 0x20022FD3 +#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION 0x20022FD3 + +#endif // AISYSTEMUIDS_HRH + + diff -r 000000000000 -r 79c6a41cd166 layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,28 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcsextendedmenuu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcsextendedmenuu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?GetItemIconL@MenuIconUtility@@SAPAVCAknIcon@@AAVCMenuItem@@@Z @ 1 NONAME ; class CAknIcon * MenuIconUtility::GetItemIconL(class CMenuItem &) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcsmenuengu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcsmenuengu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +EXPORTS + ??1CMenuEng@@UAE@XZ @ 1 NONAME ; CMenuEng::~CMenuEng(void) + ??1CMenuEngObject@@UAE@XZ @ 2 NONAME ; CMenuEngObject::~CMenuEngObject(void) + ?AddL@CMenuEng@@QAEXAAVCMenuEngObject@@HH@Z @ 3 NONAME ; void CMenuEng::AddL(class CMenuEngObject &, int, int) + ?AppendNotifyL@CMenuEng@@QAEXHH@Z @ 4 NONAME ; void CMenuEng::AppendNotifyL(int, int) + ?DequeueOperation@CMenuEng@@QAEXAAVMMenuEngOperation@@@Z @ 5 NONAME ; void CMenuEng::DequeueOperation(class MMenuEngOperation &) + ?Exist@CMenuEng@@QBEHH@Z @ 6 NONAME ; int CMenuEng::Exist(int) const + ?FindAttribute@CMenuEngObject@@QBEHABVTDesC16@@AAVTPtrC16@@AAH@Z @ 7 NONAME ; int CMenuEngObject::FindAttribute(class TDesC16 const &, class TPtrC16 &, int &) const + ?Flags@CMenuEngObject@@QBEKH@Z @ 8 NONAME ; unsigned long CMenuEngObject::Flags(int) const + ?GetAttribute@CMenuEngObject@@QBEHHAAVTPtrC16@@0AAH@Z @ 9 NONAME ; int CMenuEngObject::GetAttribute(int, class TPtrC16 &, class TPtrC16 &, int &) const + ?GetItemL@CMenuEng@@QBEXHAAVTMenuItem@@@Z @ 10 NONAME ; void CMenuEng::GetItemL(int, class TMenuItem &) const + ?GetItemsL@CMenuEng@@QBEXAAV?$RArray@VTMenuItem@@@@HPBVMMenuEngFilter@@H@Z @ 11 NONAME ; void CMenuEng::GetItemsL(class RArray &, int, class MMenuEngFilter const *, int) const + ?GetOnceLegacyFormat@CMenuEng@@QAEHXZ @ 12 NONAME ; int CMenuEng::GetOnceLegacyFormat(void) + ?Id@CMenuEngObject@@QBEHXZ @ 13 NONAME ; int CMenuEngObject::Id(void) const + ?MoveToFolderL@CMenuEng@@QAEXAAV?$RArray@H@@HH@Z @ 14 NONAME ; void CMenuEng::MoveToFolderL(class RArray &, int, int) + ?NewL@CMenuEng@@SAPAV1@ABVTDesC16@@AAVMMenuEngObserver@@@Z @ 15 NONAME ; class CMenuEng * CMenuEng::NewL(class TDesC16 const &, class MMenuEngObserver &) + ?NewObjectL@CMenuEng@@QAEPAVCMenuEngObject@@ABVTDesC16@@@Z @ 16 NONAME ; class CMenuEngObject * CMenuEng::NewObjectL(class TDesC16 const &) + ?NumAttributes@CMenuEngObject@@QBEHXZ @ 17 NONAME ; int CMenuEngObject::NumAttributes(void) const + ?ObjectL@CMenuEng@@QBEABVCMenuEngObject@@H@Z @ 18 NONAME ; class CMenuEngObject const & CMenuEng::ObjectL(int) const + ?ParentFolderL@CMenuEng@@QBEXHAAH@Z @ 19 NONAME ; void CMenuEng::ParentFolderL(int, int &) const + ?QueueOperationL@CMenuEng@@QAEXAAVMMenuEngOperation@@@Z @ 20 NONAME ; void CMenuEng::QueueOperationL(class MMenuEngOperation &) + ?RemoveAttribute@CMenuEngObject@@QAEXABVTDesC16@@@Z @ 21 NONAME ; void CMenuEngObject::RemoveAttribute(class TDesC16 const &) + ?RemoveL@CMenuEng@@QAEXH@Z @ 22 NONAME ; void CMenuEng::RemoveL(int) + ?ReorderL@CMenuEng@@QAEXHH@Z @ 23 NONAME ; void CMenuEng::ReorderL(int, int) + ?Reset@CMenuEngObject@@QAEXXZ @ 24 NONAME ; void CMenuEngObject::Reset(void) + ?RootFolderL@CMenuEng@@QBEXAAH@Z @ 25 NONAME ; void CMenuEng::RootFolderL(int &) const + ?SetAttributeL@CMenuEngObject@@QAEXABVTDesC16@@0H@Z @ 26 NONAME ; void CMenuEngObject::SetAttributeL(class TDesC16 const &, class TDesC16 const &, int) + ?SetFlags@CMenuEngObject@@QAEXKH@Z @ 27 NONAME ; void CMenuEngObject::SetFlags(unsigned long, int) + ?TraverseFolderL@CMenuEng@@QBEXHAAVMMenuEngVisitor@@@Z @ 28 NONAME ; void CMenuEng::TraverseFolderL(int, class MMenuEngVisitor &) const + ?Type@CMenuEngObject@@QBE?AVTPtrC16@@XZ @ 29 NONAME ; class TPtrC16 CMenuEngObject::Type(void) const + ?GetNative@CMenuEngObject@@QBEHXZ @ 30 NONAME ; int CMenuEngObject::GetNative(void) const + ?SetNative@CMenuEngObject@@QAEXH@Z @ 31 NONAME ; void CMenuEngObject::SetNative(int) + ?ModifiableObjectL@CMenuEng@@QAEAAVCMenuEngObject@@HH@Z @ 32 NONAME ; class CMenuEngObject & CMenuEng::ModifiableObjectL(int, int) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcsmenuhandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcsmenuhandleru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcsmenuu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcsmenuu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,59 @@ +EXPORTS + ??0CMenuHandler@@IAE@AAVRMenu@@@Z @ 1 NONAME ; CMenuHandler::CMenuHandler(class RMenu &) + ??1CMenuCompletedOperation@@UAE@XZ @ 2 NONAME ; CMenuCompletedOperation::~CMenuCompletedOperation(void) + ??1CMenuFilter@@UAE@XZ @ 3 NONAME ; CMenuFilter::~CMenuFilter(void) + ??1CMenuHandler@@UAE@XZ @ 4 NONAME ; CMenuHandler::~CMenuHandler(void) + ??1CMenuItem@@UAE@XZ @ 5 NONAME ; CMenuItem::~CMenuItem(void) + ?BaseConstructL@CMenuHandler@@IAEXXZ @ 6 NONAME ; void CMenuHandler::BaseConstructL(void) + ?Cancel@RMenuNotifier@@QAEXXZ @ 7 NONAME ; void RMenuNotifier::Cancel(void) + ?Close@RMenu@@QAEXXZ @ 8 NONAME ; void RMenu::Close(void) + ?Close@RMenuNotifier@@QAEXXZ @ 9 NONAME ; void RMenuNotifier::Close(void) + ?CreateL@CMenuItem@@SAPAV1@AAVRMenu@@ABVTDesC16@@HH@Z @ 10 NONAME ; class CMenuItem * CMenuItem::CreateL(class RMenu &, class TDesC16 const &, int, int) + ?DoNotHaveAttributeL@CMenuFilter@@QAEXABVTDesC16@@@Z @ 11 NONAME ; void CMenuFilter::DoNotHaveAttributeL(class TDesC16 const &) + ?Flags@CMenuItem@@QBEKXZ @ 12 NONAME ; unsigned long CMenuItem::Flags(void) const + ?FlagsOff@CMenuFilter@@QBEKXZ @ 13 NONAME ; unsigned long CMenuFilter::FlagsOff(void) const + ?FlagsOn@CMenuFilter@@QBEKXZ @ 14 NONAME ; unsigned long CMenuFilter::FlagsOn(void) const + ?GetAttribute@CMenuFilter@@QBEHHAAVTPtrC16@@0@Z @ 15 NONAME ; int CMenuFilter::GetAttribute(int, class TPtrC16 &, class TPtrC16 &) const + ?GetAttributeL@CMenuItem@@QAE?AVTPtrC16@@ABVTDesC16@@AAH@Z @ 16 NONAME ; class TPtrC16 CMenuItem::GetAttributeL(class TDesC16 const &, int &) + ?GetAttributeListL@CMenuItem@@QAEXAAV?$RArray@V?$TBuf@$0EA@@@@@@Z @ 17 NONAME ; void CMenuItem::GetAttributeListL(class RArray > &) + ?GetItemsL@RMenu@@QAEXAAV?$RArray@VTMenuItem@@@@HPBVCMenuFilter@@H@Z @ 18 NONAME ; void RMenu::GetItemsL(class RArray &, int, class CMenuFilter const *, int) + ?GetRunningAppsL@RMenu@@QAEXAAV?$RArray@VTUid@@@@@Z @ 19 NONAME ; void RMenu::GetRunningAppsL(class RArray &) + ?HandleCommandL@CMenuHandler@@UAEPAVCMenuOperation@@AAVCMenuItem@@ABVTDesC8@@1AAVTRequestStatus@@@Z @ 20 NONAME ; class CMenuOperation * CMenuHandler::HandleCommandL(class CMenuItem &, class TDesC8 const &, class TDesC8 const &, class TRequestStatus &) + ?HandleCommandL@CMenuItem@@QAEPAVCMenuOperation@@ABVTDesC8@@0AAVTRequestStatus@@@Z @ 21 NONAME ; class CMenuOperation * CMenuItem::HandleCommandL(class TDesC8 const &, class TDesC8 const &, class TRequestStatus &) + ?HaveAttributeL@CMenuFilter@@QAEXABVTDesC16@@0@Z @ 22 NONAME ; void CMenuFilter::HaveAttributeL(class TDesC16 const &, class TDesC16 const &) + ?Id@CMenuItem@@QBEHXZ @ 23 NONAME ; int CMenuItem::Id(void) const + ?MoveToFolderL@RMenu@@QAEPAVCMenuOperation@@ABV?$RArray@H@@HHAAVTRequestStatus@@@Z @ 24 NONAME ; class CMenuOperation * RMenu::MoveToFolderL(class RArray const &, int, int, class TRequestStatus &) + ?NewL@CMcsCacheHandler@@SAPAV1@AAVCMenuEng@@AAVCMenuSrvEngUtils@@@Z @ 25 NONAME ; class CMcsCacheHandler * CMcsCacheHandler::NewL(class CMenuEng &, class CMenuSrvEngUtils &) + ?NewL@CMcsSatMonitor@@SAPAV1@AAVCMenuEng@@@Z @ 26 NONAME ; class CMcsSatMonitor * CMcsSatMonitor::NewL(class CMenuEng &) + ?NewL@CMenuCompletedOperation@@SAPAV1@AAVRMenu@@HAAVTRequestStatus@@H@Z @ 27 NONAME ; class CMenuCompletedOperation * CMenuCompletedOperation::NewL(class RMenu &, int, class TRequestStatus &, int) + ?NewL@CMenuFilter@@SAPAV1@XZ @ 28 NONAME ; class CMenuFilter * CMenuFilter::NewL(void) + ?NewLC@CMenuFilter@@SAPAV1@XZ @ 29 NONAME ; class CMenuFilter * CMenuFilter::NewLC(void) + ?Notify@RMenuNotifier@@QAEXHHAAVTRequestStatus@@@Z @ 30 NONAME ; void RMenuNotifier::Notify(int, int, class TRequestStatus &) + ?NumAttributes@CMenuFilter@@QBEHXZ @ 31 NONAME ; int CMenuFilter::NumAttributes(void) const + ?Open@RMenuNotifier@@QAEHAAVRMenu@@@Z @ 32 NONAME ; int RMenuNotifier::Open(class RMenu &) + ?OpenL@CMenuItem@@SAPAV1@AAVRMenu@@ABVTMenuItem@@@Z @ 33 NONAME ; class CMenuItem * CMenuItem::OpenL(class RMenu &, class TMenuItem const &) + ?OpenL@CMenuItem@@SAPAV1@AAVRMenu@@H@Z @ 34 NONAME ; class CMenuItem * CMenuItem::OpenL(class RMenu &, int) + ?OpenL@RMenu@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void RMenu::OpenL(class TDesC16 const &) + ?Parent@CMenuItem@@QBEHXZ @ 36 NONAME ; int CMenuItem::Parent(void) const + ?RemoveAttribute@CMenuFilter@@QAEXABVTDesC16@@@Z @ 37 NONAME ; void CMenuFilter::RemoveAttribute(class TDesC16 const &) + ?RemoveAttributeL@CMenuItem@@QAEXABVTDesC16@@@Z @ 38 NONAME ; void CMenuItem::RemoveAttributeL(class TDesC16 const &) + ?RemoveL@RMenu@@QAEPAVCMenuOperation@@HAAVTRequestStatus@@@Z @ 39 NONAME ; class CMenuOperation * RMenu::RemoveL(int, class TRequestStatus &) + ?ReorderL@RMenu@@QAEPAVCMenuOperation@@HHAAVTRequestStatus@@@Z @ 40 NONAME ; class CMenuOperation * RMenu::ReorderL(int, int, class TRequestStatus &) + ?Reset@CMenuFilter@@QAEXXZ @ 41 NONAME ; void CMenuFilter::Reset(void) + ?ResourceCheck@RMenu@@QAEXXZ @ 42 NONAME ; void RMenu::ResourceCheck(void) + ?ResourceCount@RMenu@@QAEHXZ @ 43 NONAME ; int RMenu::ResourceCount(void) + ?ResourceMark@RMenu@@QAEXXZ @ 44 NONAME ; void RMenu::ResourceMark(void) + ?RootFolderL@RMenu@@QAEHXZ @ 45 NONAME ; int RMenu::RootFolderL(void) + ?RunMenuServer@@YAHXZ @ 46 NONAME ; int RunMenuServer(void) + ?RunningStatusL@CMenuItem@@QAEHXZ @ 47 NONAME ; int CMenuItem::RunningStatusL(void) + ?SaveL@CMenuItem@@QAEPAVCMenuOperation@@AAVTRequestStatus@@@Z @ 48 NONAME ; class CMenuOperation * CMenuItem::SaveL(class TRequestStatus &) + ?SetAttributeL@CMenuItem@@QAEXABVTDesC16@@0@Z @ 49 NONAME ; void CMenuItem::SetAttributeL(class TDesC16 const &, class TDesC16 const &) + ?SetFlags@CMenuFilter@@QAEXKK@Z @ 50 NONAME ; void CMenuFilter::SetFlags(unsigned long, unsigned long) + ?SetFlags@CMenuItem@@QAEXKH@Z @ 51 NONAME ; void CMenuItem::SetFlags(unsigned long, int) + ?SetType@CMenuFilter@@QAEXABVTDesC16@@@Z @ 52 NONAME ; void CMenuFilter::SetType(class TDesC16 const &) + ?SupportsType@CMenuHandler@@UAEHABVTDesC16@@@Z @ 53 NONAME ; int CMenuHandler::SupportsType(class TDesC16 const &) + ?Type@CMenuFilter@@QBE?AVTPtrC16@@XZ @ 54 NONAME ; class TPtrC16 CMenuFilter::Type(void) const + ?Type@CMenuItem@@QBE?AVTPtrC16@@XZ @ 55 NONAME ; class TPtrC16 CMenuItem::Type(void) const + ?__DbgSetAllocFail@RMenu@@QAEXW4TAllocFail@RAllocator@@H@Z @ 56 NONAME ; void RMenu::__DbgSetAllocFail(enum RAllocator::TAllocFail, int) + ?GetListL@RMenuSapi@@QAEXAAVTDes8@@AAVRBuf8@@@Z @ 57 NONAME ; void RMenuSapi::GetListL(class TDes8 &, class RBuf8 &) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcsmenuutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcsmenuutilsu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 1 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &) + ?SetTUint@MenuUtils@@SAXAAVTDes16@@I@Z @ 2 NONAME ; void MenuUtils::SetTUint(class TDes16 &, unsigned int) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/bwins/mcssathandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/bwins/mcssathandleru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,7 @@ +EXPORTS + ?CheckVisibility@CMcsSatHandler@@SAHXZ @ 1 NONAME ; int CMcsSatHandler::CheckVisibility(void) + ?GetName@CMcsSatHandler@@QAEHAAVTDes16@@@Z @ 2 NONAME ; int CMcsSatHandler::GetName(class TDes16 &) + ?LoadIconL@CMcsSatHandler@@QAEPAVCAknIcon@@XZ @ 3 NONAME ; class CAknIcon * CMcsSatHandler::LoadIconL(void) + ?NewL@CMcsSatHandler@@SAPAV1@XZ @ 4 NONAME ; class CMcsSatHandler * CMcsSatHandler::NewL(void) + ?NewL@CMcsSatNotifier@@SAPAV1@PAVMMcsSATNotifierCallback@@VTUid@@I@Z @ 5 NONAME ; class CMcsSatNotifier * CMcsSatNotifier::NewL(class MMcsSATNotifierCallback *, class TUid, unsigned int) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/cenrep/menu2privatecrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/cenrep/menu2privatecrkeys.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 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 MENU2PRIVATECRKEYS_H +#define MENU2PRIVATECRKEYS_H + +// Menu API + +#include + +// This key is used to set up AppShell in a predefined folder +const TUint32 KMenuShowFolder = 0x0000000c; + +//SAT KEYS +const TUint32 KMenuShowSatUI = 0x00000002; +const TUint32 KMenuSatUIName = 0x00000003; +const TUint32 KMenuSatUIIconId = 0x00000004; + +//deprecated (no support anymore through MenuInterface.lib) +const TUint32 KMenuUpdateData = 0x00000001; +const TUint32 KMenuLVFlags = 0x00000005; +const TUint32 KMenuIconPositionUpdate = 0x00000006; +const TUint32 KMenuShowApplication = 0x00000009; + + + +#endif // MENU2PRIVATECRKEYS_H diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/conf/s60mcs.confml Binary file menucontentsrv/conf/s60mcs.confml has changed diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/conf/s60mcs_101F8847.crml Binary file menucontentsrv/conf/s60mcs_101F8847.crml has changed diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/data/200113DE.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/data/200113DE.rss Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "menuuid.hrh" +#include "menustrings.hrh" +#include "mcsmenuhandlerplugin.hrh" +#include //\epoc32\include\ecom + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x200113DE; + interfaces = + { + INTERFACE_INFO + { + interface_uid = MENU_HANDLER_IF_UID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x200113E0; + version_no = 1; + display_name = ""; + default_data = str_datatype_app; + opaque_data = ""; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x200113E1; + version_no = 1; + display_name = ""; + default_data = str_datatype_url; + opaque_data = ""; + }, + IMPLEMENTATION_INFO + { + implementation_uid = 0x20019595; + version_no = 1; + display_name = ""; + default_data = str_datatype_link; + opaque_data = ""; + } + }; + } + }; + } + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/data/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/data/backup_registration.xml Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,7 @@ + + + + + + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/data/menustrings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/data/menustrings.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 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 __MENUSTRINGS_HRH__ +#define __MENUSTRINGS_HRH__ + +#define str_datatype_app "menu:application" +#define str_datatype_url "menu:url" +#define str_datatype_link "menu:link" + +#endif // __MENUSTRINGS_HRH__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcsextendedmenuu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcsextendedmenuu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _ZN15MenuIconUtility12GetItemIconLER9CMenuItem @ 1 NONAME + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcsmenuengu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcsmenuengu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +EXPORTS + _ZN14CMenuEngObject13SetAttributeLERK7TDesC16S2_i @ 1 NONAME + _ZN14CMenuEngObject15RemoveAttributeERK7TDesC16 @ 2 NONAME + _ZN14CMenuEngObject5ResetEv @ 3 NONAME + _ZN14CMenuEngObject8SetFlagsEmi @ 4 NONAME + _ZN14CMenuEngObject9SetNativeEi @ 5 NONAME + _ZN14CMenuEngObjectD0Ev @ 6 NONAME + _ZN14CMenuEngObjectD1Ev @ 7 NONAME + _ZN14CMenuEngObjectD2Ev @ 8 NONAME + _ZN8CMenuEng10NewObjectLERK7TDesC16 @ 9 NONAME + _ZN8CMenuEng13AppendNotifyLEii @ 10 NONAME + _ZN8CMenuEng13MoveToFolderLER6RArrayIiEii @ 11 NONAME + _ZN8CMenuEng15QueueOperationLER17MMenuEngOperation @ 12 NONAME + _ZN8CMenuEng16DequeueOperationER17MMenuEngOperation @ 13 NONAME + _ZN8CMenuEng17ModifiableObjectLEii @ 14 NONAME + _ZN8CMenuEng19GetOnceLegacyFormatEv @ 15 NONAME + _ZN8CMenuEng4AddLER14CMenuEngObjectii @ 16 NONAME + _ZN8CMenuEng4NewLERK7TDesC16R16MMenuEngObserver @ 17 NONAME + _ZN8CMenuEng7RemoveLEi @ 18 NONAME + _ZN8CMenuEng8ReorderLEii @ 19 NONAME + _ZN8CMenuEngD0Ev @ 20 NONAME + _ZN8CMenuEngD1Ev @ 21 NONAME + _ZN8CMenuEngD2Ev @ 22 NONAME + _ZNK14CMenuEngObject12GetAttributeEiR7TPtrC16S1_Ri @ 23 NONAME + _ZNK14CMenuEngObject13FindAttributeERK7TDesC16R7TPtrC16Ri @ 24 NONAME + _ZNK14CMenuEngObject2IdEv @ 25 NONAME + _ZNK14CMenuEngObject4TypeEv @ 26 NONAME + _ZNK14CMenuEngObject5FlagsEi @ 27 NONAME + _ZNK14CMenuEngObject9GetNativeEv @ 28 NONAME + _ZNK8CMenuEng11RootFolderLERi @ 29 NONAME + _ZNK8CMenuEng13ParentFolderLEiRi @ 30 NONAME + _ZNK8CMenuEng15TraverseFolderLEiR15MMenuEngVisitor @ 31 NONAME + _ZNK8CMenuEng5ExistEi @ 32 NONAME + _ZNK8CMenuEng7ObjectLEi @ 33 NONAME + _ZNK8CMenuEng8GetItemLEiR9TMenuItem @ 34 NONAME + _ZNK8CMenuEng9GetItemsLER6RArrayI9TMenuItemEiPK14MMenuEngFilteri @ 35 NONAME + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcsmenuhandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcsmenuhandleru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,3 @@ +EXPORTS + _Z24ImplementationGroupProxyRi @ 1 NONAME + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcsmenuu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcsmenuu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,84 @@ +EXPORTS + _Z13RunMenuServerv @ 1 NONAME + _ZN11CMenuFilter14HaveAttributeLERK7TDesC16S2_ @ 2 NONAME + _ZN11CMenuFilter15RemoveAttributeERK7TDesC16 @ 3 NONAME + _ZN11CMenuFilter19DoNotHaveAttributeLERK7TDesC16 @ 4 NONAME + _ZN11CMenuFilter4NewLEv @ 5 NONAME + _ZN11CMenuFilter5NewLCEv @ 6 NONAME + _ZN11CMenuFilter5ResetEv @ 7 NONAME + _ZN11CMenuFilter7SetTypeERK7TDesC16 @ 8 NONAME + _ZN11CMenuFilter8SetFlagsEmm @ 9 NONAME + _ZN11CMenuFilterD0Ev @ 10 NONAME + _ZN11CMenuFilterD1Ev @ 11 NONAME + _ZN11CMenuFilterD2Ev @ 12 NONAME + _ZN12CMenuHandler12SupportsTypeERK7TDesC16 @ 13 NONAME + _ZN12CMenuHandler14BaseConstructLEv @ 14 NONAME + _ZN12CMenuHandler14HandleCommandLER9CMenuItemRK6TDesC8S4_R14TRequestStatus @ 15 NONAME + _ZN12CMenuHandlerC1ER5RMenu @ 16 NONAME + _ZN12CMenuHandlerC2ER5RMenu @ 17 NONAME + _ZN12CMenuHandlerD0Ev @ 18 NONAME + _ZN12CMenuHandlerD1Ev @ 19 NONAME + _ZN12CMenuHandlerD2Ev @ 20 NONAME + _ZN13RMenuNotifier4OpenER5RMenu @ 21 NONAME + _ZN13RMenuNotifier5CloseEv @ 22 NONAME + _ZN13RMenuNotifier6CancelEv @ 23 NONAME + _ZN13RMenuNotifier6NotifyEiiR14TRequestStatus @ 24 NONAME + _ZN14CMcsSatMonitor4NewLER8CMenuEng @ 25 NONAME + _ZN16CMcsCacheHandler4NewLER8CMenuEngR16CMenuSrvEngUtils @ 26 NONAME + _ZN23CMenuCompletedOperation4NewLER5RMenuiR14TRequestStatusi @ 27 NONAME + _ZN23CMenuCompletedOperationD0Ev @ 28 NONAME + _ZN23CMenuCompletedOperationD1Ev @ 29 NONAME + _ZN23CMenuCompletedOperationD2Ev @ 30 NONAME + _ZN5RMenu11RootFolderLEv @ 31 NONAME + _ZN5RMenu12ResourceMarkEv @ 32 NONAME + _ZN5RMenu13MoveToFolderLERK6RArrayIiEiiR14TRequestStatus @ 33 NONAME + _ZN5RMenu13ResourceCheckEv @ 34 NONAME + _ZN5RMenu13ResourceCountEv @ 35 NONAME + _ZN5RMenu15GetRunningAppsLER6RArrayI4TUidE @ 36 NONAME + _ZN5RMenu17__DbgSetAllocFailEN10RAllocator10TAllocFailEi @ 37 NONAME + _ZN5RMenu5CloseEv @ 38 NONAME + _ZN5RMenu5OpenLERK7TDesC16 @ 39 NONAME + _ZN5RMenu7RemoveLEiR14TRequestStatus @ 40 NONAME + _ZN5RMenu8ReorderLEiiR14TRequestStatus @ 41 NONAME + _ZN5RMenu9GetItemsLER6RArrayI9TMenuItemEiPK11CMenuFilteri @ 42 NONAME + _ZN9CMenuItem13GetAttributeLERK7TDesC16Ri @ 43 NONAME + _ZN9CMenuItem13SetAttributeLERK7TDesC16S2_ @ 44 NONAME + _ZN9CMenuItem14HandleCommandLERK6TDesC8S2_R14TRequestStatus @ 45 NONAME + _ZN9CMenuItem14RunningStatusLEv @ 46 NONAME + _ZN9CMenuItem16RemoveAttributeLERK7TDesC16 @ 47 NONAME + _ZN9CMenuItem17GetAttributeListLER6RArrayI4TBufILi64EEE @ 48 NONAME + _ZN9CMenuItem5OpenLER5RMenuRK9TMenuItem @ 49 NONAME + _ZN9CMenuItem5OpenLER5RMenui @ 50 NONAME + _ZN9CMenuItem5SaveLER14TRequestStatus @ 51 NONAME + _ZN9CMenuItem7CreateLER5RMenuRK7TDesC16ii @ 52 NONAME + _ZN9CMenuItem8SetFlagsEmi @ 53 NONAME + _ZN9CMenuItemD0Ev @ 54 NONAME + _ZN9CMenuItemD1Ev @ 55 NONAME + _ZN9CMenuItemD2Ev @ 56 NONAME + _ZN9RMenuSapi8GetListLER5TDes8R5RBuf8 @ 57 NONAME + _ZNK11CMenuFilter12GetAttributeEiR7TPtrC16S1_ @ 58 NONAME + _ZNK11CMenuFilter13NumAttributesEv @ 59 NONAME + _ZNK11CMenuFilter4TypeEv @ 60 NONAME + _ZNK11CMenuFilter7FlagsOnEv @ 61 NONAME + _ZNK11CMenuFilter8FlagsOffEv @ 62 NONAME + _ZNK9CMenuItem2IdEv @ 63 NONAME + _ZNK9CMenuItem4TypeEv @ 64 NONAME + _ZNK9CMenuItem5FlagsEv @ 65 NONAME + _ZNK9CMenuItem6ParentEv @ 66 NONAME + _ZTI12CMenuHandler @ 67 NONAME ; ## + _ZTI18TMenuSrvAttrFilter @ 68 NONAME ; ## + _ZTI18TMenuSrvTypeFilter @ 69 NONAME ; ## + _ZTI22RMcsDrmObserverManager @ 70 NONAME ; ## + _ZTI22TMenuSrvTypeAttrFilter @ 71 NONAME ; ## + _ZTI23TMenuSrvHiddenAppFilter @ 72 NONAME ; ## + _ZTI24TMenuSrvAttrExistsFilter @ 73 NONAME ; ## + _ZTI28TMenuSrvTypeAttrExistsFilter @ 74 NONAME ; ## + _ZTV12CMenuHandler @ 75 NONAME ; ## + _ZTV18TMenuSrvAttrFilter @ 76 NONAME ; ## + _ZTV18TMenuSrvTypeFilter @ 77 NONAME ; ## + _ZTV22RMcsDrmObserverManager @ 78 NONAME ; ## + _ZTV22TMenuSrvTypeAttrFilter @ 79 NONAME ; ## + _ZTV23TMenuSrvHiddenAppFilter @ 80 NONAME ; ## + _ZTV24TMenuSrvAttrExistsFilter @ 81 NONAME ; ## + _ZTV28TMenuSrvTypeAttrExistsFilter @ 82 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcsmenuutilsu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcsmenuutilsu.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,4 @@ +EXPORTS + _ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 1 NONAME + _ZN9MenuUtils8SetTUintER6TDes16j @ 2 NONAME + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/eabi/mcssathandleru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/eabi/mcssathandleru.def Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,9 @@ +EXPORTS + _ZN14CMcsSatHandler15CheckVisibilityEv @ 1 NONAME + _ZN14CMcsSatHandler4NewLEv @ 2 NONAME + _ZN14CMcsSatHandler7GetNameER6TDes16 @ 3 NONAME + _ZN14CMcsSatHandler9LoadIconLEv @ 4 NONAME + _ZN15CMcsSatNotifier4NewLEP23MMcsSATNotifierCallback4TUidj @ 5 NONAME + _ZTI15CMcsSatNotifier @ 6 NONAME ; ## + _ZTV15CMcsSatNotifier @ 7 NONAME ; ## + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menueng.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menueng.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,502 @@ +/* +* Copyright (c) 2009 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 __MENUENG_H__ +#define __MENUENG_H__ + +#include +#include +#include // for RNodeArray +#include "mcsmenunotifier.h" // for notification events + +// FORWARD DECLARATION + +class TMenuItem; +class CXCFWTree; +class MXCFWNode; +class CMenuEngObjectFactoryProxy; +class CMenuEngObject; +class CMenuEngIdManager; +class MMenuEngObserver; +class MMenuEngOperation; +class MMenuEngFilter; +class MMenuEngVisitor; + +/** +* Event notification data. +*/ +class TMenuEngNotify + { + +public: // construction + + /** + * Constructor. + * @param aFolder Folder. + * @param aEvents Events. + */ + TMenuEngNotify( TInt aFolder, TInt aEvents ) + : iFolder( aFolder ), iEvents( aEvents ) {} + +public: // data + + TInt iFolder; ///< Folder. + TInt iEvents; ///< Events. + + }; + +/** +* Menu Engine. +*/ +NONSHARABLE_CLASS( CMenuEng ): public CActive, public MXCFWEngineObserver + { + +public: // construction + + /** + * Destructor. + */ + IMPORT_C virtual ~CMenuEng(); + + /** + * Two-phased constructor. + * @param aName Name. + * @param aObserver Observer. + * @return The created object. + */ + IMPORT_C static CMenuEng* NewL( + const TDesC& aName, + MMenuEngObserver& aObserver ); + +protected: // construction + + /** + * Constructor. + * @param aObserver Observer. + */ + CMenuEng( MMenuEngObserver& aObserver ); + + /** + * Second phase constructor. + * @param aName Name. + */ + void ConstructL( const TDesC& aName ); + +public: // new methods + + enum TState /// State machine states. + { + ENull = 0, ///< Initial state. + ELoadRamFile, ///< Loading RAM file. + ELoadRomFile, ///< Loading ROM file. + ESaveFile, ///< Saving TEMP file and replacing RAM file. + EExecuteOp, ///< Operation scheduled for execution or being executed. + EReady, ///< Idle. + EDead ///< Unrecoverable error; final state. + }; + + /** + * Queue an operation for execution. + * Queued operations are scheduled for execution by the Engine. + * @param aOperation Operation. + */ + IMPORT_C void QueueOperationL( MMenuEngOperation& aOperation ); + + /** + * Dequeue an operation (remove from the operation queue). Safe to call + * if not queued. + * @param aOperation Operation. + */ + IMPORT_C void DequeueOperation( MMenuEngOperation& aOperation ); + + /** + * Traverse a subtree of the item tree. + * @param aFolder traversal starts at this folder. + * @param aVisitor Visitor visiting the nodes and controlling the traversal. + */ + IMPORT_C void TraverseFolderL( + TInt aFolder, + MMenuEngVisitor& aVisitor ) const; + + /** + * Create a new object. Owner is the caller. The object is not added to + * the engine yet, but it has an ID already. It can be used to AddL() item. + * @param aType Type. + * @return Created object. Owner is the caller. + */ + IMPORT_C CMenuEngObject* NewObjectL( const TDesC& aType ); + + /** + * Returns current engine state. + * @return Current state. + */ + inline TState State() const; + + /* + * Gets legacy format + * @return legacy format + */ + IMPORT_C TBool GetOnceLegacyFormat(); + +public: // data query (read access) + + // Read-access methods can be called any time. + // There is a short startup period during which the engine data is not + // ready yet; calls made in that period leave with KErrNotReady. + // When the engine becomes ready, an (0 ,EItemsAddedRemoved) event is + // sent to the observer. + + /** + * Get ID of root folder. + * @param aId ID of root folder. + */ + IMPORT_C void RootFolderL( TInt& aId ) const; + + /** + * Get parent folder of item. + * @param aId Item ID. + * @param aParentId ID of parent folder. + */ + IMPORT_C void ParentFolderL( TInt aId, TInt& aParentId ) const; + + /** + * Get item header. + * @param aId Item ID. + * @param aItem Item header is returned here. + */ + IMPORT_C void GetItemL( TInt aId, TMenuItem& aItem ) const; + + /** + * Get list of items. + * @param aItemArray Array receiving item list. Existing content not touched + * (new items are appended). + * @param aFolder Get items from this folder. + * @param aFilter Filter criteria or NULL for unfiltered results. + * @param aRecursive ETrue to recurse folders, EFalse for immediate + * children only. + */ + IMPORT_C void GetItemsL( + RArray& aItemArray, + TInt aFolder, + const MMenuEngFilter* aFilter, + TBool aRecursive ) const; + + /** + * Get object. + * @param aId Item ID. + * @return Object. + */ + IMPORT_C const CMenuEngObject& ObjectL( TInt aId ) const; + +public: // data manipulation (write access). + + // All write-access methods methods must be wrapped in MMenuEngOperation + // objects (scheduled execution), otherwise they leave with KErrLocked. + + /** + * Remove item. + * @param aId ID of item to be removed. + */ + IMPORT_C void RemoveL( TInt aId ); + + /** + * Move items to another folder. + * @param aItems ID-s of items to be to be moved. All items must be in + * the same folder. + * @param aFolder Target folder. + * @param aMoveBefore. In the target folder, items will be inserted before + * this item (if found). If the target folder contains no item with that ID, + * the moved items are appended to the end of existing items. Pass 0 to + * append to the end. + */ + IMPORT_C void MoveToFolderL( + RArray& aItems, + TInt aFolder, + TInt aMoveBefore ); + + /** + * Move item to a different position in its current folder. + * @param aId ID of item to be to be reordered. + * @param aMoveBefore. Move the item before this item (if found). + * If aMoveBefore is not found, the item is moved to the end. + */ + IMPORT_C void ReorderL( TInt aId, TInt aMoveBefore ); + + /** + * Add new object. + * @param aObject Object to be added. Note, the object must have been + * created with NewObjectL of THIS engine (or the call fails)! + * Ownership taken. + * @param aFolder Parent folder. + * @param aMoveBefore. Move the item before this item (if found). + * If aMoveBefore is not found, the item is added to the end. + */ + IMPORT_C void AddL( + CMenuEngObject& aObject, + TInt aFolder, + TInt aInsertBefore ); + + /** + * Get modifiable object. Note: when this method is called, the engine + * marks the object as changed (without checking if there was really + * a change or not). Therefore, it is advisable to use ObjectL() to + * investigate an object, and only call ModifiableObjectL if changes are + * really needed. This results in better performace, as it avoids + * unnecessary saving. + * @param aId Item ID. + * @param aEvent event for engine to append. + * @return Modifiable object. Already marked as changed. + */ + IMPORT_C CMenuEngObject& ModifiableObjectL( TInt aId, + TInt aEvent = RMenuNotifier::EItemAttributeChanged ); + + + /** + * Append new notification to the list of pending notifications. + * @param aFolder Folder. + * @param aEvents Events. + */ + IMPORT_C void AppendNotifyL( TInt aFolder, TInt aEvents ); + + + IMPORT_C TBool Exist( TInt aId ) const; + +private: // from CActive + + /** + * Outstanding request completed. + */ + void RunL(); + + /** + * Cancel outstanding request. + */ + void DoCancel(); + + /** + * Handle error. + * @param aError Error code. + * @return KErrNone. + */ + TInt RunError( TInt aError ); + +private: // from MXCFWEngineObserver + + /** + * Called when Engine parsing / saving state changes. + * @param aEvent Engine event + */ + void HandleEngineEventL( TXCFWEngineEvent aEvent ); + + /** + * Called when there's an error during parsing / saving. + * @param aErrorCode Error code + */ + void HandleEngineErrorL( TInt aErrorCode ); + +private: // types + + enum TFile /// File selector. + { + ERomFile, ///< Factory file in ROM. + ERamFile, ///< Working file in RAM. + ETempFile, ///< Temp file for saving (RAM). + }; + +private: // new methods + + /** + * Get object from node. + * @param aNode Node. + * @return Object. + */ + inline CMenuEngObject& Object( MXCFWNode& aNode ) const; + + /** + * Tree is up, perform structure check. + * @param aTree Tree. + * @return The root folder node. + */ + MXCFWNode& CheckTreeL( MXCFWTree& aTree ) const; + + /** + * Sanity ID check for all nodes in the tree. + * @param aTree Tree. + * @return ETrue if ID-s are OK. + */ + TBool DebugSanityCheck( MXCFWTree& aTree ) const; + + /** + * Wait for data xml file to load. + */ + void ActiveWaitForFileLoadL(); + + /** + * Sanity ID check for one nodes in the tree. + * @param aNode Node. + * @return ETrue if ID is OK. + */ + TBool DebugSanityCheck( MXCFWNode& aNode ) const; + + /** + * Find node by ID, leave with KErrNotFound if not found. + * @param aId ID. + * @return Node. + */ + MXCFWNode& NodeL( TInt aId ) const; + + /** + * Find folder node by ID, leave with KErrNotFound if not found or not + * folder. + * @param aId ID. + * @return Folder node. + */ + MXCFWNode& FolderNodeL( TInt aId ) const; + + /** + * Find child of aParent with given id, or NULL. Not recursive. + * @param aParent Folder. + * @param aId Child ID. + * @return Child or NULL. + */ + MXCFWNode* Child( MXCFWNode& aParent, TInt aId ); + + /** + * Cancel all operations in the queue. + */ + void CancelAllOperations(); + + /** + * Validate content filename. Leave with KErrArgument if not valid. + * @param aName Content filename (without extension). + */ + void ValidateNameL( const TDesC& aName ); + + /** + * Generate filename of content file. + * @param aFname Generated filename is returned here. + * @param aSelector Filename selector. + */ + void GetFileNameL( TFileName& aFname, TFile aSelector ); + + /** + * Traverse a node. + * @param aNode Node. + * @param aVisitor Visitor visiting the nodes and controlling the traversal. + */ + TBool TraverseNodeL( MXCFWNode& aNode, MMenuEngVisitor& aVisitor ) const; + + /** + * Tree is up; create and initialize ID manager and tree ID-s. + * @param aRootNode Root node. + */ + void InitIdManagerL( MXCFWNode& aRootNode ); + + /** + * Read id_seed from the tree. + * @param aIdSeed ID seed. + */ + void GetIdSeedL( TInt& aIdSeed ); + + /** + * Write the id_seed to the tree. + * @param aSeed ID seed. + */ + void SetIdSeedL( TInt aSeed ); + +private: // state machine parts + + /** + * Self-completion: go to RunL() asynchronously. + * @param aError Error code. + */ + void SelfComplete( TInt aError ); + + /** + * Initiate loading RAM file. + */ + void LoadRamFileL(); + + /** + * Initiate loading ROM file. + */ + void LoadRomFileL(); + + /** + * Initiate saving to TEMP file. + */ + void SaveTempFileL(); + + /** + * Replace RAM file with TEMP file. + */ + void ReplaceRamFileL(); + + /** + * Complete current operation, if any. + * @param aError Completion code. + */ + void CompleteCurrentOperation( TInt aError ); + + /** + * Start executing next operation, if any. + */ + void ExecuteOperationL(); + + /** + * Save changes, if any. + */ + void SaveChangesL(); + +private: // data + + RBuf iName; ///< Own. + RBuf iTempFileName; ///< Own. + RBuf iRamFileName; ///< Own. + TBool iChanged; ///< ETrue if there are unsaved changes. + MMenuEngObserver& iObserver; + TState iState; ///< State. + CXCFWTree* iTree; ///< DOM tree. Own. + CXCFWEngine* iEngine; ///< XML Engline. Own. + CMenuEngObjectFactoryProxy* iObjectFactory; ///< Object factory. Own. + TInt iRoot; ///< Cached root folder id. + RPointerArray iOperations; ///< Pending operations. + MMenuEngOperation* iCurrentOperation; ///< Operation being served. + RArray iNotifyQueue; ///< Events for notifiers. + RFs iFs; ///< File Server Session. Own. + CMenuEngIdManager* iIdManager; ///< ID manager. Owned. + CActiveSchedulerWait* iActiveWait; + /* + * Legacy format + */ + TBool iLegacyFormat; + /** + * True if the last saving was unsuccessful + */ + TBool iDiskWasFullAndRamFileWasNotCreated; + }; + +// ----------------------------------------------------------------------------- +// CMenuEng::State +// ----------------------------------------------------------------------------- +// +CMenuEng::TState CMenuEng::State() const + { + return iState; + } + +#endif // __MENUENG_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengdeletionchecker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengdeletionchecker.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 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 __MENUENGDELETIONCHECKER_H__ +#define __MENUENGDELETIONCHECKER_H__ + +// INCLUDES + +#include +#include "menuengvisitor.h" + +// CLASS DECLARATION + +/** +* Menu Engine deletion checker - recurse a directory to check if there are +* any read-only items (lock_delete). Leave with KErrAccessDenied if yes. +*/ +NONSHARABLE_CLASS( TMenuEngDeletionChecker ): public MMenuEngVisitor + { + +public: // new methods + + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue (visit children of this folder). + */ + TBool VisitEnterL( CMenuEngObject& aFolder ) + { CheckL( aFolder ); return ETrue; } + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue (visit next sibling of this leaf). + */ + TBool VisitL( CMenuEngObject& aLeaf ) + { CheckL( aLeaf ); return ETrue; } + +private: // new methods + + /** + * Check node. Leave with KErrAccessDenied if read-only. + * @param aObject Object. + */ + void CheckL( CMenuEngObject& aObject ); + + }; + +#endif // __MENUENGDELETIONCHECKER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengfilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengfilter.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 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 __MENUENGFILTER_H__ +#define __MENUENGFILTER_H__ + +// INCLUDES + +#include + +// FORWARD DECLARATION + +class CMenuEngObject; + +// CLASS DECLARATION + +/** +* Menu Engine Filter interface. +* Instances of this filter can be passed to CMenuEng::GetItemsL(), to get +* a filtered list of menu items. +*/ +NONSHARABLE_CLASS( MMenuEngFilter ) + { + +public: // new methods + + /** + * Filter test function. + * @param aObject Object. + * @return ETrue if aObject matches this filter. + */ + virtual TBool MatchesObject( const CMenuEngObject& aObject ) const = 0; + + }; + +#endif // __MENUENGFILTER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengflags.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengflags.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 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 __MENUENGFLAGS_H__ +#define __MENUENGFLAGS_H__ + +#include + +/** +* Conversion between string and integer representations of "flags" attribute. +*/ +NONSHARABLE_CLASS( MenuEngFlags ) + { + +public: // new methods + + /** + * Convert string value to integer. + * @param aStringValue String value. + * @return Integer value. + */ + static TUint32 AsInt( const TDesC& aStringValue ); + + /** + * Convert integer value to string. + * @param Integer value. + * @param aStringValue Buffer receiving string value. + */ + static void AsString( TUint32 aIntValue, TDes& aStringValue ); + +private: // new methods + + /** + * Lookup flag name and get flag value. + * @param aString String token. + * @return Flag bit. + */ + static TUint32 FlagValue( const TDesC& aString ); + + /** + * Lookup flag bit and get token value. + * @param aFlag Flag bit. + * @return String token. + */ + static TPtrC StringValue( TUint32 aFlag ); + + }; + +/** +* Conversion between string and integer representations of "id" attribute. +*/ +NONSHARABLE_CLASS( MenuEngId ) + { + +public: // new methods + + /** + * Convert string value to integer. + * @param aStringValue String value. + * @return Integer value. + */ + static TInt AsInt( const TDesC& aStringValue ); + + /** + * Convert integer value to string. + * @param Integer value. + * @param aStringValue Buffer receiving string value. + */ + static void AsString( TInt aIntValue, TDes& aStringValue ); + + }; + +#endif // __MENUENGFLAGS_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengidcollector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengidcollector.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 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 __MENUENGIDCOLLECTOR_H__ +#define __MENUENGIDCOLLECTOR_H__ + +// INCLUDES + +#include +#include "menuengvisitor.h" + +// FORWARD DECLARATION + +class CMenuEngIdManager; + +// CLASS DECLARATION + +/** +* Menu Engine ID collector - recurse the menu tree and collect all +* used ID-s, into an array. +*/ +NONSHARABLE_CLASS( TMenuEngIdCollector ): public MMenuEngVisitor + { + +public: // construction + + /** + * Constructor. + * @param aIds Ids are appended to this array. + */ + TMenuEngIdCollector( RArray& aIds ): iIds( aIds ) {} + +public: // new methods + + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue (visit children of this folder). + */ + TBool VisitEnterL( CMenuEngObject& aFolder ) + { CollectIdL( aFolder ); return ETrue; } + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue (visit next sibling of this leaf). + */ + TBool VisitL( CMenuEngObject& aLeaf ) + { CollectIdL( aLeaf ); return ETrue; } + +private: // new methods + + /** + * Collect ID from object. + * @param aObject Object. + */ + void CollectIdL( CMenuEngObject& aObject ); + +private: // data + + RArray& iIds; ///< Id array. Not owned. + + }; + +#endif // __MENUENGIDCOLLECTOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengidmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengidmanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2009 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 __MENUENGIDMANAGER_H__ +#define __MENUENGIDMANAGER_H__ + +// INCLUDES + +#include + +// CLASS DECLARATION + +/** +* Menu Engine ID manager - providing unique ID-s. +*/ +NONSHARABLE_CLASS( CMenuEngIdManager ): public CBase + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuEngIdManager(); + + /** + * Constructor. + */ + CMenuEngIdManager(); + +public: // new methods + + /** + * Set the seed. + * @param aSeed ID seed. Any value is suitable (does not effect + * ID uniqueness). However, the seed is persisted between runs, + * it provides better ID distribution (returned ID-s are reused later). + */ + void SetSeed( TInt aSeed ) { iSeed = aSeed; } + + /** + * Get the seed. + * @return Seed. + */ + TInt Seed() const { return iSeed; } + +public: // new methods + + /** + * Generate and allocate new ID. + * @param aId ID + */ + void AllocL( TInt& aId ); + + /** + * Store existing ID (mark it as used). + * No sanity check - ID-s can be added more than once! + * @param aId ID. + */ + void AddL( TInt aId ); // Store existing ID (==mark as used) + + /** + * Free ID (mark it as unused). Safe to call if aId is not used. + * @param aId ID. + */ + void Remove( TInt aId ); // Free ID (==mark as unused) + +private: // data + + RArray iIds; ///< Id array. Own. + TInt iSeed; ///< Seed. + + }; + +#endif // __MENUENGIDMANAGER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengidmanagerinit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengidmanagerinit.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 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 __MENUENGIDMANAGERINIT_H__ +#define __MENUENGIDMANAGERINIT_H__ + +// INCLUDES + +#include +#include "menuengvisitor.h" + +// FORWARD DECLARATION + +class CMenuEngIdManager; + +// CLASS DECLARATION + +/** +* Menu Engine ID manager initialization - recurse the menu tree and collect +* all used ID-s from objects, into the ID manager. +*/ +NONSHARABLE_CLASS( TMenuEngIdManagerInit ): public MMenuEngVisitor + { + +public: // construction + + /** + * Constructor. + * @param aIdManager Ids are collected into this manager. + */ + TMenuEngIdManagerInit( CMenuEngIdManager& aIdManager ) + : iIdManager( aIdManager ) {} + +public: // new methods + + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue (visit children of this folder). + */ + TBool VisitEnterL( CMenuEngObject& aFolder ) + { AddIdL( aFolder ); return ETrue; } + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue (visit next sibling of this leaf). + */ + TBool VisitL( CMenuEngObject& aLeaf ) + { AddIdL( aLeaf ); return ETrue; } + +private: // new methods + + /** + * Add ID from object. + * @param aObject Object. + */ + void AddIdL( CMenuEngObject& aObject ); + +private: // data + + CMenuEngIdManager& iIdManager; ///< Id manager. + + }; + +#endif // __MENUENGIDMANAGERINIT_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengidsetter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengidsetter.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 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 __MENUENGIDSETTER_H__ +#define __MENUENGIDSETTER_H__ + +// INCLUDES + +#include +#include "menuengvisitor.h" + +// FORWARD DECLARATION + +class CMenuEngIdManager; + +// CLASS DECLARATION + +/** +* Menu Engine ID setter - recurse the menu tree and, allocate and set ID to +* all objects that does not have one. +*/ +NONSHARABLE_CLASS( TMenuEngIdSetter ): public MMenuEngVisitor + { + +public: // construction + + /** + * Constructor. + * @param aIdManager Ids are allocated from this manager. + */ + TMenuEngIdSetter( CMenuEngIdManager& aIdManager ) + : iIdManager( aIdManager ) {} + +public: // new methods + + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue (visit children of this folder). + */ + TBool VisitEnterL( CMenuEngObject& aFolder ) + { SetIdL( aFolder ); return ETrue; } + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue (visit next sibling of this leaf). + */ + TBool VisitL( CMenuEngObject& aLeaf ) + { SetIdL( aLeaf ); return ETrue; } + +private: // new methods + + /** + * Set ID from for this object. + * @param aObject Object. + */ + void SetIdL( CMenuEngObject& aObject ); + +private: // data + + CMenuEngIdManager& iIdManager; ///< Id manager. + + }; + +#endif // __MENUENGIDSETTER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengitemlister.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengitemlister.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 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 __MENUENGITEMLISTER_H__ +#define __MENUENGITEMLISTER_H__ + +#include "menuengvisitor.h" +#include "mcsmenuitem.h" + +#include + +// FORWARD DECLARATION + +class CMenuEng; +class MMenuEngFilter; + +// CLASS DECLARATION + +/** +* Menu Engine item lister. +* Creates a list of item headers. +*/ +NONSHARABLE_CLASS( TMenuEngItemLister ): public MMenuEngVisitor + { + +public: // construction + + /** + * Constructor. + * @param aEng Engine. + * @param aItemArray Items are appended to this list. + * @param aFolder Root folder of query (will be excluded from the listing). + * @return aFilter Filter criteria or NULL. + * @param aRecursive ETrue for recursive listing. + */ + TMenuEngItemLister( + const CMenuEng& aEng, + RArray& aItemArray, + TInt aFolder, + const MMenuEngFilter* aFilter, + TBool aRecursive ); + +public: // new methods + + // From MMenuEngVisitor: + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue to visit children of this folder. VisitLeaveL() will + * be called after children of this folder are visited. + * EFalse to skip children of this folder. VisitLeaveL() will + * be called next. + */ + TBool VisitEnterL( CMenuEngObject& aFolder ); + + /** + * Leave folder. + * @param aFolder Leaving this folder. + * @return ETrue to visit next sibling of this folder. + * EFalse to stop visiting items at this level. + */ + TBool VisitLeaveL( CMenuEngObject& aFolder ); + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue to visit next sibling of this leaf. + * EFalse to stop visiting items at this level. + */ + TBool VisitL( CMenuEngObject& aLeaf ); + +private: // new methods + + void AddL( CMenuEngObject& aObject ); + +private: // data + + const CMenuEng& iEng; ///< Engine. Not own. + RArray& iItemArray; ///< Item array. Not own. + TInt iFolder; ///< Folder of query (excluded from the listing). + const MMenuEngFilter* iFilter; ///< Filter or NULL. Not own. + TBool iRecursive; ///< ETrue for recursive listing. + + }; + +#endif // __MENUENGITEMLISTER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuenglegacyobjectfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuenglegacyobjectfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2009 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 __MENUENGLEGACYOBJECTFACTORY_H__ +#define __MENUENGLEGACYOBJECTFACTORY_H__ + +#include +#include + +// FORWARD DECLARATION + +class CMenuEng; + +/** +* Menu Engine Object factory for reading previous, legacy version of XML. +* Note. This class is meant only for reading! Objects are internalized +* and saved to the new format (@see CMenuEngObjectFactory). +*/ +NONSHARABLE_CLASS( CMenuEngLegacyObjectFactory ): public CGECODefaultObjectFactory + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuEngLegacyObjectFactory(); + + /** + * Two-phased constructor. + * @param aEng Engine. + * @return The created object. + */ + static CMenuEngLegacyObjectFactory* NewL( CMenuEng& aEng ); + +protected: // construction + + /** + * Constructor. + * @param aEng Engine. + */ + CMenuEngLegacyObjectFactory( CMenuEng& aEng ); + +private: // New + + /** + * Check support for legacy node type. + * @param aLegacyTypeIdentifier Node type. + * @return ETrue if aLegacyTypeIdentifier is supported by this factory. + */ + TBool IsSupportedType( const TDesC& aLegacyTypeIdentifier ) const; + + /** + * Get the converted (current) type for legacy node type. + * @param aLegacyTypeIdentifier Node type. + * @return Converted type. + */ + TPtrC ConvertedType( const TDesC& aLegacyTypeIdentifier ) const; + +public: // from CGECOObjectFactoryBase + + /** + * Create object and set it current. + * @param aTypeIdentifier Object type identifier. + * @return CGECOObjectBase derived object. Caller takes ownership. + */ + CGECOObjectBase* GetContentObjectAndSetContextL( + const TDesC& aTypeIdentifier ); + + /** + * Initializes the current object with attribute provider data. + * @param aAttributeProvider Attribute provider for data initialization. + */ + void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ); + + /** + * Set context object for initialize and preparesave operations. + * @param aContext Object to use in InitializeL operations. + * @return Error code. + */ + TInt SetContext( CGECOObjectBase* aContext ); + +public: // from MGECOAttributeProvider + + /** + * Get number of attributes (of current object). + * @return Number of attributes. + */ + TInt NumAttributes(); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue, + TBool& aIsLocalized ); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue ); + + /** + * Check if current object has text data. + * @return ETrue if current object has text data. + */ + TBool HasTextData(); + + /** + * Get text data of current object. + * @param aText Text data is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + + +private: // data + + CMenuEng& iEng; ///< Engine. Not owned. + + }; + +#endif // __MENUENGLEGACYOBJECTFACTORY_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengobject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengobject.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2009 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 __MENUENGOBJECT_H__ +#define __MENUENGOBJECT_H__ + +#include +#include +#include +#include +#include "menuengobjectattr.h" + +// FORWARD DECLARATION + +class CMenuEng; + +/** +* Menu Engine Object. +* Menu Engine Object represent menu items in the Engine. Object are normally +* owned by the Engine; exception are the items that are created but not yet +* added to the Engine (these are temporarily owned by the client.) +* The primary identity of objects is the Id(), this is persistent and unique. +* 0 is not a valid ID. +*/ +NONSHARABLE_CLASS( CMenuEngObject ): public CGECODefaultObject + { + +public: // construction + + /** + * Destructor. + */ + IMPORT_C virtual ~CMenuEngObject(); + +protected: // construction + + /** + * Constructor. + * @param aEng Engine. + */ + CMenuEngObject( CMenuEng& aEng ); + + /** + * Second phase constructor. + * @param aType Type. + */ + void ConstructL( const TDesC& aType ); + +public: // new methods + + /** + * Get ID. The object always has a valid unique ID (even if the object is + * not added to the Engine yet). + * @return ID. + */ + IMPORT_C TInt Id() const; + + /** + * Get flags. + * @param aFactoryCall for call from factory object(used to skip central repository check). + * @return Flags. + */ + IMPORT_C TUint32 Flags( TBool aFactoryCall = EFalse ) const; + + /** + * Get type. + * @return Type. + */ + IMPORT_C TPtrC Type() const; + + /** + * Get number of attributes. + * @return Number of attributes. + */ + IMPORT_C TInt NumAttributes() const; + + /** + * Get attribute by index. + * @param aIndex Attribute index. + * @param aName Name is returned here. + * @param aValue Value is returned here. + * @param aLocalized ETrue if attribute is localized. + * @return ETrue (unless aIndex is not valid). + */ + IMPORT_C TBool GetAttribute( + TInt aIndex, + TPtrC& aName, + TPtrC& aValue, + TBool& aLocalized ) const; + + /** + * Find attribute by name. + * @param aName Name. + * @param aValue Value is returned here. + * @param aLocalized Etrue if attribute is localized. + * @return ETrue if found. + */ + IMPORT_C TBool FindAttribute( + const TDesC& aName, + TPtrC& aValue, + TBool& aLocalized ) const; + + /** + * Set or clear flags. + * @param aMask Flags to set or clear. + * @param aOn ETrue to set, EFalse to clear. + */ + IMPORT_C void SetFlags( TUint32 aMask, TBool aOn ); + + /** + * Set attribute value. Old value, if any, is replaced. + * @param aAttrName Name. + * @param aAttrValue Value. + * @param aLocalized ETrue if attribute is localized. + */ + IMPORT_C void SetAttributeL( + const TDesC& aAttrName, + const TDesC& aAttrValue, + TBool aLocalized ); // Set attribute value. + + /** + * Set attribute value. Old value, if any, is replaced. + * For use when reading xml file with initial data + * and as a helper method for SetAttributeL. + * @param aAttrName Name. + * @param aAttrValue Value. + * @param aLocalized ETrue if attribute is localized. + */ + void SetInitialAttributeL( + const TDesC& aAttrName, + const TDesC& aAttrValue, + TBool aLocalized ); // Set attribute value. + + /** + * Method to set iNative for apps. + */ + IMPORT_C void SetNative( TBool aNative ); + + /** + * Method to get iNative for apps. + * @return ETrue if app is native. + */ + IMPORT_C TBool GetNative() const; + + + /** + * Remove attribute. + * @param aAttrName Name. + */ + IMPORT_C void RemoveAttribute( const TDesC& aAttrName ); + + /** + * Remove all attributes and flags. + */ + IMPORT_C void Reset(); // Remove all attributes and clear all flags. + +public: // but not imported: for the engine's use only. + + /** + * Two-phased constructor. + * @param aEng Engine. + * @param aType Type. + * @return The created object. + */ + static CMenuEngObject* NewL( CMenuEng& aEng, const TDesC& aType ); + + /** + * Set ID. + * @param aId ID. + */ + void SetId( TInt aId ); + + /** + * Get engine. + * @return Engine. + */ + CMenuEng& Engine(); + +private: // from CGECOObjectBase + + /** + * Get type identifier. + * @return Type identifier. + */ + const TDesC& TypeIdentifier(); + + /** + * Updates flags with hidden flag from central repository if nececerry. + * @param aFlags flags. + */ + void UpdateCrHiddenFlagL( TUint32& aFlags ) const; + + /** + * Parses descriptor containing folders hidden in central repository. + * @param aHiddenFolders descriptor containing folders hidden in central repository. + * @param aHiddenFoldersArray array to fill with names of folders hidden in central repository. + */ + void ParseHiddenFoldersL( + const TDesC& aHiddenFolders, + RArray& aHiddenFoldersArray ) const; + + /** + * Checks wether folder name is in Central Repository. + * @param aFolderName descriptor containing name of a folder. + * @return ETrue if folder is in array, EFalse otherwise. + */ + TBool IsInCrL( const TDesC& aFolderName ) const; + + + +private: // data + + TInt iId; ///< ID. + CMenuEng& iEng; ///< Engine. DO NOT USE! Only needed to check ID-generator. + RBuf iType; /// Type. Own. + RMenuEngObjectAttrArray iAttributes; ///< Attributes. Own. + TUint32 iFlags; ///< Flags. + TBool iNative; ///< app is not of midlet/java type + + }; + +#endif // __MENUENGOBJECT_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengobjectattr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengobjectattr.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2009 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 __MENUENGOBJECTATTR_H__ +#define __MENUENGOBJECTATTR_H__ + +#include + +/** +* Menu Engine Object attribute. +*/ +NONSHARABLE_CLASS( CMenuEngObjectAttr ): public CBase + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuEngObjectAttr(); + + /** + * Two-phased constructor. + * @param aName Name. + * @return The created object. + */ + static CMenuEngObjectAttr* NewL( const TDesC& aName ); + + /** + * Two-phased constructor. + * @param aName Name. + * @return The created object. + */ + static CMenuEngObjectAttr* NewLC( const TDesC& aName ); + +protected: // construction + + /** + * Constructor + */ + CMenuEngObjectAttr(); + + /** + * 2nd phase constructor. + * @param aName Name. + */ + void ConstructL( const TDesC& aName ); + +public: // new methods + + /** + * Get name. + * @return Name. + */ + TPtrC Name() const { return iName; } + + /** + * Get value. + * @return Value. + */ + TPtrC Value() const { return iValue; } + + /** + * Set (or replace) value. + * @param aValue Value. + */ + void SetValueL( const TDesC& aValue ); + + /** + * Get localized status. + * @return ETrue if localized. + */ + TBool Localized() const { return iLocalized; } + + /** + * Set localized status. + * @param aLocalized ETrue if localized. + */ + void SetLocalized( TBool aLocalized ) { iLocalized = aLocalized; } + +private: // data + + RBuf iName; ///< Name. Own. + RBuf iValue; ///< Value. Own. + TBool iLocalized; ///< Localized status. + + }; + +/** +* Array of CMenuEngObjectAttr-s. +*/ +NONSHARABLE_CLASS( RMenuEngObjectAttrArray ) +: public RPointerArray + { + +public: // new methods + + /** + * Find attribute by name. + * @param aName Name. + * @return Index of attribute, or KErrNotFound. + */ + TInt Find( const TDesC& aName ) const; + + }; + +#endif // __MENU_ENG_OBJECT_ATTR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengobjectfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengobjectfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 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 __MENUENGOBJECTFACTORY_H__ +#define __MENUENGOBJECTFACTORY_H__ + +#include "mcsdef.h" + +#include +#include + +// FORWARD DECLARATION + +class CMenuEng; + +/** +* Menu Engine Object factory. +*/ +NONSHARABLE_CLASS( CMenuEngObjectFactory ): public CGECODefaultObjectFactory + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuEngObjectFactory(); + + /** + * Two-phased constructor. + * @param aEng Engine. + * @return The created object. + */ + static CMenuEngObjectFactory* NewL( CMenuEng& aEng ); + +protected: // construction + + /** + * Constructor. + * @param aEng Engine. + */ + CMenuEngObjectFactory( CMenuEng& aEng ); + +public: // from CGECOObjectFactoryBase + + /** + * Create object and set it current. + * @param aTypeIdentifier Object type identifier. + * @return CGECOObjectBase derived object. Caller takes ownership. + */ + CGECOObjectBase* GetContentObjectAndSetContextL( + const TDesC& aTypeIdentifier ); + + /** + * Initializes the current object with attribute provider data. + * @param aAttributeProvider Attribute provider for data initialization. + */ + void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ); + + /** + * Set context object for initialize and preparesave operations. + * @param aContext Object to use in InitializeL operations. + * @return Error code. + */ + TInt SetContext( CGECOObjectBase* aContext ); + +public: // from MGECOAttributeProvider + + /** + * Get number of attributes (of current object). + * @return Number of attributes. + */ + TInt NumAttributes(); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue, + TBool& aIsLocalized ); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue ); + + /** + * Check if current object has text data. + * @return ETrue if current object has text data. + */ + TBool HasTextData(); + + /** + * Get text data of current object. + * @param aText Text data is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + +private: // data + + CMenuEng& iEng; ///< Engine. Not owned. + TBuf iBuf; ///< Conversion buffer (flags -> string). + + }; + +#endif // __MENUENGOBJECTFACTORY_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengobjectfactoryproxy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengobjectfactoryproxy.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2009 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 __MENUENGOBJECTFACTORYPROXY_H__ +#define __MENUENGOBJECTFACTORYPROXY_H__ + +#include +#include + +// FORWARD DECLARATION + +class CMenuEng; +class CMenuEngObjectFactory; +class CMenuEngLegacyObjectFactory; + +/** +* Menu Engine Object factory proxy. +* Redirects factory methods to the appropriate concrete factory when +* initializing objects. Objects are initialized to the new format. +* Note! Saving of the objects is always done in the new format. +*/ +NONSHARABLE_CLASS( CMenuEngObjectFactoryProxy ): public CGECODefaultObjectFactory + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuEngObjectFactoryProxy(); + + /** + * Two-phased constructor. + * @param aEng Engine. + * @return The created object. + */ + static CMenuEngObjectFactoryProxy* NewL( CMenuEng& aEng ); + +public: // New methods + + /** + * Set support for legacy format. + * @param aSupport New setting for legacy format support. + */ + void SupportLegacyFormat( TBool aSupport ); + + /** + * Get legacy format status. + * @retrun legacy format + */ + TBool IsLegacyFormat(); + + /** + * Reset the proxy's state. + */ + void Reset(); + +protected: // construction + + /** + * Constructor. + * @param aEng Engine. + */ + CMenuEngObjectFactoryProxy( CMenuEng& aEng ); + + /** + * Second phase constructor. + */ + void ConstructL(); + +public: // from CGECOObjectFactoryBase + + /** + * Create object and set it current. + * @param aTypeIdentifier Object type identifier. + * @return CGECOObjectBase derived object. Caller takes ownership. + */ + CGECOObjectBase* GetContentObjectAndSetContextL( + const TDesC& aTypeIdentifier ); + + /** + * Initializes the current object with attribute provider data. + * @param aAttributeProvider Attribute provider for data initialization. + */ + void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ); + + /** + * Set context object for initialize and preparesave operations. + * @param aContext Object to use in InitializeL operations. + * @return Error code. + */ + TInt SetContext( CGECOObjectBase* aContext ); + +public: // from MGECOAttributeProvider + + /** + * Get number of attributes (of current object). + * @return Number of attributes. + */ + TInt NumAttributes(); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue, + TBool& aIsLocalized ); + + /** + * Get attribute by index (of current object). + * @param aIndex Attribute index. + * @param aAttrName Attribute name is returned here. + * @param aAttrValue Attribute value is returned here. + */ + void AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue ); + + /** + * Check if current object has text data. + * @return ETrue if current object has text data. + */ + TBool HasTextData(); + + /** + * Get text data of current object. + * @param aText Text data is returned here. + * @param aIsLocalized Localized status is returned here. + */ + void TextDetailsL( TPtrC& aText, TBool& aIsLocalized ); + +private: // data + + CMenuEng& iEng; ///< Engine. Not owned. + CMenuEngObjectFactory* iObjFactory; ///< Owned. + TBool iSupportLegacyFormat; ///< Legacy format supported? + CMenuEngLegacyObjectFactory* iLegacyFactory; ///< Owned. Factory for legacy xml format. + TBool iParsingInLegacyFormat; ///< Is the context legacy type? + + }; + +#endif // __MENUENGOBJECTFACTORYPROXY_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 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 __MENUENGOBSERVER_H__ +#define __MENUENGOBSERVER_H__ + +#include + +/** +* Menu Engine Observer. +*/ +NONSHARABLE_CLASS( MMenuEngObserver ) + { + +public: // new methods + + /** + * Engine events. + * @param aFolder Events occurred in this folder. (0==unspecified.) + * @param aEvents Events. A combination of TEvent bits. + */ + virtual void EngineEvents( TInt aFolder, TInt aEvents ) = 0; + + /** + * Unrecoverable Engine error. The engine stopped working and is useless. + * Delete the engine. + * @param aErr Error code. + */ + virtual void EngineError( TInt aErr ) = 0; + /** + * Engine tree reload events. + * Happens when loading tree from Ram failed + * and was reloaded from Rom. + */ + virtual void EngineTreeReloaded() = 0; + + }; + +#endif // __MENUENGOBSERVER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengoperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 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 __MENUENGOPERATION_H__ +#define __MENUENGOPERATION_H__ + +#include + +class CMenuEng; + +/** +* Menu Engine Operation Interface - write-access engine functionality. +* Operations are executed by the engine, in the order they were added. +*/ +NONSHARABLE_CLASS( MMenuEngOperation ) + { + +public: // from MMenuEngOperation + + /** + * Perform operations on the menu. Write-access is possible. + * After this method returns, the engine will commit (save) the + * changes asynchronously, and call CompletedMenuEngOperation() + * with the result. + * No asynchronous functionality is allowed, the engine scheduler is + * not reentrant! MMenuEngOperation-s should be short and synchronous. + * If long-lasting or asynchronous functionality is required, perform the + * long lasting and asynchronous part before scheduling the operation to + * the engine. + */ + virtual void RunMenuEngOperationL() = 0; + + /** + * Operation complete (changes saved). + * @param aErr Error code. + */ + virtual void CompletedMenuEngOperation( TInt aErr ) = 0; + + }; + +#endif // __MENUENGOPERATION_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/enginc/menuengvisitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/enginc/menuengvisitor.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 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 __MENUENGVISITOR_H__ +#define __MENUENGVISITOR_H__ + +// INCLUDES + +#include + +// FORWARD DECLARATION + +class CMenuEngObject; + +// CLASS DECLARATION + +/** +* Menu Engine hierarchical visitor interface. +* Object tree depth-first traversal. +*/ +NONSHARABLE_CLASS( MMenuEngVisitor ) + { + +public: // new methods + + /** + * Enter folder. + * @param aFolder Entering this folder. + * @return ETrue to visit children of this folder. VisitLeaveL() will + * be called after children of this folder are visited. + * EFalse to skip children of this folder. VisitLeaveL() will + * be called next. + */ + virtual TBool VisitEnterL( CMenuEngObject& /*aFolder*/ ) + { return ETrue; }; + + /** + * Leave folder. + * @param aFolder Leaving this folder. + * @return ETrue to visit next sibling of this folder. + * EFalse to stop visiting items at this level. + */ + virtual TBool VisitLeaveL( CMenuEngObject& /*aFolder*/ ) + { return ETrue; }; + + /** + * Visit leaf node. + * @param aLeaf Leaf node. + * @return ETrue to visit next sibling of this leaf. + * EFalse to stop visiting items at this level. + */ + virtual TBool VisitL( CMenuEngObject& /*aLeaf*/ ) + { return ETrue; }; + + }; + +#endif // __MENUENGVISITOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menueng.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menueng.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,1381 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include "menueng.h" +#include "menuengobjectfactoryproxy.h" +#include "menuengobject.h" +#include "menuengobserver.h" +#include "menuengoperation.h" +#include "menuengfilter.h" +#include "menuengvisitor.h" +#include "menuengitemlister.h" +#include "menuengdeletionchecker.h" +#include "menuengidmanagerinit.h" +#include "menuengidsetter.h" +#include "menuengidmanager.h" +#include "menuengidcollector.h" +#include "menuengflags.h" +#include "mcsmenuitem.h" // for flags + +// CONSTANTS + +LOCAL_D const TInt KDriveAndColon = 2; //drive letter and colon, e.g. "c:" +_LIT( KMenuTypeIdSeed, "menu:id_seed" ); +_LIT( KMenuAttrIdSeed, "seed" ); +_LIT( KMenuContentDirName, "content\\" ); +_LIT( KMenuContentExtension, ".xml" ); +_LIT( KMenuTempExtension, ".$$$" ); + +// ================= LOCAL FUNCTIONS ======================= + +/** +* Insert string into other string, checking vaailable space. +* Leaves with KErrOverflow if aSoure cannot be inserted to aTarget. +* @param aTarget Target descriptor. +* @param aPos Insertion point. +* @param aSource Source descriptor. +*/ +LOCAL_C void InsertL( TDes& aTarget, TInt aPos, const TDesC& aSource ) + { + if ( aTarget.MaxLength() < aTarget.Length() + aSource.Length() ) + { + User::Leave( KErrOverflow ); + } + aTarget.Insert( aPos, aSource ); + } + +/** +* Append string to the end of other string, checking available space. +* Leaves with KErrOverflow if aSource cannot be appended to aTarget. +* @param aTarget Target descriptor. +* @param aSource Source descriptor. +*/ +LOCAL_C void AppendL( TDes& aTarget, const TDesC& aSource ) + { + if ( aTarget.MaxLength() < aTarget.Length() + aSource.Length() ) + { + User::Leave( KErrOverflow ); + } + aTarget.Append( aSource ); + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEng::Object +// --------------------------------------------------------- +// +CMenuEngObject& CMenuEng::Object( MXCFWNode& aNode ) const + { + return (CMenuEngObject&)(*aNode.Data()); + } + +// --------------------------------------------------------- +// CMenuEng::~CMenuEng +// --------------------------------------------------------- +// +EXPORT_C CMenuEng::~CMenuEng() + { + Cancel(); + CancelAllOperations(); + iOperations.Close(); + iNotifyQueue.Close(); + delete iEngine; + delete iTree; + delete iObjectFactory; + delete iIdManager; + iFs.Close(); + iName.Close(); + iTempFileName.Close(); + iRamFileName.Close(); + delete iActiveWait; + } + +// --------------------------------------------------------- +// CMenuEng::NewL +// --------------------------------------------------------- +// +EXPORT_C CMenuEng* CMenuEng::NewL +( const TDesC& aName, MMenuEngObserver& aObserver ) + { + CMenuEng* eng = new (ELeave) CMenuEng( aObserver ); + CleanupStack::PushL( eng ); + eng->ConstructL( aName ); + CleanupStack::Pop( eng ); + return eng; + } + +// --------------------------------------------------------- +// CMenuEng::CMenuEng +// --------------------------------------------------------- +// +CMenuEng::CMenuEng( MMenuEngObserver& aObserver ) +: CActive( CActive::EPriorityStandard ), iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + iLegacyFormat = EFalse; + } + +// --------------------------------------------------------- +// CMenuEng::ConstructL +// --------------------------------------------------------- +// +void CMenuEng::ConstructL( const TDesC& aName ) + { + ValidateNameL( aName ); + iName.CreateL( aName ); + User::LeaveIfError( iFs.Connect() ); + // Keep temp file and the RAM file name as members - + // we use these all the time. + TFileName fname; + GetFileNameL( fname, ETempFile ); + iTempFileName.CreateL( fname ); + GetFileNameL( fname, ERamFile ); + iRamFileName.CreateL( fname ); + iObjectFactory = CMenuEngObjectFactoryProxy::NewL( *this ); + iEngine = CXCFWEngine::NewL( this ); + iEngine->RegisterObjectFactoryL( iObjectFactory ); + SelfComplete( KErrNone ); // Start processing asynchronously. + ActiveWaitForFileLoadL(); //we need to wait until parsing is complete + } + +// --------------------------------------------------------- +// CMenuEng::QueueOperationL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::QueueOperationL( MMenuEngOperation& aOperation ) + { + __ASSERT_DEBUG( KErrNotFound == iOperations.Find( &aOperation ), \ + User::Invariant() ); + iOperations.AppendL( &aOperation ); + // If idle, kick back into life. + if ( EReady == iState ) + { + iState = EExecuteOp; + SelfComplete( KErrNone ); + } + } + +// --------------------------------------------------------- +// CMenuEng::DequeueOperation +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::DequeueOperation( MMenuEngOperation& aOperation ) + { + if ( iCurrentOperation == &aOperation ) + { + iCurrentOperation = NULL; + } + TInt i = iOperations.Find( &aOperation ); + if ( KErrNotFound != i ) + { + iOperations.Remove( i ); + } + } + +// --------------------------------------------------------- +// CMenuEng::TraverseFolderL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::TraverseFolderL +( TInt aFolder, MMenuEngVisitor& aVisitor ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + TraverseNodeL( FolderNodeL( aFolder ), aVisitor ); + } + +// --------------------------------------------------------- +// CMenuEng::NewObjectL +// --------------------------------------------------------- +// +EXPORT_C CMenuEngObject* CMenuEng::NewObjectL( const TDesC& aType ) + { + if ( !iIdManager ) + { + User::Leave( KErrNotReady ); + } + CMenuEngObject* object = CMenuEngObject::NewL( *this, aType ); + CleanupStack::PushL( object ); + TInt id; + iIdManager->AllocL( id ); + object->SetId( id ); + CleanupStack::Pop( object ); + return object; + } + +// --------------------------------------------------------- +// CMenuEng::RootFolderL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::RootFolderL( TInt& aId ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + aId = iRoot; + } + +// --------------------------------------------------------- +// CMenuEng::ParentFolderL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::ParentFolderL( TInt aId, TInt& aParentId ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + TInt parentId = 0; + if ( aId != iRoot ) + { + // We may have nodes above the root, but do not allow access to those. + // Say 0 to the root's parent. + MXCFWNode* parentNode = NodeL( aId ).Parent(); + if ( parentNode ) + { + parentId = Object( *parentNode ).Id(); + } + } + aParentId = parentId; + } + +// --------------------------------------------------------- +// CMenuEng::GetItemL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::GetItemL( TInt aId, TMenuItem& aItem ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + const CMenuEngObject& object = ObjectL( aId ); + aItem.SetId( object.Id() ); + aItem.SetFlags( object.Flags() ); + aItem.SetType( object.Type() ); + TInt parent; + ParentFolderL( aId, parent ); + aItem.SetParent( parent ); + } + +// --------------------------------------------------------- +// CMenuEng::GetItemsL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::GetItemsL( + RArray& aItemArray, + TInt aFolder, + const MMenuEngFilter* aFilter, + TBool aRecursive ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + TMenuEngItemLister lister + ( *this, aItemArray, aFolder, aFilter, aRecursive ); + TraverseFolderL( aFolder, lister ); + } + +// --------------------------------------------------------- +// CMenuEng::ObjectL +// --------------------------------------------------------- +// +EXPORT_C const CMenuEngObject& CMenuEng::ObjectL( TInt aId ) const + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + return Object( NodeL( aId ) ); + } + +// --------------------------------------------------------- +// CMenuEng::GetLegacyFormat +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuEng::GetOnceLegacyFormat() + { + TBool format = iLegacyFormat; + iLegacyFormat = EFalse; + return format; + } + +// --------------------------------------------------------- +// CMenuEng::RemoveL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::RemoveL( TInt aId ) + { + if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, EDriveC) ) + { + User::Leave( KErrDiskFull ); + } + if ( iState != EExecuteOp ) + { + User::Leave( KErrLocked ); + } + // Check if aId exists. + MXCFWNode& node = NodeL( aId ); + // Can't delete the root. + if ( aId == iRoot ) + { + User::Leave( KErrAccessDenied ); + } + // Can't delete read-only items, or folders containing any read-only items. + TMenuEngDeletionChecker checker; + TraverseNodeL( node, checker ); + // Get the IDs of items to be deleted. + RArray deletedIds; + CleanupClosePushL( deletedIds ); + TMenuEngIdCollector idCollector( deletedIds ); + TraverseNodeL( node, idCollector ); + // Add notification event. + MXCFWNode* parent = node.Parent(); + __ASSERT_DEBUG( parent, User::Invariant() ); + AppendNotifyL( Object( *parent ).Id(), + RMenuNotifier::EItemsAddedRemoved ); + // Delete node. + iTree->RemoveNodeL( &node ); + iChanged = ETrue; + // Deletion successful, remove the IDs. + for ( TInt i = 0; i < deletedIds.Count(); i++ ) + { + iIdManager->Remove( deletedIds[i] ); + } + CleanupStack::PopAndDestroy( &deletedIds ); + } + +// --------------------------------------------------------- +// CMenuEng::MoveToFolderL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::MoveToFolderL +( RArray& aItems, TInt aFolder, TInt aMoveBefore ) + { + if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, EDriveC) ) + { + User::Leave( KErrDiskFull ); + } + if ( iState != EExecuteOp ) + { + User::Leave( KErrLocked ); + } + TInt i; + TInt id; + MXCFWNode* fromFolder = NULL; + // Check that toFolder exists. + MXCFWNode& toFolder = FolderNodeL( aFolder ); + CMenuEngObject& toFolderObj = Object( toFolder ); + // Check that we can move items into target toFolder. + if ( toFolderObj.Flags() & TMenuItem::ELockMoveInto ) + { + User::Leave( KErrAccessDenied ); + } + // Check that all items exist and they are not locked against moving. + // Also check that and they are in the same toFolder. + if ( aItems.Count() ) + { + fromFolder = NodeL( aItems[0] ).Parent(); + for ( i = 0; i< aItems.Count(); i++ ) + { + id = aItems[i]; + if ( id == iRoot ) + { + User::Leave( KErrAccessDenied ); // Can't move the root. + } + MXCFWNode& node = NodeL( id ); + if ( Object( node ).Flags() & TMenuItem::ELockItem ) + { + User::Leave( KErrAccessDenied ); // lock_item + } + if ( node.Parent() != fromFolder ) + { + User::Leave( KErrArgument ); // Items from different folders. + } + } + // Add notification events. Presume that there will be no recursion. + // If there is recursion, then we make an unnecessary notify, that is + // better than missing one. + __ASSERT_DEBUG( fromFolder, User::Invariant() ); + AppendNotifyL( Object( *fromFolder ).Id(), + RMenuNotifier::EItemsAddedRemoved ); + AppendNotifyL( toFolderObj.Id(), + RMenuNotifier::EItemsAddedRemoved ); + // Do move the items. + // Recursion check is done by the XML tree (->KErrArgument). + MXCFWNode* moveBefore = Child( toFolder, aMoveBefore ); + for ( i = 0; i < aItems.Count(); i++ ) + { + iTree->MoveNodeL( &NodeL( aItems[i] ), &toFolder, moveBefore ); + } + iChanged = ETrue; + } + } + +// --------------------------------------------------------- +// CMenuEng::ReorderL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::ReorderL( TInt aId, TInt aMoveBefore ) + { + if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, EDriveC) ) + { + User::Leave( KErrDiskFull ); + } + if ( iState != EExecuteOp ) + { + User::Leave( KErrLocked ); + } + // Can't reorder the root. + if ( aId == iRoot ) + { + User::Leave( KErrArgument ); + } + // Check if aId exists. + MXCFWNode& node = NodeL( aId ); + // Check if item can be reordered. + if ( Object( node ).Flags() & TMenuItem::ELockItem ) + { + User::Leave( KErrAccessDenied ); // lock_item + } + MXCFWNode* parent = node.Parent(); + __ASSERT_DEBUG( parent, User::Invariant() ); + if ( parent ) + { + // Add notification event. + AppendNotifyL( Object( *parent ).Id(), + RMenuNotifier::EItemsReordered ); + // Move it. + MXCFWNode* moveBefore = Child( *parent, aMoveBefore ); + iTree->MoveNodeL( &node, parent, moveBefore ); + iChanged = ETrue; + } + } + +// --------------------------------------------------------- +// CMenuEng::AddL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::AddL +( CMenuEngObject& aObject, TInt aFolder, TInt aInsertBefore ) + { + if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, 0, EDriveC) ) + { + User::Leave( KErrDiskFull ); + } + if ( &aObject.Engine() != this ) + { + // ID integrity requires that objects are bound to engines. + User::Leave( KErrArgument ); + } + if ( iState != EExecuteOp ) + { + User::Leave( KErrLocked ); + } + if ( KMenuTypeData() == aObject.Type() ) + { + // Internal type, disallow. + User::Leave( KErrArgument ); + } + // Check if aFolder exists. + MXCFWNode& folder = FolderNodeL( aFolder ); + // Check if folder is locked. + if ( Object( folder ).Flags() & TMenuItem::ELockMoveInto ) + { + User::Leave( KErrAccessDenied ); // lock_moveinto + } + // Add notification event. + AppendNotifyL( aFolder, RMenuNotifier::EItemsAddedRemoved ); + // Add the node. + MXCFWNode* insertBefore = Child( folder, aInsertBefore ); + if ( insertBefore ) + { + iTree->AddNodeL( &aObject, &folder, insertBefore ); + // No leaving after this point - ownership of aObject taken by the + // tree. (Well, almost -- CXCFWTree is buggy, but hopefully it will + // be fixed.) + } + else + { + // CXCFWTree API design flaw: + // AddNodeL( &aObject, &folder, NULL ) leaves with KErrArgument! + iTree->AddNodeL( &aObject, &folder ); + // No leaving after this point - ownership of aObject taken by the + // tree. (Well, almost -- CXCFWTree is buggy, but hopefully it will + // be fixed.) + } + iChanged = ETrue; + } + +// --------------------------------------------------------- +// CMenuEng::ModifiableObjectL +// --------------------------------------------------------- +// +EXPORT_C CMenuEngObject& CMenuEng::ModifiableObjectL( TInt aId , TInt aEvent) + { + if ( !iTree ) + { + User::Leave( KErrNotReady ); + } + if ( iState != EExecuteOp ) + { + User::Leave( KErrLocked ); + } + MXCFWNode& node = NodeL( aId ); + CMenuEngObject& object = Object( node ); + // Add notification event. + MXCFWNode* parent = node.Parent(); + __ASSERT_DEBUG( parent, User::Invariant() ); + if( aEvent != RMenuNotifier::EItemsNone ) + { + AppendNotifyL( Object( *parent ).Id(), aEvent ); + } + iChanged = ETrue; // Might not be true, but how could we know? + // Note1: We must presume that this object will actually be changed + // because we haven't any information what is being done to it! + // If the object had a back-pointer to the engine, this could + // be solved, but that would be a BAD THING to do. + // Note2: other possible solution is to drop this method and invent + // something else to allow item data update. + return object; + } + + + +// --------------------------------------------------------- +// CMenuEng::AppendNotifyL +// --------------------------------------------------------- +// +EXPORT_C void CMenuEng::AppendNotifyL( TInt aFolder, TInt aEvents ) + { + for ( TInt i = 0; i < iNotifyQueue.Count(); i++ ) + { + if ( iNotifyQueue[i].iFolder == aFolder ) + { + iNotifyQueue[i].iEvents |= aEvents; + return; + } + } + iNotifyQueue.AppendL( TMenuEngNotify( aFolder, aEvents ) ); + } + +// --------------------------------------------------------- +// CMenuEng::NodeL +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuEng::Exist( TInt aId ) const + { + MXCFWNode* node = NULL; + const RNodeArray& nodes = iTree->Nodes(); + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + node = nodes[i]; + if ( aId == Object( *node ).Id() ) + { + return ETrue; + } + } + return EFalse; + } +// --------------------------------------------------------- +// CMenuEng::RunL +// --------------------------------------------------------- +// +void CMenuEng::RunL() + { + switch( iState ) + { + case ENull: + { + // Self-completion in ConstructL(). Load RAM tree. + __ASSERT_DEBUG( !iStatus.Int(), User::Invariant() ); + iState = ELoadRamFile; + LoadRamFileL(); + break; + } + + case ELoadRamFile: + { + if ( iStatus.Int() ) + { + // Error loading RAM tree -> Try ROM tree. + iObserver.EngineTreeReloaded(); + iState = ELoadRomFile; + LoadRomFileL(); + } + else + { + // Tree loaded OK. Start processing operations. + iState = EExecuteOp; + ExecuteOperationL(); + } + break; + } + + case ELoadRomFile: + { + // Error loading ROM tree is fatal. Nothing we can do. + User::LeaveIfError( iStatus.Int() ); + iState = ESaveFile; + SaveTempFileL(); + break; + } + + case ESaveFile: + { + // Error saving tree is fatal. Nothing we can do. + User::LeaveIfError( iStatus.Int() ); + // Tree saved to temp file OK. Replace content file with temp file. + ReplaceRamFileL(); + // Saving completed succesfully. + iChanged = EFalse; + // If there is a current operation, this is the final result. + CompleteCurrentOperation( iStatus.Int() ); + // Start next operation. + iState = EExecuteOp; + ExecuteOperationL(); + break; + } + + case EExecuteOp: + { + // Start next operation. + __ASSERT_DEBUG( !iStatus.Int(), User::Invariant() ); + ExecuteOperationL(); + break; + } + + case EReady: + case EDead: + default: + { + User::Invariant(); + } + } + } + +// --------------------------------------------------------- +// CMenuEng::DoCancel +// --------------------------------------------------------- +// +void CMenuEng::DoCancel() + { + // We don't have real requests, only self-completion; which is already + // completed. + } + +// --------------------------------------------------------- +// CMenuEng::RunError +// --------------------------------------------------------- +// +TInt CMenuEng::RunError( TInt aError ) + { + switch( iState ) + { + case ENull: + { + User::Invariant(); // Self-completion cannot fail. + break; + } + + case ELoadRamFile: + { + // Error loading RAM tree -> keep going (try ROM tree). + SelfComplete( aError ); + break; + } + + case ELoadRomFile: + { + // Error loading ROM tree is fatal. Nothing we can do. + // stop nested active scheduler loop if error in parsing + if ( iActiveWait->IsStarted() ) + { + iActiveWait->AsyncStop(); + } + + iState = EDead; + iObserver.EngineError( aError ); + // Can't delete the tree now, XCFW Engine keeps a pointer to it + // and still uses it even after reporting the error. :( + + break; + } + + case ESaveFile: + { + // File is too big and cannot be saved, delete it + // and try reading from rom + if (iStatus.Int() == KErrNoMemory) + { + iState = ELoadRamFile; + SelfComplete( aError ); + } + else { + // Error saving tree is fatal. Nothing we can do. + // If there is a current operation, this is the final result. + CompleteCurrentOperation( aError ); + iState = EDead; + iObserver.EngineError( aError ); + } + // Can't delete the tree now, XCFW Engine keeps a pointer to it + // and still uses it even after reporting the error. :( + break; + } + + case EExecuteOp: + { + // Current operation failed. + CompleteCurrentOperation( aError ); + // Continue with next operation. + SelfComplete( KErrNone ); + break; + } + + case EReady: + case EDead: + default: + { + User::Invariant(); + } + } + return KErrNone; + } + +// --------------------------------------------------------- +// CMenuEng::HandleEngineEventL +// --------------------------------------------------------- +// +void CMenuEng::HandleEngineEventL( TXCFWEngineEvent aEvent ) + { + switch ( aEvent ) + { + case EEvtParsingComplete: + { + __ASSERT_DEBUG( iTree, User::Invariant() ); + + // parsing operation complete + // we can stop nested active scheduler loop + if ( iActiveWait->IsStarted() ) + { + iActiveWait->AsyncStop(); + } + + TBool legacyFormat = iObjectFactory->IsLegacyFormat(); + // Reset object factory in all cases. + iObjectFactory->Reset(); + // Tree is up (maybe unsaved yet). + // Check the structure and get the root folder node. + MXCFWNode& rootNode = CheckTreeL( *iTree ); + // Init ID manager, check and fix ID-s. + InitIdManagerL( rootNode ); + // Now we have ID for all (including the root). + iRoot = Object( rootNode ).Id(); + // This is the earliest point to do an ID sanity check. + __ASSERT_DEBUG( DebugSanityCheck( *iTree ), User::Invariant() ); + // Send a "wildcard" notification so everybody reloads. + iObserver.EngineEvents( 0, RMenuNotifier::EItemsAddedRemoved ); + iLegacyFormat = legacyFormat; + SelfComplete( KErrNone ); // Go to RunL(). + break; + } + + case EEvtSavingComplete: + { + //iLegacyFormat = EFalse; + SelfComplete( KErrNone ); // Go to RunL(). + break; + } + + case EEvtParsingCanceled: + case EEvtSavingCanceled: + { + // Reset object factory in all cases. + iObjectFactory->Reset(); + SelfComplete( KErrCancel ); // Go to RunL(). + break; + } + + case EEvtParsingStarted: + case EEvtSavingStarted: + case EEvtNull: + default: + { + break; + } + } + } + +// --------------------------------------------------------- +// CMenuEng::HandleEngineErrorL +// --------------------------------------------------------- +// +void CMenuEng::HandleEngineErrorL( TInt aErrorCode ) + { + // Reset object factory in all cases. + iObjectFactory->Reset(); + + SelfComplete( aErrorCode ); // Go to RunL(). + } + +// --------------------------------------------------------- +// CMenuEng::CheckTreeL +// --------------------------------------------------------- +// +MXCFWNode& CMenuEng::CheckTreeL( MXCFWTree& aTree ) const + { + MXCFWNode* rootFolder = NULL; + MXCFWNode* treeRoot = aTree.Root(); + if ( treeRoot ) + { + // The tree has nodes. + if ( KMenuTypeData() == Object( *treeRoot ).Type() ) + { + // Root node is "menu:data" + RNodeArray nodes; + CleanupClosePushL( nodes ); + aTree.GetNodesOfTypeL( KMenuTypeFolder(), nodes, + treeRoot, EFalse ); + if ( 1 == nodes.Count() ) + { + // Exactly 1 "menu:folder" in the root. + // This is the root folder. + rootFolder = nodes[0]; + } + CleanupStack::PopAndDestroy( &nodes ); + } + } + if ( !rootFolder ) + { + User::Leave( KErrCorrupt ); + } + return *rootFolder; + } + +// --------------------------------------------------------- +// CMenuEng::DebugSanityCheck +// --------------------------------------------------------- +// +TBool CMenuEng::DebugSanityCheck( MXCFWTree& aTree ) const + { + const RNodeArray& nodes = aTree.Nodes(); + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + if ( !DebugSanityCheck( *nodes[i] ) ) + { + return EFalse; + } + } + return ETrue; + } + +// --------------------------------------------------------- +// CMenuEng::ActiveWaitForLoadFileL +// --------------------------------------------------------- +// +void CMenuEng::ActiveWaitForFileLoadL() + { + iActiveWait = new( ELeave ) CActiveSchedulerWait(); + if ( !iActiveWait->IsStarted() ) + { + iActiveWait->Start(); + } + //now we check if file was properly loaded + TInt root(0); + RootFolderL( root ); + if( !root && ( iState != EDead ) ) + { + //there was problem with Ram file(probably file was empty), lets load Rom file + iState = ELoadRamFile; + if ( !iActiveWait->IsStarted() ) + { + iActiveWait->Start(); + } + } + } + +// --------------------------------------------------------- +// CMenuEng::DebugSanityCheck +// --------------------------------------------------------- +// +TBool CMenuEng::DebugSanityCheck( MXCFWNode& aNode ) const + { + __ASSERT_DEBUG( iRoot, User::Invariant() ); + // Sanity check, for node location and ID. + // - Nodes under the root folder (==items) should have non-0 ID. + // - Nodes not under the root folder (==other stuff like id_seed) should + // always have 0 id. + // This is crucial for the ID space integrity. XCFW node lookup uses + // a flat list of nodes; the only way we can differentiate items from + // non-items is the ID. + MXCFWNode* node; + for ( node = &aNode; node; node = node->Parent() ) + { + if ( Object( *node ).Id() == iRoot ) + { + // The node is, or descendant of, the root folder. Must have an ID. + return 0 != Object( aNode ).Id(); + } + } + // Node is not under the root folder. Must not have an ID. + return 0 == Object( aNode ).Id(); + } + +// --------------------------------------------------------- +// CMenuEng::NodeL +// --------------------------------------------------------- +// +MXCFWNode& CMenuEng::NodeL( TInt aId ) const + { + __ASSERT_DEBUG( iTree, User::Invariant() ); + if ( !aId ) + { + // We can actually have 0 id node (outside the item tree), but + // those are not items. + User::Leave( KErrNotFound ); + } + MXCFWNode* node = NULL; + const RNodeArray& nodes = iTree->Nodes(); + for ( TInt i = 0; i < nodes.Count(); i++ ) + { + node = nodes[i]; + if ( aId == Object( *node ).Id() ) + { + __ASSERT_DEBUG( DebugSanityCheck( *node ), User::Invariant() ); + return *node; + } + } + User::Leave( KErrNotFound ); + /* NOTREACHED */ + return *node; + } + +// --------------------------------------------------------- +// CMenuEng::FolderNodeL +// --------------------------------------------------------- +// +MXCFWNode& CMenuEng::FolderNodeL( TInt aId ) const + { + __ASSERT_DEBUG( iTree, User::Invariant() ); + MXCFWNode& node = NodeL( aId ); + if ( KMenuTypeFolder() == Object( node ).Type() ) + { + return node; + } + User::Leave( KErrNotFound ); + /* NOTREACHED */ + return node; + } + +// --------------------------------------------------------- +// CMenuEng::Child +// --------------------------------------------------------- +// + +MXCFWNode* CMenuEng::Child( MXCFWNode& aParent, TInt aId ) + { + MXCFWNode* node; + for ( node = aParent.FirstChild(); node; node = node->NextSibling() ) + { + if ( Object( *node ).Id() == aId ) + { + break; + } + } + return node; + } + +// --------------------------------------------------------- +// CMenuEng::CancelAllOperations +// --------------------------------------------------------- +// +void CMenuEng::CancelAllOperations() + { + // For safety, we remove pointers before completion. + // (OperationCompleted might want to remove operation too, avoid + // conflict.) + MMenuEngOperation* operation; + if ( iCurrentOperation ) + { + operation = iCurrentOperation; + iCurrentOperation = NULL; + operation->CompletedMenuEngOperation( KErrCancel ); + } + while ( iOperations.Count() ) + { + operation = iOperations[0]; + iOperations.Remove( 0 ); + operation->CompletedMenuEngOperation( KErrCancel ); + } + } + +// --------------------------------------------------------- +// CMenuEng::ValidateNameL +// --------------------------------------------------------- +// +void CMenuEng::ValidateNameL( const TDesC& aName ) + { + // We only accept alphanumeric characters and underscore as content + // file name. This is stricter than the (current) file system + // restriction, for future-proofing reasons. + if ( !aName.Length() ) + { + User::Leave( KErrArgument ); + } + for ( TInt i = 0; i < aName.Length(); i++ ) + { + TChar c = aName[i]; + if ( !c.IsAlphaDigit() && '_' != c ) + { + User::Leave( KErrArgument ); + } + } + } + +// --------------------------------------------------------- +// CMenuEng::GetFileNameL +// --------------------------------------------------------- +// +void CMenuEng::GetFileNameL( TFileName& aFname, TFile aSelector ) + { + User::LeaveIfError( iFs.PrivatePath( aFname ) ); + if ( ERomFile == aSelector ) + { + InsertL( + aFname, + 0, + PathInfo::RomRootPath().Left( KDriveAndColon ) ); + } + else + { + InsertL( + aFname, + 0, + PathInfo::PhoneMemoryRootPath().Left( KDriveAndColon ) ); + } + AppendL( aFname, KMenuContentDirName ); + AppendL( aFname, iName ); + AppendL( aFname, ETempFile == aSelector ? + KMenuTempExtension : KMenuContentExtension ); + } + +// --------------------------------------------------------- +// CMenuEng::TraverseNodeL +// --------------------------------------------------------- +// +TBool CMenuEng::TraverseNodeL +( MXCFWNode& aNode, MMenuEngVisitor& aVisitor ) const + { + CMenuEngObject& object = Object( aNode ); + if ( KMenuTypeFolder() == object.Type() ) + { + if ( aVisitor.VisitEnterL( object ) ) + { + // Recursion is used - menu data tree is not very deep. + MXCFWNode* node = aNode.FirstChild(); + while( node && TraverseNodeL( *node, aVisitor ) ) + { + node = node->NextSibling(); + } + } + // countChildren( object ); + return aVisitor.VisitLeaveL( object ); + } + else + { + return aVisitor.VisitL( object ); + } + } + +// --------------------------------------------------------- +// CMenuEng::InitIdManagerL +// --------------------------------------------------------- +// +void CMenuEng::InitIdManagerL( MXCFWNode& aRootNode ) + { + __ASSERT_DEBUG( !iIdManager, User::Invariant() ); + __ASSERT_DEBUG( iTree, User::Invariant() ); + iIdManager = new (ELeave) CMenuEngIdManager(); + TInt idSeed; + GetIdSeedL( idSeed ); + iIdManager->SetSeed( idSeed ); + // Read ID-s to ID manager. + TMenuEngIdManagerInit idManagerInit( *iIdManager ); + TraverseNodeL( aRootNode, idManagerInit ); + // Make sure all nodes have ID. + TMenuEngIdSetter idSetter( *iIdManager ); + TraverseNodeL( aRootNode, idSetter ); + } + +// --------------------------------------------------------- +// CMenuEng::GetIdSeedL +// --------------------------------------------------------- +// +void CMenuEng::GetIdSeedL( TInt& aIdSeed ) + { + TInt seed = 0; + __ASSERT_DEBUG( iTree, User::Invariant() ); + MXCFWNode* root = iTree->Root(); + if ( root ) + { + RNodeArray nodes; + CleanupClosePushL( nodes ); + iTree->GetNodesOfTypeL + ( KMenuTypeIdSeed(), nodes, root, EFalse ); + if ( nodes.Count() ) + { + const CMenuEngObject& object = Object( *nodes[0] ); + TPtrC val; + TBool dummy; + if ( object.FindAttribute( KMenuAttrIdSeed(), val, dummy ) ) + { + seed = MenuEngId::AsInt( val ); + } + } + CleanupStack::PopAndDestroy( &nodes ); + } + aIdSeed = seed; + } + +// --------------------------------------------------------- +// CMenuEng::SetIdSeedL +// --------------------------------------------------------- +// +void CMenuEng::SetIdSeedL( TInt aSeed ) + { + __ASSERT_DEBUG( iTree, User::Invariant() ); + MXCFWNode* root = iTree->Root(); + if ( root ) + { + CMenuEngObject* object = NULL; + RNodeArray nodes; + CleanupClosePushL( nodes ); + iTree->GetNodesOfTypeL + ( KMenuTypeIdSeed(), nodes, root, EFalse ); + if ( nodes.Count() ) + { + object = &Object( *nodes[0] ); + } + else + { + // Outside of the item tree -> no ID set. + object = CMenuEngObject::NewL( *this, KMenuTypeIdSeed() ); + CleanupStack::PushL( object ); + iTree->AddNodeL( object, root ); + CleanupStack::Pop( object ); + } + __ASSERT_DEBUG( object, User::Invariant() ); + TBuf buf; + MenuEngId::AsString( aSeed, buf ); + object->SetAttributeL( KMenuAttrIdSeed(), buf, EFalse ); + CleanupStack::PopAndDestroy( &nodes ); + } + } + +// --------------------------------------------------------- +// CMenuEng::SelfComplete +// --------------------------------------------------------- +// +void CMenuEng::SelfComplete( TInt aError ) + { + TRequestStatus* ownStatus = &iStatus; + *ownStatus = KRequestPending; + SetActive(); + User::RequestComplete( ownStatus, aError ); + } + +// --------------------------------------------------------- +// CMenuEng::LoadRamFileL +// --------------------------------------------------------- +// +void CMenuEng::LoadRamFileL() + { + __ASSERT_DEBUG( ELoadRamFile == iState, User::Invariant() ); + __ASSERT_DEBUG( !iTree, User::Invariant() ); + iTree = CXCFWTree::NewL(); + // Legacy xml format supported only if the xml is from rom: + iObjectFactory->SupportLegacyFormat( EFalse ); + iEngine->LoadL( *iTree, iRamFileName ); + } + +// --------------------------------------------------------- +// CMenuEng::LoadRomFileL +// --------------------------------------------------------- +// +void CMenuEng::LoadRomFileL() + { + __ASSERT_DEBUG( ELoadRomFile == iState, User::Invariant() ); + // ROM file name is not kept as member - it is used only once. + TFileName fname; + GetFileNameL( fname, ERomFile ); + delete iIdManager; iIdManager = NULL; + delete iTree; iTree = NULL; + iTree = CXCFWTree::NewL(); + // Legacy xml format supported only if the xml is from rom: + iObjectFactory->SupportLegacyFormat( ETrue ); + iEngine->LoadL( *iTree, fname ); + } + +// --------------------------------------------------------- +// CMenuEng::SaveTempFileL +// --------------------------------------------------------- +// +void CMenuEng::SaveTempFileL() + { + __ASSERT_DEBUG( ESaveFile == iState, User::Invariant() ); + __ASSERT_DEBUG( iTree, User::Invariant() ); + __ASSERT_DEBUG( iIdManager, User::Invariant() ); + // Write back ID seed. + SetIdSeedL( iIdManager->Seed() ); + // Save to temp file then replace content file with temp file. + // This avoids having incomplete content file, if something goes wrong. + __ASSERT_DEBUG( DebugSanityCheck( *iTree ), User::Invariant() ); + TRAPD( err, iEngine->SaveL( *iTree, iTempFileName ) ); + if( err==KErrDiskFull ) + { + iDiskWasFullAndRamFileWasNotCreated = ETrue; + SelfComplete( KErrNone ); + } + else + { + iDiskWasFullAndRamFileWasNotCreated = EFalse; + User::LeaveIfError( err ); + } + + } + +// --------------------------------------------------------- +// CMenuEng::ReplaceRamFileL +// --------------------------------------------------------- +// +void CMenuEng::ReplaceRamFileL() + { + __ASSERT_DEBUG( ESaveFile == iState, User::Invariant() ); + // RFs::Replace() copies the file data -> + // Delete() + Rename() is used instead. + iFs.Delete( iRamFileName ); + TInt err = iFs.Rename( iTempFileName, iRamFileName ); + if( err==KErrDiskFull ) + { + iDiskWasFullAndRamFileWasNotCreated = ETrue; + } + else + { + iDiskWasFullAndRamFileWasNotCreated = EFalse; + User::LeaveIfError( err ); + } + } + +// --------------------------------------------------------- +// CMenuEng::CompleteCurrentOperation +// --------------------------------------------------------- +// +void CMenuEng::CompleteCurrentOperation( TInt aError ) + { + // Operation completion reported two ways: + // - "No change" operations report completion immediately; + // - "Change" operations trigger saving and wait the result. + __ASSERT_DEBUG( EExecuteOp == iState || ESaveFile == iState, \ + User::Invariant() ); + if ( iCurrentOperation ) + { + iCurrentOperation->CompletedMenuEngOperation( aError ); + iCurrentOperation = NULL; + } + // Flush notifications in the success case. + // (Otherwise, the changes did not happen.) + if ( !aError ) + { + for ( TInt i = 0; i < iNotifyQueue.Count(); i++ ) + { + const TMenuEngNotify& notify = iNotifyQueue[i]; + iObserver.EngineEvents( notify.iFolder, notify.iEvents ); + } + } + iNotifyQueue.Reset(); + } + +// --------------------------------------------------------- +// CMenuEng::ExecuteOperationL +// --------------------------------------------------------- +// +void CMenuEng::ExecuteOperationL() + { + __ASSERT_DEBUG( EExecuteOp == iState, User::Invariant() ); + __ASSERT_DEBUG( !iCurrentOperation, User::Invariant() ); + if ( iOperations.Count() ) + { + iCurrentOperation = iOperations[0]; + iOperations.Remove( 0 ); + iCurrentOperation->RunMenuEngOperationL(); + SaveChangesL(); + } + else + { + // No pending operations, we stop here. + // Next QueueOperationL will kick us back to operation. + iState = EReady; + } + } + +// --------------------------------------------------------- +// CMenuEng::SaveChangesL +// --------------------------------------------------------- +// +void CMenuEng::SaveChangesL() + { + // This method is part of ExecuteOperationL. + // (Post-operation processing.) + __ASSERT_DEBUG( EExecuteOp == iState, User::Invariant() ); + if ( iChanged || iDiskWasFullAndRamFileWasNotCreated ) + { + // Tree changed, async save. + iState = ESaveFile; + SaveTempFileL(); + } + else + { + // Tree not changed, we are done. + CompleteCurrentOperation( KErrNone ); + if ( iOperations.Count() ) + { + // Go for the next operation (async). + iState = EExecuteOp; // Same as current value, code clarity. + SelfComplete( KErrNone ); + } + else + { + // No pending operations, we stop here. + // Next QueueOperationL will kick us back to operation. + iState = EReady; + } + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengdeletionchecker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengdeletionchecker.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengdeletionchecker.h" +#include "menuengobject.h" +#include "mcsmenuitem.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuEngDeletionChecker::CheckL +// --------------------------------------------------------- +// +void TMenuEngDeletionChecker::CheckL( CMenuEngObject& aObject ) + { + if ( aObject.Flags() & TMenuItem::ELockDelete ) + { + User::Leave( KErrAccessDenied ); + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengflags.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengflags.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengflags.h" +#include "mcsmenuitem.h" + +// CLASS DECLARATION + +NONSHARABLE_STRUCT( TMenuFlagEntry ) + { + TUint32 iFlag; // Flag bit value (one bit only). + const TText* iString; // Flag string name. + }; + +// CONSTANTS + +/// Flag name table. Concatenated names (with spaces between) should fit into +// KMenuMaxAttrValueLen! +LOCAL_D const TMenuFlagEntry KTable[] = + { + { TMenuItem::ELockDelete, _S("lock_delete") }, + { TMenuItem::ELockName, _S("lock_name") }, + { TMenuItem::ELockIcon, _S("lock_icon") }, + { TMenuItem::ELockMoveInto, _S("lock_moveinto") }, + { TMenuItem::ELockItem, _S("lock_item") }, + { TMenuItem::EHidden, _S("hidden") }, + { TMenuItem::EMissing, _S("missing") }, + { 0 } + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// MenuEngFlags::AsInt +// --------------------------------------------------------- +// +TUint32 MenuEngFlags::AsInt( const TDesC& aStringValue ) + { + TUint32 flags = 0; + TLex lex( aStringValue ); + TPtrC token( lex.NextToken() ); + while ( token.Length() ) + { + flags |= FlagValue( token ); + token.Set( lex.NextToken() ); + } + return flags; + } + +// --------------------------------------------------------- +// MenuEngFlags::AsString +// --------------------------------------------------------- +// +void MenuEngFlags::AsString( TUint32 aIntValue, TDes& aStringValue ) + { + // Note, we assume that the result fits in aStringValue. + // It is expected to be of length KMenuMaxAttrValueLen. + // If new flags are added, we should check that their concatenated + // names (with spaces between) still fit in one attribute. If not, + // then we should use more than one "flags" attribute; but this is + // easy to avoid if flag names are kept short. (32 flags should normally + // fit in 512 characters!) + __ASSERT_DEBUG( aStringValue.MaxLength() >= KMenuMaxAttrValueLen, \ + User::Invariant() ); + aStringValue.SetLength( 0 ); + TUint32 mask; + TPtrC ptr; + TBool leadingSpace = EFalse; + for ( mask = 0x1; mask; mask = mask << 1 ) + { + ptr.Set( StringValue( mask & aIntValue ) ); + if ( ptr.Length() ) + { + if ( leadingSpace ) + { + aStringValue.Append( TChar(' ') ); + } + aStringValue.Append( ptr ); + leadingSpace = ETrue; // Need a leading space from the 2nd onwards. + } + } + } + +// --------------------------------------------------------- +// MenuEngFlags::FlagValue +// --------------------------------------------------------- +// +TUint32 MenuEngFlags::FlagValue( const TDesC& aString ) + { + // Note: This could be optimized + const TMenuFlagEntry* entry; + for ( entry = &KTable[0]; entry->iFlag; entry++ ) + { + if ( aString == TPtrC( entry->iString ) ) + { + return entry->iFlag; + } + } + return 0; + } + +// --------------------------------------------------------- +// MenuEngFlags::StringValue +// --------------------------------------------------------- +// +TPtrC MenuEngFlags::StringValue( TUint32 aFlag ) + { + // It is expected that aFlag has exactly one bit set -> first + // match is accepted. + const TMenuFlagEntry* entry; + for ( entry = &KTable[0]; entry->iFlag; entry++ ) + { + if ( aFlag & entry->iFlag ) + { + return TPtrC( entry->iString ); + } + } + return KNullDesC(); + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// MenuEngId::AsInt +// --------------------------------------------------------- +// +TInt MenuEngId::AsInt( const TDesC& aStringValue ) + { + TInt position( aStringValue.Find(KHexPrefix) ); + TPtrC string( aStringValue ); + TRadix radix( EDecimal ); + if ( position == 0 ) + { + // is hex + radix = EHex; + string.Set( aStringValue.Mid( KHexPrefix().Length() ) ); + } + + TUint id = 0; + if ( KErrNone != TLex( string ).Val( id, radix ) ) + { + return 0; + } + return id; + } + +// --------------------------------------------------------- +// MenuEngId::AsString +// --------------------------------------------------------- +// +void MenuEngId::AsString( TInt aIntValue, TDes& aStringValue ) + { + // Note, we assume that the result fits in aStringValue. + // It is expected to be of length KMenuMaxAttrValueLen. + __ASSERT_DEBUG( aStringValue.MaxLength() >= KMenuMaxAttrValueLen, \ + User::Invariant() ); + aStringValue.SetLength( 0 ); + aStringValue.AppendNum( aIntValue ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengidcollector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengidcollector.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengidcollector.h" +#include "menuengobject.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuEngIdCollector::CollectIdL +// --------------------------------------------------------- +// +void TMenuEngIdCollector::CollectIdL( CMenuEngObject& aObject ) + { + iIds.AppendL( aObject.Id() ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengidmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengidmanager.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengidmanager.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngIdManager::~CMenuEngIdManager +// --------------------------------------------------------- +// +CMenuEngIdManager::~CMenuEngIdManager() + { + iIds.Close(); + } + +// --------------------------------------------------------- +// CMenuEngIdManager::CMenuEngIdManager +// --------------------------------------------------------- +// +CMenuEngIdManager::CMenuEngIdManager() + { + } + +// --------------------------------------------------------- +// CMenuEngIdManager::AllocL +// --------------------------------------------------------- +// +void CMenuEngIdManager::AllocL( TInt& aId ) + { + TInt id = 0; + TInt startSeed = iSeed; + do + { + iSeed++; + if ( iSeed == startSeed ) + { + // No more free IDs. This happens when we used ALL possible + // integer numbers. (4GB of memory used for the ID-s only!) + // Happy coverage testing! ;) + User::Leave( KErrNoMemory ); + } + if ( KErrNotFound == iIds.FindInOrder( iSeed ) ) + { + id = iSeed; + } + } + while ( !id ); + iIds.InsertInOrderL( id ); + aId = id; + } + +// --------------------------------------------------------- +// CMenuEngIdManager::AddL +// --------------------------------------------------------- +// +void CMenuEngIdManager::AddL( TInt aId ) + { + if ( aId && KErrNotFound == iIds.FindInOrder( aId ) ) + { + iIds.InsertInOrderL( aId ); + } + } + +// --------------------------------------------------------- +// CMenuEngIdManager::Remove +// --------------------------------------------------------- +// +void CMenuEngIdManager::Remove( TInt aId ) + { + TInt i = iIds.FindInOrder( aId ); + if ( KErrNotFound != i ) + { + iIds.Remove( i ); + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengidmanagerinit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengidmanagerinit.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengidmanagerinit.h" +#include "menuengidmanager.h" +#include "menuengobject.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuEngIdManagerInit::AddIdL +// --------------------------------------------------------- +// +void TMenuEngIdManagerInit::AddIdL( CMenuEngObject& aObject ) + { + if ( aObject.Id() ) + { + iIdManager.AddL( aObject.Id() ); + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengidsetter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengidsetter.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengidsetter.h" +#include "menuengidmanager.h" +#include "menuengobject.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuEngIdSetter::SetIdL +// --------------------------------------------------------- +// +void TMenuEngIdSetter::SetIdL( CMenuEngObject& aObject ) + { + if ( !aObject.Id() ) + { + TInt id; + iIdManager.AllocL( id ); + aObject.SetId( id ); + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengitemlister.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengitemlister.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengitemlister.h" +#include "menuengfilter.h" +#include "menuengobject.h" +#include "menueng.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuEngItemLister::TMenuEngItemLister +// --------------------------------------------------------- +// +TMenuEngItemLister::TMenuEngItemLister( + const CMenuEng& aEng, + RArray& aItemArray, + TInt aFolder, + const MMenuEngFilter* aFilter, + TBool aRecursive ) +: iEng( aEng ), + iItemArray( aItemArray ), + iFolder( aFolder ), + iFilter( aFilter ), + iRecursive( aRecursive ) + { + } + +// --------------------------------------------------------- +// TMenuEngItemLister::VisitEnterL +// --------------------------------------------------------- +// +TBool TMenuEngItemLister::VisitEnterL( CMenuEngObject& aFolder ) + { + if ( iFolder == aFolder.Id() ) + { + // We need content below this folder (but not the folder itself). + return ETrue; + } + + // A folder below iFolder - add and (optionally) recurse. + AddL( aFolder ); + return iRecursive; + } + +// --------------------------------------------------------- +// TMenuEngItemLister::VisitLeaveL +// --------------------------------------------------------- +// +TBool TMenuEngItemLister::VisitLeaveL( CMenuEngObject& /*aFolder*/ ) + { + return ETrue; + } + +// --------------------------------------------------------- +// TMenuEngItemLister::VisitL +// --------------------------------------------------------- +// +TBool TMenuEngItemLister::VisitL( CMenuEngObject& aLeaf ) + { + AddL( aLeaf ); + return ETrue; + } + +// --------------------------------------------------------- +// TMenuEngItemLister::AddL +// --------------------------------------------------------- +// +void TMenuEngItemLister::AddL( CMenuEngObject& aObject ) + { + if ( !iFilter || iFilter->MatchesObject( aObject ) ) + { + TMenuItem hdr; + hdr.SetId( aObject.Id() ); + hdr.SetFlags( aObject.Flags() ); + hdr.SetType( aObject.Type() ); + TInt parent; + iEng.ParentFolderL( aObject.Id(), parent ); + hdr.SetParent( parent ); + iItemArray.AppendL( hdr ); + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuenglegacyobjectfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuenglegacyobjectfactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,252 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuenglegacyobjectfactory.h" +#include "menuengobject.h" +#include "menuengflags.h" +#include "mcsmenuitem.h" + +// Legacy types +_LIT( KLegacyTypeData, "appshell:data" ); +_LIT( KLegacyTypeApp, "appshell:application" ); +_LIT( KLegacyTypeUrl, "appshell:url" ); +_LIT( KLegacyTypeFolder, "appshell:folder" ); + +// Legacy attributes. +_LIT( KLegacyAttrLockDelete, "lock_delete" ); +_LIT( KLegacyAttrLockName, "lock_name" ); +_LIT( KLegacyAttrLockIcon, "lock_icon" ); +_LIT( KLegacyAttrLockMoveInto, "lock_moveinto" ); +_LIT( KLegacyAttrLockItem, "lock_item" ); + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::~CMenuEngLegacyObjectFactory +// --------------------------------------------------------- +// +CMenuEngLegacyObjectFactory::~CMenuEngLegacyObjectFactory() + { + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::NewL +// --------------------------------------------------------- +// +CMenuEngLegacyObjectFactory* CMenuEngLegacyObjectFactory::NewL( CMenuEng& aEng ) + { + CMenuEngLegacyObjectFactory* factory = + new (ELeave) CMenuEngLegacyObjectFactory( aEng ); + return factory; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::CMenuEngLegacyObjectFactory +// --------------------------------------------------------- +// +CMenuEngLegacyObjectFactory::CMenuEngLegacyObjectFactory( CMenuEng& aEng ) +: iEng( aEng ) + { + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::IsSupportedType +// --------------------------------------------------------- +// +TBool CMenuEngLegacyObjectFactory::IsSupportedType( const TDesC& aLegacyTypeIdentifier ) const + { + TBool ret = EFalse; + if( aLegacyTypeIdentifier.Compare( KLegacyTypeData ) == 0 || + aLegacyTypeIdentifier.Compare( KLegacyTypeApp ) == 0 || + aLegacyTypeIdentifier.Compare( KLegacyTypeUrl ) == 0 || + aLegacyTypeIdentifier.Compare( KLegacyTypeFolder ) == 0 ) + { + ret = ETrue; + } + return ret; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::ConvertedType +// --------------------------------------------------------- +// +TPtrC CMenuEngLegacyObjectFactory::ConvertedType( const TDesC& aLegacyTypeIdentifier ) const + { + TPtrC ret( KNullDesC ); + if( aLegacyTypeIdentifier.Compare( KLegacyTypeData ) == 0 ) + { + ret.Set( KMenuTypeData ); + } + else if( aLegacyTypeIdentifier.Compare( KLegacyTypeApp ) == 0 ) + { + ret.Set( KMenuTypeApp ); + } + else if ( aLegacyTypeIdentifier.Compare( KLegacyTypeUrl ) == 0 ) + { + ret.Set( KMenuTypeUrl ); + } + else if ( aLegacyTypeIdentifier.Compare( KLegacyTypeFolder ) == 0 ) + { + ret.Set( KMenuTypeFolder ); + } + return ret; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::GetContentObjectAndSetContextL +// --------------------------------------------------------- +// +CGECOObjectBase* CMenuEngLegacyObjectFactory::GetContentObjectAndSetContextL +( const TDesC& aTypeIdentifier ) + { + CMenuEngObject* object = 0; + if ( !IsSupportedType( aTypeIdentifier ) ) + { + User::Leave( KErrNotSupported ); + } + object = CMenuEngObject::NewL( iEng, ConvertedType( aTypeIdentifier ) ); + SetContext( object ); + return object; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::InitializeObjectL +// --------------------------------------------------------- +// +void CMenuEngLegacyObjectFactory::InitializeObjectL +( MGECOAttributeProvider& aAttributeProvider ) + { + if ( iContext ) + { + CMenuEngObject* context = (CMenuEngObject*)iContext; + TPtrC name; + TPtrC value; + TBool localized; + context->Reset(); + const TInt count = aAttributeProvider.NumAttributes(); + for ( TInt i = 0; i < count; i++ ) + { + aAttributeProvider.AttributeDetailsL( i, name, value, localized ); + if ( KMenuAttrId() == name ) + { + // Legacy xml format does not support 'id'. Skip it. + } + else if ( KMenuAttrFlags() == name ) + { + // Legacy xml format does not support 'flags'. Skip it. + } + + // Collect attributes that are handled as flags + else if ( KLegacyAttrLockDelete() == name ) + { + context->SetFlags( TMenuItem::ELockDelete, ETrue ); + } + else if ( KLegacyAttrLockName() == name ) + { + context->SetFlags( TMenuItem::ELockName, ETrue ); + } + else if ( KLegacyAttrLockIcon() == name ) + { + context->SetFlags( TMenuItem::ELockIcon, ETrue ); + } + else if ( KLegacyAttrLockMoveInto() == name ) + { + context->SetFlags( TMenuItem::ELockMoveInto, ETrue ); + } + else if ( KLegacyAttrLockItem() == name ) + { + context->SetFlags( TMenuItem::ELockItem, ETrue ); + } + + else + { + // Other attributes stored normally, in the object. + context->SetInitialAttributeL( name, value, localized ); + } + } + } + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::SetContext +// --------------------------------------------------------- +// +TInt CMenuEngLegacyObjectFactory::SetContext( CGECOObjectBase* aContext ) + { + iContext = aContext; + return KErrNone; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::NumAttributes +// --------------------------------------------------------- +// +TInt CMenuEngLegacyObjectFactory::NumAttributes() + { + // Do not support saving in legacy format - panic in debug build! + __ASSERT_DEBUG( EFalse, User::Invariant() ); + return 0; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngLegacyObjectFactory::AttributeDetailsL( + const TInt /*aIndex*/, + TPtrC& /*aAttrName*/, + TPtrC& /*aAttrValue*/, + TBool& /*aIsLocalized*/ ) + { + // Do not support saving in legacy format - panic in debug build! + __ASSERT_DEBUG( EFalse, User::Invariant() ); + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngLegacyObjectFactory::AttributeDetailsL( + const TInt /*aIndex*/, + TPtrC& /*aAttrName*/, + TPtrC& /*aAttrValue*/ ) + { + // Do not support saving in legacy format - panic in debug build! + __ASSERT_DEBUG( EFalse, User::Invariant() ); + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::HasTextData +// --------------------------------------------------------- +// +TBool CMenuEngLegacyObjectFactory::HasTextData() + { + return EFalse; + } + +// --------------------------------------------------------- +// CMenuEngLegacyObjectFactory::TextDetailsL +// --------------------------------------------------------- +// +void CMenuEngLegacyObjectFactory::TextDetailsL +( TPtrC& /*aText*/, TBool& /*aIsLocalized*/ ) + { + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengobject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengobject.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,398 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mcsdef.h" +#include "menuengobject.h" +#include "mcsmenuitem.h" +#include "menueng.h" +#include "centralrepository.h" + +// ================= LOCAL FUNCTIONS ======================= + +/** +* Check if this is a valid attribute name. Leave with KErrArgument if not. +* We don't accept whitespace or exotic characters anywhere, and also +* forbid setting reserved attribute "flags". +*/ +LOCAL_C void CheckAttrNameL( const TDesC& aAttrName ) + { + if ( !aAttrName.Length() ) + { + User::Leave( KErrArgument ); + } + if ( KMenuAttrFlags() == aAttrName || KMenuAttrId() == aAttrName ) + { + // Internal attributes, disallow. + User::Leave( KErrArgument ); + } + for ( TInt i = 0; i < aAttrName.Length(); i++ ) + { + TChar c = aAttrName[i]; + if ( !c.IsAlphaDigit() && + '_' != c && + '-' != c && + ':' != c ) + { + User::Leave( KErrArgument ); + } + } + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngObject::~CMenuEngObject +// --------------------------------------------------------- +// +EXPORT_C CMenuEngObject::~CMenuEngObject() + { + iAttributes.ResetAndDestroy(); + iType.Close(); + } + +// --------------------------------------------------------- +// CMenuEngObject::NewL +// --------------------------------------------------------- +// +CMenuEngObject* CMenuEngObject::NewL +( CMenuEng& aEng, const TDesC& aType ) + { + CMenuEngObject* obj = new (ELeave) CMenuEngObject( aEng ); + CleanupStack::PushL( obj ); + obj->ConstructL( aType ); + CleanupStack::Pop( obj ); + return obj; + } + +// --------------------------------------------------------- +// CMenuEngObject::CMenuEngObject +// --------------------------------------------------------- +// +CMenuEngObject::CMenuEngObject( CMenuEng& aEng ): iEng( aEng ), iNative( ETrue ) + { + } + +// --------------------------------------------------------- +// CMenuEngObject::ConstructL +// --------------------------------------------------------- +// +void CMenuEngObject::ConstructL( const TDesC& aType ) + { + CGECODefaultObject::BaseConstructL( aType ); + iType.CreateL( aType ); + } + +// --------------------------------------------------------- +// CMenuEngObject::Id +// --------------------------------------------------------- +// +EXPORT_C TInt CMenuEngObject::Id() const + { + return iId; + } + +// --------------------------------------------------------- +// CMenuEngObject::Flags +// --------------------------------------------------------- +// +EXPORT_C TUint32 CMenuEngObject::Flags( TBool aFactoryCall ) const + { + TUint32 flags = iFlags; + //if hidden flag is not set, we check it in central repository + if( !aFactoryCall ) + { + TRAP_IGNORE( UpdateCrHiddenFlagL( flags ) ); + } + return flags; + } + + +// --------------------------------------------------------- +// CMenuEngObject::UpdateCrHiddenFlagL +// --------------------------------------------------------- +// +void CMenuEngObject::UpdateCrHiddenFlagL( TUint32& aFlags ) const + { + if ( iType == KMenuTypeFolder() && !( iFlags & TMenuItem::EHidden ) ) + { + TBool localized; + TPtrC folderName(KNullDesC); + TBool exists = FindAttribute( KMenuAttrAppGroupName, folderName, localized ); + + if ( exists && IsInCrL( folderName ) ) + { + aFlags |= TMenuItem::EHidden; + } + } + } + +// --------------------------------------------------------- +// CMenuEngObject::ParseHiddenFoldersL +// --------------------------------------------------------- +// +void CMenuEngObject::ParseHiddenFoldersL( + const TDesC& aHiddenFolders, + RArray& aHiddenFoldersArray ) const + { + TLex input( aHiddenFolders ); + TLexMark startMark; + input.Mark( startMark ); + TBool notEmpty = EFalse; + while ( !input.Eos() ) + { + if( input.Peek() == ',') + { + User::LeaveIfError( aHiddenFoldersArray. + Append( input.MarkedToken( startMark ) ) ); + input.Inc(); + input.Mark( startMark ); + } + input.Inc(); + notEmpty = ETrue; + } + if ( notEmpty ) + { + User::LeaveIfError( aHiddenFoldersArray. + Append( input.MarkedToken( startMark ) ) ); + } + } + +// --------------------------------------------------------- +// CMenuEngObject::IsInCrL +// --------------------------------------------------------- +// +TBool CMenuEngObject::IsInCrL( const TDesC& aFolderName ) const + { + RBuf hiddenCRFolders; + CleanupClosePushL( hiddenCRFolders ); + hiddenCRFolders.CreateL( KCenRepBufferSize ); + + CRepository* cenRepSession = CRepository::NewLC( KCRUidMenu ); + cenRepSession->Get( KMenuHideCPFolder, hiddenCRFolders ); + CleanupStack::PopAndDestroy( cenRepSession ); + + RArray hiddenFoldersArray; + CleanupClosePushL( hiddenFoldersArray ); + ParseHiddenFoldersL( hiddenCRFolders, hiddenFoldersArray ); + + TBool result(EFalse); + TInt id = hiddenFoldersArray.Find(aFolderName); + if (KErrNotFound != id ) + { + TPtrC folderName(KNullDesC); + folderName.Set( hiddenFoldersArray[id] ); + if (folderName == aFolderName) + { + result = ETrue; + } + } + + CleanupStack::PopAndDestroy( &hiddenFoldersArray ); + CleanupStack::PopAndDestroy( &hiddenCRFolders ); + + return result; + } + +// --------------------------------------------------------- +// CMenuEngObject::Type +// --------------------------------------------------------- +// +EXPORT_C TPtrC CMenuEngObject::Type() const + { + return iType; + } + +// --------------------------------------------------------- +// CMenuEngObject::NumAttributes +// --------------------------------------------------------- +// +TInt CMenuEngObject::NumAttributes() const + { + return iAttributes.Count(); + } + +// --------------------------------------------------------- +// CMenuEngObject::GetAttribute +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuEngObject::GetAttribute +( TInt aIndex, TPtrC& aName, TPtrC& aValue, TBool& aLocalized ) const + { + if( aIndex < 0 || aIndex >= iAttributes.Count() ) + { + return EFalse; + } + CMenuEngObjectAttr* attr = iAttributes[aIndex]; + aName.Set( attr->Name() ); + aValue.Set( attr->Value() ); + aLocalized = attr->Localized(); + return ETrue; + } + +// --------------------------------------------------------- +// CMenuEngObject::FindAttribute +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuEngObject::FindAttribute +( const TDesC& aName, TPtrC& aValue, TBool& aLocalized ) const + { + TInt i = iAttributes.Find( aName ); + if ( KErrNotFound != i ) + { + CMenuEngObjectAttr* attr = iAttributes[i]; + aValue.Set( attr->Value() ); + aLocalized = attr->Localized(); + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------- +// CMenuEngObject::SetFlags +// --------------------------------------------------------- +// +EXPORT_C void CMenuEngObject::SetFlags( TUint32 aMask, TBool aOn ) + { + if ( aOn ) + { + iFlags |= aMask; + } + else + { + iFlags &= ~aMask; + } + } + +// ---------------------------------------------------------------------------- +// CMenuEngObject::SetAttributeL +// Menu item lock flags are checked (e.g. can rename), but only when the +// current SetAttributeL call is not made from the object factories. +// If it is called from there, no flags checking is made. +// This method is called from object factories when the engine is in +// ELoadRamFile or ELoadRomFile states. +// ---------------------------------------------------------------------------- +// +EXPORT_C void CMenuEngObject::SetAttributeL +( const TDesC& aAttrName, const TDesC& aAttrValue, TBool aLocalized ) + { + SetInitialAttributeL( aAttrName, aAttrValue, aLocalized ); + CGECODefaultObject::RemoveAttribute( aAttrName ); + CGECODefaultObject::SetAttributeL( aAttrName, aAttrValue, aLocalized ); + } + +void CMenuEngObject::SetInitialAttributeL +( const TDesC& aAttrName, const TDesC& aAttrValue, TBool aLocalized ) + { + CheckAttrNameL( aAttrName ); + + if ( iEng.State() != CMenuEng::ELoadRamFile && + iEng.State() != CMenuEng::ELoadRomFile && + Flags() & TMenuItem::ELockName && + ( 0 == aAttrName.Compare( KMenuAttrShortName ) || + 0 == aAttrName.Compare( KMenuAttrLongName ) || + 0 == aAttrName.Compare( KMenuAttrTitleName ) ) ) + { + User::Leave( KErrAccessDenied ); + } + + CMenuEngObjectAttr* attr = NULL; + TInt i = iAttributes.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuEngObjectAttr::NewLC( aAttrName ); + iAttributes.AppendL( attr ); + CleanupStack::Pop( attr ); + } + else + { + attr = iAttributes[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); + attr->SetValueL( aAttrValue ); + attr->SetLocalized( aLocalized ); + } + +// --------------------------------------------------------- +// CMenuEngObject::SetNative +// --------------------------------------------------------- +// +EXPORT_C void CMenuEngObject::SetNative( TBool aNative ) + { + iNative = aNative; + } + +// --------------------------------------------------------- +// CMenuEngObject::GetNative +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuEngObject::GetNative() const + { + return iNative; + } + +// --------------------------------------------------------- +// CMenuEngObject::RemoveAttribute +// --------------------------------------------------------- +// +EXPORT_C void CMenuEngObject::RemoveAttribute( const TDesC& aName ) + { + TInt i = iAttributes.Find( aName ); + if ( KErrNotFound != i ) + { + delete iAttributes[i]; + iAttributes.Remove( i ); + CGECODefaultObject::RemoveAttribute( aName ); + } + } + +// --------------------------------------------------------- +// CMenuEngObject::Reset +// --------------------------------------------------------- +// +EXPORT_C void CMenuEngObject::Reset() + { + iAttributes.ResetAndDestroy(); + iFlags = 0; + } + +// --------------------------------------------------------- +// CMenuEngObject::SetId +// --------------------------------------------------------- +// +void CMenuEngObject::SetId( TInt aId ) + { + iId = aId; + } + +// --------------------------------------------------------- +// CMenuEngObject::Engine +// --------------------------------------------------------- +// +CMenuEng& CMenuEngObject::Engine() + { + return iEng; + } + +// --------------------------------------------------------- +// CMenuEngObject::TypeIdentifier +// --------------------------------------------------------- +// +const TDesC& CMenuEngObject::TypeIdentifier() + { + return iType; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengobjectattr.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengobjectattr.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include +#include "menuengobjectattr.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngObjectAttr::~CMenuEngObjectAttr +// --------------------------------------------------------- +// +CMenuEngObjectAttr::~CMenuEngObjectAttr() + { + iName.Close(); + iValue.Close(); + } + +// --------------------------------------------------------- +// CMenuEngObjectAttr::NewL +// --------------------------------------------------------- +// +CMenuEngObjectAttr* CMenuEngObjectAttr::NewL( const TDesC& aName ) + { + CMenuEngObjectAttr* attr = NewLC( aName ); + CleanupStack::Pop( attr ); + return attr; + } + +// --------------------------------------------------------- +// CMenuEngObjectAttr::NewLC +// --------------------------------------------------------- +// +CMenuEngObjectAttr* CMenuEngObjectAttr::NewLC( const TDesC& aName ) + { + CMenuEngObjectAttr* attr = new (ELeave) CMenuEngObjectAttr(); + CleanupStack::PushL( attr ); + attr->ConstructL( aName ); + return attr; + } + +// --------------------------------------------------------- +// CMenuEngObjectAttr::CMenuEngObjectAttr +// --------------------------------------------------------- +// +CMenuEngObjectAttr::CMenuEngObjectAttr() + { + } + +// --------------------------------------------------------- +// CMenuEngObjectAttr::ConstructL +// --------------------------------------------------------- +// +void CMenuEngObjectAttr::ConstructL( const TDesC& aName ) + { + iName.CreateL( aName ); + } + +// --------------------------------------------------------- +// CMenuEngObjectAttr::SetValueL +// --------------------------------------------------------- +// +void CMenuEngObjectAttr::SetValueL( const TDesC& aValue ) + { + iValue.Close(); + iValue.CreateL( aValue ); + } + +// --------------------------------------------------------- +// RMenuEngObjectAttrArray::Find +// --------------------------------------------------------- +// +TInt RMenuEngObjectAttrArray::Find( const TDesC& aName ) const + { + for ( TInt i = 0; i < Count(); i++ ) + { + if ( !aName.Compare( operator[]( i )->Name() ) ) + { + return i; + } + } + return KErrNotFound; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengobjectfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengobjectfactory.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengobjectfactory.h" +#include "menuengobject.h" +#include "menuengflags.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngObjectFactory::~CMenuEngObjectFactory +// --------------------------------------------------------- +// +CMenuEngObjectFactory::~CMenuEngObjectFactory() + { + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::NewL +// --------------------------------------------------------- +// +CMenuEngObjectFactory* CMenuEngObjectFactory::NewL( CMenuEng& aEng ) + { + CMenuEngObjectFactory* factory = + new (ELeave) CMenuEngObjectFactory( aEng ); + return factory; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::CMenuEngObjectFactory +// --------------------------------------------------------- +// +CMenuEngObjectFactory::CMenuEngObjectFactory( CMenuEng& aEng ) +: iEng( aEng ) + { + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::GetContentObjectAndSetContextL +// --------------------------------------------------------- +// +CGECOObjectBase* CMenuEngObjectFactory::GetContentObjectAndSetContextL +( const TDesC& aTypeIdentifier ) + { + // Notes: + // Here we create an object for all nodes, even for the ones we don't know. + // (We can't check the type because of extensibility). + // This is a problem, as not all XML nodes are part of the menu structure, + // for example the "appshell:data" is not. + // + // Is it a solution to use an *exclusion* list of types here?? + CMenuEngObject* object = CMenuEngObject::NewL( iEng, aTypeIdentifier ); + SetContext( object ); + return object; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::InitializeObjectL +// --------------------------------------------------------- +// +void CMenuEngObjectFactory::InitializeObjectL +( MGECOAttributeProvider& aAttributeProvider ) + { + if ( iContext ) + { + CMenuEngObject* context = (CMenuEngObject*)iContext; + TPtrC name; + TPtrC value; + TBool localized; + context->Reset(); + const TInt count = aAttributeProvider.NumAttributes(); + for ( TInt i = 0; i < count; i++ ) + { + aAttributeProvider.AttributeDetailsL( i, name, value, localized ); + if ( KMenuAttrId() == name ) + { + // "id" -> internal attribute, convert to integer. + context->SetId( MenuEngId::AsInt( value ) ); + } + else if ( KMenuAttrFlags() == name ) + { + // "flags" -> internal attribute, convert to integer. + context->SetFlags( MenuEngFlags::AsInt( value ), ETrue ); + CGECODefaultObject* defaultContext = (CGECODefaultObject*)context; + defaultContext->RemoveAttribute(KMenuAttrFlags); + } + else + { + // Other attributes stored normally, in the object. + context->SetInitialAttributeL( name, value, localized ); + } + } + } + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::SetContext +// --------------------------------------------------------- +// +TInt CMenuEngObjectFactory::SetContext( CGECOObjectBase* aContext ) + { + iContext = aContext; + return KErrNone; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::NumAttributes +// --------------------------------------------------------- +// +TInt CMenuEngObjectFactory::NumAttributes() + { + TInt count = 0; + if ( iContext ) + { + count = 1; // We always have the ID. + CMenuEngObject* context = (CMenuEngObject*)iContext; + count += context->NumAttributes(); + if ( context->Flags( ETrue ) ) + { + // Flags, if any, are written to XML as an attribute + // named "flags". + // The object cannot have an attribute with that name. + count++; + } + } + return count; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactory::AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue, + TBool& aIsLocalized ) + { + if ( iContext ) + { + CMenuEngObject* context = (CMenuEngObject*)iContext; + if ( aIndex < context->NumAttributes() ) + { + // External attributes retrieved normally, from the object. + (void)context->GetAttribute + ( aIndex, aAttrName, aAttrValue, aIsLocalized ); + } + else if ( aIndex == context->NumAttributes() ) + { + // "id" -> internal attribute, convert to string. + MenuEngId::AsString( context->Id(), iBuf ); + aAttrName.Set( KMenuAttrId() ); + aAttrValue.Set( iBuf ); + aIsLocalized = EFalse; + } + else + { + // "flags" -> internal attribute, convert to string. + __ASSERT_DEBUG( context->Flags( ETrue ), User::Invariant() ); + MenuEngFlags::AsString( context->Flags( ETrue ), iBuf ); + aAttrName.Set( KMenuAttrFlags() ); + aAttrValue.Set( iBuf ); + aIsLocalized = EFalse; + } + } + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactory::AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue ) + { + CGECODefaultObjectFactory::AttributeDetailsL( aIndex, aAttrName, aAttrValue); + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::HasTextData +// --------------------------------------------------------- +// +TBool CMenuEngObjectFactory::HasTextData() + { + return EFalse; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactory::TextDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactory::TextDetailsL +( TPtrC& /*aText*/, TBool& /*aIsLocalized*/ ) + { + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/engsrc/menuengobjectfactoryproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/engsrc/menuengobjectfactoryproxy.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuengobjectfactoryproxy.h" +#include "menuengobjectfactory.h" +#include "menuenglegacyobjectfactory.h" +#include "menuengobject.h" + +_LIT( KLegacyTypeData, "appshell:data" ); ///< Legacy data type. +_LIT( KMenuAttrVersion, "version" ); ///< Version attribute. +LOCAL_D const TInt KSmallestMajorVersion = 5; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::~CMenuEngObjectFactoryProxy +// --------------------------------------------------------- +// +CMenuEngObjectFactoryProxy::~CMenuEngObjectFactoryProxy() + { + delete iLegacyFactory; + delete iObjFactory; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::NewL +// --------------------------------------------------------- +// +CMenuEngObjectFactoryProxy* CMenuEngObjectFactoryProxy::NewL( CMenuEng& aEng ) + { + CMenuEngObjectFactoryProxy* factory = + new (ELeave) CMenuEngObjectFactoryProxy( aEng ); + CleanupStack::PushL( factory ); + factory->ConstructL(); + CleanupStack::Pop( factory ); + return factory; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::CMenuEngObjectFactoryProxy +// --------------------------------------------------------- +// +CMenuEngObjectFactoryProxy::CMenuEngObjectFactoryProxy( CMenuEng& aEng ) +: iEng( aEng ) + { + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::ConstructL +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::ConstructL() + { + iObjFactory = CMenuEngObjectFactory::NewL( iEng ); + // iLegacyFactory is created only when needed + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::SupportLegacyFormat +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::SupportLegacyFormat( TBool aSupport ) + { + iSupportLegacyFormat = aSupport; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::SupportLegacyFormat +// --------------------------------------------------------- +// +TBool CMenuEngObjectFactoryProxy::IsLegacyFormat() + { + return iParsingInLegacyFormat; + } + + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::Reset +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::Reset() + { + iSupportLegacyFormat = EFalse; + delete iLegacyFactory; + iLegacyFactory = 0; + iParsingInLegacyFormat = EFalse; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::GetContentObjectAndSetContextL +// Note: due to XCFW no hierarcy is seen from the factory, +// thus it is ensured that only one 'data' node can exist. +// --------------------------------------------------------- +// +CGECOObjectBase* CMenuEngObjectFactoryProxy::GetContentObjectAndSetContextL +( const TDesC& aTypeIdentifier ) + { + CGECOObjectBase* object = 0; + if( iParsingInLegacyFormat ) + { + __ASSERT_DEBUG( iLegacyFactory, User::Invariant() ); + object = iLegacyFactory->GetContentObjectAndSetContextL( aTypeIdentifier ); + } + else + { + // If there is a legacy 'data' node, it is always saved with new prefix. + TPtrC type( aTypeIdentifier ); + if( iSupportLegacyFormat && aTypeIdentifier == KLegacyTypeData ) + { + type.Set( KMenuTypeData ); + } + object = iObjFactory->GetContentObjectAndSetContextL( type ); + } + // Do not call SetContext( object ); because it forwards the call! + iContext = object; + return object; + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::InitializeObjectL +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::InitializeObjectL +( MGECOAttributeProvider& aAttributeProvider ) + { + // check the 'data' node's version identifier. If the version is + // less than 5.0, then the factory will function in legacy mode + // until parsing completed (see CMenuEng::HandleEngineEventL). + CMenuEngObject* object = (CMenuEngObject*)iContext; + if ( iSupportLegacyFormat && object->Type() == KMenuTypeData ) + { + iParsingInLegacyFormat = EFalse; // By default + TPtrC name; + TPtrC value; + TBool localized; + const TInt count = aAttributeProvider.NumAttributes(); + for ( TInt i = 0; i < count; i++ ) + { + aAttributeProvider.AttributeDetailsL( i, name, value, localized ); + if ( name == KMenuAttrVersion ) + { + // Format is: . + TReal32 version( 0. ); + TLex lex( value ); + const TInt err = lex.Val( version, TChar('.') ); + if ( !err && version < KSmallestMajorVersion ) + { + // Considered as legacy xml format + if( !iLegacyFactory ) + { + iLegacyFactory = CMenuEngLegacyObjectFactory::NewL( iEng ); + } + iParsingInLegacyFormat = ETrue; + } + break; + } + } + } + + CGECODefaultObjectFactory::InitializeObjectL(aAttributeProvider); + if( iParsingInLegacyFormat ) + { + __ASSERT_DEBUG( iLegacyFactory, User::Invariant() ); + iLegacyFactory->InitializeObjectL( aAttributeProvider ); + } + else + { + iObjFactory->InitializeObjectL( aAttributeProvider ); + } + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::SetContext +// --------------------------------------------------------- +// +TInt CMenuEngObjectFactoryProxy::SetContext( CGECOObjectBase* aContext ) + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + iContext = aContext; + return iObjFactory->SetContext( aContext ); + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::NumAttributes +// --------------------------------------------------------- +// +TInt CMenuEngObjectFactoryProxy::NumAttributes() + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + return iObjFactory->NumAttributes(); + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue, + TBool& aIsLocalized ) + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + iObjFactory->AttributeDetailsL( aIndex, aAttrName, aAttrValue, aIsLocalized ); + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::AttributeDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::AttributeDetailsL( + const TInt aIndex, + TPtrC& aAttrName, + TPtrC& aAttrValue ) + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + TRAPD( err, CGECODefaultObjectFactory::AttributeDetailsL( + aIndex, + aAttrName, + aAttrValue ) ); + if( KErrNotFound==err ) + { + TBool dummy = EFalse; + AttributeDetailsL( aIndex, aAttrName, aAttrValue, dummy ); + } + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::HasTextData +// --------------------------------------------------------- +// +TBool CMenuEngObjectFactoryProxy::HasTextData() + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + return iObjFactory->HasTextData(); + } + +// --------------------------------------------------------- +// CMenuEngObjectFactoryProxy::TextDetailsL +// --------------------------------------------------------- +// +void CMenuEngObjectFactoryProxy::TextDetailsL +( TPtrC& aText, TBool& aIsLocalized ) + { + __ASSERT_DEBUG( !iLegacyFactory, User::Invariant() ); + iObjFactory->TextDetailsL( aText, aIsLocalized ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/extinc/mcssathandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/extinc/mcssathandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -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 000000000000 -r 79c6a41cd166 menucontentsrv/extinc/mcssatnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/extinc/mcssatnotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 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: +* Central Repository notifier and callback +* +*/ + + +#ifndef CMCSSATNOTIFIER_H +#define CMCSSATNOTIFIER_H + +// INCLUDES +#include +#include + +/* +* Callback for notifier. +*/ +class MMcsSATNotifierCallback + { + public: + + /** + * SATChangeL is called when the subscribed key has been changed + * + */ + virtual void SATChangeL() = 0; + + }; + + +// FORWARD DECLARATIONS +/** + * Central repository notifier + */ +class CMcsSatNotifier : public CActive + { + public: // Construction and destruction + + /** + * Creates an instance of CMenuSatNotifier implementation. + * @param aCallBack Reference to notifier interface + * @param aCategory application uid + * @param aKey key for central repository + */ + IMPORT_C static CMcsSatNotifier* NewL( MMcsSATNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ); + + /** + * Destructor. + */ + virtual ~CMcsSatNotifier(); + + + private: // From base classes + + /** + * From CActive. + */ + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + + private: + + // Constructor + CMcsSatNotifier( MMcsSATNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // User side interface to Publish & Subscribe. + RProperty iProperty; + + // Interface for notifying changes in SAT + MMcsSATNotifierCallback* iCallback; + + // category uid + TUid iCategory; + + // key identifier + TUint iKey; + + }; + +#endif // CMCSSATNOTIFIER_H + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/extsrc/mcsmenuiconutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/extsrc/mcsmenuiconutility.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,463 @@ +/* +* 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 requesting raw bitmaps +* Version : %version: 11 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mcssathandler.h" + +//#include "mcsextendedmenuitem.h" +#include "mcsmenuiconutility.h" +#include + +// Constants +_LIT( KMifIconPath, "\\resource\\apps\\" ); +const TUint32 KMifIconPathLenght = 18; +const TInt KJavaIconWidth = 88; // Java icon default width +const TInt KJavaIconHeight = 88; // Java icon default height + + + +// ================= LOCAL FUNCTIONS ======================== + + +// ----------------------------------------------------------------------------- +// CreateMbmIconLC2 - Creates bitmap +// ----------------------------------------------------------------------------- +// +LOCAL_C TBool CreateMbmIconLC2(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask, const TDesC& aAppUid ) + { + TBool ret = EFalse; + TSize size( KJavaIconWidth, KJavaIconHeight ); + + aBitmap = NULL; + aMask = NULL; + + RApaLsSession lsSession; + User::LeaveIfError( lsSession.Connect() ); + CleanupClosePushL( lsSession ); // lsSession (1) + + TUint appUidUint; + + // Gets app TUid from aAppUid descryptor + User::LeaveIfError( MenuUtils::GetTUint( aAppUid, appUidUint ) ); + TUid appUid( TUid::Uid( appUidUint) ); + + // Tries to find icon with default size. + CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC(); + TInt apaErr = lsSession.GetAppIcon( appUid, size, *apaBmp ); + if ( apaErr == KErrNotFound ) + { + // Icon not found. + // AppArc tries to find equal to or smaller than the specified size. + // Get all icon sizes and search for next bigger icon size. + CArrayFixFlat* sizes = new(ELeave) CArrayFixFlat( 5 ); + apaErr = lsSession.GetAppIconSizes(appUid, *sizes); + if ( !apaErr ) + { + if ( sizes->Count() ) + { + // There are other icon sizes + TInt idx = -1; + TInt square( size.iWidth * size.iHeight ); + for ( TInt i = 0; i < sizes->Count(); i++ ) + { + if ( ( sizes->At( i ).iWidth * sizes->At( i ).iHeight ) > square ) + { + idx = i; + break; + } + } + + if ( idx >= 0 ) + { + // Next bigger icon. + size = sizes->At( idx ); + } + else + { + // Just get the first available. + size = sizes->At( 0 ); + } + } + + // Gets icon with new size. + apaErr = lsSession.GetAppIcon( appUid, size, *apaBmp ); + } + + // Reset and destroy. + sizes->Reset(); + delete sizes; + sizes = NULL; + } + + // Some builds requires brackets + // logical correction was also made + if ( ( apaErr != KErrNone ) && + ( apaErr != KErrNotFound ) && + ( apaErr != KErrNotSupported ) ) + { + // System wide error. + User::LeaveIfError( apaErr ); + } + + if( !apaErr && + apaBmp && + apaBmp->Mask() && + apaBmp->Handle() && + apaBmp->Mask()->Handle()) + { + // AIF-based icon + CFbsBitmap* iconOwnedBitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( iconOwnedBitmap ); // iob (3) + CFbsBitmap* iconOwnedMask = new (ELeave) CFbsBitmap(); + CleanupStack::PushL( iconOwnedMask ); // iom (4) + User::LeaveIfError( + iconOwnedBitmap->Duplicate( apaBmp->Handle() ) ); + User::LeaveIfError( + iconOwnedMask->Duplicate( apaBmp->Mask()->Handle() ) ); + + CAknIcon* tmpIcon = CAknIcon::NewL(); + + // Ownership is transferred + tmpIcon->SetBitmap( iconOwnedBitmap ); + tmpIcon->SetMask( iconOwnedMask ); + // Ownership of tmpIcon is transferred + CAknIcon* appIcon = AknIconUtils::CreateIconL( tmpIcon ); + CleanupStack::Pop( 2 ); // iom, iob (2) + + aBitmap = appIcon->Bitmap(); + aMask = appIcon->Mask(); + AknInternalIconUtils::SetAppIcon(aBitmap); + + // Detach and delete + appIcon->SetBitmap( NULL ); + appIcon->SetMask( NULL ); + delete appIcon; + + ret = ETrue; + } + + CleanupStack::PopAndDestroy( 2 ); // lsSession, apaBmp (0) + + // These are both safe + if ( aBitmap ) + { + CleanupStack::PushL( aBitmap ); // (1) + CleanupStack::PushL( aMask ); // (2) + } + + return ret; + } + + +// --------------------------------------------------------- +// ParseIconFilePathL +// --------------------------------------------------------- +// + +LOCAL_C void ParseIconFilePathL( const TDesC& aIconFilePath, RBuf& aIconFilePathBuf ) + { + TParsePtrC fileParsePtrC(aIconFilePath); + if( !fileParsePtrC.PathPresent()) + { + aIconFilePathBuf.CreateL(KMifIconPathLenght + aIconFilePath.Length()); + aIconFilePathBuf.Append(KMifIconPath); + } + else + { + aIconFilePathBuf.CreateL(aIconFilePath.Length()); + } + aIconFilePathBuf.Append(aIconFilePath); + } + +// --------------------------------------------------------- +// LoadSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* LoadSkinL( TUint majorId, TUint minorId ) + { + CAknIcon* icon = NULL; + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + TAknsItemID skinId; + skinId.Set( majorId, minorId ); + + AknsUtils::CreateIconLC( + AknsUtils::SkinInstance(), + skinId, + bitmap, + mask, + KNullDesC, + KErrNotFound, + KErrNotFound ); + + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + + // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order + CleanupStack::Pop( 2 ); + + return icon; + } + +// --------------------------------------------------------- +// LoadSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* LoadAppSkinL( TUid& aAppUid ) + { + CAknIcon* icon = NULL; + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TRAPD( err, + { + AknsUtils::CreateAppIconLC( skin, aAppUid, EAknsAppIconTypeList, bitmap, mask ); + CleanupStack::Pop(2); //for trap + } + ); + if( err == KErrNone ) + { + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + } + return icon; + } + +// --------------------------------------------------------- +// GetSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetSkinL( CMenuItem& aItem ) + { + CAknIcon* icon = NULL; + TUint majorId( 0 ); + TUint minorId( 0 ); + TPtrC idString( KNullDesC ); + TBool attrExists; + + idString.Set( aItem.GetAttributeL( KMenuAttrIconSkinMajorId, attrExists ) ); + if ( attrExists && idString.Length() ) + { + User::LeaveIfError( MenuUtils::GetTUint( idString, majorId ) ); + } + else + { + return NULL; + } + + idString.Set( aItem.GetAttributeL( KMenuAttrIconSkinMinorId, attrExists ) ); + if ( attrExists && idString.Length() ) + { + User::LeaveIfError( MenuUtils::GetTUint( idString, minorId ) ); + } + else + { + return NULL; + } + + icon = LoadSkinL( majorId, minorId ); + + return icon; + } + +// --------------------------------------------------------- +// GetIconL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetIconL( CMenuItem& aItem ) + { + CAknIcon* icon = NULL; + TUint iconId( 0 ); + TUint maskId( 0 ); + TPtrC attrStr( KNullDesC ); + TBool attrExists; + + TPtrC iconFilePath( aItem.GetAttributeL( KMenuAttrIconFile, attrExists ) ); + + if ( !attrExists ) + { + return NULL; + } + + attrStr.Set( aItem.GetAttributeL( KMenuAttrIconId, attrExists ) ); + if ( attrExists ) + { + User::LeaveIfError( MenuUtils::GetTUint( attrStr, iconId ) ); + } + else + { + return NULL; + } + + attrStr.Set( aItem.GetAttributeL( KMenuAttrMaskId, attrExists ) ); + if ( attrExists ) + { + User::LeaveIfError( MenuUtils::GetTUint( attrStr, maskId ) ); + } + else + { + return NULL; + } + + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + + RBuf pathBuf; + pathBuf.CleanupClosePushL(); + ParseIconFilePathL(iconFilePath, pathBuf); + + AknIconUtils::CreateIconLC( bitmap, mask, pathBuf, iconId, maskId ); + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + CleanupStack::Pop( 2 ); + + CleanupStack::PopAndDestroy( &pathBuf ); + + return icon; + } + + + + +// --------------------------------------------------------- +// GetDefaultSkinL +// --------------------------------------------------------- +// +LOCAL_C CAknIcon* GetDefaultSkinL( CMenuItem& aItem ) + { + CAknIcon* icon = NULL; + + if ( KErrNone == aItem.Type().Compare( KMenuTypeApp ) ) + { + TBool attrExists( EFalse ); + TPtrC appUidDes( aItem.GetAttributeL( KMenuAttrUid, attrExists ) ); + if( appUidDes == KMenuSatUiUid ) + { + CMcsSatHandler* satHandler = CMcsSatHandler::NewL(); + CleanupStack::PushL( satHandler ); + icon = satHandler->LoadIconL(); + CleanupStack::PopAndDestroy( satHandler ); + } + if( !icon ) + { + if( aItem.GetAttributeL( KMenuAttrNative, attrExists ) == KMenuFalse ) + { + CFbsBitmap* bitmap( 0 ); + CFbsBitmap* mask( 0 ); + //for native + if( CreateMbmIconLC2( bitmap, mask, appUidDes ) ) + { + icon = CAknIcon::NewL(); + icon->SetBitmap( bitmap ); + icon->SetMask( mask ); + CleanupStack::Pop( 2 ); + } + } + if( !icon ) + { + TUint appUid; + TUid uid; + TInt err = MenuUtils::GetTUint( appUidDes, appUid ); + if ( !err ) + { + uid = TUid::Uid( appUid ); + icon = LoadAppSkinL( uid ); + } + } + if( !icon ) + { + icon = LoadSkinL( + KAknsIIDQgnMenuUnknownLst.iMajor, + KAknsIIDQgnMenuUnknownLst.iMinor ); + } + } + } + else if ( KErrNone == aItem.Type().Compare( KMenuTypeFolder ) ) + { + TUint childrenCount; + TBool attrExists( EFalse ); + TInt err = MenuUtils::GetTUint( + aItem.GetAttributeL( KChildrenCount, attrExists ), childrenCount ); + + if( childrenCount > 0 ) + { + icon = LoadSkinL( + KAknsIIDQgnPropFolderAppsMedium.iMajor, + KAknsIIDQgnPropFolderAppsMedium.iMinor ); + } + else + { + icon = LoadSkinL( + KAknsIIDQgnMenuFolderEmpty.iMajor, + KAknsIIDQgnMenuFolderEmpty.iMinor ); + + } + + } + + return icon; + } + +// ================= MEMBER FUNCTIONS ======================= + + +// --------------------------------------------------------- +// MenuIconUtility::GetItemIconL +// --------------------------------------------------------- +// +EXPORT_C CAknIcon* MenuIconUtility::GetItemIconL( CMenuItem& aItem ) + { + CAknIcon* icon = NULL; + // Try to get the skin of the item + TRAP_IGNORE(icon = GetSkinL( aItem )); + if ( icon ) + { + return icon; + } + + // Try to get the icon of the item (skin failed) + TRAP_IGNORE(icon = GetIconL( aItem )); + if ( icon ) + { + return icon; + } + + // Return a default (skin and icon failed) + icon = GetDefaultSkinL( aItem ); + + return icon; + } + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/extsrc/mcssathandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/extsrc/mcssathandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2002-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: Used for receive SIM Application name, icon or +* visibility information. +* +*/ + + + +// INCLUDE FILES + +#include +// From SatClient +#include "mcsdef.h" +#include + +#include "mcssathandler.h" + + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CMcsSatHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMcsSatHandler* CMcsSatHandler::NewL() + { + CMcsSatHandler* self = new( ELeave ) CMcsSatHandler( ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CMcsSatHandler::~CMcsSatHandler() + { + iSatIcon.Close(); + iSatSession.Close(); + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +EXPORT_C CAknIcon* CMcsSatHandler::LoadIconL() + { + TInt iconId( KErrNone ); + User::LeaveIfError( RProperty::Get( KCRUidMenu, KMenuSatUIIconId, iconId ) ); + CAknIcon* icon = CAknIcon::NewL(); + CleanupStack::PushL(icon); + if( iconId != KErrNone ) + { + RIconEf iIconEf; + iSatIcon.GetIconInfoL( TUint8( iconId ), iIconEf ); + CleanupClosePushL( iIconEf ); + CFbsBitmap* bitmap = GetBitmapL( iIconEf ); + if( !bitmap ) + { + CFbsBitmap* mask( NULL ); + CleanupStack::PushL( mask ); + + icon->SetBitmap( bitmap ); + // create and set mask + User::LeaveIfError( mask->Create( bitmap->SizeInPixels(), EGray256 ) ); + + CFbsBitmapDevice* maskDevice = CFbsBitmapDevice::NewL( mask ); + CleanupStack::PushL( maskDevice ); + CFbsBitGc* maskGc; + User::LeaveIfError( maskDevice->CreateContext( maskGc ) ); + CleanupStack::PushL( maskGc ); + maskGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + maskGc->SetDrawMode( CGraphicsContext::EDrawModePEN ); + maskGc->SetBrushColor( KRgbBlack ); + maskGc->Clear(); + maskGc->SetBrushColor( KRgbWhite ); + maskGc->DrawRect( TRect( TPoint( ), bitmap->SizeInPixels() ) ); + icon->SetMask( mask ); + + CleanupStack::PopAndDestroy( maskGc ); + CleanupStack::PopAndDestroy( maskDevice ); + CleanupStack::Pop( mask ); + } + CleanupStack::PopAndDestroy( &iIconEf ); // iIconEf + CleanupStack::Pop( icon ); + } + else + { + CleanupStack::PopAndDestroy( icon ); + icon = NULL; + } + return icon; + } + +// --------------------------------------------------------------------------- +// CMenuSATHandler::GetName +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CMcsSatHandler::GetName( TDes& aName ) + { + return RProperty::Get( KCRUidMenu, KMenuSatUIName, aName ); + } + +// --------------------------------------------------------------------------- +// CMenuSATHandler::GetVisibility +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CMcsSatHandler::CheckVisibility() + { + TInt visibility( KErrNone ); + TInt err = RProperty::Get( KCRUidMenu, KMenuShowSatUI, visibility ); + if( err == KErrNone && visibility ) + return ETrue; + else + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMcsSatHandler::CMcsSatHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMcsSatHandler::CMcsSatHandler() + { + } + +// ----------------------------------------------------------------------------- +// CMcsSatHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMcsSatHandler::ConstructL() + { + iSatSession.ConnectL(); + iSatIcon.OpenL( iSatSession ); + } + +// --------------------------------------------------------------------------- +// CMenuSATHandler::GetVisibility +// --------------------------------------------------------------------------- +// +CFbsBitmap* CMcsSatHandler::GetBitmapL( const RIconEf& aIconEF ) + { + TInt selectedIconIndex( KErrNotFound ); + TSize selectedIconSize( 0, 0 ); + CFbsBitmap* bitmap( NULL ); + for ( TInt i = 0; i < aIconEF.Count(); ++i ) + { + if( ( aIconEF[i].IconSize().iHeight * aIconEF[i].IconSize().iWidth ) >= + ( selectedIconSize.iHeight * selectedIconSize.iWidth ) ) + if( bitmap ) + { + delete bitmap; + bitmap = NULL; + } + // test and select index of iIcon which is not too big + TRAPD( bitmapErr, bitmap = iSatIcon.GetIconL( aIconEF[ i ] ) ); + if( !bitmapErr && bitmap ) //!iBitmap if iIcon is too big + { + selectedIconSize = aIconEF[i].IconSize(); + selectedIconIndex = i; + } + else if( bitmapErr ) + { + User::Leave( bitmapErr ); + } + } + if( selectedIconIndex != KErrNotFound ) + { + if( bitmap ) + { + delete bitmap; + bitmap = NULL; + } + TRAPD( bitmapErr, bitmap = iSatIcon.GetIconL( aIconEF[ selectedIconIndex ] ) ); + User::LeaveIfError( bitmapErr ); + return bitmap; + } + else + { + return NULL; + } + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/extsrc/mcssatnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/extsrc/mcssatnotifier.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDES +#include "mcssatnotifier.h" + +// ============================ MEMBER FUNCTIONS ============================= +// ----------------------------------------------------------------------------- +// CMcsSatNotifier::CMcsSatNotifier +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMcsSatNotifier::CMcsSatNotifier( MMcsSATNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ) : CActive( EPriorityNormal ) + { + CActiveScheduler::Add( this ); + + iCallback = aCallback; + iCategory = aCategory; + iKey = aKey; + } + +// ----------------------------------------------------------------------------- +// CMcsSatNotifier::ConstructL +// S2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CMcsSatNotifier::ConstructL() + { + // Prepare automatically + iProperty.Attach( iCategory, iKey ); + SetActive(); + iStatus = KRequestPending; + iProperty.Subscribe( iStatus ); + } + +// --------------------------------------------------------------------------- +// CMcsSatNotifier::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CMcsSatNotifier* CMcsSatNotifier::NewL( MMcsSATNotifierCallback* aCallback, + TUid aCategory, + TUint aKey ) + { + CMcsSatNotifier* self = new (ELeave) CMcsSatNotifier( aCallback, + aCategory, + aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// --------------------------------------------------------------------------- +// CMcsSatNotifier::~CMcsSatNotifier +// --------------------------------------------------------------------------- +// + +CMcsSatNotifier::~CMcsSatNotifier() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CMcsSatNotifier::DoCancel +// --------------------------------------------------------------------------- +// +void CMcsSatNotifier::DoCancel() + { + iProperty.Cancel(); + } + +// --------------------------------------------------------------------------- +// CMcsSatNotifier::RunError +// --------------------------------------------------------------------------- +// +TInt CMcsSatNotifier::RunError( TInt /*aError*/ ) + { + // Prime the active object + SetActive(); + iStatus = KRequestPending; + iProperty.Subscribe( iStatus ); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMcsSatNotifier::RunL +// --------------------------------------------------------------------------- +// +void CMcsSatNotifier::RunL() + { + // Filter out cancel status + if( iStatus != KErrCancel ) + { + // Re-issue request before notifying + SetActive(); + iStatus = KRequestPending; + iProperty.Subscribe( iStatus ); + iCallback->SATChangeL(); + } + else + { + // For PC-Lint + } + } +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* 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: Build information file for project MenuContentService +* Version : %version: sa1spcx1#22 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#include + +PRJ_PLATFORMS +ARMV5 WINSCW +#include "../menusatinterface/group/bld.inf" + +PRJ_MMPFILES +mcssathandler.mmp +mcsmenuutils.mmp +mcsmenueng.mmp +mcsmenu.mmp +mcsmenusrv.mmp +mcsmenuhandler.mmp +mcsextendedmenu.mmp + +PRJ_EXPORTS +../rom/mcs.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mcs.iby) +../data/backup_registration.xml z:/private/200113dd/backup_registration.xml + +// Generic configuration interface for component cenrep settings +../conf/s60mcs.confml MW_LAYER_CONFML(s60mcs.confml) +../conf/s60mcs_101F8847.crml MW_LAYER_CRML(s60mcs_101F8847.crml) + +// export header needed for mcssapi client +../extinc/mcssathandler.h |../../inc/mcssathandler.h + +../inc/mcsmenusapi.h MW_LAYER_PLATFORM_EXPORT_PATH(mcsmenusapi.h) diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsextendedmenu.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsextendedmenu.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,56 @@ +/* +* 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: +* Version : %version: sa1spcx1#10.1.4 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET mcsextendedmenu.dll +TARGETTYPE dll +UID 0x1000008D 0x200113E2 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../extsrc +SOURCE mcsmenuiconutility.cpp + + + +USERINCLUDE ../extinc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY aknskins.lib +LIBRARY aknicon.lib +LIBRARY mcsmenu.lib +LIBRARY mcsmenuutils.lib +//LIBRARY ws32.lib +LIBRARY fbscli.lib +LIBRARY mcssathandler.lib avkon.lib +LIBRARY efsrv.lib +LIBRARY apgrfx.lib liwServiceHandler.lib + + +//LIBRARY apgrfx.lib +//LIBRARY egul.lib +//LIBRARY apparc.lib +//LIBRARY javaregistry.lib +//LIBRARY caf.lib +//LIBRARY cafutils.lib +//LIBRARY SatClient.lib +//LIBRARY bitgdi.lib diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsmenu.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsmenu.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,130 @@ +/* +* 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: +* Version : %version: sa1spcx1#11.1.7.1.6 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include "../inc/menuuid.hrh" + +TARGET mcsmenu.dll +TARGETTYPE dll +UID 0x1000008D MENU_DLL_UID3 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +// Client and common code +SOURCEPATH ../src +SOURCE menu.cpp +SOURCE menusapi.cpp +SOURCE menuitem.cpp +SOURCE menunotifier.cpp +SOURCE menuoperation.cpp +SOURCE menubuf.cpp +SOURCE menuutil.cpp +SOURCE menuitemattr.cpp +SOURCE menufilter.cpp +SOURCE menuclientoperation.cpp +SOURCE menucompletedoperation.cpp +SOURCE menuhandlereng.cpp +SOURCE menuhandler.cpp + +// Server code +SOURCEPATH ../srvsrc +SOURCE menusrvsession.cpp +SOURCE menusrv.cpp +SOURCE menusrvobject.cpp +SOURCE menusrvoperation.cpp +SOURCE menusrvobjectfilter.cpp +SOURCE menusrvnotifier.cpp +SOURCE menusrvbuf.cpp +SOURCE menusrvstream.cpp +SOURCE menusrveng.cpp +SOURCE menusrvengutils.cpp +SOURCE timeout.cpp +SOURCE menusrvappscanner.cpp +SOURCE menusrvfoldercrnotifier.cpp +SOURCE menusrvmmchistory.cpp +SOURCE mcsrunningappshandler.cpp +SOURCE mcsrunningappswgmonitor.cpp +SOURCE mcsrunningappsfswmonitor.cpp +SOURCE mcsrunningappshiddenattrscanner.cpp +SOURCE mcsrunningappsaddremovehandler.cpp +SOURCE mcssatmonitor.cpp +SOURCE mcsdrmhandler.cpp +SOURCE mcscachehandler.cpp +SOURCE menusrvattr.cpp +SOURCE mcsdrmobserver.cpp +SOURCE mcsdrmscanner.cpp +SOURCE mcsdrmobservermanager.cpp +SOURCE mcschildrenhandler.cpp +SOURCE mcschildrenscanner.cpp + +SOURCE mcsmmcobserver.cpp +SOURCE mcsfreespaceobserver.cpp +SOURCE mcsinstallnotifier.cpp +SOURCE mcssuiteobjectattr.cpp +SOURCE mcssuiteobject.cpp +SOURCE mcssuiteobjectfactory.cpp +SOURCE mcssuiteparser.cpp +SOURCE menusvrsuite.cpp +SOURCE mcssuitehandler.cpp + +SOURCE mcsgetlistcreatorinterface.cpp +SOURCE mcsgetlisthandler.cpp +SOURCE mcsgetlistflatcreator.cpp +SOURCE mcsgetlisttreecreator.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../srvinc +USERINCLUDE ../enginc +USERINCLUDE ../extinc +// it must remain like this as JAVA API is published in app layer +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY ecom.lib +LIBRARY apparc.lib +LIBRARY apgrfx.lib +LIBRARY platformenv.lib +LIBRARY mcsmenueng.lib +LIBRARY mcsmenuutils.lib +LIBRARY flogger.lib +LIBRARY centralrepository.lib +LIBRARY CenRepNotifHandler.lib +LIBRARY mcssathandler.lib +LIBRARY sisregistryclient.lib +LIBRARY fbscli.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY drmserverinterfaces.lib +LIBRARY javaregistryclient.lib +LIBRARY drmhelper.lib +LIBRARY drmrightsinfo.lib +LIBRARY sysutil.lib + +LIBRARY ws32.lib +LIBRARY bafl.lib +LIBRARY WidgetRegistryClient.lib +LIBRARY featmgr.lib +LIBRARY liwServiceHandler.lib +LIBRARY xcfw.lib + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsmenueng.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsmenueng.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include "../inc/menuuid.hrh" + +TARGET mcsmenueng.dll +TARGETTYPE dll +UID 0x1000008D MENU_ENG_UID3 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../engsrc +SOURCE menueng.cpp +SOURCE menuengidmanager.cpp +SOURCE menuenglegacyobjectfactory.cpp +SOURCE menuengobjectattr.cpp +SOURCE menuengobject.cpp +SOURCE menuengobjectfactory.cpp +SOURCE menuengobjectfactoryproxy.cpp +SOURCE menuengflags.cpp +SOURCE menuengitemlister.cpp +SOURCE menuengdeletionchecker.cpp +SOURCE menuengidmanagerinit.cpp +SOURCE menuengidsetter.cpp +SOURCE menuengidcollector.cpp + +USERINCLUDE ../enginc +USERINCLUDE ../inc + +// APP layer system include is needed here because xcfw_api has +// dependency to app layer +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY xcfw.lib +LIBRARY platformenv.lib +LIBRARY flogger.lib +LIBRARY sysutil.lib +LIBRARY centralrepository.lib diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsmenuhandler.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsmenuhandler.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET mcsmenuhandler.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x200113DE + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../handlersrc + +SOURCE menuhandlerproxy.cpp +SOURCE menuapphandler.cpp +SOURCE menuurlhandler.cpp +SOURCE menuuninstalloperation.cpp +SOURCE menulinkhandler.cpp + +USERINCLUDE ../inc +USERINCLUDE ../handlerinc + +// it must remain like this as JAVA API is published in app layer +SYSTEMINCLUDE /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY swinstcli.lib +LIBRARY mcsmenu.lib +LIBRARY mcsmenuutils.lib +LIBRARY apgrfx.lib +LIBRARY ws32.lib +LIBRARY javaregistryclient.lib +LIBRARY apparc.lib +LIBRARY sisregistryclient.lib +LIBRARY widgetregistryclient.lib +LIBRARY eikcore.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib + +SOURCEPATH ../data +START RESOURCE 200113DE.rss +LANG sc +TARGET mcsmenuhandler.rsc +END // RESOURCE + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsmenusrv.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsmenusrv.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,49 @@ +/* +* 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: +* Version : %version: sa1spcx1#5.1.7 % << Don't touch! Updated by Synergy at check-out. +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include "../inc/menuuid.hrh" + +EPOCHEAPSIZE 4000 3000000 + +TARGET mcsmenuserver.exe +TARGETTYPE exe +UID 0x1000008c MENU_SRV_UID3 +CAPABILITY AllFiles ProtServ ReadDeviceData +VENDORID VID_DEFAULT + +EPOCSTACKSIZE 0x5000 + +SOURCEPATH ../srvsrc +SOURCE menusrvmain.cpp + + +USERINCLUDE ../srvinc +USERINCLUDE ../enginc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY mcsmenu.lib +LIBRARY mcsmenuutils.lib + + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcsmenuutils.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcsmenuutils.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include "../inc/menuuid.hrh" + +TARGET mcsmenuutils.dll +TARGETTYPE dll +UID 0x1000008D 0x2001CB55 +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../utilssrc +SOURCE mcsmenuutils.cpp + +USERINCLUDE ../utilsinc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/group/mcssathandler.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/mcssathandler.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,42 @@ +/* +* 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: +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET mcssathandler.dll +TARGETTYPE dll +UID 0x1000008D 0x2001CB7B +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../extsrc +SOURCE mcssathandler.cpp +SOURCE mcssatnotifier.cpp + + +USERINCLUDE ../extinc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY aknicon.lib +LIBRARY SatClient.lib +LIBRARY fbscli.lib +LIBRARY bitgdi.lib + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlerinc/menuapphandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlerinc/menuapphandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 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 __MENUAPPHANDLER_H__ +#define __MENUAPPHANDLER_H__ + +#include "mcsmenuhandlerplugin.h" + +#include + +class CEikonEnv; + +/** +* Handler for menu items of type "menu:app". +*/ +NONSHARABLE_CLASS( CMenuAppHandler ): public CMenuHandlerPlugin + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuAppHandler(); + + /** + * Two-phased constructor. Leaves on failure. + * @param aMenu Menu. + * @return The constructed object. + */ + static CMenuAppHandler* NewL( RMenu &aMenu ); + +protected: // construction + + /** + * Constructor. + * @param aMenu Menu. + */ + CMenuAppHandler( RMenu &aMenu ); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +public: // from CMenuHandler + + /** + * Query support for item type. + * @param aType Type. + * @return ETrue if handler supports this type, EFalse otherwise. + */ + TBool SupportsType( const TDesC& aType ); + + /** + * Handle command. + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: // internal + + void LaunchApplicationL( const TUid aUid, const TDesC8 &aParam, TInt aViewId ); + +private: // data + + CEikonEnv* iEikEnv; + + }; + +#endif // __MENUAPPHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlerinc/menulinkhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlerinc/menulinkhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 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 __MENU_LINK_HANDLER_H__ +#define __MENU_LINK_HANDLER_H__ + +#include +#include "mcsmenuhandlerplugin.h" + +/** +* Handler for menu items of type "menu:link". +*/ +NONSHARABLE_CLASS( CMenuLinkHandler ): public CMenuHandlerPlugin + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuLinkHandler(); + + /** + * Two-phased constructor. Leaves on failure. + * @param aMenu Menu. + * @return The constructed object. + */ + static CMenuLinkHandler* NewL( RMenu &aMenu ); + +protected: // construction + + /** + * Constructor. + * @param aMenu Menu. + */ + CMenuLinkHandler( RMenu &aMenu ); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +public: // from CMenuHandler + + /** + * Query support for item type. + * @param aType Type. + * @return ETrue if handler supports this type, EFalse otherwise. + */ + TBool SupportsType( const TDesC& aType ); + + /** + * Handle command. + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: // data + + }; + +#endif // __MENU_LINK_HANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlerinc/menuuninstalloperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlerinc/menuuninstalloperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 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 __MENUUNINSTALLOPERATION_H__ +#define __MENUUNINSTALLOPERATION_H__ + +#include "mcsmenuoperation.h" + +#include +#include + +class RMenu; +class CMenuItem; + +/** +* Uninstall CMenuOperation +* Encapsulates the functionality of uninstalling an application. +*/ +NONSHARABLE_CLASS( CMenuUninstallOperation ) : public CMenuOperation + { + +public: // construction + + virtual ~CMenuUninstallOperation(); + + static CMenuUninstallOperation* NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + CMenuItem& aItem ); + +private: // construction + + CMenuUninstallOperation( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus ); + + void ConstructL( CMenuItem& aItem ); + + void AppInfoL( const TUid& aAppUid, TPtrC8& aMimeType, TUid& aPackageUid ); + + TBool GetInstallPkgUidL( const TDesC& aAppFullName, TUid& aPackageUid ); + void GetJavaSuitUidL( const TUid& aAppUid, TUid& aPackageUid ); + TBool IsWidgetL( const TUid& aAppUid ); + +private: // from CActive + + void RunL(); + void DoCancel(); + TInt RunError( TInt aError ); + +private: + + enum TUninstState + { + EIdle, + EUninstalling, + ERemoving + } iState; + SwiUI::RSWInstLauncher iUninstaller; + CMenuOperation* iRemoveOperation; + TInt iId; + }; + +#endif // __MENUUNINSTALLOPERATION_H__ \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlerinc/menuurlhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlerinc/menuurlhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 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 __MENUURLHANDLER_H__ +#define __MENUURLHANDLER_H__ + +#include "mcsmenuhandlerplugin.h" + +#include + +// Constants +const TUid KUidBrowser = { 0x10008D39 }; +_LIT( KBrowserPrefix, "4 " ); + +/** +* Handler for menu items of type "menu:app". +*/ +NONSHARABLE_CLASS( CMenuUrlHandler ): public CMenuHandlerPlugin + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CMenuUrlHandler(); + + /** + * Two-phased constructor. Leaves on failure. + * @param aMenu Menu. + * @return The constructed object. + */ + static CMenuUrlHandler* NewL( RMenu &aMenu ); + +protected: // construction + + /** + * Constructor. + * @param aMenu Menu. + */ + CMenuUrlHandler( RMenu &aMenu ); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +public: // from CMenuHandler + + /** + * Query support for item type. + * @param aType Type. + * @return ETrue if handler supports this type, EFalse otherwise. + */ + TBool SupportsType( const TDesC& aType ); + + /** + * Handle command. + * @param aItem Item of supported type. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +private: // internal + + void LaunchUrlL( const TDesC& aUrl ); + +private: // data + + }; + +#endif // __MENUURLHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlersrc/menuapphandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menuapphandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "menuapphandler.h" +#include "mcsmenuitem.h" +#include "menucompletedoperation.h" +#include "menuuninstalloperation.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuAppHandler::~CMenuAppHandler +// --------------------------------------------------------- +// +CMenuAppHandler::~CMenuAppHandler() + { + } + +// --------------------------------------------------------- +// CMenuAppHandler::NewL +// --------------------------------------------------------- +// +CMenuAppHandler* CMenuAppHandler::NewL( RMenu &aMenu ) + { + CMenuAppHandler* handler = new (ELeave) CMenuAppHandler( aMenu ); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; + } + +// --------------------------------------------------------- +// CMenuAppHandler::CMenuAppHandler +// --------------------------------------------------------- +// +CMenuAppHandler::CMenuAppHandler( RMenu &aMenu ) +: CMenuHandlerPlugin( aMenu ) + { + iEikEnv = CEikonEnv::Static(); + } + +// --------------------------------------------------------- +// CMenuAppHandler::ConstructL +// --------------------------------------------------------- +// +void CMenuAppHandler::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------- +// CMenuAppHandler::SupportsType +// --------------------------------------------------------- +// +TBool CMenuAppHandler::SupportsType( const TDesC& aType ) + { + if ( !aType.Compare( KMenuTypeApp() ) ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------- +// CMenuAppHandler::HandleCommandL +// --------------------------------------------------------- +// +CMenuOperation* CMenuAppHandler::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ) + { + if ( aCommand == KMenuCmdOpen() && aItem.Type() == KMenuTypeApp() ) + { + TBool attrExists = ETrue; + TPtrC url = aItem.GetAttributeL( KMenuAttrUid(), attrExists ); + + if ( !attrExists ) + { + User::Leave( KErrCorrupt ); + } + + TUint appUidNo; + TInt err = MenuUtils::GetTUint( url, appUidNo ); + if ( err != KErrNone ) + { + User::Leave( KErrCorrupt ); + } + + TInt viewId; + TPtrC view = aItem.GetAttributeL( KMenuAttrView(), attrExists ); + + if ( attrExists ) + { + err = MenuUtils::GetTUint( view, (TUint &)viewId ); + if( err != KErrNone ) + { + User::Leave( KErrCorrupt ); + } + } + else + { + viewId = -1; + } + + LaunchApplicationL( TUid::Uid( appUidNo ), aParams, viewId ); + + return CMenuCompletedOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + else if ( aCommand == KMenuCmdRemove() && aItem.Type() == KMenuTypeApp() ) + { + return CMenuUninstallOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, aItem ); + } + User::Leave ( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------- +// CMenuAppHandler::LaunchApplicationL +// --------------------------------------------------------- +// +void CMenuAppHandler::LaunchApplicationL( const TUid aUid, const TDesC8 &aParam, TInt aViewId ) + { + if ( aViewId > 0 && iEikEnv ) + { + TUid viewId = TUid::Uid( aViewId ); + TVwsViewId view( aUid, viewId ); + iEikEnv->EikAppUi()->ActivateViewL( view ); + } + else + { + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + + TApaTaskList* taskList = new (ELeave) TApaTaskList( wsSession ); + TApaTask task = taskList->FindApp( aUid ); + + delete taskList; + + if ( task.Exists() ) + { + task.BringToForeground(); + } + else + { + TApaAppInfo appInfo; + TApaAppCapabilityBuf capabilityBuf; + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL( appArcSession ); + + User::LeaveIfError( appArcSession.GetAppInfo( appInfo, aUid ) ); + User::LeaveIfError( appArcSession.GetAppCapability( capabilityBuf, aUid ) ); + + TApaAppCapability& caps = capabilityBuf(); + TFileName appName = appInfo.iFullName; + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appName ); + + if ( caps.iLaunchInBackground ) + { + cmdLine->SetCommandL( EApaCommandBackground ); + } + else + { + cmdLine->SetCommandL( EApaCommandRun ); + } + + cmdLine->SetTailEndL( aParam ); + + User::LeaveIfError( appArcSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( &wsSession ); + } + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlersrc/menuhandlerproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menuhandlerproxy.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "menuapphandler.h" +#include "menuurlhandler.h" +#include "menulinkhandler.h" + +// ============================ LOCAL FUNCTIONS =============================== + +LOCAL_C CMenuHandlerPlugin* AppHandlerNewL( RMenu *aMenu ) + { + return CMenuAppHandler::NewL( *aMenu ); + } + +LOCAL_C CMenuHandlerPlugin* UrlHandlerNewL( RMenu *aMenu ) + { + return CMenuUrlHandler::NewL( *aMenu ); + } + +LOCAL_C CMenuHandlerPlugin* LinkHandlerNewL( RMenu *aMenu ) + { + return CMenuLinkHandler::NewL( *aMenu ); + } + +// ============================ CONSTANTS =============================== + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x200113E0, AppHandlerNewL ), + IMPLEMENTATION_PROXY_ENTRY( 0x200113E1, UrlHandlerNewL ), + IMPLEMENTATION_PROXY_ENTRY( 0x20019595, LinkHandlerNewL ), + }; + +// ============================ GLOBAL FUNCTIONS =============================== + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlersrc/menulinkhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menulinkhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES +#include +#include "menulinkhandler.h" +#include "menuuninstalloperation.h" +#include "mcsdef.h" +#include "mcsmenuitem.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuLinkHandler::~CMenuLinkHandler +// --------------------------------------------------------- +// +CMenuLinkHandler::~CMenuLinkHandler() + { + } + +// --------------------------------------------------------- +// CMenuLinkHandler::NewL +// --------------------------------------------------------- +// +CMenuLinkHandler* CMenuLinkHandler::NewL( RMenu &aMenu ) + { + CMenuLinkHandler* handler = new (ELeave) CMenuLinkHandler( aMenu ); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; + } + +// --------------------------------------------------------- +// CMenuLinkHandler::CMenuLinkHandler +// --------------------------------------------------------- +// +CMenuLinkHandler::CMenuLinkHandler( RMenu &aMenu ) +: CMenuHandlerPlugin( aMenu ) + { + } + +// --------------------------------------------------------- +// CMenuLinkHandler::ConstructL +// --------------------------------------------------------- +// +void CMenuLinkHandler::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------- +// CMenuLinkHandler::SupportsType +// --------------------------------------------------------- +// +TBool CMenuLinkHandler::SupportsType( const TDesC& aType ) + { + if ( !aType.Compare( KMenuTypeLink ) ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------- +// CMenuLinkHandler::HandleCommandL +// --------------------------------------------------------- +// +CMenuOperation* CMenuLinkHandler::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ) + { + if ( aCommand == KMenuCmdOpen && aItem.Type() == KMenuTypeLink ) + { + TBool attrExists = EFalse; + TPtrC val = aItem.GetAttributeL( KMenuAttrRefId, attrExists ); + if ( attrExists ) + { + // "ref_id" defined, get item and forward command. + TUint refId = 0; + MenuUtils::GetTUint( val, refId ); + CMenuItem* item = CMenuItem::OpenL( iMenu, refId ); + CleanupStack::PushL( item ); + CMenuOperation* op = item->HandleCommandL + ( aCommand, aParams, aStatus ); // Not pushed, no leaving. + CleanupStack::PopAndDestroy( item ); + return op; + } + else + { + // "ref_id" missing from aItem. + User::Leave( KErrCorrupt ); + return NULL; + } + } + else if ( aCommand == KMenuCmdRemove && aItem.Type() == KMenuTypeLink ) + { + return CMenuUninstallOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, aItem ); + } + + User::Leave ( KErrNotSupported ); + return NULL; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlersrc/menuuninstalloperation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menuuninstalloperation.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,395 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "mcsdef.h" +#include "mcsmenu.h" +#include "mcsmenuitem.h" +#include "menuuninstalloperation.h" + +_LIT8( KAppMimeType, "x-epoc/x-sisx-app" ); +_LIT8( KMidletMimeType, "application/java-archive" ); +_LIT8( KWidgetMimeType, "application/x-nokia-widget"); + +const TUid KMidletType = { 0x10210E26 }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuUninstallOperation::~CMenuUninstallOperation +// --------------------------------------------------------- +// +CMenuUninstallOperation::~CMenuUninstallOperation() + { + Cancel(); + iUninstaller.Close(); + delete iRemoveOperation; + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::NewL +// --------------------------------------------------------- +// +CMenuUninstallOperation* CMenuUninstallOperation::NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + CMenuItem& aItem ) + { + CMenuUninstallOperation* self; + + self = new ( ELeave ) CMenuUninstallOperation( aMenu, aPriority, aObserverStatus ); + CleanupStack::PushL( self ); + self->ConstructL( aItem ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::CMenuUninstallOperation +// --------------------------------------------------------- +// +CMenuUninstallOperation::CMenuUninstallOperation +( RMenu &aMenu, TInt aPriority, TRequestStatus &aObserverStatus ) +: CMenuOperation( aMenu, aPriority, aObserverStatus ), +iState( EIdle ), +iRemoveOperation( NULL ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::ConstructL +// --------------------------------------------------------- +// +void CMenuUninstallOperation::ConstructL( CMenuItem& aItem ) + { + TBool exists; + TPtrC uidAttr( aItem.GetAttributeL( KMenuAttrUid, exists ) ); + TUint uid; + TUid packageUid = KNullUid; + TPtrC8 mimeType; + + + if( !exists ) + { + User::Leave( KErrCorrupt ); + } + + if( aItem.Flags() & TMenuItem::ELockDelete ) + { + iObserverStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrAccessDenied ); + return; + } + + User::LeaveIfError( iUninstaller.Connect() ); + + iId = aItem.Id(); + + // Prepare parameters + MenuUtils::GetTUint( uidAttr, uid ); + + AppInfoL( TUid::Uid( uid ), mimeType, packageUid ); + + // Commence the uninstallations + iUninstaller.Uninstall( iStatus, packageUid, mimeType ); + iObserverStatus = KRequestPending; + if( mimeType == KMidletMimeType() + && IsWidgetL( TUid::Uid( uid ) ) ) + { + //we remove java type app(it will gain different uid + //during next install) and widget type app(it MIGHT get + //different uid during next install) from xml + iState = EUninstalling; + } + else + { + //if its not java or widget app we leave it in xml, + //appscanner will hide it for later passible reinstallation + iState = ERemoving; + } + + SetActive(); + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::AppInfo +// --------------------------------------------------------- +// +void CMenuUninstallOperation::AppInfoL( const TUid& aAppUid, TPtrC8& aMimeType, TUid& aPackageUid ) + { + TUid typeUid; + RApaLsSession apaLsSession; + + User::LeaveIfError( apaLsSession.Connect() ); + CleanupClosePushL( apaLsSession ); + User::LeaveIfError( apaLsSession.GetAllApps() ); + + if( KErrNone == apaLsSession.GetAppType( typeUid, aAppUid ) && + typeUid == KMidletType ) + { + GetJavaSuitUidL( aAppUid, aPackageUid ); + aMimeType.Set( KMidletMimeType ); + } + else if( IsWidgetL( aAppUid ) ) + { + aPackageUid = aAppUid; + aMimeType.Set( KWidgetMimeType ); + } + else + { + TApaAppInfo appInfo; + User::LeaveIfError( apaLsSession.GetAppInfo( appInfo, aAppUid ) ); + if( !GetInstallPkgUidL( appInfo.iFullName, aPackageUid ) ) + { + aPackageUid = aAppUid; + } + aMimeType.Set( KAppMimeType ); + } + + CleanupStack::PopAndDestroy( &apaLsSession ); + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::GetInstallPkgUidL +// --------------------------------------------------------- +// +TBool CMenuUninstallOperation::GetInstallPkgUidL( const TDesC& aAppFullName, TUid& aPackageUid ) + { + // Search for the full name of the application amongst every file name in + // every installed packages. + TBool found = EFalse; + Swi::RSisRegistrySession iSisRegSession; + + // Get the array of ids of every installed packages + if( KErrNone != iSisRegSession.Connect() ) + { + return found; + } + CleanupClosePushL( iSisRegSession ); + + RArray packageIds; + CleanupClosePushL( packageIds ); + + iSisRegSession.InstalledUidsL( packageIds ); + + RPointerArray< HBufC > packageFiles; + CleanupClosePushL( packageFiles ); + + for( TInt i = 0; i < packageIds.Count() && !found; ++i ) + { + const TUid packageId = packageIds[i]; + Swi::RSisRegistryEntry packageEntry; + + // Get the array of file names in the current install package and look + // if there is one suggesting that the application was installed from + // the package. + if( KErrNone == packageEntry.Open( iSisRegSession, packageId ) ) + { + CleanupClosePushL( packageEntry ); + packageEntry.FilesL( packageFiles ); + for( TInt pf = 0; pf < packageFiles.Count() && !found; ++pf ) + { + if( packageFiles[pf]->FindC( aAppFullName ) == 0 ) + { + aPackageUid = packageId; + found = ETrue; + } + } + packageFiles.ResetAndDestroy(); + CleanupStack::PopAndDestroy( &packageEntry ); + } + } + + CleanupStack::PopAndDestroy( &packageFiles ); + CleanupStack::PopAndDestroy( &packageIds ); + CleanupStack::PopAndDestroy( &iSisRegSession ); + + return found; + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::GetJavaSuitUidL +// --------------------------------------------------------- +// +void CMenuUninstallOperation::GetJavaSuitUidL( const TUid& aAppUid, TUid& aPackageUid ) + { + Java::CJavaRegistry* javaRegistry; + javaRegistry = Java::CJavaRegistry::NewLC(); + + Java::CJavaRegistryEntry* regEntry = + javaRegistry->RegistryEntryL( aAppUid ); + if( regEntry ) + { + CleanupStack::PushL( regEntry ); + + Java::TJavaRegistryEntryType entryType = regEntry->Type(); + + if ( ( entryType >= Java::EGeneralPackage ) && + (entryType < Java::EGeneralApplication) ) + { + //package entry + aPackageUid = regEntry->Uid(); + } + else + { + //application entry + Java::CJavaRegistryApplicationEntry* regApplicationEntry = + static_cast( regEntry ); + Java::CJavaRegistryPackageEntry* regPackageEntry = + regApplicationEntry->PackageEntryL(); + aPackageUid = regPackageEntry->Uid(); + delete regPackageEntry; + } + CleanupStack::PopAndDestroy( regEntry ); + } + else + { + aPackageUid = aAppUid; + } + CleanupStack::PopAndDestroy( javaRegistry ); + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::IsWidget +// --------------------------------------------------------- +// + +TBool CMenuUninstallOperation::IsWidgetL( const TUid& aAppUid ) + { + RWidgetRegistryClientSession widgetReg; + TBool isWidget; + + if( KErrNone != widgetReg.Connect() ) + { + return EFalse; + } + CleanupClosePushL( widgetReg); + isWidget = widgetReg.IsWidget( aAppUid ); + CleanupStack::PopAndDestroy( &widgetReg ); + + return isWidget; + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::RunL +// --------------------------------------------------------- +// +void CMenuUninstallOperation::RunL() + { + if( KErrNone == iStatus.Int() ) + { + switch( iState ) + { + case EUninstalling: + { + __ASSERT_DEBUG( NULL == iRemoveOperation, User::Invariant() ); + iState = ERemoving; + iRemoveOperation = iMenu.RemoveL( iId, iStatus ); + SetActive(); + } + break; + + case ERemoving: + { + delete iRemoveOperation; + iRemoveOperation = NULL; + iState = EIdle; + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + break; + + default: + // Object is in an unexpected state + __ASSERT_DEBUG( 0, User::Invariant() ); + } + } + else if ( KErrNotFound == iStatus.Int() && iState == ERemoving ) + { + // Most probably: After uninstalling the application the application + // scanner removed the corresponding item from the xml so not finding + // the menuitem is not an error here. + delete iRemoveOperation; + iRemoveOperation = NULL; + iState = EIdle; + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, KErrNone ); + } + else + { + // Report error + delete iRemoveOperation; + iRemoveOperation = NULL; + iState = EIdle; + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::DoCancel +// --------------------------------------------------------- +// +void CMenuUninstallOperation::DoCancel() + { + switch( iState ) + { + case EUninstalling: + { + iState = EIdle; + } + break; + + case ERemoving: + { + delete iRemoveOperation; + iRemoveOperation = NULL; + iState = EIdle; + } + break; + + default: + // Object is in an unexpected state + __ASSERT_DEBUG( 0, User::Invariant() ); + } + iUninstaller.CancelAsyncRequest( SwiUI::ERequestUninstall ); + // Complete the caller: + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + +// --------------------------------------------------------- +// CMenuUninstallOperation::RunError +// --------------------------------------------------------- +// +TInt CMenuUninstallOperation::RunError( TInt aError ) + { + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, aError ); + + return KErrNone; + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/handlersrc/menuurlhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/handlersrc/menuurlhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "menuurlhandler.h" +#include "menuuninstalloperation.h" +#include "menucompletedoperation.h" +#include "mcsmenuitem.h" +#include "mcsdef.h" + +#include +#include +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuUrlHandler::~CMenuUrlHandler +// --------------------------------------------------------- +// +CMenuUrlHandler::~CMenuUrlHandler() + { + } + +// --------------------------------------------------------- +// CMenuUrlHandler::NewL +// --------------------------------------------------------- +// +CMenuUrlHandler* CMenuUrlHandler::NewL( RMenu &aMenu ) + { + CMenuUrlHandler* handler = new (ELeave) CMenuUrlHandler( aMenu ); + CleanupStack::PushL( handler ); + handler->ConstructL(); + CleanupStack::Pop( handler ); + return handler; + } + +// --------------------------------------------------------- +// CMenuUrlHandler::CMenuUrlHandler +// --------------------------------------------------------- +// +CMenuUrlHandler::CMenuUrlHandler( RMenu &aMenu ) +: CMenuHandlerPlugin( aMenu ) + { + } + +// --------------------------------------------------------- +// CMenuUrlHandler::ConstructL +// --------------------------------------------------------- +// +void CMenuUrlHandler::ConstructL() + { + BaseConstructL(); + } + +// --------------------------------------------------------- +// CMenuUrlHandler::SupportsType +// --------------------------------------------------------- +// +TBool CMenuUrlHandler::SupportsType( const TDesC& aType ) + { + if ( !aType.Compare( KMenuTypeUrl() ) ) + { + return ETrue; + } + + return EFalse; + } + +// --------------------------------------------------------- +// CMenuUrlHandler::HandleCommandL +// --------------------------------------------------------- +// +CMenuOperation* CMenuUrlHandler::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& /*aParams*/, + TRequestStatus& aStatus ) + { + // Check if item type is correct + if( aItem.Type() != KMenuTypeUrl() ) + { + User::Leave( KErrNotSupported ); + } + + if( !aCommand.Compare( KMenuCmdOpen() ) ) + { + // Get URL attribute 'url' + TBool attrExists = ETrue; + TPtrC url = aItem.GetAttributeL( KMenuAttrUrl(), attrExists ); + + if( !attrExists ) + { + User::Leave( KErrCorrupt ); + } + + LaunchUrlL( url ); + + return CMenuCompletedOperation::NewL + ( iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------- +// CMenuUrlHandler::LaunchUrlL +// --------------------------------------------------------- +// + +void CMenuUrlHandler::LaunchUrlL( const TDesC& aUrl ) + { + CSchemeHandler* urlHandler = CSchemeHandler::NewL( aUrl ); + if( urlHandler ) + { + CleanupStack::PushL( urlHandler ); + urlHandler->HandleUrlStandaloneL(); + CleanupStack::PopAndDestroy( urlHandler ); + } + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/mcsmenusapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/mcsmenusapi.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 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 __MCSMENUSAPI_H__ +#define __MCSMENUSAPI_H__ + +#include + +#include "mcsmenu.h" + +/** + * Menu session. + * The menu is an ID-based tree structure of menu folders and items. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenuSapi ): public RMenu + { +public: + + /** + * GetList operation + * @param aSerializedIn serialized list of input parameters + * @param aSerializedOut serialized list with getlist output + */ + IMPORT_C void GetListL( TDes8& aSerializedIn, + RBuf8& aSerializedOut ); + + + }; + +#endif // __MCSMENUSAPI_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menubuf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menubuf.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of client side stream buffer +* +*/ + + +#ifndef __MENUBUF_H__ +#define __MENUBUF_H__ + +#include "menusrvdef.h" +#include +#include + +class RMenu; + +/** + * Client side stream buffer. Not seekable. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenuBuf ): public RSubSessionBase, public TStreamBuf + { + +public: + + /** + * Close the object. + */ + void Close(); + + /** + * Open the object (initially empty). + * @param aMenu Session to be used. + * @return Error code. + */ + TInt Open( RMenu& aMenu ); + + /** + * Open this object using other object. + * @param aHandle Handle used to open this object. + * @param aFunction Function. + * @param aArgs Arguments. Use arg 0 and 1 only; + * arg 2 and 3 are used internally. + * @return Error code. + */ + TInt Open( RMenu& aMenu, TInt aFunction, TIpcArgs& aArgs ); + +private: + + /** + * Read data from server. + * @param aLength The number of bytes read. + */ + void IpcReadL( TInt& aLength ); + + /** + * Write data to server. + */ + void IpcWriteL(); + + /** + * Get read lag (number of bytes transferred from server side but not + * yet read). + * @return Read lag. + */ + inline TInt Lag( TRead aArea ) const; + + /** + * Get write lag (number of bytes written but not yet transferred to + * server side). + * @return Write lag. + */ + inline TInt Lag( TWrite aArea ) const; + +// from base class TStreamBuf + + /** + * Re-fill the intermediate buffer and reset the start and end points + * of the read area. + * @param aMaxLength The maximum amount of data required. + * @return The amount of data available. + */ + TInt UnderflowL( TInt aMaxLength ); + + /** + * Empty the intermediate buffer and resets the start and end points + * of the write area. + */ + void OverflowL(); + + /** + * Synchronise the stream buffer with the stream. In effect, this + * ensures that buffered data is delivered to the stream. + * Write lag flushed. + * Read lag leaves with KErrNotSupported. + */ + void DoSynchL(); + +private: // Data + + TMenuBuf iBuf; ///< Data buffer. + + }; + +#include "menubuf.inl" + +#endif // __MENUBUF_H__ + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menubuf.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menubuf.inl Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of client side stream buffer +* +*/ + + +// --------------------------------------------------------- +// RMenuBuf::Lag() +// --------------------------------------------------------- +// +inline TInt RMenuBuf::Lag( TRead ) const + { + return Ptr( ERead ) - End( ERead ); + } + +// --------------------------------------------------------- +// RMenuBuf::Lag() +// --------------------------------------------------------- +// +inline TInt RMenuBuf::Lag( TWrite ) const + { + return Ptr( EWrite ) - iBuf.iData; + } + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menuclientoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menuclientoperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of Menu operation subsession +* +*/ + + +#ifndef __MENUCLIENTOPERATION_H__ +#define __MENUCLIENTOPERATION_H__ + +#include "mcsmenuoperation.h" +#include + +class RMenu; +class RMenuBuf; +class CMenuItem; + +/** + * Menu operation subsession object. + * This is a "disposable" object (used only once): + * CreateXxx() -> Start() -> Close(). + * CreateXxx() methods package and send operation data to server side; Start() + * invokes the operation asynchronously. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenuOperation ): public RSubSessionBase + { + +public: + + /** + * Close the operation. Safe to call if not open. + */ + void Close(); + + /** + * Create a Remove operation. + * @param aMenu Menu. + * @param aId Remove this item. + * @return Error code. + */ + TInt CreateRemove( RMenu& aMenu, TInt aId ); + + /** + * Create a MoveToFolder operation. + * @param aMenu Menu. + * @param aId ID-s of item to be to be moved have been sent in this + * buffer. + * @param aMoveBefore. Move the items before this item (if found). + * If aMoveBefore is not found, the aItem is moved to the end. + * @return Error code. + */ + TInt CreateMoveToFolder( + RMenu& aMenu, + const RMenuBuf& aItems, + TInt aFolder, + TInt aMoveBefore ); + + /** + * Create Reorder operation. + * @param aMenu Menu. + * @param aId ID of item to be to be reordered. + * @param aMoveBefore. Move the item before this item (if found). + * If aMoveBefore is not found, the aItem is moved to the end. + * @return Error code. + */ + TInt CreateReorder( RMenu& aMenu, TInt aId, TInt aMoveBefore ); + + /** + * Create Add operation. + * @param aMenu Menu. + * @param aType Type. Maximum length is KMenuMaxTypeLen. + * @param aChanges Operation data (attributes, etc.) have been sent in this + * buffer. + * @param aId ID of item to be created is returned here (ID is reserved, + * but not yet valid). + * @return Error code. + */ + TInt CreateAdd( RMenu& aMenu, const TDesC& aType, const RMenuBuf& aChanges, TInt& aId ); + + /** + * Create Update operation. + * @param aMenu Menu. + * @param aId Id. + * @param aChanges Operation data (attributes, etc.) have been sent in this + * buffer. + * @return Error code. + */ + TInt CreateUpdate( RMenu& aMenu, TInt aId, const RMenuBuf& aChanges ); + + /** + * Cancel operation. + * NOT safe to call on an unopened operation. + */ + void Cancel(); + + /** + * Start operation. + * @param aStatus Completes with error code when operation is done. + */ + void Start( TRequestStatus &aStatus ); + + }; + +/** + * RMenuOperation wrapped as CMenuOperation. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuClientOperation ): public CMenuOperation + { + +public: + + /** + * Destructor. + */ + virtual ~CMenuClientOperation(); + + /** + * Constructor. + * @param aMenu Menu. + * @param Priority Active Object priority. + * @param aStatus Completes with error code when operation is done. + */ + CMenuClientOperation( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus ); + + /** + * Construct and start Remove operation. + * @param aMenu Menu. + * @param aId Remove this item. + */ + void RemoveL( TInt aId ); + + /** + * Construct and start a MoveToFolder operation. + * @param aMenu Menu. + * @param aId ID-s of item to be to be moved have been sent in this + * buffer. + * @param aMoveBefore. Move the items before this item (if found). + * If aMoveBefore is not found, the aItem is moved to the end. + */ + void MoveToFolderL( const RMenuBuf& aItems, TInt aFolder, TInt aMoveBefore ); + + /** + * Construct and start Reorder operation. + * @param aMenu Menu. + * @param aId ID of item to be to be reordered. + * @param aMoveBefore. Move the item before this item (if found). + * If aMoveBefore is not found, the aItem is moved to the end. + */ + void ReorderL( TInt aId, TInt aMoveBefore ); + + /** + * Construct and start Add operation. + * @param aMenu Menu. + * @param aType Type. Maximum length is KMenuMaxTypeLen. + * @param aChanges Operation data (attributes, etc.) have been sent in this + * buffer. + * @return ID of item to be created (ID is reserved, but not yet valid). + */ + TInt AddL( const TDesC& aType, const RMenuBuf& aChanges ); + + /** + * Construct and start Update operation. + * @param aMenu Menu. + * @param aId Id. + * @param aChanges Operation data (attributes, etc.) have been sent in this + * buffer. + */ + void UpdateL( TInt aId, const RMenuBuf& aChanges ); + +private: + + /** + * Start operation. + */ + void Start(); + +// from base class CActive + + /** + * Operation completed. + */ + void RunL(); + + /** + * Cancel operation. + */ + void DoCancel(); + + /** + * Never called, RunL() is not leaving. + */ + TInt RunError( TInt /*aError*/ ) { return KErrNone; } + +private: // data + + RMenuOperation iOperation; ///< The operation. Own. + + }; + +#endif // __MENUCLIENTOPERATION_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menucompletedoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menucompletedoperation.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of completed menu operation +* +*/ + + +#ifndef __MENUCOMPLETEDOPERATION_H__ +#define __MENUCOMPLETEDOPERATION_H__ + +#include "mcsmenuoperation.h" +#include + +class RMenu; + +/** + * Completed CMenuOperation. + * Utility class to wrap synchronous functionality as asynchronous menu + * operation. Used in CMenuHandlers and other menu operations where the + * API requires an asynchronous operation but the concrete functionality + * is synchronous and the result is already available. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuCompletedOperation ): public CMenuOperation + { + +public: + + /** + * Destructor. + */ + IMPORT_C virtual ~CMenuCompletedOperation(); + + /** + * Two-phased constructor. Constructs an operation that is already complete. + * @param aMenu Menu. + * @param aPriority Active Object priority. + * @param aStatus Observer request status. Completes with aError. + * @param aError Completion code (result of the operation). + * @return Asynchronous operation. Owned by the caller. + */ + IMPORT_C static CMenuCompletedOperation* NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + TInt aError ); + +private: + + /** + * Constructor + * @param aMenu Menu. + * @param aPriority Active Object priority. + * @param aStatus Observer request status. + */ + CMenuCompletedOperation( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus ); + + /** + * Report completion. + * @param aError Completion code (result of the operation). + */ + void ReportCompletion( TInt aError ); + +// from base class CActive + + /** + * Report completion to observer. + */ + void RunL(); + + /** + * Cancel object (never called). + */ + void DoCancel(); + + /** + * Handle error. + * @param aError Error code. + * @return KErrNone. + */ + TInt RunError( TInt aError ); + + }; + +#endif // __MENUCOMPLETEDOPERATION_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menuhandlereng.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menuhandlereng.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu handler engine +* +*/ + + +#ifndef __MENUHANDLERENG_H__ +#define __MENUHANDLERENG_H__ + +#include + +class RMenu; +class CMenuHandler; +class CMenuOperation; +class CMenuItem; + +/** + * Menu handler engine. + * Handler related menu functionality and objects (factory, handler list, ...) + * are collected in this class, to keep RMenu implementation and API clean. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuHandlerEng ): public CBase + { + +public: + + /** + * Destructor. + */ + virtual ~CMenuHandlerEng(); + + /** + * Two-phased constructor. + * @param aMenu Menu. + * @return The created object. + */ + static CMenuHandlerEng* NewL( RMenu& aMenu ); + + /** + * Handle command. + * @param aItem Item. + * @param aCommand Command. + * @param aParams. Command parameters. + * @param aStatus Observer request status. When the operation completes, + * this status will be completed with the resulting error code. + * @return Asynchronous operation. Owned by the caller. + */ + CMenuOperation* HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ); + +protected: + + /** + * Constructor. + * @param aMenu Menu. + */ + CMenuHandlerEng( RMenu& aMenu ); + +private: + + /** + * Find loaded handler by type. + * @param aType Type. + * @return Loaded handler or NULL no handler is loaded for that type. + */ + CMenuHandler* FindHandler( const TDesC& aType ); + + /** + * Load handler for given type. + * @param aType Type. + * @return Loaded handler or NULL no handler is found for that type. + */ + CMenuHandler* LoadHandlerL( const TDesC& aType ); + +private: // data + + RMenu& iMenu; /// iHandlers; ///< Own. + + }; + +#endif // __MENUHANDLERENG_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menuitemattr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menuitemattr.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu item attribute +* +*/ + + +#ifndef __MENUITEMATTR_H__ +#define __MENUITEMATTR_H__ + +#include + +class RWriteStream; +class RReadStream; + +/** + * Menu item attribute. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMenuItemAttr ): public CBase + { + +public: + + /** + * Destructor. + */ + virtual ~CMenuItemAttr(); + + /** + * Two-phased constructor. + * @param aName Attribute name. + * @return The created object. + */ + static CMenuItemAttr* NewL( const TDesC& aName ); + + /** + * Two-phased constructor. + * @param aName Attribute name. + * @return The created object. + */ + static CMenuItemAttr* NewLC( const TDesC& aName ); + + /** + * Two-phased constructor (create and internalize). + * @aStream Stream. + * @return The created object. + */ + static CMenuItemAttr* NewLC( RReadStream& aStream ); + + /** + * Get name. + * @return Name. + */ + TPtrC Name() const { return iName; } + + /** + * Get value. + * @return Value, or NULL if attribute is not set. + */ + HBufC* Value() const { return iValue; } + + /** + * Set value. Sets changed status as appropriate. + * @param aValue Value, or NULL if attribute is not set (==remove attr). + * Ownership taken. + */ + void SetValue( HBufC* aValue ); + + /** + * Get changed status. + * @return ETrue if changed. + */ + TBool Changed() const { return iChanged; } + + /** + * Set changed status. + * @param Changed status. + */ + void SetChanged( TBool aChanged ) { iChanged = aChanged; } + + /** + * Externalize to stream. + * @param aStream Stream to externalize to. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize from stream. + * @param aStream Stream to externalize from. + */ + void InternalizeL( RReadStream& aStream ); + +protected: + + /** + * Second phased constructor. + * @param aName Attribute name. + */ + void ConstructL( const TDesC& aName ); + +private: // data + + RBuf iName; ///< Name. Own. + HBufC* iValue; ///< Value (or NULL). Own. + TBool iChanged; ///< ETrue if changed. + + }; + +/** + * Attribute array. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( RMenuItemAttrArray ) : public RPointerArray + { + +public: + + /** + * Find attribute by name. + * @param aName Name. + * @return Index of attribute, or KErrNotFound. + */ + TInt Find( const TDesC& aName ) const; + + /** + * Count changed attributes. + * @return Number of changed attributes. + */ + TInt CountChanged() const; + + /** + * Clear changed status for all attributes. + */ + void ClearChanged(); + + /** + * Externalize changed items to stream. + * @param aStream Stream to externalize to. + */ + void ExternalizeChangesL( RWriteStream& aStream ) const; + + /** + * Externalize all items to stream. + * @param aStream Stream to externalize to. + */ + void ExternalizeL( RWriteStream& aStream ) const; + + /** + * Internalize from stream. + * @param aStream Stream to externalize from. + */ + void InternalizeL( RReadStream& aStream ); + + }; + +/** +* Push a ResetAndDestroy() on the cleanup stack. +* @param aArray Array. +*/ +void CleanupResetAndDestroyPushL( RMenuItemAttrArray& aArray ); + +#endif // __MENUITEMATTR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menulogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menulogger.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,136 @@ +/* +* 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: Logging macros +* +*/ + + +#ifndef __SSYNC_LOGGER_H__ +#define __SSYNC_LOGGER_H__ + +#include +#include + +#include + +#undef __LOGGING__ + +/// Logging directory. +_LIT( KLogDir, "mcs" ); +/// Log file name. +_LIT( KLogFile, "mcs.txt" ); +/// Format string: enter function. +_LIT( KLogEnterFn, "-> %S" ); +/// Format string: leave function. +_LIT( KLogLeaveFn, "<- %S" ); +/// Format string: time. +_LIT( KLogTimeFormatString, "%H:%T:%S:%*C2" ); +/// Format string: timestamp. +_LIT( KLogTimeStampFormatString, "%S %S" ); + +#ifdef __LOGGING__ + +#pragma message("Logging is enabled") + +#include + +/// Write log: enter function. +#define CLOG_ENTERFN( a ) \ + { \ + _LIT( temp, a ); \ + RFileLogger::WriteFormat \ + ( \ + KLogDir, \ + KLogFile, \ + EFileLoggingModeAppend, \ + KLogEnterFn, \ + &temp \ + ); \ + } + +/// Write log: leave function. +#define CLOG_LEAVEFN( a ) \ + { \ + _LIT( temp, a ); \ + RFileLogger::WriteFormat \ + ( \ + KLogDir, \ + KLogFile, \ + EFileLoggingModeAppend, \ + KLogLeaveFn, \ + &temp \ + ); \ + } + +/// Write log: string 'a'. +#define CLOG_WRITE( a ) \ + { \ + _LIT( temp, a ); \ + RFileLogger::Write \ + ( \ + KLogDir, \ + KLogFile, \ + EFileLoggingModeAppend, \ + temp \ + ); \ + } + +/// Write log: formatted. +#define CLOG_WRITE_FORMAT( a, b... ) \ + { \ + _LIT( temp, a ); \ + RFileLogger::WriteFormat \ + ( \ + KLogDir, \ + KLogFile, \ + EFileLoggingModeAppend, \ + temp, \ + b \ + ); \ + } + +#define CLOG_WRITE_FORMAT8( a, b... ) \ + { \ + _LIT8( temp, a ); \ + RFileLogger::WriteFormat \ + ( \ + KLogDir, \ + KLogFile, \ + EFileLoggingModeAppend, \ + temp, \ + b \ + ); \ + } + +#else /* not defined __LOGGING__ */ + +/// Empty definition (disable log). +#define CLOG_ENTERFN( a... ) + +/// Empty definition (disable log). +#define CLOG_LEAVEFN( a... ) + +/// Empty definition (disable log). +#define CLOG_WRITE( a... ) + +/// Empty definition (disable log). +#define CLOG_WRITE_FORMAT( a... ) + +/// Empty definition (disable log). +#define CLOG_WRITE_FORMAT8( a... ) + +#endif /* def __LOGGING__ */ + +#endif // __SSYNC_LOGGER_H__ + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menumsg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menumsg.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu client-server command IDs +* Version : %version: sa1spcx1#8 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef __MENUMSG_H__ +#define __MENUMSG_H__ + +#include + +/// Menu functions. +enum TMenuFunction + { + EMenuNullFunction, + + // Functions with test capability + EMenuTestCapabilityStart, + + EMenuResourceMarkStart, + EMenuResourceMarkEnd, + EMenuResourceCount, + EMenuSetHeapFailure, + + EMenuTestCapabilityEnd, + + // Functions with read device data capability + EMenuReadCapabilityStart, + + EMenuConstructSession, + EMenuRootFolder, + EMenuStreamClose, + EMenuStreamOpen, + EMenuStreamRead, + EMenuStreamWrite, + EMenuGetHdr, + EMenuGetItems, + EMenuGetRunningApps, + EMenuGetItemsFiltered, + EMenuItemGetAttribute, + EMenuItemGetAttributeList, + EMenuNotifierClose, + EMenuNotifierOpen, + EMenuNotifierNotify, + EMenuNotifierNotifyCancel, + EMenuItemGetIcon, + EMenuGetListSize, + EMenuGetListData, + EMenuReadCapabilityEnd, + + // Functions with write device data capability + EMenuWriteCapabilityStart, + + EMenuOperationClose, + EMenuOperationCreateRemove, + EMenuOperationCreateMoveToFolder, + EMenuOperationCreateReorder, + EMenuOperationCreateAdd, + EMenuOperationCreateUpdate, + EMenuOperationCancel, + EMenuOperationStart, + + EMenuWriteCapabilityEnd, + + EMenuMaxFunction // End marker for sanity check. + }; + +#endif // __MENUMSG_H__ + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menusrvdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menusrvdef.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of menu server constants +* +*/ + + +#ifndef __MENUSRVDEF_H_ +#define __MENUSRVDEF_H_ + +#include + +/// Major version number. +LOCAL_D const TInt KMenuMajorVersion = 1; +/// Minor version number. +LOCAL_D const TInt KMenuMinorVersion = 0; +/// Build number. +LOCAL_D const TInt KMenuBuild = 0; + +/// Menu Content Service Server name. +_LIT( KMenuSrvName, "!MCSSRV" ); +/// Menu Content Service Server executable. +_LIT( KMenuSrvExe, "mcsmenuserver" ); +/// Exit delay in microseconds (10 sec). +LOCAL_D const TInt KMenuSrvExitDelay = 10000000; +/// Stream buffer size. +LOCAL_D const TInt KMenuStreamBufSize = 512; + +/** + * Stream buffer data container. + */ +NONSHARABLE_CLASS( TMenuBuf ) + { + +public: // Data + + TInt iLen; ///< Data length. + TUint8 iData[KMenuStreamBufSize]; ///< Data buffer. + + }; + +#endif // __MENUSRVDEF_H_ + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menuuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menuuid.hrh Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of different UIDs used in MenuContentService +* +*/ + + +#ifndef __MENU_UID_HRH__ +#define __MENU_UID_HRH__ + +#define MENU_DLL_UID3 0x200113DB +#define MENU_ENG_UID3 0x200113DC +#define MENU_SRV_UID3 0x200113DD + +#endif // __MENU_UID_HRH__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/inc/menuutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/inc/menuutil.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of static utility functions +* +*/ + + +#ifndef __MENUUTIL_H__ +#define __MENUUTIL_H__ + +#include "mcsmenuitem.h" +#include + +class RWriteStream; +class RReadStream; + +/** + * Static utility functions. + */ +NONSHARABLE_CLASS( MenuUtil ) + { + +public: + + /** + * Externalize integer array into a stream. + * @param aArray Array to externalize. + * @param aStream The stream to externalize to. + */ + static void ExternalizeL + ( const RArray& aArray, RWriteStream& aStream ); + + /** + * Internalize integer array from a stream. Existing data is kept, + * new ones appended. + * @param aArray Array to internalize. + * @param aStream The stream to externalize from. + */ + static void InternalizeL + ( RArray& aArray, RReadStream& aStream ); + + /** + * Externalize uid array into a stream. + * @param aArray Array to externalize. + * @param aStream The stream to externalize to. + */ + static void ExternalizeL + ( const RArray& aArray, RWriteStream& aStream ); + + /** + * Internalize uid array from a stream. Existing data is kept, + * new ones appended. + * @param aArray Array to internalize. + * @param aStream The stream to externalize from. + */ + static void InternalizeL + ( RArray& aArray, RReadStream& aStream ); + + /** + * Externalize header array into a stream. + * @param aArray Array to externalize. + * @param aStream The stream to externalize to. + */ + static void ExternalizeL + ( const RArray& aArray, RWriteStream& aStream ); + + /** + * Internalize header array from a stream. Existing data is kept, + * new ones appended. + * @param aArray Array to internalize. + * @param aStream The stream to externalize from. + */ + static void InternalizeL + ( RArray& aArray, RReadStream& aStream ); + + /** + * Check if backup operation is in progress. + * @return ETrue if backup is in progress. + */ + static TBool BackupInProgressL(); + + }; + +#endif // __MENUUTIL_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/menusatinterface/Bwins/MenuInterfaceU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/menusatinterface/Bwins/MenuInterfaceU.DEF Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,5 @@ +EXPORTS + ??0CMenuSATInterface@@QAE@XZ @ 1 NONAME ; CMenuSATInterface::CMenuSATInterface(void) + ?MakeSatUiVisible@CMenuSATInterface@@QAEHHABVTDesC16@@@Z @ 2 NONAME ; int CMenuSATInterface::MakeSatUiVisible(int, class TDesC16 const &) + ?MakeSatUiVisible@CMenuSATInterface@@QAEHHABVTDesC16@@E@Z @ 3 NONAME ; int CMenuSATInterface::MakeSatUiVisible(int, class TDesC16 const &, unsigned char) + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/menusatinterface/EABI/MenuInterfaceU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/menusatinterface/EABI/MenuInterfaceU.DEF Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,6 @@ +EXPORTS + _ZN17CMenuSATInterface16MakeSatUiVisibleEiRK7TDesC16 @ 1 NONAME + _ZN17CMenuSATInterface16MakeSatUiVisibleEiRK7TDesC16h @ 2 NONAME + _ZN17CMenuSATInterfaceC1Ev @ 3 NONAME + _ZN17CMenuSATInterfaceC2Ev @ 4 NONAME + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/menusatinterface/Src/MenuSatInterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/menusatinterface/Src/MenuSatInterface.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2002-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: Implements application shell SAT interface for external +* applications. +* +*/ + + +// INCLUDE FILES +#include + +#include + +#include "../../cenrep/menu2privatecrkeys.h" + +// CONSTANTS +const TInt KMaxFolderNameLength = 248; + +// ----------------------------------------------------------------------------- +// CMenuSATInterface::CMenuSATInterface +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMenuSATInterface::CMenuSATInterface() + { + RProperty::Define( KCRUidMenu, KMenuShowSatUI, RProperty::EInt ); + RProperty::Define( KCRUidMenu, KMenuSatUIName, RProperty::EText ); + RProperty::Define( KCRUidMenu, KMenuSatUIIconId, RProperty::EInt ); + + } + +// ----------------------------------------------------------------------------- +// CMenuSATInterface::MakeSatUiVisible +// Change visibility and name properties in central repository. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMenuSATInterface::MakeSatUiVisible( TBool aVisible, + const TDesC& aName ) + { + return SetSatUiVisibilityData( aVisible, aName, -1 ); + } + +// ----------------------------------------------------------------------------- +// CMenuSATInterface::MakeSatUiVisible +// Change visibility, name and icon properties in central repository. +// ----------------------------------------------------------------------------- +EXPORT_C TInt CMenuSATInterface::MakeSatUiVisible( TBool aVisible, + const TDesC& aName, + TUint8 aIconInfoId ) + { + return SetSatUiVisibilityData( aVisible, aName, (TInt)aIconInfoId ); + } + +// ----------------------------------------------------------------------------- +// CMenuSATInterface::SetSatUiVisibilityData +// Do the actual hard work of setting visibility, name and icon properties +// in central repository. +// ----------------------------------------------------------------------------- +TInt CMenuSATInterface::SetSatUiVisibilityData( TBool aVisible, + const TDesC& aName, + TInt8 aIconInfoId ) + { + + // Append only the KMaxFolderNameLength leftmost characters + TBuf satName; + satName.Append( aName.Left( KMaxFolderNameLength ) ); + + // Passes the make sat ui command to AppShell using the central repository + + // Visibility + TInt err = RProperty::Set( KCRUidMenu, KMenuShowSatUI, aVisible );; + + // Name + if( aName.Length() ) + { + err |= RProperty::Set( KCRUidMenu, KMenuSatUIName, satName ); + } + + // Icon id + if( aIconInfoId != -1 ) + { + // set the Sat UI icon ID + err |= RProperty::Set( KCRUidMenu, KMenuSatUIIconId, aIconInfoId ); + } + + return err; + } + +// End of file diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/menusatinterface/group/MenuInterface.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/menusatinterface/group/MenuInterface.mmp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2002-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: Interface for accessing menu functionality externally. +* +*/ + +// To get the MW_LAYER_SYSTEMINCLUDE-definition +#include + +TARGET MenuInterface.dll +TARGETTYPE DLL +UID 0x1000008D 0x10210EAB +TARGETPATH /system/libs + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../Src + +SOURCE MenuSatInterface.cpp + +USERINCLUDE ../Inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + +LANG SC diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/menusatinterface/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/menusatinterface/group/bld.inf Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2004-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: Interface build information file +* +*/ + + +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_EXPORTS + +PRJ_MMPFILES +MenuInterface.mmp + +PRJ_TESTMMPFILES +//../../internal/Interface/TSrc/Group/Interface_TEST.mmp + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/rom/mcs.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/rom/mcs.iby Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 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 __MENU_CONTENT_SERVICE_IBY__ +#define __MENU_CONTENT_SERVICE_IBY__ + +#include + +file=ABI_DIR\BUILD_DIR\mcsmenuutils.dll SHARED_LIB_DIR\mcsmenuutils.dll +file=ABI_DIR\BUILD_DIR\mcsmenueng.dll SHARED_LIB_DIR\mcsmenueng.dll +file=ABI_DIR\BUILD_DIR\mcsmenu.dll SHARED_LIB_DIR\mcsmenu.dll +file=ABI_DIR\BUILD_DIR\mcsmenuserver.exe PROGRAMS_DIR\mcsmenuserver.exe +file=ABI_DIR\BUILD_DIR\mcsextendedmenu.dll SHARED_LIB_DIR\mcsextendedmenu.dll +file=ABI_DIR\BUILD_DIR\mcssathandler.dll SHARED_LIB_DIR\mcssathandler.dll + +#ifndef APPSHELL_IBY +#define APPSHELL_IBY + +file=ABI_DIR\BUILD_DIR\menuinterface.dll SHARED_LIB_DIR\menuinterface.dll + +#endif //APPSHELL_IBY + +ECOM_PLUGIN( mcsmenuhandler.dll, mcsmenuhandler.rsc ) + +data=ZPRIVATE\200113dd\backup_registration.xml PRIVATE\200113dd\backup_registration.xml + +#endif // __MENU_CONTENT_SERVICE_IBY__ + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menu.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,416 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mcsdef.h" + +#include "mcsmenu.h" +#include "menusrvdef.h" +#include "menumsg.h" +#include "menubuf.h" +#include "menuutil.h" +#include "menuclientoperation.h" +#include "menuhandlereng.h" +#include "mcsmenufilter.h" + +#include +#include + +// ================= LOCAL FUNCTIONS ======================= + +/** +* Start the server executable. +* @return Error code. +*/ +LOCAL_C TInt StartServer() + { + TInt err( KErrNone ); + RProcess server; + err = server.Create( KMenuSrvExe, KNullDesC, EOwnerThread ); + if ( !err ) + { + TRequestStatus status; + server.Rendezvous( status ); + if ( status != KRequestPending ) + { + server.Kill( 0 ); // Abort startup. + } + else + { + server.Resume(); // Logon OK - start the server. + } + User::WaitForRequest( status ); // Wait for start or death. + // We can't use the 'exit reason' if the server panicked as this + // is the panic 'reason' and may be '0' which cannot be distinguished + // from KErrNone. + err = (server.ExitType() == EExitPanic) ? KErrGeneral : status.Int(); + server.Close(); + } + return err; + } + +// ================= MEMBER FUNCTIONS ======================= + +NONSHARABLE_CLASS( RMenu::TData ) + { +public: + // Transfer buffer. Size must be big enough to accomodate any object that + // will go through it: attribute, TMenuItem + TUint16 iBuf[KMenuMaxAttrValueLen]; + // Handler engine. + CMenuHandlerEng* iHandler; + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RMenu::Close +// --------------------------------------------------------- +// +EXPORT_C void RMenu::Close() + { + RSessionBase::Close(); + if ( iData ) + { + delete iData->iHandler; iData->iHandler = NULL; + delete iData; iData = NULL; + } + } + +// --------------------------------------------------------- +// RMenu::OpenL +// --------------------------------------------------------- +// +EXPORT_C void RMenu::OpenL( const TDesC& aName ) + { + __ASSERT_DEBUG( !iData, User::Invariant() ); + User::LeaveIfError( ConnectSession() ); + CleanupClosePushL( *this ); // Atomcic connect + local data + construct. + iData = new (ELeave) RMenu::TData(); + iData->iHandler = NULL; + // We have a connected blank session, now construct it. + // It would be good to have a CreateSession which leaves us at least one + // IpcArg, so the name could be sent to session creation directly. + // Since having a fully constructed session needs this extra IPC, the + // server side session had to be cluttered with ASSERTS. (Almost all + // messages need to check that the session is fully constructed.) + // + // The reason for this is a design issue (we use the session as an object, + // and not just as a communication channel. But normally there is only one + // object used, so why complicate things for the client? + User::LeaveIfError + ( SendReceive( EMenuConstructSession, TIpcArgs( &aName ) ) ); + CleanupStack::Pop( this ); + } + +// --------------------------------------------------------- +// RMenu::RootFolderL +// --------------------------------------------------------- +// +EXPORT_C TInt RMenu::RootFolderL() + { + __ASSERT_DEBUG( iData, User::Invariant() ); + TPckgBuf pckg; + User::LeaveIfError( SendReceive( EMenuRootFolder, TIpcArgs( &pckg ) ) ); + return pckg(); + } + +// --------------------------------------------------------- +// RMenu::GetItemsL +// --------------------------------------------------------- +// +EXPORT_C void RMenu::GetItemsL( + RArray& aItemArray, + TInt aFolder, + const CMenuFilter* aFilter /*=NULL*/, + TBool aRecursive /*=EFalse*/ ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + if ( aFilter ) + { + // Filtered query, 2+ more IPC. + // The buffer is opened empty, used to send the filter + // then the result is received into it. + RMenuBuf buf; + User::LeaveIfError( buf.Open( *this ) ); + CleanupClosePushL( buf ); + RWriteStream stream( &buf ); + aFilter->ExternalizeL( stream ); + stream.CommitL(); + TIpcArgs args( aFolder, aRecursive, buf.SubSessionHandle() ); + User::LeaveIfError( SendReceive( EMenuGetItemsFiltered, args ) ); + RReadStream rs( &buf ); + MenuUtil::InternalizeL( aItemArray, rs ); + CleanupStack::PopAndDestroy( &buf ); + } + else + { + // Unfiltered query. + // The buffer already contains the query result when Open() returns. + RMenuBuf buf; + TIpcArgs args( aFolder, aRecursive ); + User::LeaveIfError( buf.Open( *this, EMenuGetItems, args ) ); + CleanupClosePushL( buf ); + RReadStream stream( &buf ); + MenuUtil::InternalizeL( aItemArray, stream ); + CleanupStack::PopAndDestroy( &buf ); + } + } + +// --------------------------------------------------------- +// RMenu::GetRunningAppsL +// --------------------------------------------------------- +// +EXPORT_C void RMenu::GetRunningAppsL( RArray& aArray ) + { + RMenuBuf buf; + TIpcArgs args( 0 ); + User::LeaveIfError( buf.Open( *this, EMenuGetRunningApps, args ) ); + CleanupClosePushL( buf ); + RReadStream stream( &buf ); + MenuUtil::InternalizeL( aArray, stream ); + CleanupStack::PopAndDestroy( &buf ); + } + + +// --------------------------------------------------------- +// RMenu::RemoveL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* RMenu::RemoveL( TInt aId, TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + CMenuClientOperation* op = new (ELeave) CMenuClientOperation + ( *this, CActive::EPriorityStandard, aStatus ); + CleanupStack::PushL( op ); + op->RemoveL( aId ); + CleanupStack::Pop( op ); + return op; + } + +// --------------------------------------------------------- +// RMenu::MoveToFolderL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* RMenu::MoveToFolderL( + const RArray& aItems, + TInt aFolder, + TInt aMoveBefore, + TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + RMenuBuf buf; + User::LeaveIfError( buf.Open( *this ) ); + CleanupClosePushL( buf ); + RWriteStream stream( &buf ); + MenuUtil::ExternalizeL( aItems, stream ); + stream.CommitL(); + CMenuClientOperation* op = new (ELeave) CMenuClientOperation + ( *this, CActive::EPriorityStandard, aStatus ); + CleanupStack::PushL( op ); + op->MoveToFolderL( buf, aFolder, aMoveBefore ); + CleanupStack::Pop( op ); + CleanupStack::PopAndDestroy( &buf ); + return op; + } + +// --------------------------------------------------------- +// RMenu::ReorderL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* RMenu::ReorderL +( TInt aId, TInt aMoveBefore, TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + CMenuClientOperation* op = new (ELeave) CMenuClientOperation + ( *this, CActive::EPriorityStandard, aStatus ); + CleanupStack::PushL( op ); + op->ReorderL( aId, aMoveBefore ); + CleanupStack::Pop( op ); + return op; + } + +// --------------------------------------------------------- +// RMenu::ResourceMark +// --------------------------------------------------------- +// +EXPORT_C void RMenu::ResourceMark() + { + SendReceive( EMenuResourceMarkStart ); + } + +// --------------------------------------------------------- +// RMenu::ResourceCheck +// --------------------------------------------------------- +// +EXPORT_C void RMenu::ResourceCheck() + { + SendReceive( EMenuResourceMarkEnd ); + } + +// --------------------------------------------------------- +// RMenu::ResourceCount +// --------------------------------------------------------- +// +EXPORT_C TInt RMenu::ResourceCount() + { + return SendReceive( EMenuResourceCount ); + } + +#ifdef _DEBUG + +// --------------------------------------------------------- +// RMenu::__DbgSetAllocFail +// --------------------------------------------------------- +// +EXPORT_C void RMenu::__DbgSetAllocFail +( RAllocator::TAllocFail aType, TInt aRate ) + { + TInt type = STATIC_CAST( TInt, aType ); + SendReceive( EMenuSetHeapFailure, TIpcArgs( type, aRate ) ); + } + +#else /* not _DEBUG */ + +// --------------------------------------------------------- +// RMenu::__DbgSetAllocFail +// --------------------------------------------------------- +// +EXPORT_C void RMenu::__DbgSetAllocFail +( RAllocator::TAllocFail /*aType*/, TInt /*aRate*/ ) + { + } + +#endif /* def _DEBUG */ + +// --------------------------------------------------------- +// RMenu::HandleCommandL +// --------------------------------------------------------- +// +CMenuOperation* RMenu::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + if ( !iData->iHandler ) + { + // Create handler engine on demand - handlers not loaded unless needed. + iData->iHandler = CMenuHandlerEng::NewL( *this ); + } + return iData->iHandler->HandleCommandL + ( aItem, aCommand, aParams, aStatus ); + } + +// --------------------------------------------------------- +// RMenu::ConnectSession +// --------------------------------------------------------- +// +TInt RMenu::ConnectSession() + { + TVersion version( KMenuMajorVersion, KMenuMinorVersion, KMenuBuild ); + TInt err = CreateSession( KMenuSrvName, version ); + if ( KErrNotFound == err ) + { + err = StartServer(); + if ( !err || KErrAlreadyExists == err ) // Deal with race conditions. + { + err = CreateSession( KMenuSrvName, version ); + } + } + return err; + } + +// --------------------------------------------------------- +// RMenu::GetAttributeL +// --------------------------------------------------------- +// +HBufC* RMenu::GetAttributeL( TInt aId, const TDesC& aAttrName ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + __ASSERT_DEBUG( sizeof( iData->iBuf ) >= 2 * KMenuMaxAttrValueLen, \ + User::Invariant() ); // Must fit into the transfer buffer. + + RBuf ptr; + ptr.CleanupClosePushL(); + ptr.CreateL(KMenuMaxAttrValueLen); + TPckgBuf attrExists( EFalse ); + TIpcArgs args( aId, &aAttrName, &attrExists, &ptr ); + User::LeaveIfError( SendReceive( EMenuItemGetAttribute, args ) ); + + if( attrExists() ) + { + HBufC* ret = ptr.AllocL(); + CleanupStack::PopAndDestroy( &ptr ); + return ret; + } + else + { + CleanupStack::PopAndDestroy( &ptr ); + return NULL; + } + } + + + +// --------------------------------------------------------- +// RMenu::GetAttributeL +// --------------------------------------------------------- +void RMenu::GetAttributeListL( TInt aId, RArray& aList ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + __ASSERT_DEBUG( sizeof( iData->iBuf ) >= 2 * KMenuMaxAttrValueLen, \ + User::Invariant() ); // Must fit into the transfer buffer. + + RMenuBuf buf; + TIpcArgs args( aId ); + User::LeaveIfError( buf.Open( *this, EMenuItemGetAttributeList, args ) ); + CleanupClosePushL( buf ); + RReadStream rs( &buf ); + + TInt len; + TAttributeName name; + while ( ETrue ) + { + + len = rs.ReadInt32L(); + + if ( len == 0 ) + { + break; + } + + rs.ReadL( name, len ); + aList.AppendL( name ); + } + + CleanupStack::PopAndDestroy( &buf ); + } + +// --------------------------------------------------------- +// RMenu::GetHdrL +// --------------------------------------------------------- +// +const TMenuItem& RMenu::GetHdrL( TInt aId ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + __ASSERT_DEBUG( sizeof( iData->iBuf ) >= sizeof( TMenuItem ), \ + User::Invariant() ); // Header must fit into the transfer buffer. + TPckg pckg( (TMenuItem&)iData->iBuf ); + TIpcArgs args( aId, &pckg ); + User::LeaveIfError( SendReceive( EMenuGetHdr, args ) ); + return pckg(); // Returned object is in the transfer buffer. + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menubuf.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menubuf.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menubuf.h" +#include "menumsg.h" +#include "mcsmenu.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RMenuBuf::Open +// --------------------------------------------------------- +// +TInt RMenuBuf::Open( RMenu& aMenu ) + { + SetBuf( ERead | EWrite, iBuf.iData, iBuf.iData ); // Empty. + return CreateSubSession( aMenu, EMenuStreamOpen, TIpcArgs() ); + } + +// --------------------------------------------------------- +// RMenuBuf::Open +// --------------------------------------------------------- +// +TInt RMenuBuf::Open( RMenu& aMenu, TInt aFunction, TIpcArgs& aArgs ) + { + iBuf.iLen = 0; + SetBuf( ERead | EWrite, iBuf.iData, iBuf.iData ); // Initially empty. + TPckg buf( iBuf ); + aArgs.Set( 2, &buf ); + TInt err = CreateSubSession( aMenu, aFunction, aArgs ); + if ( !err && iBuf.iLen > 0 ) + { + // If aFunction provided data, it is already here. + SetEnd( ERead, iBuf.iData + iBuf.iLen ); + } + return err; + } + +// --------------------------------------------------------- +// RMenuBuf::Close() +// --------------------------------------------------------- +// +void RMenuBuf::Close() + { + // Mind the order: TStreamBuf::Close calls SynchL -> needs an open buf. + TStreamBuf::Close(); + CloseSubSession( EMenuStreamClose ); + } + +// --------------------------------------------------------- +// RMenuBuf::UnderflowL() +// --------------------------------------------------------- +// +TInt RMenuBuf::UnderflowL( TInt /*aMaxLength*/ ) + { + __ASSERT_DEBUG( Avail( ERead ) == 0, User::Invariant() ); + TInt len; + IpcReadL( len ); + return len; + } + +// --------------------------------------------------------- +// RMenuBuf::OverflowL() +// --------------------------------------------------------- +// +void RMenuBuf::OverflowL() + { + __ASSERT_DEBUG( Avail( EWrite ) == 0, User::Invariant() ); + IpcWriteL(); + } + +// --------------------------------------------------------- +// RMenuBuf::DoSynchL() +// --------------------------------------------------------- +// +void RMenuBuf::DoSynchL() + { + if ( Lag( ERead ) ) + { + // Read lag unexpected, we do not support seeking. + User::Leave( KErrNotSupported ); + } + IpcWriteL(); // Flush write lag. + SetBuf( ERead | EWrite, iBuf.iData, iBuf.iData ); + } + +// --------------------------------------------------------- +// RMenuBuf::IpcReadL() +// --------------------------------------------------------- +// +void RMenuBuf::IpcReadL( TInt& aLength ) + { + TPtr8 ptr( iBuf.iData, KMenuStreamBufSize ); + User::LeaveIfError( SendReceive( EMenuStreamRead, TIpcArgs( &ptr ) ) ); + SetBuf( EWrite, iBuf.iData, iBuf.iData ); + SetBuf( ERead, iBuf.iData, iBuf.iData + ptr.Length() ); + aLength = ptr.Length(); + } + +// --------------------------------------------------------- +// RMenuBuf::IpcWriteL() +// --------------------------------------------------------- +// +void RMenuBuf::IpcWriteL() + { + if ( Lag( EWrite ) ) + { + TPtrC8 ptr( iBuf.iData, Lag( EWrite ) ); + User::LeaveIfError + ( SendReceive( EMenuStreamWrite, TIpcArgs( &ptr ) ) ); + } + SetBuf( ERead, iBuf.iData, iBuf.iData ); + SetBuf( EWrite, iBuf.iData, iBuf.iData + KMenuStreamBufSize ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuclientoperation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuclientoperation.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuclientoperation.h" +#include "menumsg.h" +#include "mcsmenu.h" +#include "menubuf.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RMenuOperation::Close +// --------------------------------------------------------- +// +void RMenuOperation::Close() + { + if ( SubSessionHandle() ) + { + CloseSubSession( EMenuOperationClose ); + } + } + +// --------------------------------------------------------- +// RMenuOperation::CreateRemove +// --------------------------------------------------------- +// +TInt RMenuOperation::CreateRemove( RMenu& aMenu, TInt aId ) + { + __ASSERT_DEBUG( !SubSessionHandle(), User::Invariant() ); + return CreateSubSession( + aMenu, + EMenuOperationCreateRemove, + TIpcArgs( aId ) ); + } + +// --------------------------------------------------------- +// RMenuOperation::CreateMoveToFolder +// --------------------------------------------------------- +// +TInt RMenuOperation::CreateMoveToFolder +( RMenu& aMenu, const RMenuBuf& aItems, TInt aFolder, TInt aMoveBefore ) + { + __ASSERT_DEBUG( !SubSessionHandle(), User::Invariant() ); + return CreateSubSession( + aMenu, + EMenuOperationCreateMoveToFolder, + TIpcArgs( aItems.SubSessionHandle(), aFolder, aMoveBefore ) ); + } + +// --------------------------------------------------------- +// RMenuOperation::CreateReorder +// --------------------------------------------------------- +// +TInt RMenuOperation::CreateReorder +( RMenu& aMenu, TInt aId, TInt aMoveBefore ) + { + __ASSERT_DEBUG( !SubSessionHandle(), User::Invariant() ); + return CreateSubSession( + aMenu, + EMenuOperationCreateReorder, + TIpcArgs( aId, aMoveBefore ) ); + } + +// --------------------------------------------------------- +// RMenuOperation::CreateAdd +// --------------------------------------------------------- +// +TInt RMenuOperation::CreateAdd +( RMenu& aMenu, const TDesC& aType, const RMenuBuf& aChanges, TInt& aId ) + { + __ASSERT_DEBUG( !SubSessionHandle(), User::Invariant() ); + TPckg id( aId ); + id() = 0; + return CreateSubSession( + aMenu, + EMenuOperationCreateAdd, + TIpcArgs( &aType, aChanges.SubSessionHandle(), &id ) ); + } + +// --------------------------------------------------------- +// RMenuOperation::CreateUpdate +// --------------------------------------------------------- +// +TInt RMenuOperation::CreateUpdate +( RMenu& aMenu, TInt aId, const RMenuBuf& aChanges ) + { + __ASSERT_DEBUG( !SubSessionHandle(), User::Invariant() ); + return CreateSubSession( + aMenu, + EMenuOperationCreateUpdate, + TIpcArgs( aId, aChanges.SubSessionHandle() ) ); + } + +// --------------------------------------------------------- +// RMenuOperation::Cancel +// --------------------------------------------------------- +// +void RMenuOperation::Cancel() + { + SendReceive( EMenuOperationCancel ); + } + +// --------------------------------------------------------- +// RMenuOperation::Start +// --------------------------------------------------------- +// +void RMenuOperation::Start( TRequestStatus &aStatus ) + { + aStatus = KRequestPending; + SendReceive( EMenuOperationStart, aStatus ); + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuClientOperation::~CMenuClientOperation +// --------------------------------------------------------- +// +CMenuClientOperation::~CMenuClientOperation() + { + Cancel(); + iOperation.Close(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::CMenuClientOperation +// --------------------------------------------------------- +// +CMenuClientOperation::CMenuClientOperation +( RMenu &aMenu, TInt aPriority, TRequestStatus &aObserverStatus ) +: CMenuOperation( aMenu, aPriority, aObserverStatus ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CMenuClientOperation::RemoveL +// --------------------------------------------------------- +// +void CMenuClientOperation::RemoveL( TInt aId ) + { + User::LeaveIfError( iOperation.CreateRemove( iMenu, aId ) ); + Start(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::MoveToFolderL +// --------------------------------------------------------- +// +void CMenuClientOperation::MoveToFolderL +( const RMenuBuf& aItems, TInt aFolder, TInt aMoveBefore ) + { + User::LeaveIfError( iOperation.CreateMoveToFolder + ( iMenu, aItems, aFolder, aMoveBefore ) ); + Start(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::ReorderL +// --------------------------------------------------------- +// +void CMenuClientOperation::ReorderL( TInt aId, TInt aMoveBefore ) + { + User::LeaveIfError( iOperation.CreateReorder( iMenu, aId, aMoveBefore ) ); + Start(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::AddL +// --------------------------------------------------------- +// +TInt CMenuClientOperation::AddL +( const TDesC& aType, const RMenuBuf& aChanges ) + { + TInt id = 0; + User::LeaveIfError( iOperation.CreateAdd( iMenu, aType, aChanges, id ) ); + Start(); + return id; + } + +// --------------------------------------------------------- +// CMenuClientOperation::UpdateL +// --------------------------------------------------------- +// +void CMenuClientOperation::UpdateL +( TInt aId, const RMenuBuf& aChanges ) + { + User::LeaveIfError( iOperation.CreateUpdate( iMenu, aId, aChanges ) ); + Start(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::Start +// --------------------------------------------------------- +// +void CMenuClientOperation::Start() + { + iObserverStatus = KRequestPending; + iOperation.Start( iStatus ); + SetActive(); + } + +// --------------------------------------------------------- +// CMenuClientOperation::RunL +// --------------------------------------------------------- +// +void CMenuClientOperation::RunL() + { + // Propagate completion to observer. + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + +// --------------------------------------------------------- +// CMenuClientOperation::DoCancel +// --------------------------------------------------------- +// +void CMenuClientOperation::DoCancel() + { + iOperation.Cancel(); + // Propagate completion to observer. + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menucompletedoperation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menucompletedoperation.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menucompletedoperation.h" +#include "mcsmenu.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuCompletedOperation::~CMenuCompletedOperation +// --------------------------------------------------------- +// +EXPORT_C CMenuCompletedOperation::~CMenuCompletedOperation() + { + Cancel(); + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::NewL +// --------------------------------------------------------- +// +EXPORT_C CMenuCompletedOperation* CMenuCompletedOperation::NewL( + RMenu &aMenu, + TInt aPriority, + TRequestStatus &aObserverStatus, + TInt aError ) + { + CMenuCompletedOperation* op = new (ELeave) CMenuCompletedOperation + ( aMenu, aPriority, aObserverStatus ); + op->ReportCompletion( aError ); + return op; + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::CMenuCompletedOperation +// --------------------------------------------------------- +// +CMenuCompletedOperation::CMenuCompletedOperation +( RMenu &aMenu, TInt aPriority, TRequestStatus &aObserverStatus ) +: CMenuOperation( aMenu, aPriority, aObserverStatus ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::ReportCompletion +// --------------------------------------------------------- +// +void CMenuCompletedOperation::ReportCompletion( TInt aError ) + { + iObserverStatus = KRequestPending; + TRequestStatus* ownStatus = &iStatus; + *ownStatus = KRequestPending; + SetActive(); + User::RequestComplete( ownStatus, aError ); + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::RunL +// --------------------------------------------------------- +// +void CMenuCompletedOperation::RunL() + { + // Propagate completion to observer. + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, iStatus.Int() ); + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::DoCancel +// --------------------------------------------------------- +// +void CMenuCompletedOperation::DoCancel() + { + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, KErrCancel ); + } + +// --------------------------------------------------------- +// CMenuCompletedOperation::RunError +// --------------------------------------------------------- +// +TInt CMenuCompletedOperation::RunError( TInt aError ) + { + TRequestStatus* status = &iObserverStatus; + User::RequestComplete( status, aError ); + + return KErrNone; + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menufilter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menufilter.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,258 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mcsmenufilter.h" +#include "menuitemattr.h" + +#include + +NONSHARABLE_CLASS( CMenuFilter::TData ) + { + +public: // data + + TUint32 iFlagsOn; ///< These flags should be on. + TUint32 iFlagsOff; ///< These flags should be off. + TBuf iType; ///< Type filter (empty == filter off). + RMenuItemAttrArray iAttributes; ///< Attribute filter. + + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuFilter::~CMenuFilter +// --------------------------------------------------------- +// +EXPORT_C CMenuFilter::~CMenuFilter() + { + if ( iData ) + { + iData->iAttributes.ResetAndDestroy(); + delete iData; + } + } + +// --------------------------------------------------------- +// CMenuFilter::NewL +// --------------------------------------------------------- +// +EXPORT_C CMenuFilter* CMenuFilter::NewL() + { + CMenuFilter* filter = NewLC(); + CleanupStack::Pop( filter ); + return filter; + } + +// --------------------------------------------------------- +// CMenuFilter::NewLC +// --------------------------------------------------------- +// +EXPORT_C CMenuFilter* CMenuFilter::NewLC() + { + CMenuFilter* filter = new (ELeave) CMenuFilter(); + CleanupStack::PushL( filter ); + filter->ConstructL(); + return filter; + } + +// --------------------------------------------------------- +// CMenuFilter::CMenuFilter +// --------------------------------------------------------- +// +CMenuFilter::CMenuFilter() + { + } + +// --------------------------------------------------------- +// CMenuFilter::ConstructL +// --------------------------------------------------------- +// +void CMenuFilter::ConstructL() + { + iData = new (ELeave) CMenuFilter::TData(); + Reset(); + } + +// --------------------------------------------------------- +// CMenuFilter::FlagsOn +// --------------------------------------------------------- +// +EXPORT_C TUint32 CMenuFilter::FlagsOn() const + { + return iData->iFlagsOn; + } + +// --------------------------------------------------------- +// CMenuFilter::FlagsOff +// --------------------------------------------------------- +// +EXPORT_C TUint32 CMenuFilter::FlagsOff() const + { + return iData->iFlagsOff; + } + +// --------------------------------------------------------- +// CMenuFilter::Type +// --------------------------------------------------------- +// +EXPORT_C TPtrC CMenuFilter::Type() const + { + return iData->iType; + } + +// --------------------------------------------------------- +// CMenuFilter::NumAttributes +// --------------------------------------------------------- +// +EXPORT_C TInt CMenuFilter::NumAttributes() const + { + return iData->iAttributes.Count(); + } + +// --------------------------------------------------------- +// CMenuFilter::GetAttribute +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuFilter::GetAttribute +( TInt aIndex, TPtrC& aAttrName, TPtrC& aAttrValue ) const + { + CMenuItemAttr* attr = iData->iAttributes[aIndex]; + aAttrName.Set( attr->Name() ); + if ( attr->Value() ) + { + aAttrValue.Set( *attr->Value() ); + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------- +// CMenuFilter::Reset +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::Reset() + { + iData->iType = KNullDesC(); + iData->iAttributes.ResetAndDestroy(); + iData->iFlagsOn = 0; + iData->iFlagsOff = 0; + } + +// --------------------------------------------------------- +// CMenuFilter::SetFlags +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::SetFlags( TUint32 aFlagsOn, TUint32 aFlagsOff ) + { + iData->iFlagsOn = aFlagsOn; + iData->iFlagsOff = aFlagsOff; + } + +// --------------------------------------------------------- +// CMenuFilter::SetType +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::SetType( const TDesC& aType ) + { + iData->iType = aType; + } + +// --------------------------------------------------------- +// CMenuFilter::HaveAttributeL +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::HaveAttributeL +( const TDesC& aAttrName, const TDesC& aAttrValue ) + { + CMenuItemAttr* attr = NULL; + TInt i = iData->iAttributes.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuItemAttr::NewLC( aAttrName ); + iData->iAttributes.AppendL( attr ); + CleanupStack::Pop( attr ); // Now owned by iAttributes. + } + else + { + attr = iData->iAttributes[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); + attr->SetValue( aAttrValue.AllocL() ); + } + +// --------------------------------------------------------- +// CMenuFilter::DoNotHaveAttributeL +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::DoNotHaveAttributeL( const TDesC& aAttrName ) + { + CMenuItemAttr* attr = NULL; + TInt i = iData->iAttributes.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuItemAttr::NewLC( aAttrName ); + iData->iAttributes.AppendL( attr ); + CleanupStack::Pop( attr ); // Now owned by iAttributes. + } + else + { + attr = iData->iAttributes[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); + attr->SetValue( NULL ); + } + +// --------------------------------------------------------- +// CMenuFilter::RemoveAttribute +// --------------------------------------------------------- +// +EXPORT_C void CMenuFilter::RemoveAttribute( const TDesC& aAttrName ) + { + TInt i = iData->iAttributes.Find( aAttrName ); + if ( KErrNotFound != i ) + { + delete iData->iAttributes[i]; + iData->iAttributes.Remove( i ); + } + } + +// --------------------------------------------------------- +// CMenuFilter::ExternalizeL +// --------------------------------------------------------- +// +void CMenuFilter::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteUint32L( iData->iFlagsOn ); + aStream.WriteUint32L( iData->iFlagsOff ); + aStream.WriteInt32L( iData->iType.Length() ); + aStream.WriteL( iData->iType ); + iData->iAttributes.ExternalizeL( aStream ); + } + +// --------------------------------------------------------- +// CMenuFilter::InternalizeL +// --------------------------------------------------------- +// +void CMenuFilter::InternalizeL( RReadStream& aStream ) + { + iData->iFlagsOn = aStream.ReadUint32L(); + iData->iFlagsOff = aStream.ReadUint32L(); + TInt len = aStream.ReadInt32L(); + aStream.ReadL( iData->iType, len ); + iData->iAttributes.ResetAndDestroy(); + iData->iAttributes.InternalizeL( aStream ); + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuhandler.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mcsmenuhandler.h" + +// ================= MEMBER FUNCTIONS ======================= + +NONSHARABLE_CLASS( CMenuHandler::TData ) + { + // Future-proofing only. + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuHandler::~CMenuHandler +// --------------------------------------------------------- +// +EXPORT_C CMenuHandler::~CMenuHandler() + { + } + +// --------------------------------------------------------- +// CMenuHandler::CMenuHandler +// --------------------------------------------------------- +// +EXPORT_C CMenuHandler::CMenuHandler( RMenu &aMenu ) +: iMenu( aMenu ) + { + } + +// --------------------------------------------------------- +// CMenuHandler::BaseConstructL +// --------------------------------------------------------- +// +EXPORT_C void CMenuHandler::BaseConstructL() + { + // Future-proofing only. + } + +// --------------------------------------------------------- +// CMenuHandler::SupportsType +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuHandler::SupportsType( const TDesC& /*aType*/ ) + { + return EFalse; + } + +// --------------------------------------------------------- +// CMenuHandler::HandleCommandL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* CMenuHandler::HandleCommandL( + CMenuItem& /*aItem*/, + const TDesC8& /*aCommand*/, + const TDesC8& /*aParams*/, + TRequestStatus& /*aStatus*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuhandlereng.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuhandlereng.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuhandlereng.h" +#include "mcsmenuhandler.h" +#include "mcsmenuhandlerplugin.h" +#include "mcsmenuhandlerplugin.hrh" +#include "mcsdef.h" +#include "mcsmenuitem.h" +#include "menuuid.hrh" + +// ================= MEMBER FUNCTIONS ======================= + +/** +* Cleanupstack support method, calls RImplInfoPtrArray::ResetAndDestroy() +* of the passed argument (array). +* @param aArray Array. +*/ +LOCAL_C void ResetAndDestroyArray( TAny* aArray ) + { + ((RImplInfoPtrArray*)aArray)->ResetAndDestroy(); + } + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuHandlerEng::~CMenuHandlerEng +// --------------------------------------------------------- +// +CMenuHandlerEng::~CMenuHandlerEng() + { + iHandlers.ResetAndDestroy(); + } + +// --------------------------------------------------------- +// CMenuHandlerEng::NewL +// --------------------------------------------------------- +// +CMenuHandlerEng* CMenuHandlerEng::NewL( RMenu& aMenu ) + { + CMenuHandlerEng* eng = new (ELeave) CMenuHandlerEng( aMenu ); + return eng; + } + +// --------------------------------------------------------- +// CMenuHandlerEng::CMenuHandlerEng +// --------------------------------------------------------- +// +CMenuHandlerEng::CMenuHandlerEng( RMenu& aMenu ): iMenu( aMenu ) + { + } + +// --------------------------------------------------------- +// CMenuHandlerEng::HandleCommandL +// --------------------------------------------------------- +// +CMenuOperation* CMenuHandlerEng::HandleCommandL( + CMenuItem& aItem, + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ) + { + // Currently, we load handlers on demand and never unload them. + // As there aren't many types of items, this seems appropriate. + CMenuHandler* handler = FindHandler( aItem.Type() ); + if ( !handler ) + { + handler = LoadHandlerL( aItem.Type() ); + } + if ( handler ) + { + return handler->HandleCommandL( aItem, aCommand, aParams, aStatus ); + } + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------- +// CMenuHandlerEng::FindHandler +// --------------------------------------------------------- +// +CMenuHandler* CMenuHandlerEng::FindHandler( const TDesC& aType ) + { + for ( TInt i = 0; i < iHandlers.Count(); i++ ) + { + CMenuHandler* handler = iHandlers[i]; + if ( handler->SupportsType( aType ) ) + { + return handler; + } + } + return NULL; + } + +// --------------------------------------------------------- +// CMenuHandlerEng::LoadHandlerL +// --------------------------------------------------------- +// +CMenuHandler* CMenuHandlerEng::LoadHandlerL( const TDesC& aType ) + { + CMenuHandlerPlugin* handler = NULL; + TBuf8 type; + type.Copy( aType ); + TEComResolverParams resolverParams; + resolverParams.SetDataType( type ); + RImplInfoPtrArray implInfoArray; + CleanupStack::PushL( TCleanupItem( ResetAndDestroyArray, &implInfoArray ) ); + REComSession::ListImplementationsL + ( TUid::Uid( MENU_HANDLER_IF_UID ), resolverParams, implInfoArray ); + + __ASSERT_DEBUG( implInfoArray.Count() <= 1, User::Invariant() ); + + if ( implInfoArray.Count() != 0 ) + { + TUid implUid = implInfoArray[ 0 ]->ImplementationUid(); + handler = CMenuHandlerPlugin::NewL( implUid, iMenu ); + CleanupStack::PushL( handler ); + // Here we check if this is the handler we need. Currently we only do + // a sanity check for the handler (it should support the registered + // types!), but later this can be extended with better support query. + // E.g. support for type AND command, etc. + if ( handler->SupportsType( aType ) ) + { + iHandlers.AppendL( handler ); + CleanupStack::Pop( handler ); + } + else + { + CleanupStack::PopAndDestroy( handler ); + handler = NULL; + } + } + + CleanupStack::PopAndDestroy( &implInfoArray ); + return handler; + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuitem.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,475 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include + +#include "mcsmenuitem.h" +#include "menuitemattr.h" +#include "menubuf.h" +#include "mcsmenu.h" +#include "menuclientoperation.h" +#include "menucompletedoperation.h" + + +NONSHARABLE_CLASS( CMenuItem::TData ) + { + +public: // construction + + TData( RMenu& aMenu ): iMenu( aMenu ) {} + +public: // data + + RMenu& iMenu; + TMenuItem iHdr; + TUint32 iOrigFlags; + RMenuItemAttrArray iAttrCache; + TInt iInsertBefore; + + }; + +// ================= LOCAL FUNCTIONS ======================= + +/** +* Check if this is a valid attribute name. Leave with KErrArgument if not. +* We don't accept whitespace or exotic characters anywhere, and also +* forbid setting reserved attribute "flags". +* The Engine also checks this, but it's more friendly to leave on client +* side too - no point in attempting something that we know will fail. +*/ +LOCAL_C void CheckAttrNameL( const TDesC& aAttrName ) + { + if ( !aAttrName.Length() ) + { + User::Leave( KErrArgument ); + } + if ( KMenuAttrFlags() == aAttrName || KMenuAttrId() == aAttrName ) + { + // Internal attributes, disallow. + User::Leave( KErrArgument ); + } + for ( TInt i = 0; i < aAttrName.Length(); i++ ) + { + const TChar c = aAttrName[i]; + // Allowed set of characters + if ( !c.IsAlphaDigit() && + '_' != c && + '-' != c && + ':' != c ) + { + User::Leave( KErrArgument ); + } + } + } + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// TMenuItem::ExternalizeL +// --------------------------------------------------------- +// +void TMenuItem::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt32L( iId ); + aStream.WriteInt32L( iParent ); + aStream.WriteUint32L( iFlags ); + aStream.WriteInt32L( iType.Length() ); + aStream.WriteL( iType ); + } + +// --------------------------------------------------------- +// TMenuItem::InternalizeL +// --------------------------------------------------------- +// +void TMenuItem::InternalizeL( RReadStream& aStream ) + { + iId = aStream.ReadInt32L(); + iParent = aStream.ReadInt32L(); + iFlags = aStream.ReadUint32L(); + TInt len = aStream.ReadInt32L(); + aStream.ReadL( iType, len ); + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuItem::~CMenuItem +// --------------------------------------------------------- +// +EXPORT_C CMenuItem::~CMenuItem() + { + if ( iData ) + { + iData->iAttrCache.ResetAndDestroy(); + delete iData; + } + } + +// --------------------------------------------------------- +// CMenuItem::CreateL +// --------------------------------------------------------- +// +EXPORT_C CMenuItem* CMenuItem::CreateL +( RMenu& aMenu, const TDesC& aType, TInt aFolder, TInt aInsertBefore ) + { + if ( KMenuTypeData() == aType ) + { + // Internal type, disallow. + User::Leave( KErrArgument ); + } + // Item created locally, no IPC. + CMenuItem* item = NewLC( aMenu ); + item->iData->iHdr.SetType( aType ); + item->iData->iHdr.SetParent( aFolder ); + item->iData->iOrigFlags = item->iData->iHdr.Flags(); + item->iData->iInsertBefore = aInsertBefore; + CleanupStack::Pop( item ); + return item; + } + +// --------------------------------------------------------- +// CMenuItem::OpenL +// --------------------------------------------------------- +// +EXPORT_C CMenuItem* CMenuItem::OpenL( RMenu& aMenu, TInt aId ) + { + // Get header from server, IPC needed. + return OpenL( aMenu, aMenu.GetHdrL( aId ) ); + } + +// --------------------------------------------------------- +// CMenuItem::OpenL +// --------------------------------------------------------- +// +EXPORT_C CMenuItem* CMenuItem::OpenL( RMenu& aMenu, const TMenuItem& aHdr ) + { + // We accept the existing header, no IPC needed. + CMenuItem* item = NewLC( aMenu ); + item->iData->iHdr = aHdr; + item->iData->iOrigFlags = item->iData->iHdr.Flags(); + CleanupStack::Pop( item ); + return item; + } + +// --------------------------------------------------------- +// CMenuItem::CMenuItem +// --------------------------------------------------------- +// +CMenuItem::CMenuItem() + { + } + +// --------------------------------------------------------- +// CMenuItem::NewLC +// --------------------------------------------------------- +// +CMenuItem* CMenuItem::NewLC( RMenu& aMenu ) + { + CMenuItem* item = new (ELeave) CMenuItem(); + CleanupStack::PushL( item ); + item->iData = new (ELeave) CMenuItem::TData( aMenu ); + return item; + } + +// --------------------------------------------------------- +// CMenuItem::Id +// --------------------------------------------------------- +// +EXPORT_C TInt CMenuItem::Id() const + { + return iData->iHdr.Id(); + } + +// --------------------------------------------------------- +// CMenuItem::Parent +// --------------------------------------------------------- +// +EXPORT_C TInt CMenuItem::Parent() const + { + return iData->iHdr.Parent(); + } + +// --------------------------------------------------------- +// CMenuItem::Flags +// --------------------------------------------------------- +// +EXPORT_C TUint32 CMenuItem::Flags() const + { + return iData->iHdr.Flags(); + } + +// --------------------------------------------------------- +// CMenuItem::SetFlags +// --------------------------------------------------------- +// +EXPORT_C void CMenuItem::SetFlags( TUint32 aMask, TBool aOn ) + { + if ( aOn ) + { + iData->iHdr.SetFlags( iData->iHdr.Flags() | aMask ); + } + else + { + iData->iHdr.SetFlags( iData->iHdr.Flags() & ~aMask ); + } + } + +// --------------------------------------------------------- +// CMenuItem::Type +// --------------------------------------------------------- +// +EXPORT_C TPtrC CMenuItem::Type() const + { + return iData->iHdr.Type(); + } + +// --------------------------------------------------------- +// CMenuItem::GetAttributeL +// --------------------------------------------------------- +// +EXPORT_C TPtrC CMenuItem::GetAttributeL +( const TDesC& aAttrName, TBool& aAttrExists ) + { + CheckAttrNameL( aAttrName ); + CMenuItemAttr* attr = NULL; + TInt i = iData->iAttrCache.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuItemAttr::NewLC( aAttrName ); + HBufC* value; + if( iData->iHdr.Id() ) + { + value = iData->iMenu.GetAttributeL( Id(), aAttrName ); + } + else + { + value = NULL; + } + + attr->SetValue( value ); // Takes ownership. + attr->SetChanged( EFalse ); // New in cache -> not changed. + iData->iAttrCache.AppendL( attr ); + CleanupStack::Pop( attr ); // Now owned by the cache. + } + else + { + attr = iData->iAttrCache[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); // Should be cached by now. + if ( attr->Value() ) + { + aAttrExists = ETrue; + return *attr->Value(); + } + aAttrExists = EFalse; + return KNullDesC(); + } + +// --------------------------------------------------------- +// CMenuItem::GetAttributeL +// --------------------------------------------------------- +// +EXPORT_C void CMenuItem::GetAttributeListL( RArray& aList ) + { + iData->iMenu.GetAttributeListL( Id(), aList ); + } + +// --------------------------------------------------------- +// CMenuItem::SetAttributeL +// --------------------------------------------------------- +// +EXPORT_C void CMenuItem::SetAttributeL +( const TDesC& aAttrName, const TDesC& aAttrValue ) + { + CheckAttrNameL( aAttrName ); + CMenuItemAttr* attr = NULL; + TInt i = iData->iAttrCache.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuItemAttr::NewLC( aAttrName ); + attr->SetChanged( ETrue ); // Changed. + iData->iAttrCache.AppendL( attr ); + CleanupStack::Pop( attr ); // Now owned by the cache. + } + else + { + attr = iData->iAttrCache[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); // Should be cached by now. + attr->SetValue( aAttrValue.AllocL() ); // Sets changed bit as needed. + } + +// --------------------------------------------------------- +// CMenuItem::RemoveAttributeL +// --------------------------------------------------------- +// +EXPORT_C void CMenuItem::RemoveAttributeL( const TDesC& aAttrName ) + { + CheckAttrNameL( aAttrName ); + CMenuItemAttr* attr = NULL; + TInt i = iData->iAttrCache.Find( aAttrName ); + if ( KErrNotFound == i ) + { + attr = CMenuItemAttr::NewLC( aAttrName ); + attr->SetChanged( ETrue ); // Changed. + iData->iAttrCache.AppendL( attr ); + CleanupStack::Pop( attr ); // Now owned by the cache. + } + else + { + attr = iData->iAttrCache[i]; + } + __ASSERT_DEBUG( attr, User::Invariant() ); // Should be cached by now. + attr->SetValue( NULL ); // Sets changed bit as needed. + } + +// --------------------------------------------------------- +// CMenuItem::SaveL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* CMenuItem::SaveL( TRequestStatus& aStatus ) + { + if ( !Changed() ) + { + return CMenuCompletedOperation::NewL + ( iData->iMenu, CActive::EPriorityStandard, aStatus, KErrNone ); + } + if ( Id() ) + { + return UpdateL( aStatus ); + } + return AddL( aStatus ); + } + +// --------------------------------------------------------- +// CMenuItem::HandleCommandL +// --------------------------------------------------------- +// +EXPORT_C CMenuOperation* CMenuItem::HandleCommandL( + const TDesC8& aCommand, + const TDesC8& aParams, + TRequestStatus& aStatus ) + { + return iData->iMenu.HandleCommandL( *this, aCommand, aParams, aStatus ); + } + +// --------------------------------------------------------- +// CMenuItem::AddL +// --------------------------------------------------------- +// +CMenuOperation* CMenuItem::AddL( TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( Changed(), User::Invariant() ); + __ASSERT_DEBUG( !Id(), User::Invariant() ); + RMenuBuf buf; + User::LeaveIfError( buf.Open( iData->iMenu ) ); + CleanupClosePushL( buf ); + RWriteStream stream( &buf ); + // Flags. + stream.WriteUint32L( iData->iHdr.Flags() ); + __ASSERT_DEBUG( 0 == iData->iOrigFlags, User::Invariant() ); // New item! + // Attributes. + __ASSERT_DEBUG( iData->iAttrCache.Count() == \ + iData->iAttrCache.CountChanged(), User::Invariant() ); // New item! + iData->iAttrCache.ExternalizeL( stream ); + // Parent folder and insertion point. + stream.WriteInt32L( Parent() ); + stream.WriteInt32L( iData->iInsertBefore ); + stream.CommitL(); + CMenuClientOperation* op = new (ELeave) CMenuClientOperation + ( iData->iMenu, CActive::EPriorityStandard, aStatus ); + CleanupStack::PushL( op ); + TInt id = op->AddL( Type(), buf ); + __ASSERT_DEBUG( id, User::Invariant() ); + iData->iHdr.SetId( id ); // Write ID back. + CleanupStack::Pop( op ); + CleanupStack::PopAndDestroy( &buf ); + ClearChanged(); + return op; + } + +// --------------------------------------------------------- +// CMenuItem::UpdateL +// --------------------------------------------------------- +// +CMenuOperation* CMenuItem::UpdateL( TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( Changed(), User::Invariant() ); + __ASSERT_DEBUG( Id(), User::Invariant() ); + RMenuBuf buf; + User::LeaveIfError( buf.Open( iData->iMenu ) ); + CleanupClosePushL( buf ); + RWriteStream stream( &buf ); + // Flags and flag changes (small -> always sent). + stream.WriteUint32L( iData->iHdr.Flags() ); + stream.WriteUint32L( iData->iOrigFlags ^ iData->iHdr.Flags() ); + // Changed attributes. + iData->iAttrCache.ExternalizeChangesL( stream ); + stream.CommitL(); + CMenuClientOperation* op = new (ELeave) CMenuClientOperation + ( iData->iMenu, CActive::EPriorityStandard, aStatus ); + CleanupStack::PushL( op ); + op->UpdateL( Id(), buf ); + CleanupStack::Pop( op ); + CleanupStack::PopAndDestroy( &buf ); + ClearChanged(); + return op; + } + +// --------------------------------------------------------- +// CMenuItem::Changed +// --------------------------------------------------------- +// +TBool CMenuItem::Changed() const + { + return !iData->iHdr.Id() || // New item + iData->iHdr.Flags() != iData->iOrigFlags || // Changed flags + iData->iAttrCache.CountChanged(); // Changed attributes + } + +// --------------------------------------------------------- +// CMenuItem::ClearChanged +// --------------------------------------------------------- +// +void CMenuItem::ClearChanged() + { + iData->iAttrCache.ClearChanged(); + iData->iOrigFlags = iData->iHdr.Flags(); + } + + +// --------------------------------------------------------- +// CMenuItem::RunningStatus +// --------------------------------------------------------- +// +EXPORT_C TBool CMenuItem::RunningStatusL() + { + TBool ret(EFalse); + HBufC* value; + value = iData->iMenu.GetAttributeL( Id(), KRunningStatus ); + if( value ) + { + ret = ETrue; + } + delete value; + return ret; + } + + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuitemattr.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuitemattr.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include +#include "menuitemattr.h" + +// ================= LOCAL FUNCTIONS ======================= + +/** +* Cleanup support method. Call ResetAndDestroy() on the array. +* @param RMenuItemArray* as TAny* +*/ +LOCAL_C void ResetAndDestroy( TAny* aArray ) + { + ((RMenuItemAttrArray*)aArray)->ResetAndDestroy(); + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMenuItemAttr::~CMenuItemAttr +// --------------------------------------------------------- +// +CMenuItemAttr::~CMenuItemAttr() + { + iName.Close(); + delete iValue; + } + +// --------------------------------------------------------- +// CMenuItemAttr::NewL +// --------------------------------------------------------- +// +CMenuItemAttr* CMenuItemAttr::NewL( const TDesC& aName ) + { + CMenuItemAttr* attr = NewLC( aName ); + CleanupStack::Pop( attr ); + return attr; + } + +// --------------------------------------------------------- +// CMenuItemAttr::NewLC +// --------------------------------------------------------- +// +CMenuItemAttr* CMenuItemAttr::NewLC( const TDesC& aName ) + { + CMenuItemAttr* attr = new (ELeave) CMenuItemAttr(); + CleanupStack::PushL( attr ); + attr->ConstructL( aName ); + return attr; + } + +// --------------------------------------------------------- +// CMenuItemAttr::NewLC +// --------------------------------------------------------- +// +CMenuItemAttr* CMenuItemAttr::NewLC( RReadStream& aStream ) + { + CMenuItemAttr* attr = new (ELeave) CMenuItemAttr(); + CleanupStack::PushL( attr ); + attr->InternalizeL( aStream ); + return attr; + } + +// --------------------------------------------------------- +// CMenuItemAttr::ConstructL +// --------------------------------------------------------- +// +void CMenuItemAttr::ConstructL( const TDesC& aName ) + { + iName.CreateL( aName ); + } + +// --------------------------------------------------------- +// CMenuItemAttr::SetValue +// --------------------------------------------------------- +// +void CMenuItemAttr::SetValue( HBufC* aValue ) + { + if ( iValue ) + { + if ( aValue && *iValue == *aValue ) + { + // String to same string: no change. + delete aValue; + } + else + { + // String to other string or NULL: change. + iChanged = ETrue; + delete iValue; + iValue = aValue; + } + } + else + { + if ( aValue ) + { + // NULL to string: change. + iChanged = ETrue; + iValue = aValue; + } + else + { + // NULL to NULL: no change. + } + } + } + +// --------------------------------------------------------- +// CMenuItemAttr::ExternalizeL +// --------------------------------------------------------- +// +void CMenuItemAttr::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt32L( iName.Length() ); + aStream.WriteL( iName ); + if ( iValue ) + { + aStream.WriteInt32L( iValue->Length() ); + aStream.WriteL( *iValue ); + } + else + { + aStream.WriteInt32L( KErrNotFound ); + } + } + +// --------------------------------------------------------- +// CMenuItemAttr::InternalizeL +// --------------------------------------------------------- +// +void CMenuItemAttr::InternalizeL( RReadStream& aStream ) + { + iName.Close(); + delete iValue; iValue = NULL; + TInt len; + len = aStream.ReadInt32L(); + iName.CreateL( len ); + aStream.ReadL( iName, len ); + len = aStream.ReadInt32L(); + if ( len >= 0 ) + { + iValue = HBufC::NewL( len ); + TPtr ptr( iValue->Des() ); + aStream.ReadL( ptr, len ); + } + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::Find +// --------------------------------------------------------- +// +TInt RMenuItemAttrArray::Find( const TDesC& aName ) const + { + for ( TInt i = 0; i < Count(); i++ ) + { + if ( !aName.Compare( operator[]( i )->Name() ) ) + { + return i; + } + } + return KErrNotFound; + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::CountChanged +// --------------------------------------------------------- +// +TInt RMenuItemAttrArray::CountChanged() const + { + TInt count = 0; + for ( TInt i = 0; i < Count(); i++ ) + { + if ( operator[]( i )->Changed() ) + { + count++; + } + } + return count; + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::ClearChanged +// --------------------------------------------------------- +// +void RMenuItemAttrArray::ClearChanged() + { + for ( TInt i = 0; i < Count(); i++ ) + { + operator[]( i )->SetChanged( EFalse ); + } + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::ExternalizeChangesL +// --------------------------------------------------------- +// +void RMenuItemAttrArray::ExternalizeChangesL( RWriteStream& aStream ) const + { + aStream.WriteInt32L( CountChanged() ); + for ( TInt i = 0; i < Count(); i++ ) + { + const CMenuItemAttr* attr = operator[]( i ); + if ( attr->Changed() ) + { + attr->ExternalizeL( aStream ); + } + } + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::ExternalizeL +// --------------------------------------------------------- +// +void RMenuItemAttrArray::ExternalizeL( RWriteStream& aStream ) const + { + aStream.WriteInt32L( Count() ); + for ( TInt i = 0; i < Count(); i++ ) + { + operator[]( i )->ExternalizeL( aStream ); + } + } + +// --------------------------------------------------------- +// RMenuItemAttrArray::InternalizeL +// --------------------------------------------------------- +// +void RMenuItemAttrArray::InternalizeL( RReadStream& aStream ) + { + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; i++ ) + { + CMenuItemAttr* attr = CMenuItemAttr::NewLC( aStream ); + AppendL( attr ); + CleanupStack::Pop( attr ); + } + } + +// --------------------------------------------------------- +// CleanupResetAndDestroyPushL +// --------------------------------------------------------- +// +void CleanupResetAndDestroyPushL( RMenuItemAttrArray& aArray ) + { + CleanupStack::PushL( TCleanupItem( ResetAndDestroy, &aArray ) ); + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menunotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menunotifier.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mcsmenunotifier.h" +#include "mcsmenu.h" +#include "menumsg.h" + +NONSHARABLE_CLASS( RMenuNotifier::TData ) + { + }; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RMenuNotifier::Close +// --------------------------------------------------------- +// +EXPORT_C void RMenuNotifier::Close() + { + if ( iData ) + { + CloseSubSession( EMenuNotifierClose ); + delete iData; iData = NULL; + } + } + +// --------------------------------------------------------- +// RMenuNotifier::Open +// --------------------------------------------------------- +// +EXPORT_C TInt RMenuNotifier::Open( RMenu& aMenu ) + { + __ASSERT_DEBUG( !iData, User::Invariant() ); + // Creation of local data and server object is atomic. + TInt err = KErrNone; + iData = new RMenuNotifier::TData(); + if ( iData ) + { + err = CreateSubSession( aMenu, EMenuNotifierOpen ); + if ( err ) + { + delete iData; iData = NULL; + } + } + else + { + err = KErrNoMemory; + } + return err; + } + +// --------------------------------------------------------- +// RMenuNotifier::Notify +// --------------------------------------------------------- +// +EXPORT_C void RMenuNotifier::Notify +( TInt aFolder, TInt aEvents, TRequestStatus& aStatus ) + { + __ASSERT_DEBUG( iData, User::Invariant() ); + TIpcArgs args( aFolder, aEvents ); + SendReceive( EMenuNotifierNotify, args, aStatus ); + } + +// --------------------------------------------------------- +// RMenuNotifier::Cancel +// --------------------------------------------------------- +// +EXPORT_C void RMenuNotifier::Cancel() + { + __ASSERT_DEBUG( iData, User::Invariant() ); + SendReceive( EMenuNotifierNotifyCancel ); + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuoperation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuoperation.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "mcsmenuoperation.h" + diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menusapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menusapi.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "mcsmenusapi.h" +#include "menumsg.h" + + + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// RMenu::GetListL +// --------------------------------------------------------- +// +EXPORT_C void RMenuSapi::GetListL( TDes8& aSerializedIn, + RBuf8& aSerializedOut ) + { + TInt sizeList(0); + TPckg sizeDes(sizeList); + TIpcArgs args1( &aSerializedIn, &sizeDes ); + User::LeaveIfError( SendReceive( EMenuGetListSize, args1 ) ); + aSerializedOut.CreateL( sizeList ); + TIpcArgs args2( &aSerializedOut ); + User::LeaveIfError( SendReceive( EMenuGetListData, args2 ) ); + } diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/src/menuutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/src/menuutil.cpp Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES + +#include "menuutil.h" +#include "menulogger.h" + +#include +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// MenuUtil::ExternalizeL +// --------------------------------------------------------- +// +void MenuUtil::ExternalizeL +( const RArray& aArray, RWriteStream& aStream ) + { + aStream.WriteInt32L( aArray.Count() ); + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + aStream.WriteInt32L( aArray[i] ); + } + } + +// --------------------------------------------------------- +// MenuUtil::InternalizeL +// --------------------------------------------------------- +// +void MenuUtil::InternalizeL +( RArray& aArray, RReadStream& aStream ) + { + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; i++ ) + { + aArray.AppendL( aStream.ReadInt32L() ); + } + } + +// --------------------------------------------------------- +// MenuUtil::ExternalizeL +// --------------------------------------------------------- +// +void MenuUtil::ExternalizeL +( const RArray& aArray, RWriteStream& aStream ) + { + aStream.WriteInt32L( aArray.Count() ); + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + aStream.WriteInt32L( aArray[i].iUid ); + } + } + +// --------------------------------------------------------- +// MenuUtil::InternalizeL +// --------------------------------------------------------- +// +void MenuUtil::InternalizeL +( RArray& aArray, RReadStream& aStream ) + { + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; i++ ) + { + aArray.AppendL( TUid::Uid(aStream.ReadInt32L()) ); + } + } + +// --------------------------------------------------------- +// MenuUtil::ExternalizeL +// --------------------------------------------------------- +// +void MenuUtil::ExternalizeL +( const RArray& aArray, RWriteStream& aStream ) + { + aStream.WriteInt32L( aArray.Count() ); + for ( TInt i = 0; i < aArray.Count(); i++ ) + { + aArray[i].ExternalizeL( aStream ); + } + } + +// --------------------------------------------------------- +// MenuUtil::InternalizeL +// --------------------------------------------------------- +// +void MenuUtil::InternalizeL +( RArray& aArray, RReadStream& aStream ) + { + TMenuItem hdr; + TInt count = aStream.ReadInt32L(); + for ( TInt i = 0; i < count; i++ ) + { + hdr.InternalizeL( aStream ); + aArray.AppendL( hdr ); + } + } + +// --------------------------------------------------------- +// MenuUtil::BackupInProgressL +// --------------------------------------------------------- +// +TBool MenuUtil::BackupInProgressL() + { + TBool backupInProgress( EFalse ); + TInt backupRestoreStatus( 0 ); + const TInt err = RProperty::Get( KUidSystemCategory, + conn::KUidBackupRestoreKey, + backupRestoreStatus ); + + if( err ) + { + CLOG_WRITE_FORMAT8( "B&R error: %d", err ); + if( KErrNotFound != err ) + { + User::Leave( err ); + } + } + else + { + CLOG_WRITE_FORMAT8( "B&R status: 0x%x", backupRestoreStatus ); + if( backupRestoreStatus == conn::EBURUnset || + backupRestoreStatus & conn::EBURNormal || + (backupRestoreStatus & conn::KBackupIncTypeMask) == conn::ENoBackup) + { + backupInProgress = EFalse; + } + else + { + backupInProgress = ETrue; + } + } + + return backupInProgress; + } + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcscachehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcscachehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,86 @@ +/* +* 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 __MCSCACHEHANDLER_H__ +#define __MCSCACHEHANDLER_H__ + +#include "menusrvattr.h" +class CMenuEng; +class CMenuSrvEngUtils; + +/** + * DRM Handler. + * @lib mcsdrmhandler.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsCacheHandler ): + public CBase + { +public: + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + IMPORT_C static CMcsCacheHandler* NewL( + CMenuEng& aEng, + CMenuSrvEngUtils& aUtils ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsCacheHandler(); + + void HandleRemoveId( TInt aId ); + void HandleRemoveAttribute( TInt aId, const TDesC& aAttrName ); + + void EngineEvents( TInt aEvents ); + +private: + + /** + * Constructor. + */ + CMcsCacheHandler( + CMenuEng& aEng, + CMenuSrvEngUtils& aUtils ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + void RemoveNotExistItems(); + + void CMcsCacheHandler::RemoveItemsWithChangedAttributesL(); + + +private: // data + CMenuEng& iEng ; ///< Engine. + + CMenuSrvEngUtils& iUtils; + +public: + RMenuSrvAttrArray iAttrCache; + }; + +#endif // __MCSDRMHANDLER_H__ \ No newline at end of file diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcschildrenhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcschildrenhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 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 MCSCHILDRENHANDLER_H_ +#define MCSCHILDRENHANDLER_H_ + +#include "mcschildrenscanner.h" + +class CMenuSrvEng; +class CMcsCacheHandler; + +/** + * FolderChildrenCount Handler. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsChildrenHandler ): + public CBase, + public MMcsChildrenScanner + { +public: + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + + static CMcsChildrenHandler* NewL( + CMenuSrvEng& aSrvEng, + CMcsCacheHandler& aCacheHandler ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsChildrenHandler(); + + + void EngineEvents( TInt aFolder, TInt aEvents ); + void HandleChildrenEvent(TInt aId, TUint aOldCount, TUint aNewCount); + +private: + + /** + * Constructor. + */ + CMcsChildrenHandler( + CMenuSrvEng& aSrvEng, + CMcsCacheHandler& aCacheHandler ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + void ScanL(TInt aFolder); + + +private: // data + + + CMenuSrvEng& iSrvEng; + + CMcsCacheHandler& iCacheHandler; + + CMcsChildrenScanner* iScanner; /// < Own + + }; + +#endif /*MCSCHILDRENHANDLER_H_*/ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcschildrenscanner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcschildrenscanner.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2009 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 MCSCHILDRENSCANNER_H_ +#define MCSCHILDRENSCANNER_H_ + + +#include +#include "menuengoperation.h" +#include "mcsmenuitem.h" + +class CMenuSrvEng; + +/** + * Interface for updating Now Playing entry after Publish&Subscribe events. + * + * @since S60 v3.2 + */ +class MMcsChildrenScanner + { + +public: + virtual void HandleChildrenEvent(TInt aId, TUint oldCount, TUint newCount) = 0; + }; + + +/** + * Children Scanner Active Object. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsChildrenScanner ) : + public CActive, + public MMenuEngOperation + { + +public: + + /** + * Creates an instance of CMcsChildrenScanner implementation. + * + * @since S60 v5.0 + */ + static CMcsChildrenScanner* NewL( + MMcsChildrenScanner& aObserver, + CMenuSrvEng& aSrvEng); + + /** + * Destructor. + */ + virtual ~CMcsChildrenScanner(); + + void Scan(TInt aId); + +private: + + /** + * Execute engine operation: + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + + void ScanFolderL(); + + +private: + /** + * Constructor. + * + * @since S60 v5.0 + */ + CMcsChildrenScanner ( + MMcsChildrenScanner& aObserver, + CMenuSrvEng& aSrvEng); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + +private: // From CActive. + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + +private: + + void AddId(TInt aId); + + void RemoveId(TInt aId); + +private: + + + /** + * Interface for notifying changes. + * Not own. + */ + MMcsChildrenScanner& iObserver; + + /** + * Menu engine. + * Not own. + */ + CMenuSrvEng& iSrvEng; + + TBool iOpStatus; + + RArray iIdBuff; + + }; + +#endif /*MCSCHILDRENSCANNER_H_*/ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsdrmhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsdrmhandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,110 @@ +/* +* 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 __MCSDRMHANDLER_H__ +#define __MCSDRMHANDLER_H__ + +#include "mcsinstallnotifier.h" + +#include "mcsdrmobserver.h" +#include "mcsdrmscanner.h" +#include "mcsdrmobservermanager.h" + +class CMcsCacheHandler; +class MMcsInstallListener; +/** + * DRM Handler. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsDrmHandler ): + public CBase, + public MMcsInstallListener, + public MMcsDrmObserver, + public MMcsDrmAppScanner + { +public: + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + + static CMcsDrmHandler* NewL( + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils, + CMcsCacheHandler& aCacheHandler ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsDrmHandler(); + + void HandleDrmEvent( TUid aUid ); + + void HandleDrmAppEvent(); + + void EngineEvents( TInt aFolder, TInt aEvents ); + + /** + * Handle Install Event + */ + void HandleInstallNotifyL(TInt aPackageUid); + +private: + + /** + * Constructor. + */ + CMcsDrmHandler( + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils, + CMcsCacheHandler& aCacheHandler ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + void AddRemoveObserversL( + const RArray& aDrmProtectedArray ); + + TInt AppFolderIdL( TUid aUid ); + +private: // data + + RMcsDrmObserverManager iObserversManager; + + + CMenuSrvEng& iSrvEng; ///< Menu Engine. Not own. + + CMenuSrvEngUtils& iUtils; + + CMcsCacheHandler& iCacheHandler; + + CMcsDrmScanner* iScanner; + + CMcsInstallNotifier* iInstallNotifier; + + }; + +#endif // __MCSDRMHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsdrmobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsdrmobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,138 @@ +/* +* 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 __MCSDRMOBSERVER_H__ +#define __MCSDRMOBSERVER_H__ + +#include +#include + +/** + * Interface for updating DRM rights after change. + * + * @since S60 v5.0 + */ +class MMcsDrmObserver + { + +public: + + /** + */ + virtual void HandleDrmEvent( TUid aUid ) = 0; + }; + + +/** + * DRM Observer Interface. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsDrmObserver ): + public CBase, + public MDRMEventObserver + { + +public: + + /** + * Creates an instance of CMcsDrmObserver implementation. + * + * @since S60 v5.0 + * @param aCallBack Reference to notifier interface. + */ + static CMcsDrmObserver* NewL( + MMcsDrmObserver& aObserver, + const TDesC& aDRMContentId, + TUid aUid, + TDRMEventType aDRMEventType ); + + + /** + * Destructor. + */ + virtual ~CMcsDrmObserver(); + + /** + */ + TUid Uid(); + + /** + * HandleNotificationL + * + * Callback function for the event notifications + * The MDRMEvent object ownership stays with the notifier, + * do not delete it + * + * @param aEvent : an object of the type MDRMEvent + * @since S60Rel2.6 + */ + void HandleEventL( MDRMEvent* aEvent ); + +private: + /** + * Constructor. + * + * @since S60 v5.0 + * @param aObserver Reference to MMcsDrmObserver interface. + * @param aUid UID of application + * @param aDRMEventType type of an event to register + */ + CMcsDrmObserver( + MMcsDrmObserver& aObserver, + TUid aUid, + TDRMEventType aDRMEventType ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL( const TDesC& aDRMContentId ); + + + + /** + */ + void RegisterEventObserverL(); + + /** + */ + void UnRegisterEventObserver(); + + +private: + + + /** + * Interface for notifying changes. + * Not own. + */ + MMcsDrmObserver& iObserver; + + TUid iAppUid; + + //Own + RBuf8 iContentId; + //Own + CDRMNotifier* iDRMNotifier; + + TDRMEventType iDRMEventType; + }; + +#endif // __MCSDRMOBSERVER_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsdrmobservermanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsdrmobservermanager.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __MCSDRMOBSERVERMANAGER_H_ +#define __MCSDRMOBSERVERMANAGER_H_ + +#include +#include "mcsdrmobserver.h" + + +class CMcsDrmObserver; +class CMenuSrvEngUtils; + + +class RMcsDrmObserverManager + { +public: + + /** + * Default constructor. + */ + RMcsDrmObserverManager( CMenuSrvEngUtils& aUtils ); + + /** + * Destructor. + */ + virtual ~RMcsDrmObserverManager(); + + + void RemoveMissingObservers( + const RArray& aDrmProtectedArray ); + + void CreateObserversL( + const RArray& aDrmArray, + TDRMEventType aMask, + MMcsDrmObserver& aObserver ); + + void CreateObserversL( + const RArray& aDrmProtectedArray, + MMcsDrmObserver& aObserver ); + + void RefreshObserverL( + const RArray& aDrmProtectedArray, + TUid aUid, + MMcsDrmObserver& aObserver ); + + /** + */ + void AddL( CMcsDrmObserver* aObserver ); + + /** + * + */ + void Remove( CMcsDrmObserver* aObserver ); + + /** + */ + void Close(); + + TInt FindUid( TUid aUid ); + +private: + RPointerArray< CMcsDrmObserver > iObservers; + + CMenuSrvEngUtils& iUtils; + }; + +#endif /*__MCSDRMOBSERVERMANAGER_H_*/ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsdrmscanner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsdrmscanner.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,205 @@ +/* +* 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 __MCSDRMSCANNER_H__ +#define __MCSDRMSCANNER_H__ + +#include +#include "menuengoperation.h" +#include "mcsmenuitem.h" + +class CMenuSrvEngUtils; +class CMenuSrvEng; +class TAppItem; +/** + * Interface for updating Now Playing entry after Publish&Subscribe events. + * + * @since S60 v3.2 + */ +class MMcsDrmAppScanner + { + +public: + + virtual void HandleDrmAppEvent() = 0; + }; + + +/** + * DRM Scanner Active Object. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsDrmScanner ) : + public CActive, + public MMenuEngOperation + { + +public: + + /** + * Creates an instance of CMcsDrmScanner implementation. + * + * @since S60 v5.0 + */ + static CMcsDrmScanner* NewL( + MMcsDrmAppScanner& aObserver, + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils ); + + /** + * Destructor. + */ + virtual ~CMcsDrmScanner(); + + const RArray& DrmExpiredAppArray(); + const RArray& DrmProtectedAppArray(); + + void Scan(); + + void RemoveObserverAndScanL( TUid aUid ); + +private: + + /** + * Execute engine operation: + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + + /** + */ + void ScanDrmApplicationsL(); + + /** + */ + void GetMcsAppItemsL( RArray& aArray ); + +private: + /** + * Constructor. + * + * @since S60 v5.0 + */ + CMcsDrmScanner( + MMcsDrmAppScanner& aObserver, + CMenuSrvEng& aSrvEng, + CMenuSrvEngUtils& aUtils ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + +private: // From CActive. + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + +private: + + void GetAppItemsL( + RArray& aItemArray, + RArray& aAppItemArray ); + + void GetUidsL( + RArray& aAppItemArray, + RArray& aUidArray ); + + TBool RemoveNotExistingApps( + RArray& aArrayToModify, + const RArray& aUidArray ); + + TBool RemoveChangedApps( ); + + TBool RemoveMissingApps( const RArray& aUidArray ); + + TBool CheckDrmAppsL( const RArray& aUidArray ); + +private: + + + +private: + + + /** + * Interface for notifying changes. + * Not own. + */ + MMcsDrmAppScanner& iObserver; + + + CMenuSrvEng& iSrvEng; + + CMenuSrvEngUtils& iUtils; + + RArray iNotProtectedAppArray; + RArray iDrmExpiredAppArray; + RArray iDrmProtectedAppArray; + + RArray iChangedAppArray; + + + TBool iOpStatus; + + }; + +NONSHARABLE_CLASS( TAppItem ) + { + public: + TAppItem( TInt aId, TUid aUid ): iId(aId), iUid(aUid) {}; + + TInt Id() const + { + return iId; + }; + + TUid Uid() const + { + return iUid; + }; + + private: + TInt iId; + TUid iUid; + + }; + + +#endif // __MCSDRMSCANNER_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsfreespaceobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsfreespaceobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CMCSFREESPACEOBSERVER_H +#define CMCSFREESPACEOBSERVER_H + +#include // For CActive, link against: euser.lib +#include + +/** + * Interface for monitoring free space. + * + * @since S60 v5.0 + */ +class MMcsFreeSpaceObserver + { +public: + /** + * Handles free space threshold events. + * It must be implemented in derived clesses. + */ + virtual void HandleFreeSpaceEventL() = 0; + static const TInt64 EFreeDiskSpace = 40*1024; + }; + + +/** + * Free space Observer Interface. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CMcsFreeSpaceObserver) : public CActive + { +public: + // Cancel and destroy + ~CMcsFreeSpaceObserver(); + + // Two-phased constructor. + static CMcsFreeSpaceObserver* NewL(MMcsFreeSpaceObserver& aCallback, + TInt64 aFreeDiskSpace = MMcsFreeSpaceObserver::EFreeDiskSpace, + TInt aDrive=EDriveC); + + // Two-phased constructor. + static CMcsFreeSpaceObserver* NewLC(MMcsFreeSpaceObserver& aCallback, + TInt64 aFreeDiskSpace = MMcsFreeSpaceObserver::EFreeDiskSpace, + TInt aDrive = EDriveC); + +private: + // C++ constructor + CMcsFreeSpaceObserver(MMcsFreeSpaceObserver& aCallback, + TInt64 aFreeDiskSpace, + TInt aDrive); + + // Second-phase constructor + void ConstructL(); + +private: + // From CActive + // Handle completion + void RunL(); + + void DoCancel(); + + TInt RunError(TInt aError); + +private: + /* + * Observed drive. + */ + TInt iDrive; + /* + * Free space threshold (bytes). + */ + TInt64 iFreeDiskSpace; + /* + * A handle to a file server session. + */ + RFs iFs; + /* + * An object of a class implementing callback + * function (HandleFreeSpaceEventL) + * of MMcsFreeSpaceObserver interface. + */ + MMcsFreeSpaceObserver& iCallback; + + }; + +#endif // CMCSFREESPACEOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsgetlistcreatorinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsgetlistcreatorinterface.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,209 @@ +/* +* 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 item information that is not supported by +* the MCS server itself +* +*/ + + +#ifndef __MCSGETLISTCREATORINTERFACE_H__ +#define __MCSGETLISTCREATORINTERFACE_H__ + +#include + +//forward declarations +class CLiwDefaultList; +class CLiwDefaultMap; +class CMenuSrvEng; + + +/** + * CMcsGetAttrStrategy + * Abstract class for sttribute getting strategy + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsGetAttrStrategy ): public CBase + { +public: + + /** + * Constructor. + */ + CMcsGetAttrStrategy( CMenuSrvEng& aEng ); + + /** + * Destructor. + */ + virtual ~CMcsGetAttrStrategy(); + + + /** + * TODO: add comment + */ + virtual void PrepareL(TInt aId) = 0; + + /** + * Get attribute value. + * @since S60 v5.0 + * @param aAttrName Attribute name. + * @param aAttrExists Will be set to indicate whether attribute exists + * or not. + * @return Attribute value. Empty string if attribute does not exist. + */ + virtual void GetAttributeL(const TDesC& aAttrName, + TBool& aAttrExists, TDes& aAttrVal ) = 0; + +protected: + /** + * Engine. not own + */ + CMenuSrvEng& iEng; + }; + + +/** + * Interface for creating list containg result for getlist operation + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CMcsGetListCreatorInterface ) : public CBase + { +public: + /** + * Destructor. + */ + ~CMcsGetListCreatorInterface(); + + /* + * Create getlist output list + * @param aIdsArray array containing ids of items to be added to output list + * @param aRequiredAttributes required attributes + * @param aIgnoredAttributes ignored attributes + * @result output list + */ + virtual CLiwDefaultList* CreateLC( + RArray& aIdsArray, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes) = 0; + +protected: + /** + * Constructor. + */ + CMcsGetListCreatorInterface( CMenuSrvEng& aEng ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Builds map with attributes + * @param aMenuItem an item + * @param aRequiredAttributes required attributes + * @param aIgnoredAttributes ignored attributes + * @param aMap map to store result + */ + void BuildMapL( + const TMenuItem& aMenuItem, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes, + CLiwDefaultMap* aMap ); + + /** + * Adds fundamental attributes for an item + * @param aMenuItem an item + * @param aMap map to store result + */ + void AddFundamentalAttributesL( + const TMenuItem& aMenuItem, + CLiwDefaultMap* aMap ); + + /** + * Adds required attributes + * @param aMenuItem an item + * @param aRequiredAttributes required attributes + * @param aMap map to store results + */ + void AddRequiredAttributesL( + const TMenuItem& aMenuItem, + CDesC16Array* aRequiredAttributes, + CLiwDefaultMap* aMap ); + + /** + * Adds all attributes without ignored + * @param aMenuItem an item + * @param aIgnoredAttributes ignored attributes + * @param aMap map to store results + */ + void AddAttributesWithoutIgnoredL( + const TMenuItem& aMenuItem, + CDesC16Array* aIgnoredAttributes, + CLiwDefaultMap* aMap ); + + /* + * Adds required attributes without ignored + * @param aMenuItem an item + * @param aRequiredAttributes required attributes + * @param aIgnoredAttributes ignored attributes + * @param aMap map to store results + */ + void AddRequiredAttributesWithoutIgnoredL( + const TMenuItem& aMenuItem, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes, + CLiwDefaultMap* aMap ); + + /** + * Adds all attributes + * @param aMenuItem an item + * @param aMap map to store results + */ + void AddAllAttributesL( + const TMenuItem& aMenuItem, + CLiwDefaultMap* aMap ); + + /* + * Adds icon related attributes to a map + * @param aMenuItem an item + * @param aMap map to store results + */ + void FillIconAttributesMapL( + const TMenuItem& aMenuItem, + CLiwDefaultMap* aMap ); + + /* + * Appends attribute to a map + * @param aAttrName an attribute name + * @param aMap map to store results + */ + void AppendAttrL( + const TDesC& aAttrName, + CLiwDefaultMap* aMap ); + + /* + * Sets actual attribute getting strategy for give item id. + */ + void SetGetterStrategyL(TInt aId); + +protected: + /** + * Engine. not own + */ + CMenuSrvEng& iEng ; + CMcsGetAttrStrategy* iActualGetter; ///< Actual strategy for item. + CMcsGetAttrStrategy* iSuiteGetter; ///< Get strategy for suite. Own. + CMcsGetAttrStrategy* iNormalGetter; ///< Get strategy for not suite. Own. + }; +#endif __MCSGETLISTCREATORINTERFACE_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsgetlistflatcreator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsgetlistflatcreator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* 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: This class implements MMcsGetListCreatorInterface. It builds flat +* output list for getlist operation +* +* +*/ + + +#ifndef __MCSGETLISTFLATCREATOR_H__ +#define __MCSGETLISTFLATCREATOR_H__ + +#include +#include "mcsgetlistcreatorinterface.h" + +//forward declarations +class CMenuSrvEng; + +/* + * GetList flat list creator + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsGetlistFlatCreator ): public CMcsGetListCreatorInterface + { +public: + /** + * Factory method. + */ + static CMcsGetlistFlatCreator* NewL( CMenuSrvEng& aEng ); + + /** + * Destructor. + */ + ~CMcsGetlistFlatCreator(); + +//from MMcsGetListCreatorInterface + CLiwDefaultList* CreateLC( RArray& aIdsArray, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes ); + +private: + /** + * Constructor. + */ + CMcsGetlistFlatCreator( CMenuSrvEng& aEng ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + }; + +#endif // __MCSGETLISTFLATCREATOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsgetlisthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsgetlisthandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,195 @@ +/* +* 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: This class is a handler for getlist operation. It manages fetching and +* providing getlist information +* +* +*/ + + +#ifndef __MCSGETLISTHANDLER_H__ +#define __MCSGETLISTHANDLER_H__ + +#include +#include + +#include "mcsmenuitem.h" + +//Forward declatations +class CMenuSrvEng; +class CLiwGenericParamList; +class CMenuFilter; +class CLiwMap; + +/* + * GetList Handler. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsGetlistHandler ): public CBase + { + public: + typedef TUint TBasicParameters; + enum + { + EGetListRecursive = 1, + EGetListFlat = 2, + EGetListParentOnly = 4, + EGetListIncludeParent = 8 + }; + + /** + * Factory method. + */ + static CMcsGetlistHandler* NewL( CMenuSrvEng& aEng ); + + /** + * Destructor. + */ + ~CMcsGetlistHandler(); + + /** + * Do getlist operation. Stores serialized result in + * iSerializedOutput descriptor + * @param aSerializedInput serialized input parameters for getlist + * @result size of serialized result descriptor + */ + TInt GetListSizeL( const TDesC8& aSerializedInput ); + + /* + * Returns result of GetList operation + * @return serialized output of GetList operation + **/ + TPtrC8 GetListDataL( ); + + /* + * Destroys the output buffer. + **/ + void CloseOutputBuffer( ); + +private: + /** + * Constructor. + */ + CMcsGetlistHandler( CMenuSrvEng& aEng ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: + + /** + * Fetches basic input parameters for GetList operation + * @param aInputList input list for GetList + * @param aFolderId to store folder id + * @param aBasicParameters to store basic parameters + */ + void FetchBasicParametersL( const CLiwGenericParamList* aInputList, + TInt& aFolderId, TBasicParameters& aBasicParameters ); + + /** + * Fetches required and ignored attributes + * @param aInputList input list for GetList + * @param aRequiredAttributes to store required attributes + * @param aIgnoredAttributes to store ignored attributes + */ + void FetchRequiredAndIgnoredAttributesL( + const CLiwGenericParamList* aInputList, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes ); + + /** + * Fetches filter + * @param aInputList input list for GetList + * @param aFilter to store filter + */ + TBool FetchFilterL( const CLiwGenericParamList* aInputList, + CMenuFilter* aFilter ); + + /** + * Fetches items ids + * @param aItemArray items ids + * @param aFolderId folder id + * @param aFilter filter + * @param aBasicParameters basic input parameters for getlist + */ + void FetchItemsIdsL( RArray& aItemArray, TInt aFolderId, + CMenuFilter* aFilter, TBasicParameters& aBasicParameters ); + + /** + * Gets attributes from descriptor + * @param aList descriptor containing attributes + * @param aArray array to store attributes + */ + void GetAttributesL( const TDesC& aList, CDesC16Array* aArray ); + + /** + * Set flags in filter + * @param inputMap Input map containint flags + * @param aFilter filter + */ + void SetFlagsL( const CLiwMap* inputMap, CMenuFilter* aFilter ); + + /** + * Set attribute string to input map + * @param inputMap input map + * @param aAttrName input attribute name + * @param aFilter filter + */ + void SetAttributeDesL( const CLiwMap* inputMap, + const TDesC& aAttrName, CMenuFilter* aFilter ); + + /** + * Set attribute hex to input map + * @param inputMap input map + * @param aAttrName input attribute name + * @param aFilter filter + */ + void SetAttributeHexFormatL( const CLiwMap* inputMap, + const TDesC& aAttrName, CMenuFilter* aFilter ); + + /** + * Set attribute num to input map + * @param inputMap input map + * @param aAttrName input attribute name + * @param aFilter filter + */ + void SetAttributeNumL( const CLiwMap* inputMap, + const TDesC& aAttrName, CMenuFilter* aFilter ); + + /** + * Set attribute bool to input map + * @param inputMap input map + * @param aAttrName input attribute name + * @param aFilter filter + */ + void SetAttributeBoolL( const CLiwMap* inputMap, + const TDesC& aAttrName, CMenuFilter* aFilter ); + + +private: + /** + * Engine. not own + */ + CMenuSrvEng& iEng ; + + /** + * Buffer for serialized result.own + */ + RBuf8 iOutputBuffer; + }; + +#endif // __MCSGETLISTHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsgetlisttreecreator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsgetlisttreecreator.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,95 @@ +/* +* 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: This class implements MMcsGetListCreatorInterface. It builds tree +* output list for getlist operation +* +* +*/ + + +#ifndef __MCSGETLISTTREECREATOR_H__ +#define __MCSGETLISTTREECREATOR_H__ + +#include +#include "mcsgetlistcreatorinterface.h" + +//forward declarations +class CMenuSrvEng; +class CLiwDefaultList; + +/* + * GetList tree list creator + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsGetlistTreeCreator ): public CMcsGetListCreatorInterface + { +public: + /** + * Factory method. + */ + static CMcsGetlistTreeCreator* NewL( CMenuSrvEng& aEng ); + + /** + * Destructor. + */ + ~CMcsGetlistTreeCreator(); + +//from MMcsGetListCreatorInterface + CLiwDefaultList* CreateLC( RArray& aIdsArray, + CDesC16Array* aRequiredAttributes, + CDesC16Array* aIgnoredAttributes ); + +private: + /** + * Constructor. + */ + CMcsGetlistTreeCreator( CMenuSrvEng& aEng ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Builds output as a tree for GetList operation + * @param aIdsArray array containing items to build tree with + * @param aList list to store result + * @param aIndex index to start with + * @param aParentInt parent id + */ + void BuildTreeListL( RArray& aIdsArray, CLiwDefaultList& aList, + TInt& aIndex, TInt aParentId ); + + + /** + * Inserts list with children to aList + * @param aList list to store result + * @param aChildList list containing children + */ + void InsertChildListL(CLiwDefaultList& aList, + CLiwDefaultList* aChildList); +private: + /* + * not own + */ + CDesC16Array* iRequiredAttributes; + + /* + * not own + */ + CDesC16Array* iIgnoredAttributes; + }; + +#endif // __MCSGETLISTTREECREATOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsinstallnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsinstallnotifier.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,139 @@ +/* +* 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: This class implements MMcsGetListCreatorInterface. It builds tree +* output list for getlist operation +* +* +*/ + +#ifndef MCSINSTALLNOTIFIER_H_ +#define MCSINSTALLNOTIFIER_H_ + +#include +#include + + +/** + * Interface for updating after installer events. + * + * @since S60 v5.0 + */ +class MMcsInstallListener + { +protected: + /** + * Enum defining the purpouse of the installation event. + */ + enum TInstOp + { + EInstOpNone = 0x00000000, + EInstOpInstall = 0x00000001, + EInstOpUninstall = 0x00000002, + EInstOpRestore = 0x00000004 + }; +public: + virtual void HandleInstallNotifyL(TInt aEvent) = 0; + }; + + +/** + * MCS Install notifier. + * + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsInstallNotifier ) : + public CActive + { + /** + * Enum defining the purpouse of the installation event. + */ + enum TInstOp + { + EInstOpNone = 0x00000000, + EInstOpInstall = 0x00000001, + EInstOpUninstall = 0x00000002, + EInstOpRestore = 0x00000004 + }; + + enum TInstOpStatus + { + EInstOpStatusNone = 0x00000000, + EInstOpStatusSuccess = 0x00000100, + EInstOpStatusAborted = 0x00000200 + }; +public: + + /** + * Creates an instance of CMCSInstallNotifier implementation. + * @param aNotifier Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + */ + static CMcsInstallNotifier* NewL(MMcsInstallListener& aListener, TInt aKey ); + + /** + * Destructor. + */ + virtual ~CMcsInstallNotifier(); + +private: + + /** + * Constructor. + * @param aNotifier Reference to notifier interface. + * @param aCategory Package uid. + * @param aKey Key for central repository. + */ + CMcsInstallNotifier( MMcsInstallListener& aListener, TInt aKey ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * From CActive. + */ + void DoCancel(); + + /** + * From CActive. + */ + void RunL(); + + /** + * From CActive. + */ + TInt RunError( TInt aError ); + +private: + /**. + * Own. + */ + RProperty iProperty; + + /** + * Interface for notifying changes in folder. + * Not Own. + */ + MMcsInstallListener& iListener; + + /* + * + */ + TInt iKey; + }; + + +#endif /* MCSINSTALLNOTIFIER_H_ */ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsmmcobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsmmcobserver.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,92 @@ +/* +* 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: This class implements MMcsGetListCreatorInterface. It builds tree +* output list for getlist operation +* +* +*/ + +#ifndef CMCSMMCOBSERVER_H +#define CMCSMMCOBSERVER_H + +#include // For CActive, link against: euser.lib +#include + +/** + * Interface for handling Mmc inserrtion / removal. + * + * @since S60 v5.0 + */ +class MMcsMmcObserver + { +public: + virtual void HandleMmcEventL(TInt aEvent) = 0; + enum TInstOp + { + EMmcInsert = 0x00000001, + EMmcRemove = 0x00000002, + }; + }; + + +/** + * Mmc Observer Interface. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS(CMcsMmcObserver) : public CActive + { +public: + // Cancel and destroy + ~CMcsMmcObserver(); + + // Two-phased constructor. + static CMcsMmcObserver* NewL(MMcsMmcObserver& aCallback); + + // Two-phased constructor. + static CMcsMmcObserver* NewLC(MMcsMmcObserver& aCallback); + +private: + // C++ constructor + CMcsMmcObserver(MMcsMmcObserver& aCallback); + + // Second-phase constructor + void ConstructL(); + +private: + // From CActive + // Handle completion + void RunL(); + + // How to cancel me + void DoCancel(); + + + TInt RunError(TInt aError); + + // Count acvtive drives + TInt DriveCount(TDriveList& aDriveList); + +private: + + + TDriveList iDriveList; + + TInt iDriveCount; + RFs iFs; + MMcsMmcObserver& iCallback; + + }; + +#endif // CMCSMMCOBSERVER_H diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsrunningappsaddremovehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsrunningappsaddremovehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef __MCSRUNNINGAPPSADDREMOVEHANDLER_H__ +#define __MCSRUNNINGAPPSADDREMOVEHANDLER_H__ + + +#include "menuengoperation.h" + + +//Forward declatations +class CMenuEng; +class MMcsRunningAppsHandler; + +/* + * Supports AttributeChanged notification handling + * if running application was moved from one folder to another + */ + +NONSHARABLE_CLASS( CMcsRunningAppsAddRemoveHandler ): public CBase, + MMenuEngOperation + { +public: + /** + * Factory method. + */ + static CMcsRunningAppsAddRemoveHandler* NewL( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler ); + + /** + * Destructor. + */ + ~CMcsRunningAppsAddRemoveHandler(); + + /* + * Appends a folder to iFolders array and queue to menueng operation + * @param aFolder of folder for which the method was invoked + */ + void HandleAddRemoveL( TInt aFolder ); + +private: + /** + * Constructor. + */ + CMcsRunningAppsAddRemoveHandler( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation + * Handles AttributeChanged notification and queue next operation + * if iFolders array is not empty + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + +private://data + /* + * engine. not own + */ + CMenuEng& iEng ; ///< Engine. + + /* + * not own + */ + MMcsRunningAppsHandler* iRunningAppsHandler; + + /* + * Flag storing operation status information + */ + TBool iOperationInProgress; + + /* + * own. + */ + RArray iFolders; + }; + + + +#endif // __MCSRUNNINGAPPSADDREMOVEHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsrunningappsfswmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsrunningappsfswmonitor.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef __MCSRUNNINGAPPSFSWMONITOR_H__ +#define __MCSRUNNINGAPPSFSWMONITOR_H__ + +#include + +#include "menuengoperation.h" + + +//Forward declatations +class CMenuEng; +class MMcsRunningAppsHandler; + +/* + * FSW hidden monitor. + * It cooperates with CMcsRunningAppsHandler. It updates FSW status for + * all applications and passes an array with FSW hidden applications + * UIDs to CMcsRunningAppsHandler + */ +NONSHARABLE_CLASS( CMcsRunningAppsFswMonitor ): public CActive, MMenuEngOperation + { +public: + /** + * Factory method. + */ + static CMcsRunningAppsFswMonitor* NewL( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler, + TInt aPriority = EPriorityStandard); + + /** + * Destructor. + */ + ~CMcsRunningAppsFswMonitor(); + + /** + * Checks if aUid is present in iFswHiddenApps array + * @param aUid uid of an application + * @return FSW hidden value + */ + TBool IsFswHidden( TUid aUid ); + +private: + /** + * Constructor. + */ + CMcsRunningAppsFswMonitor( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler, + TInt aPriority ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation: + * Do the scan + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + +private: //from CActive + + /** + * It is called if FSW status property changes + */ + void RunL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + + /** + * Provides Active object safe cancellation + */ + void DoCancel(); + +private: + /** + * It activates the object, requests an event from the windowserver. + */ + void Start(); + + + /** + * Fills iFswHiddenApps array with UIDs of FSW hidden applications + * and passes this array to CMcsRunningAppsHandler + */ + void UpdateFswHiddenApplicationsL(); + + +private://data + /* + * engine. not own + */ + CMenuEng& iEng ; ///< Engine. + + /* + * own + */ + RArray iFswHiddenApps; + + /** + * FSW status change listener property + */ + RProperty iFSWStatusProperty; + + /* + * not own + */ + MMcsRunningAppsHandler* iRunningAppsHandler; + + }; + + + +#endif // __MCSRUNNINGAPPSFSWMONITOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsrunningappshandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsrunningappshandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,275 @@ +/* +* 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: This class maintains a list of the running apps, and listen +* for changes in the running apps. It calls the observer if there is such a +* change. +* +* +*/ + + +#ifndef __MCSRUNNINGAPPSHANDLER_H__ +#define __MCSRUNNINGAPPSHANDLER_H__ + +#include +#include +#include + +#include "menuengoperation.h" +#include "menusrvengutils.h" + +//Forward declatations +class CMenuEng; +class CMcsCacheHandler; +class CMcsRunningAppsWgMonitor; +class CMcsRunningAppsFswMonitor; +class CMcsRunningAppsHiddenAttrScanner; +class CMcsRunningAppsAddRemoveHandler; + +/** + * Interface for updating RunningApps list stored in CMcsRunningAppsHandler class + * + * @since S60 v3.2 + */ +class MMcsRunningAppsHandler + { +public: + enum TArrayDataType + { + ERunningApps, + EFswHiddenApps, + EHiddenApps + }; + /* + * Called by HiddenAttr scanner, FSW monitor or WindowsGroup + * Monitor. + * @param aArray an array containing UIDs of running, hidden or + * fsw apps + * @param aType type of data stored in aArray + */ + virtual void HandleListUpdateL(const RArray& aArray, + TArrayDataType aType ) = 0; + + /* + * Called by AddRemoveHandler + * @param aFolder id of folder for which the method was invoked + */ + virtual void HandleAddRemoveRunningAppL( TInt aFolder ) = 0; + + }; + +/* + * RunningApps Handler. + * @lib mcsmenu.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsRunningAppsHandler ): public CBase, MMcsRunningAppsHandler + { + public: + + /** + * Factory method. + */ + static CMcsRunningAppsHandler* NewL( + CMenuEng& aEng, + CMcsCacheHandler& aCacheHandler ); + + /** + * Destructor. + */ + ~CMcsRunningAppsHandler(); + + /** + * Called by EngineEvents method + * @param aFolder folder id + * @param aEvents events + */ + void EngineEventsL( TInt aFolder, TInt aEvents ); + + /** + * Called by CMenuSrvEng class object + * @param aFolder folder id + * @param aEvents events + */ + void EngineEvents( TInt aFolder, TInt aEvents ); + + /** + * Fills aArray with UIDs of running apps + * @param aArray array to be filled with UIDs of running apps + */ + void GetRunningAppsL( RArray& aArray ); + + /** + * Returns running status of an item + * @param aItemId id of the item + * @return running status of an item + */ + TBool GetRunningStatusL( TInt aItemId ); + + +// from MMcsRunningAppsHandler + + /* + * Called by HiddenAttr scanner, FSW monitor or WindowsGroup + * Monitor. + * @param aArray an array containing UIDs of running, hidden or + * fsw apps + * @param aType type of data stored in aArray + */ + void HandleListUpdateL(const RArray& aArray, TArrayDataType aType ); + + /* + * Called by AddRemoveHandler + * @param id of folder for which the method was invoked + */ + void HandleAddRemoveRunningAppL( TInt aFolder ); + +private: + /** + * Constructor. + */ + CMcsRunningAppsHandler( + CMenuEng& aEng, + CMcsCacheHandler& aCacheHandler ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + /** + * Called by HandleListUpdateL + * @param aArray array with UIDs of running apps + */ + void HandleRunningAppsChangedL( const RArray& aArray ); + + /** + * Called by HandleListUpdateL + * @param aArray array with UIDs of FSW hidden apps + */ + void HandleFswHiddenAppsChangedL( const RArray& aArray ); + + /** + * Called by HandleListUpdateL + * @param aArray array with UIDs of hidden apps + */ + void HandleHiddenAppsChangedL(const RArray& aArray ); + + /** + * Sends AttributeChange notification for item and parents of the item + * it it is necessary, it is also responsible for removing data from cache + * if attribute value cahnged + * @param aId id of item with changed running status attribute + */ + void HandleNotificationL( TInt aId ); + + /** + * Sends AttributeChange notification for items and parents of items with + * given uid, it is also responsible for removing data from cache + * if attribute value has changed + * @param aAppUid uid of items with changed running status attribute + */ + void HandleNotificationL( TUid aAppUid ); + + /** + * Gets list of items with secified uid + * @param aAppUid items uid + * @return KErrNotFound if no item was found KErrNone if succesfull + */ + TInt GetItemsListL( TUid aAppUid, RArray& aItemArray ); + + /* + * Updates array containing folders with running status + * @param aFolderId id of a folder + * @param aNewRunningStatus current running status + */ + void UpdateFolderRunningStatusL( TInt aFolderId, TBool aNewRunningStatus ); + + + /** + * Updates array containing folders with running status. + * It is called at startup and it scans all folders + */ + void UpdateFoldersRunningStatusL( ); + + /** + * Gets running status for CMenuEngObject + * @param aEngObj object to be checked + * @return running status of an object + */ + TBool GetRunningStatusL( const CMenuEngObject& aEngObj ); + + /** + * Gets previous Folder running status + * @param aId id of the folder + * @return previous running status of a folder (stored in + * iRunningFolderStatus array ) + */ + TBool GetFolderPreviousRunningStatusL( TInt aId ); + + + /** + * Gets current folder running status + * @param aId id of the folder + * @return running status of a folder + */ + TBool GetFolderRunningStatusL( TInt aId ); + + /** + * Gets current application running status + * @param aUid UID of an application + * @return running status of an application + */ + TBool GetAppRunningStatusL( TUid aUid ); + +private: + + CMenuEng& iEng ; ///< Engine. not own + + /** not own + */ + CMcsCacheHandler& iCacheHandler; + + /* + * own + */ + CMcsRunningAppsWgMonitor* iWindowGroupMonitor; + + /* + * own + */ + CMcsRunningAppsFswMonitor* iFswMonitor; + + /* + * own + */ + CMcsRunningAppsHiddenAttrScanner* iHiddenAttrScanner; + + /* + * own + */ + CMcsRunningAppsAddRemoveHandler* iAddRemoveHandler; + + /* + * own + */ + RArray iRunningApps; + + /* + * own + */ + RArray iRunningFolderStatus; + }; + +#endif // __MCSRUNNINGAPPSHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsrunningappshiddenattrscanner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsrunningappshiddenattrscanner.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef __MCSRUNNINGAPPSHIDDENATTRSCANNER_H__ +#define __MCSRUNNINGAPPSHIDDENATTRSCANNER_H__ + + +#include "menuengoperation.h" + + +//Forward declatations +class CMenuEng; +class MMcsRunningAppsHandler; + +/* + * It scans MCS to get UIDs of applications with "hidden" attribute. + * It cooperates with CMcsRunningAppsHandler. + */ +NONSHARABLE_CLASS( CMcsRunningAppsHiddenAttrScanner ): public CBase, MMenuEngOperation + { +public: + /** + * Factory method. + */ + static CMcsRunningAppsHiddenAttrScanner* NewL( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler ); + + /** + * Destructor. + */ + ~CMcsRunningAppsHiddenAttrScanner(); + + /* + * + */ + void ScanL(); + + /** + * Checks if aUid is present in iHiddenApps array + * @param aUid UID of an application + * @return hidden attribute of an application + */ + TBool IsHidden( TUid aUid ); + +private: + /** + * Constructor. + */ + CMcsRunningAppsHiddenAttrScanner( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation: + * Do the application scan + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + +private: + /* + * Do the scan and update iHiddenApps array with UIDs of applications + * with "hidden" attribute. The array is subsequently passed to + * CMcsRunningAppsHandler + */ + void UpdateHiddenApplicationsL(); + + +private://data + /* + * engine. not own + */ + CMenuEng& iEng ; ///< Engine. + + /* + * own + */ + RArray iHiddenApps; + + /* + * not own + */ + MMcsRunningAppsHandler* iRunningAppsHandler; + + /* + * Flag storing operation status information + */ + TBool iOperationInProgress; + + }; + + + +#endif // __MCSRUNNINGAPPSHIDDENATTRSCANNER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcsrunningappswgmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcsrunningappswgmonitor.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +#ifndef __MCSRUNNINGAPPSWGMONITOR_H__ +#define __MCSRUNNINGAPPSWGMONITOR_H__ + +#include +#include + +#include "menuengoperation.h" + + +//Forward declatations +class CMenuEng; +class MMcsRunningAppsHandler; +class CApaWindowGroupName; + +/* + * Windows Group change monitor. + * It cooperates with CMcsRunningAppsHandler. If any application was + * launched or closed it passes an array with currently running applications + * UIDs to CMcsRunningAppsHandler + */ +NONSHARABLE_CLASS( CMcsRunningAppsWgMonitor ): public CActive, MMenuEngOperation + { + public: + /** + * Factory method. + */ + static CMcsRunningAppsWgMonitor* NewL( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler, + TInt aPriority = EPriorityStandard ); + + /** + * Destructor. + */ + ~CMcsRunningAppsWgMonitor(); + + +private: + /** + * Constructor. + */ + CMcsRunningAppsWgMonitor( + CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler, + TInt aPriority ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation: + * Do the application scan and update menu accordingly. + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + +private: + /** + * It is called if an event is received from the windowserver. + */ + void RunL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + + /** + * Provides Active object safe cancellation + */ + void DoCancel(); + + /** + * It activates the object, requests an event from the windowserver. + */ + void Start(); + + /* + * Fills iRunningApps array with UIDs of currently running applications + * and passes this array to CMcsRunningAppsHandler + */ + void UpdateRunningApplicationsL(); + + /** + * Updates the list of the running widgets. + */ + void UpdateWidgetTaskListL( ); + +private://data + /* + * engine. not own + */ + CMenuEng& iEng ; ///< Engine. + + /** + * The events can be received via this session. + */ + RWsSession iWsSession; + + /** + * Seesion to widget registry. own + */ + RWidgetRegistryClientSession iWidgetSession; + + /* + * own + */ + RArray iRunningApps; + + /* + * not own + */ + MMcsRunningAppsHandler* iRunningAppsHandler; + + /* + * own + */ + RWindowGroup iWg; + + /* + * own + */ + CApaWindowGroupName* iWgName; + + /* + * + */ + TBool iOperationInProgress; + }; + + + +#endif // __MCSRUNNINGAPPSWGMONITOR_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcssatmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcssatmonitor.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,102 @@ +/* +* 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 __MCSSATMONITOR_H__ +#define __MCSSATMONITOR_H__ + +#include "mcssatnotifier.h" +#include "menuengoperation.h" + +//Forward declatations +class MMenuEngObserver; +class CMenuEng; +class CMcsSatNotifier; + +/** + * SAT Handler. + * @lib mcssathandler.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsSatMonitor ): public CBase, + public MMcsSATNotifierCallback, MMenuEngOperation + { +public: + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + IMPORT_C static CMcsSatMonitor* NewL( CMenuEng& aEng ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsSatMonitor(); + +private: + + /** + * Constructor. + */ + CMcsSatMonitor( CMenuEng& aEng ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation: + * Do the application scan and update menu accordingly. + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + + + /** + * Inherited from MNotifierMMcsSATNotifierCallbackCallback + * + * @since Series 60 3.1 + * @return void + */ + void SATChangeL(); + + TInt GetIdL( TUid aAppUid ); + +private: // data + + CMenuEng& iEng; ///< Engine. + + CMcsSatNotifier* iMcsSatNotifier1; + + CMcsSatNotifier* iMcsSatNotifier2; + TBool iOpStatus; + }; + +#endif // __MCSSATHANDLER_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcssuitehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcssuitehandler.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MCSSUITEHANDLER_H_ +#define MCSSUITEHANDLER_H_ + +#include +#include + + +#include "menusvrsuite.h" +#include "mcsinstallnotifier.h" +#include "menuengoperation.h" +#include "mcsmmcobserver.h" +#include "mcsfreespaceobserver.h" + +class CMenuEng; +class TMenuItem; + +/** + * Suite Handler. + * @lib mcsdrmhandler.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsSuiteHandler ): + public CBase, MMcsInstallListener, MMenuEngOperation, MMcsMmcObserver, + MMcsFreeSpaceObserver + { +public: + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + static CMcsSuiteHandler* NewL( + CMenuEng& aEng, const TDesC& aDirName ); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsSuiteHandler(); + + /** + * Check if suite of given name is present + * in handler. + */ + TBool HaveSuite(const TDesC& aSuiteName); + + /** + * Get attribute from suite handler. + */ + void GetAttribute( const TDesC& aSuiteName, const TDesC& aAttrName, + TBool& aAttrExists, TDes& aAttrVal ); + +private: + + /** + * Execute engine operation: + * Do the application scan and update menu accordingly. + */ + void RunMenuEngOperationL(); + void CompletedMenuEngOperation( TInt aErr ); + /** + * Constructor. + */ + CMcsSuiteHandler( CMenuEng& aEng ); + + /** + * 2nd phase constructor. + */ + void ConstructL(const TDesC& aDirName); + + /** + * Handle Install Event + */ + void HandleInstallNotifyL(TInt aEvent); + + /** + * Handle Mmc Event + */ + void HandleMmcEventL(TInt aEvent); + + /** + * Handle Free Space Event. + */ + void HandleFreeSpaceEventL(); + /** + * Lists new suits + */ + void CheckSuiteDirL(); + + /** + * Add new suits + */ + void AddNew(); + + /** + * Remove old suits + */ + void RemoveOld(); + + /** + * Removes not installed suites from content xml file(basically during restore) + * @since S60 v5.0. + */ + void ScanSuitesL(); + + + /** + * Check if file is installed + */ + TBool FileInstalled(const TDesC& aFileName); + + /** + * Check if file was removed from installed file list + */ + TBool FileUninstalled(const TDesC& aFileName); + + /** + * Check if file need Update + * @param aTimestamp - actual timestamp of file + */ + TBool FileNeedUpdate(const TDesC& aFileName, const TTime& aTimestamp); + + /** + * Validates file extansion + */ + TBool ValidExtansion(const TDesC& aFileName); + + /** + * Install file with suites + */ + void InstallFileL(const TDesC& aFileName, const TTime& aTimestam); + + /** + * Removes file with suites + */ + void UninstallFileL(const TDesC& aFileName); + + /** + * Update file with suites + */ + void UpdateFileL(const TDesC& aFileName, const TTime& aTimestam); + + /** + * Get suites from a file + */ + void GetSuitesL(const TDesC& aFileName, RPointerArray& aSuiteArray); + + /* + * Reopen older suite. Used when deleteing suite that was replaced by newer one. + */ + void ReopenSuiteL(TInt aSuiteArrayPos); + + /** + * Append suite items to array + * @since S60 v5.0. + * @param aItemArray array to append suite items + * @param aAttrName attribute name + * @param aAttrValue attribute value + */ + void GetMenuSuitesL( + RArray& aItemArray, + const TDesC& aAttrName, + const TDesC& aAttrValue ); + + + /** + * Addes or updates suite + */ + void AddSuiteL( const TPtrC& aSuiteName ); + + /** + * Removes suite + */ + void RemoveSuiteFromXmlL( const TPtrC& aSuiteName ); + + /** + * Updates suites in content xml file + * @since S60 v5.0. + * @param aMcsItems suite items + * @param aIndex index of suite item to update + */ + void UpdateSuiteInXmlL( + RArray & aMcsItems, + TInt aIndex ); + + /** + * Addes suite to main xml file + */ + void AddSuiteToXmlL( const TPtrC& aSuiteName ); + + + void UpdateItemsL( const RArray& aItemArray ); + +private: // data + CMenuEng& iEng ; ///< Engine. Not Own. + RFs iFs; ///< File Server. Own. + RBuf iDirPath; ///< Path to observerd dir. Own. + CDesCArrayFlat* iFileNewList; ///< List of new files in dir. Own. + CDesCArrayFlat* iInstalledFileList; ///< List of installed suites. Own. + RArray iNewTimestamps; ///< List of current files' timestamps. Own. + RArray iTimestamps; ///< List of files' timestamps when isntalled. Own. + CMcsInstallNotifier* iInstallNotifier; ///< Own + CMcsMmcObserver* iMmcObserver; + CMcsFreeSpaceObserver* iFreeSpaceObserver; /// Free space observer. Own. + RMenuSrvSuiteArray iSuites; ///< Suite array. Own. + TInt iEvent;/// < last event. Own + }; + +#endif /* MCSSUITEHANDLER_H_ */ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcssuiteobject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcssuiteobject.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef SUITEOBJECT_H +#define SUITEOBJECT_H + +#include +#include "mcssuiteobjectattr.h" + +/** +* Menu Engine Object attribute. +*/ +NONSHARABLE_CLASS( CSuiteObject ): public CBase + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CSuiteObject(); + + /** + * Two-phased constructor. + * @param aFileName File Name. + * @return The created object. + */ + static CSuiteObject* NewL( const TDesC& aFileName ); + + /** + * Two-phased constructor. + * @param aFileName File Name. + * @return The created object. + */ + static CSuiteObject* NewLC( const TDesC& aFileName ); + +protected: // construction + + /** + * Constructor + */ + CSuiteObject(); + + /** + * 2nd phase constructor. + * @param aFileName File Name. + */ + void ConstructL( const TDesC& aFileName ); + +public: // new methods + + /** + * Get file name. + * @return file name. + */ + TPtrC FileName() const { return iFileName; } + + /** + * Get suite name. + * @return suite name. + */ + TPtrC SuiteName() const { return iName; } + + /** + * Set suite name. + * @param aName Name. + */ + void SetSuiteNameL( const TDesC& aName ); + + /** + * Set attribute. + * @param aAttrName atrribute name. + * @param aAttrValue atrribute value. + * @param aLocalized localisation of attribute. + */ + void SetInitialAttributeL( const TDesC& aAttrName, + const TDesC& aAttrValue, + TBool aLocalized ); + + void GetAttribute( const TDesC& aAttrName, + TBool& aAttrExists, TDes& aAttrVal ); + + /** + * Reset, destroy and close iAttributes array. + */ + void CloseSuiteArray(); + + +private: // data + + RBuf iFileName; /// + +/** +* Menu Engine Object attribute. +*/ +NONSHARABLE_CLASS( CSuiteObjectAttr ): public CBase + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CSuiteObjectAttr(); + + /** + * Two-phased constructor. + * @param aName Name. + * @return The created object. + */ + static CSuiteObjectAttr* NewL( const TDesC& aName ); + + /** + * Two-phased constructor. + * @param aName Name. + * @return The created object. + */ + static CSuiteObjectAttr* NewLC( const TDesC& aName ); + +protected: // construction + + /** + * Constructor + */ + CSuiteObjectAttr(); + + /** + * 2nd phase constructor. + * @param aName Name. + */ + void ConstructL( const TDesC& aName ); + +public: // new methods + + /** + * Get name. + * @return Name. + */ + TPtrC Name() const { return iName; } + + /** + * Get value. + * @return Value. + */ + TPtrC Value() const { return iValue; } + + /** + * Set (or replace) value. + * @param aValue Value. + */ + void SetValueL( const TDesC& aValue ); + + /** + * Get localized status. + * @return ETrue if localized. + */ + TBool Localized() const { return iLocalized; } + + /** + * Set localized status. + * @param aLocalized ETrue if localized. + */ + void SetLocalized( TBool aLocalized ) { iLocalized = aLocalized; } + +private: // data + + RBuf iName; ///< Name. Own. + RBuf iValue; ///< Value. Own. + TBool iLocalized; ///< Localized status. + + }; + +/** +* Array of CSuiteObjectAttr-s. +*/ +NONSHARABLE_CLASS( RSuiteAttrArray ) +: public RPointerArray + { + +public: // new methods + + /** + * Find attribute by name. + * @param aName Name. + * @return Index of attribute, or KErrNotFound. + */ + TInt Find( const TDesC& aName ) const; + + }; + +#endif // SUITEOBJECTATTR_H diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcssuiteobjectfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcssuiteobjectfactory.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __SUITEOBJECTFACTORY_H__ +#define __SUITEOBJECTFACTORY_H__ + +#include +// FORWARD DECLARATION + +class CGECODefaultObjectFactory; +class MGECOAttributeProvider; + +/** +* Menu Engine Object factory. +*/ +NONSHARABLE_CLASS( CSuiteObjectFactory ): public CGECODefaultObjectFactory + { + +public: // construction + + /** + * Destructor. + */ + virtual ~CSuiteObjectFactory(); + + /** + * Two-phased constructor. + * @return The created object. + */ + static CSuiteObjectFactory* NewL( ); + +protected: // construction + + /** + * Constructor. + */ + CSuiteObjectFactory(); + +public: // from CGECOObjectFactoryBase + + /** + * Initializes the current object with attribute provider data. + * @param aAttributeProvider Attribute provider for data initialization. + */ + void InitializeObjectL( + MGECOAttributeProvider& aAttributeProvider ); + + }; + +#endif // __SUITEOBJECTFACTORY_H__ diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/mcssuiteparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/mcssuiteparser.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef SUITEPARSER_H +#define SUITEPARSER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CXCFWTree; +class CSuiteObject; +class RSuiteObjectArray; +class CSuiteObjectFactory; + +// CLASS DECLARATION + +/** + * CSuiteParser + * + */ +NONSHARABLE_CLASS( CSuiteParser ) : public CBase, public MXCFWEngineObserver + { +public: + //event enumeration + + enum TSuiteParsingStatus // statuses + + { + ECompleted = 0, // factory settings completed successfully + EFailed = -1 // factory settings failed + }; + +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CSuiteParser(); + + /** + * Two-phased constructor. + * @param aFileName a xml file to parse. + */ + static CSuiteParser* NewL( const TDesC& aFileName ); + + /** + * Two-phased constructor. + * @param aFileName a xml file to parse. + */ + static CSuiteParser* NewLC( const TDesC& aFileName ); + + /** + * Gets suites array + * @param aSuitesArray array that wil be filled with suites. + */ + TInt GetSuitsArrayL( RPointerArray& aSuitesArray ); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CSuiteParser(); + + /** + * EPOC default constructor for performing 2nd stage construction + * @param aFileName a xml file to parse. + */ + void ConstructL( const TDesC& aFileName ); + + /** + * Handles the "entries" node. + * @param aSuitesArray array that wil be filled with suites. + */ + void HandleEntriesL( RPointerArray& aSuitesArray ); + + /** + * Creats suite object from node in xml file + * @param aNode that contains suite's data. + */ + CSuiteObject* CreateSuiteLC( MXCFWNode* aNode ); + + +public: + // Functions from base classes + + /** + * Called when Engine parsing / saving state changes + * User can do desired actions on corresponding events. + * @param aEvent Engine event. + */ + virtual void HandleEngineEventL( TXCFWEngineEvent aEvent ); + + /** + * Called when there's an error during parsing / saving + * @param aErrorCode Error code from engine + */ + virtual void HandleEngineErrorL( TInt aErrorCode ); + + /** + * Called when the file parsing is finished + * + * @param aStatus parsing status. + */ + void HandleCompletionL( TSuiteParsingStatus aStatus ); + +private: // data + + /** + * Name of a file to parse. Own. + */ + RBuf iFileName; + + /** + * Content engine. Own. + */ + CXCFWEngine* iContentEngine; + + /** + * Content tree. Own. + */ + CXCFWTree* iContentTree; + + /** + * scheduler for make synchronous restoration + */ + CActiveSchedulerWait* iActiveScheduler; + + /** + * Status of parsing + */ + TSuiteParsingStatus iCompletionStatus; + + /** + * Factory object needed for localised attributes. Own. + */ + CSuiteObjectFactory* iObjectFactory; + + }; + + +#endif // SUITEPARSER_H diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/menusrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/menusrv.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2009 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 __MENUSRV_H__ +#define __MENUSRV_H__ + +// INCLUDES + +#include +#include +#include +#include "menuengobserver.h" + +// FORWARD DECLARATION + +class CMenuSrvEng; +class CTimeout; + +// GLOBAL FUNCTIONS + +/** +* Run the Menu Server (entry function). +* @return Error code. +*/ +IMPORT_C TInt RunMenuServer(); + +// CLASS DECLARATION + +/** +* Menu Server. +*/ +NONSHARABLE_CLASS( CMenuSrv ) : public CPolicyServer + { +public: // Constructor + + /** + * Destructor. + */ + virtual ~CMenuSrv(); + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed server. + */ + static CMenuSrv* NewL(); + +public: // New methods + + /** + * Creates the object container. + * @param - + * @return A pointer to the newly created CObjectCon. + */ + CObjectCon* NewContainerL(); + + /** + * Removes the specified object container from this container index + * and deletes it. + * @param aCon A pointer to the object container to be removed. + * @return None. + */ + void RemoveContainer( CObjectCon* aCon ); + + /** + * Get a new shared engine with this name. Owner is the caller. + * The returned object should be Close()-d, not deleted! + * @param aName Content file name. + * @return Shared Engine. + */ + CMenuSrvEng* GetEngineL( const TDesC& aName ); + + /** + * A shared engine is deleted. + * When the last engine is deleted, we can exit. + */ + void EngineDeleted(); + +private: // Constructors and destructor + + /** + * Constructor. + */ + CMenuSrv(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + +private: // From CServer2 + + /** + * Create new session. + * @param aVersion Version. + * @param aMessage Message (unused). + * @return New session. + */ + CSession2* NewSessionL + ( const TVersion& aVersion, const RMessage2& aMessage ) const; + + /** + * Performs a custom security check. + * @param aMsg The message to check. + * @param aAction A reference to the action to take if the security + * check fails. + * @param aMissing A reference to the list of security attributes missing + * from the checked process. + * @return A value from TCustomResult. + */ + TCustomResult CustomSecurityCheckL( + const RMessage2& aMsg, + TInt& aAction, + TSecurityInfo& aMissing ); + + + +private: // Data + + CTimeout* iExitTimer; ///< Exit timer. Own. + CObjectConIx* iObjectConIx; ///< Container index. Own. + CObjectCon* iEngines; ///< Engines. Own. + +}; + +#endif // __MENUSRV_H__ + +// End of File diff -r 000000000000 -r 79c6a41cd166 menucontentsrv/srvinc/menusrvappscanner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/srvinc/menusrvappscanner.h Thu Dec 17 08:54:17 2009 +0200 @@ -0,0 +1,495 @@ +/* +* Copyright (c) 2009 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 __MENUSRVAPPSCANNER_H__ +#define __MENUSRVAPPSCANNER_H__ + +#include +#include +#include +#include +#include "menuengoperation.h" +#include "mcssatnotifier.h" +#include "menuengfilter.h" +#include "mcsfreespaceobserver.h" +#include "mcsmenuitem.h" +#include "mcsmenunotifier.h" +#include + +// FORWARD DECLARATION + +class CMenuEng; +class TAppAtributes; +class CMenuSrvMmcHistory; +class CRepository; +class CCenRepNotifyHandler; +class RWidgetRegistryClientSession; + +/** +* Application scanner. +* Using AppArc application information, keeps menu application +* items ("menu:application") up-to-date. +* +* Operation is asynchronous (because AppArc startup is asynchronous): +* 1. ConstructL(): invokes iApaLsSession to build app list (async). +* 2. RunL(): App list is complete, this object schedules itself to Engine. +* 3. RunMenuEngOperationL(): The operation is executed by the engine. +* 4. HandleAppListEvent(): change in app list, go back to step 2. +* +* App scanning does the following: +* - Applications present in the system but not appearing in the menu are added +* to the appropriate folder. +* - Java apps should appear / disappear. TODO not impemented yet! +* - Hide hidden applications, show non-hidden applications (flag "hidden"). +* - Hide / show MMC-related items, according to whether MMC is present or not +* (flag "missing"). Keep an MMC history, purge old MMC-based menu items +* (== missing menu items whose MMC card has not been seen for long). +* - Observing AppArc (and MMC, and Java, etc etc) to keep the menu data up +* to date continuously. +*/ +NONSHARABLE_CLASS( CMenuSrvAppScanner ) +: public CActive, public MMenuEngOperation, public MApaAppListServObserver, + public MCenRepNotifyHandlerCallback, public MMcsSATNotifierCallback, + MMcsFreeSpaceObserver + { + +public: // Constructor + + /** + * Destructor. + */ + virtual ~CMenuSrvAppScanner(); + + /** + * Two-phased constructor. + * @param aEng Engine. + */ + static CMenuSrvAppScanner* NewL( CMenuEng& aEng ); + + +private: // Constructors and destructor + + /** + * Constructor. + * @param aEng Engine. + */ + CMenuSrvAppScanner( CMenuEng& aEng ); + + /** + * Second phased constructor. + */ + void ConstructL(); + +private: // from CActive + + /** + * Request completed, schedule engine operation. + */ + void RunL(); + + /** + * Cancel request. + */ + void DoCancel(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + TInt RunError( TInt aError ); + +private: // from MMcsFreeSpaceObserver + /** + * Handle Free Space Event. + */ + void HandleFreeSpaceEventL(); + +private: // from MMenuEngOperation + + /** + * Execute engine operation: + * Do the application scan and update menu accordingly. + */ + void RunMenuEngOperationL(); + + /** + * Error handling: ignore error. + * @param aErr Error code. + */ + void CompletedMenuEngOperation( TInt aErr ); + +private: // from MApaAppListServObserver + + void HandleAppListEvent( TInt aEvent ); + +private: // from MCenRepNotifyHandlerCallback + + /** + * Called if one of CR keys has changed + * @param aId Id of the key that has changed. + * @param aNewValue The new value of the key. + */ + void HandleNotifyString( TUint32 aKey, const TDesC16& aNewValue ); + +private: // from MMcsSATNotifierCallback + + /** + * Inherited from MNotifierMMcsSATNotifierCallbackCallback + * + * @since Series 60 3.1 + * @return void + */ + void SATChangeL(); + +public: + /** + * Schedule appscanner run. + * Self complete active object. + */ + void ScheduleScan(); + +private: // new methods + + /** + */ + void HandleLockDeleteFlagUpdateL( const TMenuItem& aItem,TInt aUid ); + + /** + * Updates application's missing attribute. + * Add new menu item referring to this application. + * @param aItem menu item. + */ + void HandleMissingFlagUpdateL( const TMenuItem& aItem ); + + /** + * Updates hidden flag. + * @param aItem menu item. + * @param aUid Application's uid. + * @param aApaItemHidden Application's hidden status from ApaLsSession. + */ + void HandleHiddenFlagUpdateL( + const TMenuItem & aItem, + TInt & aAppUid, + TBool aApaItemHidden ); + /** + * Updates native attribute. + * @param aItem menu item. + * @param aUid Application's uid. + */ + void HandleNativeAttrUpdateL( + const TMenuItem& aItem, + TInt aUid ); + + /** + * Updates mmc attribute. + * @param aItem menu item. + * @param aUid Application's uid. + * @param aMmcId MMC ID of currently inserted MMC, or 0. + */ + void HandleMmcAttrUpdateL( + const TMenuItem& aItem, + TInt aUid, + TUint aMmcId ); + + + /** + */ + TBool IsInRomL( TInt aUid ); + + /** + */ + void GetCrItemsL( RArray& aArray ); + + + /** + */ + void ParseUidsL( const TDesC& aHiddenApplications, + RArray& aArray ); + /** + */ + void GetApaItemsL( RArray& aArray ); + + /** + */ + void SetHidden( const TDesC& aHiddenAppUid, + RArray& aArray ); + + /** + */ + void GetMcsAppItemsL( RArray& aArray); + + /** + */ + void GetMcsAppItemsL( TBool aLegacy, const TUint aUid, + RArray& aArray); + + + /** + * New application is found, no menu item refers to it. + * Add new menu item referring to this application. + * @param aUid Application capability. + * @param aCurrentMmcId MMC ID of currently inserted MMC, or 0. + */ + void AddAppItemL( + TUint aUid, + TUint aCurrentMmcId ); + + TInt CreateInstallFolderL( TUint aUid ); + + /** + * @param aAppUid application UID + * @return TBool + */ + TBool IsMidlet( const TUid aAppUid ); + + + /** + * Find menu folder which has the specified "applicationgroup_name" + * attribute. If no such folder exists, create. + * @param aAppGroupName value of the "applicationgroup_name" attribute + * @param aFolderId Folder ID. + */ + void AppGroupFolderL( const TDesC& aAppGroupName, TInt& aFolderId ); + + /** + * Find the default folder (folder having attribute 'default="1"'). + * If not found, return 0. + * @param aFolderId Dedault folder or 0. + */ + void DefaultFolderL( TInt& aFolderId ); + + /** + * Make sure that folder is writable (remove "lock_moveinto"). + * @param aFolder Folder id. + */ + void EnsureFolderWritableL( TInt aFolder ); + + /** + * Handle items are in the menu but no corresponding app is present: + * - Items that are on a recently used MMC are get "missing" flag but kept. + * - Items that are not on MMC or the MMC is not recently used, are + * removed form the menu. + * @param aItems Missing items. + */ + void HandleMissingItemsL( const RArray& aItems ); + + /** + * Updates objects flags to aFlagPresent if needed. + * @param aFlagValue value for flag. + * @param aItem menu item. + * @param aFlag menu item's flag. + * @param aEvent menu item's event for engine. + */ + void SetObjectFlagsL( + TBool aFlagValue, + const TMenuItem& aItem, + const TMenuItem::TFlags& aFlag, + const RMenuNotifier::TEvent& aEvent = RMenuNotifier::EItemAttributeChanged ); + + /** + * Check currently inserted MMC card, update and save MMC history. + * @return Current MMC id, or 0 if no MMC is inserted. + */ + TUint UpdateMmcHistoryL(); + + /** + * Get current MMC id. 0 if no MMC is inserted, or in case of any errors. + * @return Current MMC id, or 0. + */ + TUint CurrentMmcId() const; + + /** + * Check if file is on given default drive type. + * @param aFileName File name. + * @return ETrue if aFileName is on given default drive type. + */ + TBool IsFileInDrive( + const TDesC& aFileName, + const DriveInfo::TDefaultDrives& aDefaultDrive ) const; + + /** + * Check if application is installed on given drive type. + * @param aUid app uid. + * @param aDefaultDrive drive type. + * @return ETrue if app is installed on given drive type. + */ + TBool IsAppInDrive( + const TUid aUid, + const DriveInfo::TDefaultDrives& aDefaultDrive ) const; + + /** + * Check if application is installed on MMC. + * @param aUid app uid. + * @return ETrue if app is installed on MMC. + */ + TBool IsMmcApp( const TUid aUid ) const; + + /** + * Check if application is installed on mass storage. + * @param aUid app uid. + * @return ETrue if app is installed on mass storage. + */ + TBool IsMassStorageApp( const TUid aUid ) const; + + /** + * Check if drive's status is EDriveInUse. + * @param aDefaultDrive default drive type. + * @return ETrue if drive is in use. + */ + TBool IsDriveInUse( + const DriveInfo::TDefaultDrives& aDefaultDrive ); + + /** + TODO + */ + void HideItemIfPresentL( TInt aFolder, TInt aId, const TDesC& aUid, TBool aWasHidden ); + + /** + TODO + */ + void GetHiddenFlagAndUidL( TInt aId, TBool& aHidden, TPtrC& aUidStr ); + + /** + TODO + */ + void SetHiddenFlagL( TInt aId, TBool aWasHidden, TBool aHide ); + + /** + TODO + */ + void ValidateLinkUidL( TInt aFolder, TInt aId, const TDesC& aUidStr ); + + /** + TODO + */ + void UpdateLinkL( TInt aId, TBool aExists, TBool aShowItem, TBool aMissingItem ); + + /** + TODO + */ + void ValidateLinkRefIdL( TInt aId, const TDesC& refIdStr ); + + /** + TODO + */ + void ValidateLinkL( TInt aFolder, TInt aId ); + + /** + TODO + */ + void UpdateApplicationItemL( + RArray& aMcsItems, + const TAppAtributes& aApaItem, + TUint aMmcId, + TBool isLegacy ); + + /** + TODO + */ + void UpdateApplicationItemsL(); + + /** + TODO + */ + void UpdateApplicationWithHideIfInstalledItemsL(); + + /** + TODO + */ + void UpdateLinkItemsL(); + + +private: // data + + CMenuEng& iEng ; ///< Engine. + RApaLsSession iApaLsSession; ///< AppArc session. Own. + CApaAppListNotifier* iNotifier; ///< Change notifier. Own. + CMenuSrvMmcHistory* iMmcHistory; ///< MMC history. Own. + RFs iFs; ///< File Server Session. Own. + RWidgetRegistryClientSession iWidgetSession;///